Feb 05 2010

My Toyota

Published by Mark under Notes & Asides, Opinion

fj_sand_pond_rd.JPG Toyota is taking a pounding in the press for some highly visible quality issues that have surfaced over the last few months, requiring one of the largest vehicle recalls in the company’s history. Every company hits rough spots, and I have no doubt Toyota will do the right thing by its customers, and by itself. The FJ Cruiser pictured to the left (on what remains of Sand Pond Rd. in the Pahaquarry region of northwest New Jersey) is the third Toyota I’ve owned in 15 years, and is one of the best vehicles of any kind that I have owned, ever. In fact, all three of our Toyotas, the FJ, a Sienna minivan, and a Camry wagon, have been solid, well-designed, well-executed vehicles that have given us our money’s worth. If I ever manage to wear out the FJ, you can bet I’ll buy another one.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Feb 05 2010

I Can’t Believe I Survived!

Published by Mark under Notes & Asides

I think about the lives my kids and all of their friends lead today, and I realize that I shouldn’t be here. It is only by the grace of God or munificent fortune that I failed to die at a young age. Here is a list of things I can’t believe I survived, and I didn’t even bother to include eating raw egg, not washing my hands, and playing with turtles and rodents.

Riding my bike without a helmet. Riding my bike without a helmet, really fast, down a long really steep hill, with a playing card clipped to the rear strut, and turning around to look down at it, and hitting the front of a parked dump truck at full speed. Without a helmet.

Walking home from school. Walking home from school, at the age of 7, crossing Twelve Mile Road in Farmington Hills, and not looking both ways, and getting tagged by Mr. Shoemaker’s sedan so hard I flipped head over heals and my shoes flew off. And then accepting a ride home from him.

Running away. Running away from home at the age of ten, in the dark, with my parents watching, and traveling less than a mile before building a small fire in a field and sitting down to wait for my Dad to show up.

Getting towed behind my Dad’s Pinto. Getting towed, behind my Dad’s red Ford Pinto, through the snowy streets of Auburn, on a ten-foot bobsled with a bunch of other screaming, laughing kids, and having it flip on a corner and scatter us all from curb to curb.

Climbing trees. Climbing as high in trees as I could possibly climb. Climbing until the branches bent under my weight, and then swinging like a monkey and falling off and breaking my left arm.

Setting stuff on fire. Setting stuff on fire on the hearth of the old brick incinerator in our basement, and pouring in a can of lacquer thinner to see what would happen, and finding out that what would happen is that it would explode and set a quarter of the basement on fire, with my parents out to dinner.

Fighting. Fighting with other boys in the schoolyard during recess in the days before “Say no to violence!” posters, when we would beat each other senseless while 2/3 of the rest of the school, including every single girl, stood in a circle egging us on.

Bumper skating. Bumper skating behind the municipal buses in Auburn, NY, crouched down low where nobody could see us, as a primary means of wintertime transportation.

Ingesting pesticides and hydrocarbons. Ingesting pesticides and hydrocarbons while riding our bikes right behind the truck that sprayed a thick fog of malathion and diesel fuel to control mosquitoes in our neighborhood in Indiana. It was cool inside that fog.

Setting half the woods on fire. Setting half the woods behind our house on fire while attempting to erect an epic tree fort, and learning that copius amounts of gasoline are not necessarily the best ant control methodology.

Playing with electricity. Playing with electricity mostly by cutting the plug and some cord off an old appliance, stripping the wire ends bare, then plugging it in and touching them to stuff, like twelve volt DC motors and six volt solenoids.

Funny thing is, I look back over that list and I think I had a pretty normal childhood. Our parents didn’t hover over us. They let us get out of the house, try stupid stuff, get burned and break bones. I can’t count the high-speed bicycle crashes I was in, and nobody wore a helmet. No teacher ever broke up one of our fights. No parent ever called the fire department because they saw one of us fifty feet up a maple. Nobody panicked when the sun went down and we weren’t home. Nobody required us to ride in the car to a friend’s house half a mile away. I ask myself whether the world today is more dangerous, and the answer is that I don’t believe it is. I think we’re the ones who have changed.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

2 responses so far

Jan 22 2010

SilverDraw Library

Published by Mark under Programming

About a year ago I started work on a set of Silverlight libraries providing controls and classes that implement the primary features of a drawing application. Some of the results of that effort made their way into demos on this site, i.e. the ColorTools and GradientMaker demos. Eventually I also posted a partially complete demo of a drawing program, however not long after that I joined the J. Becker team, and have been heads down working with a small, creative group on some cool Silverlight media management stuff. The upshot of it all is that the drawing libraries, and the application they were designed to support, have been gathering dust.

