Posts Tagged ‘Angry’

Please Stop Spamming the Debugger Output

When I'm writing a GUI or a multithreaded server application, I make heavy use of OutputDebugString (and various API's that map to it). This is a very useful tool when the act of stepping through an application has side effects that drastically change the experiment. Unfortunately, it looks everyone else likes this API, too.

I try to be courteous and pay my developer taxes here–when my application is deployed to customers, rest assured that it will not be writing debugger output by default. I put my calls to OutputDebugString on a switch in one way or another, or I just compile them out in release mode.

(This is not just being kind to anyone trying to debug something else on a machine running my application. I need to do this to avoid embarrassment. I curse quite a bit in my traces.)

Not everybody is taking the trouble to do this. To wit:

Debugger output spam from Visual Studio

If I open up dbmon or debugview and wave my mouse around a little, i'm inundated with messages from these applications:

  • Visual Studio 2005 [by far the worst].
  • Visual SourceSafe [a close second place].
  • Trillian
  • The remnants of Symantec products that I have not yet succeeded in disabling.

I find it particularly annoying that my development tools are hampering my development in this way.

The Worst Possible Way to Handle Exceptions

The worst possible way to "handle" exceptions is to show the user a message box with __FILE__ as the text. This is extremely poor form.

Intel VTune error dialog

Apparently, Intel did not get the memo. Worse, this happens as many as ten times when I open Visual Studio. Why do I feel like I was mistakenly given a debug build of VTune?

A Real Head-Scratcher Courtesy The CLR And Office Teams

"Why the hell is this application insisting on loading an old version of the CLR?" I'm guessing that's what you're asking yourself if you've gotten here through your search engine of choice. Well, relax. I'm about to explain.

It is reasonably well-known that there are .config file settings that can force an application to load a specific CLR version. It is also possible to write unmanaged code using the hosting API's like CorBindToRuntimeEx to bind to a specific version. I'm not talking about either of these scenarios.

There is a set of undocumented (as far as I know) registry keys that can override either of these vectors. They are located here:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\AppPatch\v2.0.50727.00000

If you take a look at this key on your own machine, you'll probably see a handful of applications listed.

The root of the Microsoft Office .NET Framework version bug

Applications can specify a target version of the framework that will be loaded into the process, even if there is no .config file present, and even if you write some C++ to call CorBindToCurrentRuntime. Mscoree will simply report that the current runtime is 1.1.4322, even if the user has 2.0 installed on their machine. This is, I suppose, superfically similar to the strategy used in the Image File Execution Options built into NT.

I can see where this would be handy–presumably Microsoft has a handful of .NET 1.1 apps in the wild that showed bugs against 2.0, and it's not exactly practical or foolproof to try to drop a .config file on those apps when installing the framework (naturally, somebody can just install the application after the framework, then be puzzled as to why it isn't working).

Good solution, right? It's a shame they fouled it up.

Notice that Word and Excel are both listed as special applications on my machine. I have these values on my laptop:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\policy\ AppPatch\v2.0.50727.00000\excel.exe\{2CCAA9FE-6884-4AF2-99DD-5217B94115DF}]
"Minimum File Version Number"="11.0.0.0"
"Maximum File Version Number"="11.0.9999.9999"
"Target Version"="v1.1.4322"

It appears as though the someone is trying to force a relatively older build of Excel/Word 2003 to load v1.1. Fair enough, the Excel build on my machine is up to 11.6 at this point. Unfortunately, those developers failed miserably in the attempt. Every single other application listed under AppPatch in my registry looks like this:

"Minimum File Version"="11.0.0.0"
"Maximum File Version"="11.0.9999.9999"
"Target Version"="v1.1.4322"

When the version filter isn't specified (or actually in this case, miswritten as "Minimum/Maximum File Version Number" instead of "Minimum/Maximum File Version"), all versions of the executable will load the target version. So these keys effectively break 2.0 addins for all versions of Word and Excel.

There is an update available that fixes this issue, here. The KB article that accompanies it doesn't really explain what the issue is, which is why I've summarized it here. Office update is not exactly an automatic affair like its Windows counterpart, so this bug makes it essentially impossible to write a fault-free Office addin that targets 2.0 and does not hack up the user's registry upon installation. I can't say I advocate doing that, but I would understand if you did. As for myself, I am most likely going to target 1.1 much longer than I had hoped would be necessary.

