Showing results for April 2004 - Page 3 of 4 - The Old New Thing

Apr 16, 2004
0
0

Mapping all those "strange" digits to "0" through "9"

Raymond Chen
Raymond Chen

In an earlier article, I discussed how the Char.IsDigit() method and its Win32 counterpart, GetStringTypeEx report things to be digits that aren't just "0" through "9". If you really care just about "0" through "9", then you can test for them explicitly. For example, as a regular expression, use [0-9] instead of \d. Alternatively, for a regular exp...

Code
Apr 16, 2004
0
0

Sorry, no free ice cream in Tennessee; it's illegal

Raymond Chen
Raymond Chen

It seems that giving away ice cream has been illegal in Tennessee since 1957, when state legislators were trying to combat alleged unfair trade practices by the dairy industry. Upon its being alerted to the existence of this law, the state Senate and House unanimously passed a bill to repeal the law, sending it to the governor for signa...

Non-Computer
Apr 15, 2004
0
2

Why can't I install Windows on my USB drive?

Raymond Chen
Raymond Chen

A collection of limitations (both hardware and software) currently prevent Windows from booting and running off a USB drive. Some of them are described in this whitepaper from WinHEC 2003. Another reason not mentioned in this paper is that during any hot-plug operation, the USB bus is completely reinitialized. Windows really doesn't like it...

Other
Apr 15, 2004
0
0

Astonishingly, rules apply to everyone.

Raymond Chen
Raymond Chen

Spain's Crown Prince and his fiancée are outraged that they had to go through airport security in Miami. "The prince and his bodyguard felt they should not be subjected to the screening, but if they do not have an escort from the State Department or the Secret Service, it is required," she added. "It is the law." Apparently, the...

Non-Computer
Apr 14, 2004
0
1

Not all short filenames contain a tilde

Raymond Chen
Raymond Chen

I'm sure everybody has seen the autogenerated short names for long file names. For the long name "Long name for file.txt", you might get "LONGNA~1.TXT" or possibly "LO18C9~1.TXT" if there are a lot of collisions. What you may not know is that sometimes there is no tilde at all! Each filesystem decides how it wants to implement short filenam...

Code
Apr 14, 2004
0
0

Playing on an entirely different level

Raymond Chen
Raymond Chen

Competitive Scrabble® is another game entirely. For example, here's a game from the 2001 World Championship. You can follow it move-by-move, or you can read the game commentary. The name "Stefan" you see in the commentary is Wall Street Journal reporter Stefan Fatsis, author of Word Freak: Heartbreak, Triumph, Genius and...

Non-Computer
Apr 13, 2004
0
1

First thing we do is kill all the jerks

Raymond Chen
Raymond Chen

There a fascinating article in today's New York Times on a troop of baboons which went pacifist: ... researchers describe the drastic temperamental and tonal shift that occurred in a troop of 62 baboons when its most belligerent members vanished from the scene. The victims were all dominant adult males that had been strong and snarly enoug...

Non-Computer
Apr 13, 2004
0
1

Unicode collation is hard

Raymond Chen
Raymond Chen

The principle of "garbage in, garbage out" applies to Unicode collation. If you hand it a meaningless string and ask to compare it to another meaningless string, you get meaningless results. I am not a Unicode expert; I just play one on the web. A real Unicode expert is Michael Kaplan, whose explanation of how comparing invalid Unicode ...

Code
Apr 12, 2004
0
0

The random number seed can be the weakest link

Raymond Chen
Raymond Chen

Random number generation is hard. That's why you should leave it to the experts. But even if you choose a good random number generator, you still have to seed it properly. The best random number generator in the world isn't very useful if people can guess the seed. That's why seeding the random number generator with the current time is...

Code
Apr 12, 2004
0
0

Extraterrestrial income

Raymond Chen
Raymond Chen

As I was reading one of the bajillion annual reports in my mailbox, I happened across a comment regarding extraterrestrial income. Space aliens have to pay income tax? Oh, no, it was just a misread for the controversial extraterritorial income exclusion.

Non-Computer