This morning I received a request from Sweden for the source to GradientMaker, which I’m happy to share. I had previously released the source for the color controls in ColorTools, but the GradientEditor control hadn’t been added at that point. When I got around to implementing it I created a dependency on another small library which I hadn’t released, and so I put off adding the GradientEditor to what was publicly available. Prompted by this morning’s request I have whipped it all into shape and uploaded it to the site. See the download links at the end of the post.

The code is released under a new BSD license. In order to package it I ripped the projects for the two libraries out of the solution I created for the app last year, and placed them into a solution called SilverDraw. It’s a little aspirational at the moment, but I hope to add in some of the other drawing code I have written and release some updates to it soon. There is no documentation, but the code is pretty well-commented. If you have any questions feel free to email me.

Downloads: SilverDraw Assemblies, SilverDraw Source

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Jan 19 2010

Still Lost

Published by Mark under Words and Writing

Ok, I admit I have been in the middle of a really unproductive cycle for the last couple of weeks. I’m not talking about work. I’m talking about the other 50% of my life, or more specifically the 50% of that 50% that is available for liesure, and which for some strange reason I can’t explain continues to be devoted in large part to watching old episodes of Lost. I can’t stop. I need help. There is no reason for me to be watching this show. Actually, I did have a sort of rational goal in mind, which was to catch up before the start of the final season. But I’m not sure I’ll make it.

Lost has a great premise, but a tough one to get a long run out of. Gilligan’s Island only made it for three seasons, and that feels like some sort of cosmic constant because I have just started in on Lost’s fourth season on Netflix and it’s just getting ridiculous. There must have been at least some members of the cast and crew looking at those scripts each week and thinking “what the hell?” So far my favorite example of how ludicrous it gets involves the “Looking Glass” underwater station.

First, and maybe funniest, is the moment when Sayid unfurls a blueprint of the station at the Beach Camp, and the title on the document is “Looking Glass Hatch.” Why is this hilariously stupid? The blueprint was created by Dharma, and is a document that pre-dated the castaways’ arrival. The castaways referred to these installations as “hatches” because the first thing Locke found was a metal hatch. The rooms below it then became known as the hatch, and the other rooms they found were by extension hatches. There’s no reason to think any of the original builders would have thought of an underwater habitat and lab as a “hatch” or labelled it that way on a blueprint.

Then there is the whole series of events leading up to Charlie’s checking out. If the Looking Glass station were the source of the jamming signals don’t you think that, before paddling out and trying to dive on it and get inside without SCUBA equipment, you might try, oh, I don’t know, cutting that fat cable leading down to it from the beach? Yes, there could be backup power. It might not work. But I would try it before I got wet, and so would any other rational person. As an aside, what builder sophisticated enough to create an underwater habitat and lab would just leave that cable lying on the damn beach?

Then we get to Charlie in the communications room, where he has just turned off the jamming signal. He knew he was supposed to drown there, and it looks like he has cheated fate. But wait! The Russian guy who got shot in the chest with a speargun is swimming outside the porthole, and he has a grenade! The grenade goes off, the porthole shatters, water is pouring in. What does Charlie do? Does he step through the door he is standing right next to and pull it shut after him? No, he closes it and locks himself in the room. Yea, I get to die!

This is just bad writing. It’s lazy writing. You could rewrite that entire sequence of events, preserve every ounce of drama and mystery, and have it all make sense from start to finish. But to do that you have to think about it, and maybe that’s a luxury television writers don’t have anymore. Or maybe the absurdity itself has some larger meta-purpose that I don’t get yet. I have no idea. But it’s hard to imagine people watching this stuff without laughing.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Jan 15 2010

Getting Lost

Published by Mark under Words and Writing

Given the title and what I often write about here, you might think this post is about either losing one’s way, or becoming hopelessly mired in the documentation for some arcane class library. It’s about neither of those things, nor is it concerned with any other variation on the theme of not knowing where you are. Rather, it’s about writing, and the title reflects that I got to thinking about writing while watching a billion episodes of ABC’s drama “Lost.” Well, perhaps not a billion. Anyway, let me explain.

I hardly watch television. I have an HDHomerun on our network and can get 120+ channels at my desktop, but frankly it’s 99% crap. Pick a channel at random and you have a 75% chance of hitting a commercial. Wait the commercial through and you have an 85% chance of finding yourself watching Cops. The remaining 15% of the time is split between informercials and a show on the “History Channel” entitled “Mega-awesome Disasters III: The Earth is Overwhelmed by Ice and then Explodes!” Most of the time I turn it on after work and fall asleep waiting for dinner to be ready.