Thus Ends the Great Adsense Experiment

I install Adblock on all my machines, so I wasn't seeing any of the ads on my own site. I had thought they were all going to be hilariously off-topic (one that stood out was some guy named "Dan Poynter" plugging his small business), but apparently not. It didn't occur to me that if I wrote articles decrying pet psychics that Google would plaster ads for palm readings all over my site, but in retrospect that was obviously the only possible result. It turns out that the money isn't worth looking like an idiot.

Online Sports Journalism Audition

I'll admit, I personally prefer complete sentences, paragraphs, and attempted grammar. But, I thought I would try to write a "column" that is nothing but a long, bulleted list since this approach seems to be working for the so-untalented-he's-talented Bill Simmons.

Television that ruins an entire day if watched for even one second:

  • Dr. Phil - Relentless shouting. Truisms presented as revelations. "You need to get ahold of your life."
  • Mad TV - Bizzare, almost sinister, terrible acting. Not funny.
  • Anything about Nostradamus on the History Channel - John Hogue, in being what I will call a metafraud, has achieved something very impressive. He has somehow created a career for himself by sort-of-looking-like another fraud who has been dead for five hundred years.

    John Hogue, Bearded Dimwit
  • Anything about the Civil War on the History Channel - Sorry for the lack of variety here, but I just have to mention the guy with the Elmer Fudd accent that is on all of these documentaries. Apparently I am the only person in the world that is bothered by this.
  • The Q-Ray Commercial - If you think you should feel sorry for the people making testimonials, you are wrong. This is a rare intersection of people who deserve to have their money stolen and advertisers who do not deserve to receive money.
  • The 700 Club - Excessive squinting. Miraculously, doesn't seem to be on DirectTV in New York City.
  • Mind of Mencia - The person who greenlighted this trainwreck should receive the death penalty.
  • The Inaudible Fossilized Nun - I have no idea what the real name of this show is, but everyone knows who I'm talking about.
  • Pirate Radio TV - This is a cable access television show in Ithaca, New York. Typical rants include, "why did they move the CVS out to Route 13? Fuck!" and "Cornell students should count in antlerless deer season." It is sometimes entertaining to call in to the live broadcast and argue with the host–he flusters easily.

    The Pirate Radio host: think comic book guy, but not even unintentionally funny.
  • Fox NFL Pregame - Despite my soft spot for Terry Bradshaw, this has devolved into a retard tickle fight.

The Curse of Siragusa

Tony Siragusa is the nuclear option in Fox Sports' ongoing war against dramatic pause.

Tony Siragusa

Every Sunday he roves the sidelines ensuring that even the slightest moment of dead air is filled with sense-dulling stupidity. "I love coming to Cleveland because they've got the best nacho cheese in the league here. Ok, back to you guys." Last week, he told viewers that Redskins quarterback Mark Brunell had been practicing all week with wet balls to prepare for the depressing perpetual downpour in Seattle. Not content to leave it at that, he then demonstrated the act of submerging a football in a bucket of water.

If Scooter the Talking Baseball wasn't evidence enough, it should now be obvious that Fox's interest is machiavellian masochism rather than the enjoyment of genuine fans. They know that you will watch, and they want to make it hurt as much as possible. It is therefore left to us to take action, get involved, and improve the quality of our football experience. Here are some thoughts I had, which I urge you to try the next time Siragusa visits your NFL city. Bear in mind that these may require felonious access to the playing surface.

  • "Steal his nose," refuse to give it back. Let Siragusa chase you for three hours.
  • With several accomplices, distract Siragusa with a system of flashing mirrors. (Unlikely to work in winter.)
  • Stage a sham rib cookoff near the stadium prior to kickoff; lace Tony's racks with Lunesta.

Ok, back to you guys.

Cry me a River, Stupid Ohio

For a decade and a half, I was aware of exactly two Bengals fans.

  • ESPN personality and all-around good guy Dan Patrick.
  • A very irate patron of St. Mark's Ale House in New York City. This guy had positioned himself in a wooden chair in the center of a crowded bar, so that he could see the Arizona, Cincinatti, and Detroit games simultaneously. Anytime anyone attempted to change the station on any of the three televisions, he threw a holy fit. He was wearing an Ickey Woods jersey, and eventually wound up getting in a fistfight before being carried out. (Clearly out of his mind. Screw you buddy, if you happen to get here by Googling "batshit insane Bengals fan.")

