The Old New Thing

Displaying the dictionary, part 1: Naive version

We return briefly to the ongoing Chinese/English dictionary series and write some code to display all the definitions we had worked so hard to collect. (I figure you're anxious to see something on the screen, so I am going to handle the Traditional Chinese/Simplified Chinese issue later. For now, the "Simplified" column will be blank.) ...

Why does Explorer eject the CD after you finish burning it?

Partly as a convenience, but partly to work around buggy hardware. The developer responsible for CD burning explained it to me. Most CD drives cache information about the disc in their internal memory to improve performance. However, some drives have a bug where they fail to update the cache after the CD has been written to. As a result, you ...

Why can't the default drag/drop behavior be changed?

A common reaction to my explanation of whether dragging a file will result in a move or copy was that there should be a setting that lets you change the algorithm by which Explorer decides whether you want to move or copy. There are a few reasons why this is a bad idea. First, if there were such a setting, then it removes some of the ...

Can you trust the Man on the Street interview?

Occasionally, in a news story, the reporter will ask for comments or opinion from a passer-by (nicknamed "the man on the street"). Greg Packer has created a second career as that man. In the last 10 years, he's been quoted at least a dozen times by the New York Post. He's been quoted at least 14 times by the Daily News, most recently just ...

Answer to quick puzzle about security and synchronization

As many people quickly figured out, the reason why the the returns immediately is that the call is failing. The reason is that the second process opened the handle with access, which grants permission to call the function, the function, and the fatally flawed function, but it doesn't include access, which is necessary if you ...

A quick puzzle about security and synchronization

This quick puzzle floated past one of our internal discussion groups. In Process B, the succeeds, but the returns immediately instead of waiting. Explain. [Correction: I confused the matter by passing as the third parameter, thereby creating an event that is initially signalled. Change it to so that the event is created non-...