So I missed the whole “Lost” phenomenon. I was aware of it like a distant cultural carrier-wave, but up until two weeks ago I hadn’t watched a single episode. Then my wife got a Netflix account and I discovered their on-demand streaming library and Windows 7 Media Center integration. If you have a job and responsibility do not sign up for this service. It should be a schedule II controlled substance. Once you start watching there is no reason to stop. An intervention will require physically removing you from your couch with a large putty knife. The service is fast, the quality of the video and audio excellent, and if the library isn’t massive yet, there is still enough to keep you supine for a year. It should be illegal.

One of the titles in the Netflix streaming library is all of “Lost.” I always wondered what the buzz was all about, so I decided to watch a few episodes. I’ve now watched about 35 of them, and will probably watch the remainder of Season 2, at least. But as I have watched it an interesting thing has happened: I’ve transitioned from watching to see where the story goes, to waiting for the next completely absurd plot twist to unfold so I can laugh and launch derisive comments at the monitor. What prompted me to write this post is not that I have been watching “Lost” devolve into a comedy of writing horror, but rather that it seems to me like so much writing these days has succumbed to the same fate.

Making a good story is very hard. I know because I keep trying and failing. Aside from all the other well-cataloged elements a good story requires, its events must be constructed on a foundation of plausibility. You have to get the little things right in order to make the world feel believable and real. Not to say that a good story cannot contain the incredible. The incredible and otherworldly make great story elements. But the incredible has to spring from the credible. When the big incredible thing happens, it has to happen in the context of a world that is wholly credible in all the small details. That’s what allows the reader to disregard reason and leap that small gap from the mundane to the wonderful.

The problem with “Lost” is that virtually nothing about it is plausible. It could have been. There’s no reason why it shouldn’t have been. The big incredible things that happen work very well. It’s just that they happen in a world that is itself absurd. It falls apart the minute you start to think about it. Yet the show is hugely popular and won an Emmy. It makes me wonder if most of the audience ever does think about it. Clearly some get it, and the evident absurdities and incongruities have even led fans to speculate that all the characters actually died on the plane and that they are in purgatory. I don’t think they are, but the viewers might be.

Start with the basic premise of the show. The writers needed to get a group of people into an exotic, isolated location without hope of rescue or recourse to any of the normal amenties of civilization. How did they choose to do that? They had an airliner break up at altitude and dump its three sections onto a mountainous island in the South Pacific, relatively intact and with a substantial number of living humans aboard. Every single aspect of this series of events is implausible in the extreme.

The pilots were on their way to Los Angeles from Sydney when they “lost all communication” and “turned back toward Fiji.” First, airliners don’t lose all communication unless they lose all power. The average airliner has something like four independent radios, as well as satellite communication with the fleet home office. Second, when an airliner breaks up at altitude at full cruise speed (the airliner in Lost was actually in a dive and would have been exceeding cruise speed) it doesn’t come down gently, or in very large pieces. People don’t live through that, or at least not often. There is one case I am aware of where a stewardess was tossed into the tail section of an aircraft after it was split by a bomb. The tail impacted on a forested slope and bounced to a stop and she lived, although very seriously injured. Everyone else on the aircraft was killed. In “Lost” some of the passengers are tossed into the water, some into the jungle, but at least 60-80 of them get up and walk away.

Yeah, right. Was that really the best the writers could come up with? There was no other way to get this group of people into the situation they wanted? I can think of at least three. “Lost” doesn’t really get any better after the passengers are deposited at the edge of the jungle and struggling to survive. One of my favorite chuckle-inducing scenes was when Sayid turns on a handheld VHF radio and exclaims breathlessly “We have a bar!” It’s as if all the writers are 20 year-olds who think every communications device works like an IPhone. Later he takes that same, single transceiver and by setting up some aluminum antennas in various places he uses that same, single transceiver to attempt to triangulate the position of a radio signal they intercepted. The producers should have hired some of the team that created MacGiver. At least some of the science would be sound.

The silliness just continues to multiply the longer you keep punching up that next episode, from hunting wild boar with a knife, to making use of dynamite that has been sitting in a humid jungle for 90 years. We don’t even have to get into the illogical, irrational way most of the characters behave. And yet I keep watching those episodes on Netflix, and from this and the series persistent popularity the writers might conclude that they have done a bang-up job. And so, from a business perspective, I guess they have. But in terms of quality there is quite a large difference between watching something out of appreciation for its merits, and watching something else out of the morbid fascination of witnessing a trainwreck.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Jan 14 2010

Stripping HTML Comments

Published by Mark under Programming

