Showing archive results for 2006

May 9, 2006
Post comments count0
Post likes count1

Subtle ways your innocent program can be Internet-facing

Raymond Chen

Last time, we left off with a promise to discuss ways your program can be Internet-facing without your even realizing it, and probably the most common place for this is the command line. Thanks to CIFS, files can be shared across the Internet and accessed via UNC notation. This means that anybody can set up a CIFS server and create files like , an...

Other
May 8, 2006
Post comments count0
Post likes count0

Seattle boating season opens but never closes

Raymond Chen

This past weekend was Opening Day of the Seattle boating season. This tends to create traffic chaos in the Montlake neighborhood, which leads to confusing newspaper headlines like Opening Day closure. I remember many years ago asking a boat-owning colleague, "So, when does boating season close?" "Oh, it doesn't close." "Then why do they have a...

Non-Computer
May 5, 2006
Post comments count0
Post likes count2

What can I do with the HINSTANCE returned by the ShellExecute function?

Raymond Chen

As we saw earlier, in 16-bit Windows, the identified a program. The Win32 kernel is a complete redesign from the 16-bit kernel, introducing such concepts as "kernel objects" and "security descriptors". In particular 16-bit Windows didn't have "process IDs"; the instance handle served that purpose. That is why the and functions returned an . But...

History
May 4, 2006
Post comments count0
Post likes count0

On the bogusness of reporting the winning word in a spelling bee

Raymond Chen

Whenever the United States media report on a spelling bee (typically, the Scripps National Spelling Bee, the best-known spelling bee in the country), they always report on the "winning word". But the winning word is a bogus metric because the winning word in real life tends to be comparatively easy. It's the penultimate word that is the hard one. ...

Non-Computer
May 4, 2006
Post comments count0
Post likes count4

Doing quick arithmetic from the command prompt

Raymond Chen

The command processor comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers: Note that we had to quote the shift operator since it would otherwise be misinterpreted as a "redirect stdout and append" operator. For more information, type at the command prompt.

Tips/Support
May 3, 2006
Post comments count0
Post likes count1

The alertable wait is the non-GUI analog to pumping messages

Raymond Chen

When you are doing GUI programming, you well know that the message pump is the primary way of receiving and dispatching messages. The non-GUI analog to the message pump is the alertable wait. A user-mode APC is a request for a function to run on a thread in user mode. You can explicitly queue an APC to a thread with the function, or you can do ...

Code
May 2, 2006
Post comments count0
Post likes count1

A cache with a bad policy is another name for a memory leak

Raymond Chen

A common performance trick is to reduce time spent in the heap manager by caching the last item freed (or maybe the last few) so that a subsequent allocation can just re-use the item rather than having to go make a new one. But you need to be careful how you do this or you can end up making things worse rather than better. Here's an example motiva...

Code
May 1, 2006
Post comments count0
Post likes count0

Tips from an American on on driving in Taiwan

Raymond Chen

Although I have been a passenger in a car many times, I thank my lucky stars that I have never had to be the person behind the wheel in Taiwan. But if you decide you want to give it a shot, you might want to pick up some driving tips from an American who spent time in Taiwan as an English teacher, part of his Teaching English in Taiwan site. My ...

Non-Computer
May 1, 2006
Post comments count0
Post likes count2

What's so special about bitmaps and DCs?

Raymond Chen

You can select pens, brushes, fonts and bitmaps into a DC with the function, and from this list, bitmaps are special. Because, if you look carefully, bitmaps are the only modifiable objects on the list. Pens, brushes and fonts cannot be modified once they are created. But bitmaps, oh, bitmaps. A bitmap selected into a DC changes as you draw into ...

Code