The Old New Thing

Not quite understanding why you wash your hands before playing the piano

My niece wanted to play my piano, and I asked her to wash her hands. She said, "I don't need that, I have Magic Soap," and she produced a bottle of hand sanitizer. Um, the purpose of washing your hands isn't so the piano doesn't get sick. My piano-instructor cousin-in-law tells me that her young students often say, "My hands are not dirty. ...

Microspeak: Hipo

A friend of mind was asked out of the blue, "What does hypo mean?" She started to flash back to high school English class and Greek word roots. "I've started to hear it everywhere. Like Everyone in that meeting is a hypo or We need to reach out to hypos." My friend realized that she had mis-heard the question. It was not about the Greek ...

How do I pin a program directly to the Start menu rather than a shortcut?

Anonymous bemoans the fact that pinning programs to the Start menu (in Windows XP) actually pins the shortcut rather than the program itself. This means that if you right-click on a shortcut to pin it, then delete the shortcut, the pinned item stops working. How do you pin the program directly? You pin the program directly by right-...

No, you can't ask whether your notification icon is visible or not

A customer asked what started out as a simple question, but by now you know that this sort of simple question only raises new questions: Is there a way that we can detect that the user has hidden our notification icon? No, there is no way to ask whether your notification icon is hidden or visible. Users decide which icons they want to see, ...
Comments are closed.0Code

There's only so much you can do to stop running code from simulating UI actions

Commenter KiwiBlue asks whether Captcha-style tests were considered to prevent unsigned drivers from programmatically clicking the 'Install anyway' button. I'm sure somebody considered it, but Captcha has its own problems. "Type the (distorted) letters below"-type Captcha cannot be used by people with visual impairments, people who are ...
Comments are closed.0Other

Even if you have a lock, you can borrow some lock-free techniques

Even if you prefer to use a lock (after all, they are much easier to program), you can borrow some lock-free techniques. For example, consider this: There are some concerns here. First of all, there's the lock hierarchy issue: If reticulating a spline takes the geometry lock, that may violate our lock hierarchy. If the lock g_cs is a hot...
Comments are closed.0Code

The performance improvements of a lock-free algorithm is often not in the locking

GWO wonders what the conditions are under which the lock-free version significantly outpeforms a simple critical section. Remember that switching to a lock-free algorithm should be guided by performance measurements. Switching from a simple algorithm to a complex one shouldn't be done unless you know that the simple algorithm is having ...
Comments are closed.0Code

Corrections to Patterns for using the InitOnce functions

Adam Rosenfield pointed out that it is not possible to fail an asynchronous initialization; if you pass INIT_ONCE_INIT_FAILED when completing an asynchronous initialization, the function fails with ERROR_INVALID_PARAMETER. (Serves me right for writing an article the night before it goes up.) A more correct version is therefore In other ...
Comments are closed.0Code