Over the last couple of days I was working on a system that generates HTML emails. The email content is created by loading and rendering ascx controls that perform the value substitutions into a template, and comments had been included in the templates describing what data items each email required. This morning I realized that the comments were being included in the email bodies, so that using ‘View Source’ would display them. Not a huge deal, but it would be better not to have them in there, so I went looking for a method to strip the HTML comments. Everything I found seemed more cumbersome than necessary, so I threw together this simple recursive method to remove HTML comments from a string. It’s naive with respect to the question “what is a comment in HTML?” For my purposes a comment is the text between the <!– and –> tags, and that’s it. Posting this in case someone finds it useful.

  1. private string StripHtmlComments(string html)
  2. {
  3. int open = html.IndexOf("<!--");
  4. if (open > -1)
  5. {
  6. int close = html.IndexOf("-->");
  7. if (close > open)
  8. {
  9. string newHtml = html.Remove(open, (close - open) + 3);
  10. return StripHtmlComments(newHtml);
  11. }
  12. else throw new FormatException("The input HTML contains mismatched comment tags");
  13. }
  14. else return html;
  15. }
Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Nov 18 2009

QAMplexity

Published by Mark under Technology

In the 34 years or so since I was introduced to computers there have been a few moments that really grabbed my attention, and that formed lasting memories. One was the first time I loaded up buttfish.gif on my 12 mhz. 286 with it’s shiny new Orchid graphics card, and saw 640 x 480 pixels of stunning 16 bit color. That was about 1988 or so. Another occured around 2004 when I was over at a friend’s house relaxing after dinner, and he opened up a window on his desktop. There was a spinning hourglass for a couple of seconds, and then the local newscaster was in that window delivering the 11 PM update. Live television in a window. That was very slick. Later that same friend was an early adopter of a sweet 24″ wide-screen monitor, which he hooked up to an ATSC tuner for over-the-air HD. That was even slicker.

Before long I had my own tuner, an ATI device based on their Theatre-550 chip hooked up to Comcast, running Snapstream’s Beyond TV as a front end. These types of tuners are a combination of television receiver and video capture circuitry. They receive and decode the incoming analog RF signal and send the frames to a digitizer, which converts them to digital and outputs them as an mpeg stream. With this combination of hardware and software I received 70 analog channels, and could do all the requisite DVR things like skip around and record. The quality was so-so, but not any worse than an older analog television, and it was right there on my desktop. I could watch breaking news as I worked on code or a document, record movies, all that good stuff, either full screen or in a window. Neato.

Then came the digital switchover. Suddenly the 70 analog channels that I had been able to receive became 23. Life was dark and colorless. ST:TNG could not be recorded. And thus it remained for some time. I stopped watching TV on my computer, and took to renting movies when I felt like it. DVDs always looked great on my Dell 24″ widescreen;  much better than those old analog TV channels, and who the hell needs them anyway? Sniff. More time passed, and I found myself opening my birthday present a couple of weeks ago, and there inside the box was a Silcondust HDHomerun.

Since the rest of this post isn’t going to necessarily wax all sweetness and light about digital cable on the PC, let me say one thing about the HDHomerun up front: good God, what a cool little device this is! If you aren’t familiar with it, an HDHomerun is a little unit about the size of a 4-port switch. It has two coaxial connections for signal inputs, an ethernet port, and a power brick. You connect the coax from the cable provider, patch it to your router or a switch, and plug it in. Install a little well-written software on your PC (native Windows 7 64-bit included) and voila! You now have two QAM-capable HD tuners streaming beautiful 1080 HD (and whatever else) over the network to whatever QAM-capable front end you want to use. I’m using Windows Media Center, which at least in the Windows 7 version works very well with clear QAM. Wait, what? QAM? What is that, you ask? It sounds like an acronym for a gastric disorder. In fact it is not. It merely causes gastric disorders.

QAM stands for Quadrature Amplitude Modulation, and all the technical details that I don’t understand aside, it is a protocol by which streams of bits are transmitted between the cable company’s digital head end, and the QAM decoder in your set-top box, cable-ready widescreen TV, or HDHomerun. There it may become beautiful HD video, or still-pretty-decent SD video, or information such as program-guide entries, channel assignments, programming metadata, etc. Since the average coaxial cable connection is a very fat pipe indeed, squeezing nearly 40 megabits/second out of a single 6 mhz. slice of its over 750 mhz. of bandwidth, the protocol is continually evolving to add additional services. In fact, one of the reasons cable companies are eager to go digital is that the old analog channels take up a big chunk of that 750 mhz that could be used for other stuff.