Over the last few months, thousands have come out of the woodwork. The fact that your team is a disgrace is no reason to hide. I have known many Lions, Bears, and Browns fans through their respective lean years. In an odd way, I am able to respect the pluck of Browns fans. They may not have many things going for them–brains, literacy, or motor skills, to name a few–but they come out and cheer for their stupid team. This was not so for Bengals fans.

You deserve every embarrasing moment of what happened to you, so shut up.

Exploit Natural Mappings in Interface Design

The on-screen guide for my Direct TV box looks roughly like this:

DirectTV blows

The control on my remote that causes the current channel to move up and down looks like this:

DirectTV blows

If the problem here is obvious to you, you too may have a future in user interface design. If you thought to yourself, "hey, they screwed up an obvious natural mapping," then you are probably already involved on some level.

Just to make it perfectly clear what I am talking about, the orientation of the controls are out of whack. From my perspective, the channels increase going down on the screen but going up on the remote. The fact that the two don't match causes me to change the channel up when I meant to change it down, and vice versa, pretty much constantly.

You might call me a moron, and most days you might be right, but not here. This design is broken. It should do what I want without requiring me to stop to think about it.

It's amazing that decades after the publication of The Design of Everyday Things that it is still possible for a well-funded company to make this mistake. This company has enough money to buy the NFL through 2010, but apparently it isn't able to find a decent interface designer.

Most of the Information on the Internet is Wrong

Attention reader: this website may contain terrible advice and fundamentally flawed code samples. Personally, I don't believe this to be the case, but my advice to you is to read it as if that were true. That you should question everything you read is not a principle unique to technical websites, of course. However, I have found that some very smart people are willing to suspend disbelief when they see code written on some idiot's website.

I have complained about the Code Project website before. Although there are some exceptional articles on it, and many useful samples, these are dwarfed by the sheer volume of terrible ideas. There is a rating system, but this is only a halfassed attempt to filter out the crap. Fact is, the names of API functions bring in traffic. Code quality is not part of the pagerank formula.

My objective isn't to single out the Code Project - it is only the most successful of many similar sites. The reason I am mentioning it is because I found the following in an article today:

What we are implementing is called a COM class, so it should have a GUID associated with it. There is a tool you can use to generate a GUID called guidgen.exe, or you can take the one I've generated for you:

[Guid("{21F21921-B0FD-4801-862F-4BC417928574}")]

This is slightly paraphrased, and the GUID is replaced (I'm not sure why, but I would feel bad embarrasing the author by linking to him). It's clear to me that he doesn't fully understand what he is trying to teach, but it probably isn't to the lion's share of ignorant programmers in the world. It's also obvious to me that using a GUID from a website tutorial in commercial software is a profoundly bad idea, but this apparently isn't so for everyone.

I wonder how many senior developers have blown their stack after finally finding this GUID conflict in a subordinate's code? That would be an interesting case study of the law of large numbers.

The phenomenon of blindly accepting anything in virtual print goes in both directions. In addition to giving you lots of things you can do (but shouldn't), sites also tell you things you can't do (but actually, you can). Many are the times I've been told, "sorry, this bug can't be fixed" with a link to a Code Project forum post with some anonymous boob saying, "there's no way to do it." Similar incidents over the years have put me on a hair trigger when it comes to samples.

If you can't trust the MSDN documentation all of the time, you certainly can't trust the plebeians in the forums.

Wrote a Concurrency Library for Everyone

Herb Sutter says the concurrency revolution is coming. This guy says, “*** you!! the concurrency revolution is coming!”

That is the kind of attitude we need in the industry. We need more in-your-face greeks and fewer genial mustachioed C++ architects. Call me crazy.

I know this is the type of enthusiasm that is typically found in insane people building anti-gravity machines in their backyards, but I think these guys might be on to something with their Concurrency and Coordination Runtime (CCR).

I highly recommend watching the video–even if you have no idea what these people are talking about. Seriously mind-blowing stuff.