Showing results for June 2006 - Page 2 of 4 - The Old New Thing

Jun 22, 2006
0
0

An auto-reset event is just a stupid semaphore

Raymond Chen
Raymond Chen

When you create an event with the function, you get to specify whether you want an auto-reset event or a manual-reset event. Manual-reset events are easy to understand: If the event is clear, then a wait on the event is not satisfied. If the event is set, then a wait on the event succeeds. Doesn't matter how many people are waiting for the event;...

Code
Jun 21, 2006
0
0

It's still not a democracy, but at least other people have noticed, too

Raymond Chen
Raymond Chen

I'm glad I'm not the only person to notice that elections for boards of directors are completely rigged so that the nominees always win and there's nothing you can do about it. It appears that the issue was the hot topic in this year's proxy war skirmishes. This year, one company actually called me at home asking me to send in my proxy. I guess...

Non-Computer
Jun 21, 2006
0
0

Psychic debugging: Understanding DDE initiation

Raymond Chen
Raymond Chen

You too can use your psychic powers to debug the following problem: We have a problem with opening documents with our application by double-clicking them in Explorer. What's really strange is that if we connect a debugger to Explorer and set a breakpoint on , then wait a moment after returns, then hit '', then the document opens fine. But if w...

Code
Jun 20, 2006
0
0

Three-Minute Masterpieces (2006)

Raymond Chen
Raymond Chen

The Seattle Times invited its readers to make three-minute movies, and the best were screened at the Seattle International Film Festival. Or you can watch them online.

Non-Computer
Jun 20, 2006
0
0

A single-instance program is its own denial of service

Raymond Chen
Raymond Chen

There are many ways a program can establish itself as a single-instance program; I won't go into them here. But once people head down the path of a single-instance program, they bump into another issue in their security review: Denial of service. We are using a named mutex with a fixed name in order to detect whether another copy of the program is...

Other
Jun 19, 2006
0
0

Announcements on the ferry, one self-explanatory, one not

Raymond Chen
Raymond Chen

While I was riding the ferry last Saturday, there were two announcements made over the public address system. "All crew please report to the Second Mate's office." What were they all doing in the Second Mate's office? Would the whole crew fit into the office? And while all the crew are in the Second Mate's office, who's steering the ferry? The s...

Non-Computer
Jun 19, 2006
0
0

Why can't you programmatically reorder the items on the Start menu?

Raymond Chen
Raymond Chen

The classic Start menu and the "All Programs" portion of the Windows XP Start menu permit you to customize the order of the shortcuts that appear there. You can use drag/drop to rearrange them, or force them to be sorted by name. But why is there no programmatic interface to these actions? Because the power would be used for evil far more tha...

Other
Jun 16, 2006
0
0

Understanding what significant digits really mean

Raymond Chen
Raymond Chen

A double-precision floating point number carries fifteen significant digits. What does this really mean? I multiplied 0.619207 by 10,000,000 and got 6192069.999999991 instead of 6192070. That's only six significant digits; where's my fifteen? Talking about significant digits is really just a shorthand for talking about relative precision. "Fifte...

Other
Jun 15, 2006
0
0

It's a good idea to get somebody who knows the language to be your proofreader

Raymond Chen
Raymond Chen

If you're going to use text from another language, it behooves you to get somebody who knows the language to be your proofreader. Those who fail to heed this advice with respect to Chinese characters may end up featured on Hanzi Smatter 一知半解, which starts with a book titled A Dictionary of Chinese Symbols whose cover d...

Non-Computer
Jun 15, 2006
0
0

Window class properties apply to all windows that belong to the class

Raymond Chen
Raymond Chen

Window class properties apply to all windows that belong to the class. That's why they're called class properties. This seems like an obvious thing to say when put in so many words, but I see many "solutions" that lose sight of this simple fact. All the properties that you set in the (or ) are window class properties, as are the properties that...

Code