Unfortunately, tuning in to all this wonderful stuff is a little like sitting in front of my Dad’s old tube-driven Hallicrafters spinning the shortwave dial, circa 1970. You’d hear lots of interesting things, but never really know where they came from, or why, or even necessarily how to find them again if you wanted to. In the digital cable world the set-top box, or STB to geeks, receives all this digital information and uses it to organize the channels, construct the program guide, send and receive commands, etc. Most importantly, it decrypts the channels that have been scrambled by the cable company, which might include all the channels, or just some of them, wholly depending on where you live and what the local cable operator chooses to do. The FCC says that they have to send the digital streams for network and some other feeds “in the clear” so that devices like the HDHomerun and Digital Cable-ready televisions can receive them, but that might mean as few as a dozen channels on some networks.

If you buy a digital QAM tuner card or device and hook it up to your cable system, then scan for clear channels, and you’re lucky like me, you may have as many as 120 or so come back in a list. Each will be identified by a virtual channel number, potentially a guide number, and a callsign or identifying string of text. The virtual channel numbers consist of a primary channel and subchannel, for example, 65.4, which is currently the History Channel on my system. For stations with multiple feeds you might find them snuggled in next to each other within one primary channel. If the station is one of the old-line networks then it has probably been assigned the primary digital channel that corresponds to the traditional analog assignment in that area. For example, WABC in New York has been channel 7 for years. On the Comcast digital network the four WABC feeds are currently 7.1, 7.3, 7.5, and 7.7. When these channels are presented to the viewer by the STB it hides them behind the guide numbers, so WABC is at guide channel 7, where it has always been, while the HD feed at 7.7 is mapped up into the 200’s with the rest of Comcast’s HD lineup.

This mapping capability allows the cable company to move digital channel assignments around without affecting the programming guide, and unfortunately for the PCTV enthusiast that’s exactly what they do. In the short time I have had my HDHomerun Comcast has made changes to the channel assignments twice, throwing my carefully edited channel mappings in Media Center out the window. But if the channel assignments change, at least it should be easy to pick up the new location by scanning the callsigns, right? I mean, WABC is WABC. The problem is that once again the STB has access to channel metadata that the tuner and Media Center do not, and it uses this metadata to make the callsigns understandable. Without this information, it’s left up to you to figure out that WABCDT2 is the WABC HD feed, that WPIXDT is the ION HD feed, that WLVTDT4 is the HD feed for the local public television station, etc. And if you take the time to do that, editing in the correct descriptions for all the available channels as Media Center allows you to do, and then have to rescan because the assignments changed… well it sucks, let’s put it that way.

It would be nice if the cable companies would assign stable digital channels, but for whatever reason they don’t. And I don’t mean to imply that the shifting is done for spite. I applaud Comcast for sending nearly 120 clear channels in my area, and in each of the last two shufflings I have actually gained new channels. So they have their reasons, but it still makes setting up and maintaining digital cable on your PC a real challenge. Not that I doubt the overall antipathy, or at least apathy, that cable providers feel toward component digital tuners. What they want is to rent you a set top box, which gives them pretty close to end-to-end control over the content and the presentation. What the rest of us want is for them to act a little like the old networks, that broadcast in the clear and for the public good to at least some extent. The FCC also wants this, and has required the cable companies to support the Cablecard standard, which allows you to plug a decryption module into a digital tuner and receive all the encrypted content without a STB, and without any two-way services or programming guide. Still the cable companies support Cablecard only half-heartedly, and the fact that there are Cablecard-ready PC tuners on the way is unlikely to cause any smiles to break out at Comcast.

The cable providers have been in an enviable position for some time now, with municipally-granted monopoly markets that companies like Verizon are only now beginning to break in to. Within the fuzzy embrace of those regulatory monopolies they have built a truly impressive hybrid fiber/coax network. As I mentioned above they have a tremendous amount of downstream bandwidth in that pipe, and over time they will have many opportunities to fill it with premium services. My own feeling is that they should send all the non-premium SD and HD feeds in the clear, with stable channel assignments. Let’s face it, most of these channels are commercial-choked crap these days anyway. By sending the straight video in the clear companies like Comcast will only increase the number of screens in the average consumer household on which their content is playing, and they can include advertisements for their premium services within those content streams.

Whether this will ever happen I don’t know, but one thing I am quite sure of: over time there will be more and more alternatives to the cable content feeds. Driven by competitive pressure they have steadily increased the bandwidth and quality of consumer level connections. I get 20 mbps downstream here, and 2 mbps up. Not long ago I watched every episode of the PBS series “Carrier” in HD, using Microsoft’s Internet TV service through Media Center. The cable providers can’t close down the IP pipe they’ve opened, and that pipe represents competition. Perhaps, over time, that competition will spur them to become more open and less defensive about what they consider to be the proprietary parts of their content stream. We’ll see. In the meantime setting up a digital cable-ready PC is going to remain something for enthusiasts with more time and patience than sense, and that includes me.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Nov 15 2009

