The Old New Thing

The ways people mess up IUnknown::QueryInterface

When you're dealing with application compatibility, you discover all sorts of things that worked only by accident. Today, I'll talk about some of the "creative" ways people mess up the IUnknown::QueryInterface method. Now, you'd think, "This interface is so critical to COM, how could anybody possible mess it up?" Forgetting to respond to...

Swedish spicy food

My friend Jonathan is acting as my host in Uppsala, and he was responsible for preparing dinner for a staff party at his nation. He chose curry. The same thing he chose the last time he was responsible for preparing dinner for a party. The last time, one of the attendees ceremonially dumped the curry into the trash because it was "...

URLs too small? Here comes hugeurl.com

Sure, everybody knows about little tinyurl.com, handing out short URLs for large unwieldy ones. But nobody pays any attention to tinyurl.com's arch-nemesis: www.hugeurl.com, or as they like to call themselves, http://www.hugeurl.com/?ZWY3ZTE0NWFmOTg5ZDU2M2QxYWI3ZTNhMGJj ZjlhNGMmMTImVm0wd2QyUXlVWGxXYTJoV1YwZG9WVll3Wkc5alJsWjBUVlpP ...

Regular expressions and the dreaded *? operator

The regular expression *? operator means "Match as few characters as necessary to make this pattern succeed." But look at what happens when you mix it up a bit: This pattern matches a quoted string containing no embedded quotes. This works because the first quotation mark starts the string, the .*? gobbles up everything in between, ...

The SAS in-flight safety video

Each time I see the SAS in-flight safety video, I am amused by the story they tell about each of their "characters". The safety video features four groups of travellers, a man and a young girl, a retired couple, a (very Scandinavian-looking) businesswoman, and a (vaguely Hispanic) young man. Each procedure is illustrated one of the ...

Out of the deep fryer

McDonalds anonunced that it would no longer offer "Super Size" on its menu. The ostensible reason was that the addition of newer healthier options didn't leave room on the menu for "Super Size". This was of course laughable on its face. Now it's even more laughable, because it turns out that the so-called "healthy" options are ...

Some files come up strange in Notepad

David Cumps discovered that certain text files come up strange in Notepad. The reason is that Notepad has to edit files in a variety of encodings, and when its back against the wall, sometimes it's forced to guess. Here's the file "Hello" in various encodings: This is the traditional ANSI encoding. This is the Unicode (little-...

the qUirKY jaPan HomEPage

The weird stuff about Japan you were afraid to ask about. The Seldom-Asked Questions are interesting, but what I find the most fascinating is the pictures of various Japanese subcultures. [Raymond is currently on vacation; this message was pre-recorded...

@-notation was never legal in HTTP URLs anyway

Some people are in an uproar over IE's dropping of support for @ notation in HTTP URLs. What people fail to note is that The @ notation was never legal for HTTP URLs in the first place. If you go to RFC 1738 section 3.3 (HTTP), it explicitly states: An HTTP URL takes the form: where <host> and <port> are as described...

Why an object cannot be its own enumerator

I've seen people using the following cheat when forced to implement an enumerator: Why create a separate enumerator object when you can just be your own enumerator? It's so much easier. And it's wrong. Consider what happens if two people try to enumerate your formats at the same time: The two enumerators are really the same enumerator...