Feb 28, 2013
Post comments count0
Post likes count1
As a puzzle, commenter nobugz
asks,
"What kind of infinity is 1.#J?"
double z = 0;
printf("%.2f", 1/z);
Now, the division by zero results in IEEE positive infinity,
would would normally be printed as
1#INF.
But the catch here is that the print format says
"Display at most two places after the decimal point."
But where is the decimal point in i...
Feb 28, 2013
Post comments count0
Post likes count1
The structure lets you specify a bitmap to appear next to the menu item. Is there a way to do this from a menu resource template?
No.
If you look at the format of menu templates, you'll see that there is nowhere to specify a bitmap.
Which kind of makes sense, because it is the responsibility of the application to destroy the bitmap refer...
Feb 27, 2013
Post comments count0
Post likes count1
A user of the imaginary
Program Q
program wanted to write an automated test that created a table,
then ran various sub-test which communicated among each other
by updating that table.
When my test tries to create a table,
the program asks the following question:
q install server -r testdb
Setting up this machine to be a registered tabl...
Feb 26, 2013
Post comments count0
Post likes count1
This is a story from a friend of a friend,
which makes it probably untrue, but I still like the story.
One of my colleagues jokingly suggested that we could speed up
our code by adding these lines to our project
#define EnterCriticalSection(p) ((void)0)
#define LeaveCriticalSection(p) ((void)0)
I replied, "You think you're joking, but you're...
Feb 25, 2013
Post comments count0
Post likes count1
I dreamed that a friend of mine was showing me her new appliance: A combination urinal/bidet/washing machine. As we loaded clothes into it, she said, "You okay in there, Stephanie?" A muffled voice emerged from within: "Just let me know when you're ready."
Feb 22, 2013
Post comments count0
Post likes count0
Many years ago, I wrote, "Do not write in-process shell extensions in managed code." Since I originally wrote that article, version 4 of the .NET Framework was released, and one of the features of that version is that it supports in-process side-by-side runtimes. Does that mean that it's now okay to write shell extensions in managed code?
The ans...
Feb 22, 2013
Post comments count0
Post likes count1
When you associate a file handle with an I/O completion port with the function, you can pass an arbitrary pointer-sized integer called the which will be returned by the function for every I/O that completes against that file handle. But isn't that parameter superfluous? If somebody wanted to associated additional data with a file handle, they...
Feb 21, 2013
Post comments count0
Post likes count1
As every computer scientist knows, the IEEE floating point format reserves a number of representations for infinity and non-numeric values (collectively known as NaN, short for not a number). If you try to print one of these special values with the Visual C runtime library, you will get a corresponding special result:
Positive and negative inf...
Feb 20, 2013
Post comments count0
Post likes count1
If you want to figure out some quirks of a calling
convention,
you can always ask the compiler to do it for you,
on the not unreasonable assumption that the compiler
understands calling conventions.
"When a __stdcall
function returns a large structure by value,
there is a hidden first parameter that specifies the
address the return value should ...