7-zip Incorrect Command Line Opening RARs

Published by Mark under Notes & Asides, Technology

Ok, this one has been driving me nuts for a couple of weeks now, ever since I rebuilt my system and installed Windows 7 64-bit. I have been using 7-zip for years, and kept on using it long after Windows gained excellent in-shell support for .ZIP folders, because 7-zip handles RAR, TAR and other formats, and unlike WinRAR it’s free and open source. However, after installing it on the 64-bit edition of Windows 7 I consistently got an “Incorrect Command Line” error trying to open RAR archives by double-clicking them in Explorer. If I right-clicked the archive and selected 7-zip -> Open Archive it worked fine. Not a big deal, but I’m the kind of guy to be bothered by this stuff until I get it fixed.

Today I noticed something interesting. If I right-clicked the file and chose Open With -> 7-zip GUI, I got the same error. However if I right-clicked and chose Open With -> 7-zip File Manager it worked fine, and got me to the archive folder view I wanted. For those of you not familiar with the different versions of 7-zip that come in the default install, there are three: 7-zip Console, 7-zip GUI, and 7-zip File Manager. Now I don’t understand exactly how 7-zip GUI differs from File Manager, but I’ll go out on a limb and assume it’s a GUI view of a single archive, rather than an Explorer-like Window in which you can navigate to different folders. Whatever. All that matters to me is that when I went into Control Panel -> Default Programs -> Associate a file type or protocol with a program, selected the .rar file extension, and clicked Change Program I was able to choose 7-zip File Manager as the default, and from that point onward it worked as it should. Tada!

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Sep 29 2009

Picky, Picky

Published by Mark under Programming

Sometimes programming in .NET just drives me up a wall. Not that I would prefer to go back to the Win32 API and writing my own message loops, but when a framework is as all-encompassing and opaque as .NET is, it’s doubly important to make the internals work right and sensibly, and doubly likely that somewhere they will do neither. Case in point: I probably spent four hours today trying to inject some custom behavior into a WCF channel only to find out that the problem was the lack of a space in front of a comma. Or, more accurately, four spaces in front of four commas.

My goal was to use message inspectors to sniff out an authentication cookie from an incoming WCF service reply, and inject it into subsequent requests, as part of a piggyback authentication scheme with an ASP.NET website. I won’t say much about message inspectors. They let you get your hands on various parts of an incoming or outgoing message before it is handed to the client or proxy, however the case may be. They work as advertised and there are a lot of good posts on how to use them. Microsoft has one too… it’s just not good. If you want to read specifically about managing cookies using inspectors this is the post that got me started.

If you read any of those posts you’ll notice that to implement a message inspector requires also creating a custom behavior that implements IEndpointBehavior. It’s a very simple class that just creates an instance of your inspector class on demand. If you’re willing to deal with creating the behavior for every service and every channel manually you can stop there, since there are imperative ways to do this. What I wanted was to be able to specify the behavior declaratively, in the .config file where the endpoints are defined, so that it is added transparently to all channels when they are used. In order to do that you need one more class: a custom extension of BehaviorExtensionElement that gets registered in the system.serviceModel/extensions/behaviorExtensions configuration scope. This class creates the behavior, the behavior creates the inspector, and so on and so forth.

And that’s where the fun began. The syntax for declaring the extension element and behavior looks like this:

  1. <system.serviceModel>
  2. <extensions>
  3. <behaviorExtensions>
  4. <add name="extensionName" type="extensionType" />
  5. </behaviorExtensions>
  6. </extensions>
  7.  
  8. <behaviors>
  9. <endpointBehaviors>
  10. <behavior name="behaviorName">
  11. <extensionName />
  12. </behavior>
  13. </endpointBehaviors>
  14. </behaviors>
  15. ...
  16. </system.serviceModel>

Looking at the behaviorExtensions/add element, the name attribute value is arbitrary, and is used later to declare the behavior itself. The type attribute value must be the fully qualified typename of the class that implements the behavior extension. When I first wrote the code I assumed that “fully qualified” meant: include the namespace. My declaration looked something like this:

  1. <behaviorExtensions>
  2. <add name="myExtension" type="MyNamespace.MyExtension" />
  3. </behaviorExtensions>

When I got everything written and fired it up I got a configuration error from the parser, indicating that it could not find the named assembly. Hmm… /facepalm. I had implemented the extension class in a separate assembly, so of course it couldn’t find it. I tried adding the assembly name:

  1. <behaviorExtensions>
  2. <add name="myExtension" type="MyNamespace.MyExtension, MyAssemblyName" />
  3. </behaviorExtensions>

