Showing results for April 2010 - The Old New Thing

Apr 30, 2010
0
0

Welcome to Taiwan's premier English-only nightclub

Raymond Chen
Raymond Chen

One of my friends is fluent in both Mandarin and English. When she lived in Taiwan, she paid a visit to a nightclub whose gimmick was that you had to speak English. The target audience was not foreigners but rather native Taiwanese who learned English as a second language. My friend didn't have any problems with this rule, but many of the guests ap...

Non-Computer
Apr 30, 2010
0
0

If it's not yours, then don't mess with it without permission from the owner

Raymond Chen
Raymond Chen

It's surprising how many principles of real life also apply to computer programming. For example, one of the rules of thumb for real life is that is that if something doesn't belong to you, then you shouldn't mess with it unless you have permission from the owner. If you want to ride Jimmy's bike, then you need to have Jimmy's permission. Even if J...

Code
Apr 29, 2010
0
0

A short puzzle about heap expansion

Raymond Chen
Raymond Chen

At the 2008 PDC, somebody stopped by the Ask the Experts table with a question about the heap manager. I don't understand why the heap manager is allocating a new segment. I allocated a bunch of small blocks, then freed nearly all of them. And then when my program makes a large allocation, it allocates a new segment instead of reusing the mem...

Code
Apr 27, 2010
0
0

He bought the whole seat, but we only needed the edge

Raymond Chen
Raymond Chen

After the Windows 95 project was released to manufacturing, but before the launch event itself, the team finally had a chance to relax and unwind after many years of hard work. The project manager decided to have a morale event to get everyone together to do something fun. A typical morale event might be going to see a baseball game, renting ...

Non-Computer
Apr 26, 2010
0
0

Why doesn't TryEnterCriticalSection try harder?

Raymond Chen
Raymond Chen

Bart wants to know why the gives up if the critical section is busy instead of trying the number of times specified by the critical section spin count. Actually, there was another condition on the proposed new behavior: "but does not release its timeslice to the OS if it fails to get it while spinning." This second condition is a non-starter b...

Other
Apr 23, 2010
0
0

Our legal department suggests you skip our salad dressing and just eat an avocado

Raymond Chen
Raymond Chen

I saw a bottle of salad dressing with very strange fine print. The picture on the bottle is of half an avocado. But the fine print on the bottle reads "Does not contain avocados." Okay, so the picture on the bottle isn't a picture of the product. This is strange but not entirely unheard of. After all, a box of Girl Scout cookies has pictures of ...

Non-Computer
Apr 23, 2010
0
0

Why can't I get my regular expression pattern to match words that begin with %?

Raymond Chen
Raymond Chen

A customer asked for help writing a regular expression that, in the customer's words, matched the string when it appeared as a standalone word. One of the things that people often forget to do when asking a question is to describe the things that they tried and what the results were. This is important information to include, because it saves th...

Code
Apr 22, 2010
0
0

Email tip: When asking for help with a problem, also mention what you've already tried

Raymond Chen
Raymond Chen

When you ask a question, you should also mention what steps you've already taken when attempting to solve it on your own. First of all, it saves the people who decide to help you with your problem from exploring lines of investigation which you've already tried (and which you know don't work). "I tried setting the timeout to 60 seconds before issu...

Other
Apr 21, 2010
0
0

Email tip: When you say that something didn't work, you have to say how it didn't work

Raymond Chen
Raymond Chen

I illustrate this point with an imaginary conversation, inspired by actual ones I've seen (and, occasionally, been a frustrated party to). From: X I want to do ABC, but I don't have a DEF. Anybody know of a workaround? Somebody has an idea: From: Y Try mounting this ISO file into a virtual machine and trying the ABC from there. Unfor...

Other