The Old New Thing

10 is the new 6

While it may no longer be true that everything at Microsoft is built using various flavors of Visual C++ 5.0, 6.0, and 7.0, there is still a kernel of truth in it: A lot of customers are still using Visual C++ 6.0. That's why the unofficial slogan for Visual C++ 2010 was 10 is the new 6. Everybody on the team got a T-shirt with the slogan...

Who would ever write a multi-threaded GUI program?

During the development of Windows 95, the user interface team discovered that a component provided by another team didn't work well under multi-threaded conditions. It was documented that the function had to be the first call made by a thread into the component. The user interface team discovered that if one thread called , and then ...

Enumerating bit strings with a specific number of bits set (binomial coefficients strike again)

Today's Little Program prints all bit strings of length n subject to the requirement that the string have exactly k 1-bits. For example, all bit strings of length 4 with 2 bits set are 0011, 0101, 0110, 1001, 1010, and 1100. Let's write BitString(n, k) to mean all the bit strings of length n with exactly k bits set. Let's look at the ...
Comments are closed.0 0
Code

Non-classical processor behavior: How doing something can be faster than not doing it

Consider the following program: The program generates a lot of random integers in the range 0..9 and then counts how many are less than 0, less than 1, less than 2, and so on. It also prints how long the operation took in QPC units. We don't really care how big a QPC unit is; we're just interested in the relative values. (We print the ...
Comments are closed.0 0
Code

Can we continue to call FindNextFile() with the same handle that returned an error last time?

A customer wanted to know whether it was okay to call with the same handle that returned an error last time. In other words, consider the following sequence of events: The customer elaborated: Suppose that the directory contains four files, A, B, C, and D. We expect the following: After returns an error, can we continue to search ...
Comments are closed.0 0
Code

Why do network servers sometimes show up as a Recycle Bin Location?

A customer wanted to know why some of their users showed network servers among the locations shown in the Recycle Bin property sheet. Answer: Because those users are using Folder Redirection. In particular, if you redirect the My Documents folder, then a network Recycle Bin location is created to hold the files deleted from My Documents. ...

Microspeak: Brownbag

Remember, Microspeak is not merely for jargon exclusive to Microsoft, but it's jargon that you need to know. The term brownbag (always one word, accent on the first syllable) refers to a presentation given during lunch. The attendees are expected to bring their lunch to the meeting room and eat while they listen to the presentation. A ...

Improving the performance of CF_HDROP by providing file attribute information

The clipboard format is still quite popular, despite its limitation of being limited to files. You can't use it to represent virtual content, for example. For all of you still using , you can improve the performance of drag/drop operations by adding a little more information to your data object. Observe that the clipboard format is ...
Comments are closed.0 0
Code

Closing over the loop variable is just as harmful in JavaScript as it is in C#, and more cumbersome to fix

Prerequisite reading: Closing over the loop variable considered harmful. JavaScript has the same problem. Consider: The most common case where you encounter this is when you are hooking up event handlers in a loop, so that's the case I used as an example. No matter which button you click, they all alert , rather than the respective ...
Comments are closed.0 0
Code