That didn’t work either. A little more poking around on the web and I discovered that the parser absolutely required the complete strong name of the assembly. So I added the missing fields, and my declaration looked like this:

  1. <behaviorExtensions>
  2. <add name="myExtension" type="MyNamespace.MyExtension, MyAssemblyName, version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  3. </behaviorExtensions>

Still no go, but now the error changed. Instead of complaining that the assembly could not be found the parser now squeaked about the manifest data not matching the reference. Aha! Progress! I googled a bit more and discovered another post describing problems with breaking the string and having spaces after the commas. So I removed the spaces. I won’t bore you with another listing. Just look at the one above and imagine taking out the spaces after the commas in the type attribute string. It still did not farking work.

Damn, /facepalm, the sequel. My assembly is signed. Just because Microsoft’s example used null for the PublicKeyToken attribute doesn’t mean I can. I used sn.exe to generate a public key token and replaced the null with a string of letters and digits. Again, no listing, just use your imagination. It still didn’t work. But the error changed again! Instead of complaining about the mismatched manifest data the error now simply stated that the element couldn’t be loaded. I changed the key back to null – mismatched manifest data. Put back the token – can’t load element. What the hell? It was pretty obvious that I was getting past the assembly part… but what now?

Google provided no additional help, except for one or two posts that mentioned the unusual pickiness of the config parser with respect to this element. And it was while ruminating over one of these that I remembered taking those damn spaces out earlier in the process. I put them back in.

And it worked. Just why the presence of spaces in a comma-separated list of substrings should be important to the config parser I don’t know. I don’t even care. All I know is that it worked with spaces, and it didn’t work without them. Microsoft must have its reasons because the issue has been brought up a number of times and they have refused to acknowlege it as a bug. To me it looks like a bug, or at least a massively anal design decision, but what do I know? All I can do is kick the damn thing until it works.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

2 responses so far

Sep 23 2009

Where is the surround sound mixer in Vista?

Published by Mark under Technology

Despite the fact that there is every possibility I am uniquely imperceptive, I thought I would throw this out there on the off chance that there is at least one other person who was stumbling around in the Vista user interface looking for a way to adjust channel levels in a 5.1 or 7.1 channel surround sound setup.

Used to be in Windows XP you right clicked the speaker tray icon and clicked on mixer, but after I upgraded to Vista I could no longer find the damn thing. Worse, something wierd in the Creative drivers I was using for my sound card kept messing with the center channel level, forcing me to go through their audio console to reset the mixer defaults.

Today I finally stumbled on it, hidden three layers deep in the audio properties dialogs. Just to prove that I really did run it to ground, here is a pic.

vista_mixer

To find your way to the mixer right click the speaker tray icon, then click “Playback Devices” to open the Sound dialog. In the Sound dialog either double-click the Speakers device, or click it and then click the “Properties” button at the bottom. Either action will open the “Speakers Properties” dialog. Click the “Levels” tab, and then click the “Balance” button next to “Play Control”. That’s all there is to it.

Pass It On:
  • Digg
  • Furl
  • del.icio.us
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Live
  • Print

No responses yet

Next »

