The Old New Thing

Practical development throughout the evolution of Windows.

Latest posts

Feb 18, 2009
Post comments count 0
Post likes count 1

Guest TCP psychic debugging: Why the remote server keeps RSTing the connection

Raymond Chen

My colleague Keith Moore (who occasionally comments on this site) shared with me one of his recent triumphs of psychic debugging. First the question: The customer is getting an RST response from IIS and they would like to know why. Here is a fragment from a network capture that illustrates the problem. (Fragment deleted.) The full capture is available on ... Keith didn't look at the full capture; he barely even glanced at the fragment. Because his psychic powers told him the answer: The amount of data they are sending does not match the Content-Length header. He goes on to explain: If there's unrea...

Feb 17, 2009
Post comments count 0
Post likes count 0

Another Seattle bus tool: One Bus Away

Raymond Chen

I was recently tipped off to yet another Seattle bus tool: One Bus Away, which not only provides real-time bus arrival information for every stop in the Metro system, but does so in a variety of formats. You can use the Web-based interface (which is close to what you can already get from the Tracker Location View), but the real magic is that the information is also available via SMS, Web-enabled handheld devices, and—most important to me—any mobile phone. I have One Bus Away on my speed dial, and I've set bookmarks on the stops I use the most, so I'm never more than a few taps of the phone away fr...

Feb 17, 2009
Post comments count 0
Post likes count 1

Why doesn’t the file system have a function that tells you the number of files in a directory?

Raymond Chen

There are any number of bits of information you might want to query from the file system, such as the number of files in a directory or the total size of the files in a directory. Why doesn't the file system keep track of these things? Well, of course, one answer is that it certainly couldn't keep track of every possible fragment of information anybody could possibly want, because that would be an infinite amount of information. But another reason is simply a restatement of the principle we learned last time: Because the file system doesn't keep track of information it doesn't need. The file system doesn't...

Feb 16, 2009
Post comments count 0
Post likes count 1

Don’t keep track of information you don’t need

Raymond Chen

This is sort of an extreme corollary to Don't save anything you can recalculate. Sure, it sounds like such an obvious principle, but many people fail to understand its consequences. Let's look at the principle again. Don't keep track of information you don't need. I remember being asked to look at a customer's program, and one thing that struck me was that the program had a bazillion different flag variables that it spent a lot of time setting and clearing. Here's an oversimplified example: void CConfiguration::ShowDialog(HWND hwnd) { m_fShowingDialog = true; DoModal(hwnd); m_fShowingDialog = false; ...

Feb 13, 2009
Post comments count 0
Post likes count 0

The love bus, also known as Metro Bus Route number 308

Raymond Chen

Four years ago, Troy Kleweno spotted Christine Hsieh on the 308 bus. He saw her twice a day, once in the morning on the way to work, and again in the evening on the way home. His co-workers teased him about the "bus girl" he pined after for six months before he finally said hello. That led to a date, and soon they were a couple. It's only fitting then that when Troy decided that it was time to propose marriage, that he do it on the 308 bus. Watch it here. Happy Valentine's Day, everybody.

Feb 13, 2009
Post comments count 0
Post likes count 1

The checkbox: The mating call of the loser

Raymond Chen

(Cultural note: The phrase the mating call of the loser is a term of derision. I used it here to create a more provocative headline even though it's stronger than I really intended, but good writing is bold.) When given a choice between two architectures, some people say that you should give users a checkbox to select which one should be used. That is the ultimate cowardly answer. You can't decide between two fundamentally different approaches, and instead of picking one, you say "Let's do both!", thereby creating triple, perhaps quadruple the work compared to just choosing one or the other. It's like you'...

Feb 12, 2009
Post comments count 0
Post likes count 0

Superthunderstingcar is go!

Raymond Chen

If you are an old geezer, you'll remember supermarionated shows, the most famous of which is Thunderbirds. And if you're not an old geezer, then this amazing spoof by Peter Cook and Dudley Moore will mean nothing to you. (You will also have no idea who Peter Cook and Dudley Moore are.)

Feb 12, 2009
Post comments count 0
Post likes count 5

What does the COM Surrogate do and why does it always stop working?

Raymond Chen

The process goes by the name COM Surrogate and the only time you're likely even to notice its existence is when it crashes and you get the message COM Surrogate has stopped working. What is this COM Surrogate and why does it keep crashing? The COM Surrogate is a fancy name for Sacrificial process for a COM object that is run outside of the process that requested it. Explorer uses the COM Surrogate when extracting thumbnails, for example. If you go to a folder with thumbnails enabled, Explorer will fire off a COM Surrogate and use it to compute the thumbnails for the documents in the folder. It does this becaus...

Feb 11, 2009
Post comments count 0
Post likes count 0

In order to serve you bett… wait, it really is better: Fuel surcharges

Raymond Chen

Normally, the phrase In order to serve you better means that you're about to get screwed. Imagine my surprise to discover that United has stopped imposing a fuel surcharge for flights between Canada and the United States due to the decrease in fuel prices. But wait, that's only for flights between Canada and the United States. Flights within the United States appear to have the surcharge in place as usual. Hey, I've got an idea. How about getting rid of this surcharge nonsense and just raise the price of the ticket? Naw, that's just crazy talk. I can see the Calvin & Hobbes cartoon already. "Lemo...