Posts by this author

Sep 20, 2004
0
0

How to host an IContextMenu, part 1 – Initial foray

Most documentation describes how to plug into the shell context menu structure and be a context menu provider. If you read the documentation from the other side, then you also see how to host the context menu. (This is the first of an eleven-part series with three digressions. Yes, eleven parts—sorry for all you folks who are in it just ...

Code
Sep 17, 2004
0
0

Why does my mouse/touchpad sometimes go berzerk?

Each time you move a PS/2-style mouse, the mouse send three bytes to the computer. For the sake of illustration, let's say the three bytes are x, y, and buttons. The operating system sees this byte stream and groups them into threes: x y b x y b x y b x y b Now suppose the cable is a bit jiggled loose and one of the "y"s gets lost. The ...

Tips/Support
Sep 16, 2004
0
0

A visual history of spam (and virus) email

I have kept every single piece of spam and virus email since mid-1997. Occasionally, it comes in handy, for example, to add naïve Bayesian spam filter to my custom-written email filter. And occasionally I use it to build a chart of spam and virus email. The following chart plots every single piece of spam and virus email that arrived at my...

Other
Sep 16, 2004
0
0

What happens when you specify RegexOptions.ECMAScript?

The flag changes the behavior of .NET regular expressions. One of the changes I had discussed earlier was with respect to matching digits. For those who want to know more, a summary of the differences is documented in MSDN under the devious title "ECMAScript vs. Canonical Matching Behavior". Apparently some people had trouble finding that page...

Code
Sep 15, 2004
0
1

Interlocked operations don’t solve everything

Interlocked operations are a high-performance way of updating DWORD-sized or pointer-sized values in an atomic manner. Note, however, that this doesn't mean that you can avoid the critical section. For example, suppose you have a critical section that protects a variable, and in some other part of the code, you want to update the variable ...

Code
Sep 10, 2004
0
0

Storsjöodjur hunting season will opening soon

Scotland doesn't have the corner on monsters in lakes. You'll also find them in Norway, in Sweden (read about a recent expedition), and in Canada, among many, many others. Anywhere there are lakes, there's bound to be a legend about a monster in one of them. It appears, however that Sweden's Storsjöodjur is about to lose its protected ...

Non-Computer
Sep 10, 2004
0
1

Sometimes the bug isn’t apparent until late in the game

I didn't debug it personally, but I know the people who did. During Windows XP development, a bug arrived on a computer game that crashed only after you got to one of the higher levels. After many saved and restored games, the problem was finally identified. The program does its video work in an offscreen buffer and transfers it to the ...

History
Sep 9, 2004
0
0

Why isn’t the original window order always preserved when you undo a Show Desktop?

A commenter asked why the original window order is not always preserved when you undo a Show Desktop. The answer is "Because the alternative is worse." Guaranteeing that the window order is restored can result in Explorer hanging. When the windows are restored when you undo a Show Desktop, Explorer goes through and asks each window that it...

Code

Feedback