3d home architect design suite deluxe 8 download . acd see download . acronis disk director suite 9.0 . acronis true image 10 . acronis true image home 2009 download . adobe acrobat 5 . adobe acrobat 6 download . adobe acrobat 7.0 pro download . adobe acrobat 7.0 professional . adobe acrobat 8 pro . adobe acrobat 8 professional download . adobe acrobat 8 standard . adobe acrobat 8.0 professional download . adobe acrobat 9 download . adobe acrobat 9 pro extended download . adobe acrobat reader 5 . adobe acrobat reader 8 download . adobe after effects 7.0 . adobe after effects cs3 professional . adobe after effects cs4 . adobe after effects download . adobe captivate 3 . adobe contribute cs4 download . adobe creative suite 3 design premium . adobe creative suite 4 . adobe creative suite 4 design premium download . adobe creative suite 4 master collection download . adobe creative suite 4 master collection mac . adobe cs2 master collection . adobe cs3 design premium . adobe cs4 design premium . adobe cs4 download . adobe cs4 master collection download . adobe cs4 master collection mac . adobe cs4 web premium . adobe dreamweaver 8 . adobe dreamweaver cs2 download . adobe dreamweaver cs3 . adobe dreamweaver cs4 download . adobe fireworks cs3 . adobe flash 9 . adobe flash cs2 . adobe flash cs4 professional . adobe flash cs4 professional mac . adobe illustrator cs2 . adobe illustrator cs4 mac download . adobe indesign 2.0 . adobe indesign cs4 download . adobe photoshop 12 download . adobe photoshop 6 . adobe photoshop cs . adobe photoshop cs2 download . adobe photoshop cs3 download . adobe photoshop cs3 extended . adobe photoshop cs4 extended . adobe photoshop cs4 extended mac . adobe premiere 6.5 download . adobe premiere pro cs3 . adobe premiere pro cs4 download . adobe presenter 7 download . apple final cut express 5 download . autodesk 3ds max . autodesk 3ds max 2010 . autodesk autocad 2007 . autodesk autocad 2008 . autodesk autocad 2010 download . autodesk autocad architecture 2009 download . autodesk autocad electrical 2010 download . autodesk autocad inventor lt 2010 . autodesk autocad inventor professional suite 2010 (32 bit) . autodesk autocad inventor professional suite 2010 (64 bit) . autodesk autocad mechanical 2010 . autodesk autosketch 9 . autodesk inventor 2008 . autodesk inventor professional 2009 download . avid media composer 2.8 download . cakewalk sonar 7 producer edition . corel painter 10 . corel painter x download . corel photoimpact x3 download . corel video studio pro x2 download . download 2003 microsoft office . download acronis disk director suite 10 . download adobe acrobat 6.0 professional . download adobe acrobat pro . download adobe acrobat reader 6 . download adobe captivate 2 . download adobe contribute 3 . download adobe creative suite 3 . download adobe cs3 . download adobe cs3 master collection . download adobe cs3 master collection mac . download adobe dreamweaver cs4 mac . download adobe fireworks cs4 . download adobe flash 8 . download adobe flash cs3 professional . download adobe flash cs3 professional mac . download adobe illustrator 9.0 . download adobe illustrator cs3 . download adobe illustrator cs4 . download adobe indesign 4 . download adobe indesign cs . download adobe indesign cs3 . download adobe photoshop 7 . download adobe photoshop 7.0 . download adobe premiere 2.0 . download apple final cut express 4 mac . download apple final cut studio . download autodesk 3d studio max 2009 . download autodesk 3d studio max design 2009 . download autodesk autocad 2009 . download autodesk autocad architecture 2010 . download autodesk mudbox 2009 . download corel draw 11 mac . download corel dvd copy 6 plus . download corel video studio 12 . download dreamweaver 4 . download dreamweaver cs2 . download dreamweaver cs3 . download dreamweaver cs4 . download dreamweaver mx 2004 . download intuit quickbooks 2009 premier . download mcafee total protection 2009 . download microsoft autoroute 2007 europe . download microsoft frontpage 2002 . download microsoft money 2004 . download microsoft money 2007 . download microsoft money 2008 . download microsoft money plus 2008 . download microsoft office 2003 professional . download microsoft office 2004 for mac . download microsoft office 2008 for mac . download microsoft office 2008 mac . download microsoft office 97 . download microsoft office enterprise 2007 . download microsoft office for mac . download microsoft office visio professional 2003 . download microsoft office xp . download microsoft streets and trips 2009 . download microsoft windows vista business (64bit) . download microsoft windows vista home basic with sp2 (32 bit) . download microsoft windows vista home premium with sp2 (32 bit) . download microsoft windows vista home premium with sp2 (64 bit) . download microsoft windows vista ultimate (64bit) . download microsoft works 4.5 . download nero 10 . download nero 2009 . download nero 8 ultra edition . download nero burn . download parallels desktop 4.0 for mac . download pctools spyware doctor 5.5 . download quarkxpress 8 . download roxio creator 2009 ultimate . download roxio creator plus . download sony vegas pro 8 . download steinberg nuendo 3 . download symantec winfax pro 10.0 . download vmware workstation 6.5 ace . download vmware workstation 7 . download window xp professional . download windows 7 release . download windows office xp . download windows vista 64 bit . download windows vista ultimate . download windows xp pro sp2 . download windows xp sp1 . download xilisoft video converter ultimate 5.1 . graphisoft archicad 12 . guitar pro 5 mac download . guitar pro 6 . i.r.i.s. readiris pro 11 download . intuit quicken rental property manager 2009 . macromedia dreamweaver . mathworks matlab r2008a . microsoft autoroute 2008 download . microsoft autoroute europe 2009 download . microsoft autoroute express download . microsoft digital image suite 2006 download . microsoft encarta premium 2007 . microsoft encarta premium 2009 . microsoft frontpage 2.0 . microsoft frontpage 2003 download . microsoft frontpage 2007 . microsoft mappoint 2009 north america download . microsoft money 2005 . microsoft money 2007 home & business . microsoft money 2009 . microsoft money plus download . microsoft money premium . microsoft office 2000 download . microsoft office 2002 . microsoft office 2003 enterprise