Showing archive results for 2007

Aug 15, 2007
Post comments count0
Post likes count1

C# static constructors are called on demand, not at startup

Raymond Chen

One of the differences between C++ and C# is when static constructors run. In C++, static constructors are the first thing run in a module, even before the function runs.¹ In C#, however, static constructors don't run until you use the class for the first time. If your static constructor has side effects, you may find yourself experiencing ...

Code
Aug 14, 2007
Post comments count0
Post likes count0

SIFF 2007 wrap-up: Grandhotel, The Boss of It All, Vacation

Raymond Chen

Sorry, SIFF fans, but this article got stuck in the queue. But now it's unstuck. Grandhotel : A sweet story about a shy, innocent, weather-obsessed hotel employee and the even stranger people who surround him. I wasn't quite sure what to expect, but I was quite pleased with what I got. Part comedy, part drama, the movie creates touching moments wh...

Non-Computer
Aug 14, 2007
Post comments count0
Post likes count0

What is the order of evaluation in C#?

Raymond Chen

The C and C++ languages leave the order of evaluation generally unspecified aside from specific locations called sequence points. Side effects of operations performed prior to the sequence point are guaranteed visible to operations performed after it.¹ For example, the C comma operator introduces a sequence point. When you write f(), g(), the...

Code
Aug 13, 2007
Post comments count0
Post likes count0

Math is hard, let's go shopp—oops

Raymond Chen

(The title is another variation on Math is hard, let's go shopping!", which appears to be a popular catchphrase over in Michael Kaplan's neck of the woods. The history of the phrase was researched on Language Log.) Last spring, I was at a local crafts store and paid for a $2.15 item with a $5 bill and two dimes. The teenage salesclerk rang up t...

Non-Computer
Aug 13, 2007
Post comments count0
Post likes count0

Why is the blog's subtitle "Not actually a .NET blog"?

Raymond Chen

Based on the feedback from my last CLR week, I think one CLR week a year is about right, Welcome to CLR Week 2007. I'll kick off the week with something not actually technical, but which might be puzzling to the newcomers: Why is the blog's subtitle "Not actually a .NET blog"? When I started, the blog hosting site for Microsoft technical blogger...

History
Aug 10, 2007
Post comments count0
Post likes count1

Things I've written that have amused other people, Episode 4

Raymond Chen

One of my colleagues pointed out that my web site is listed in the references section of this whitepaper. It scares me that I'm being used as formal documentation because that is explicitly what this web site isn't. I wrote back, I really need to put a disclaimer on my web site. FOR ENTERTAINMENT PURPOSES ONLY Remember, this is a blog. The op...

OtherThings I've written that have amused other people
Aug 9, 2007
Post comments count0
Post likes count0

Martina Navratilova's final Wimbledon appearance, and this time she means it

Raymond Chen

When I was growing up, our family followed professional tennis on television, and Wimbledon was of course the tennis tournament of the year. During those years, it seemed always to boil down to Martina Navratilova against Chris Evert in the final, and the family's loyalties were split. (I sided with the old guard and pulled for Chris Evert.) In t...

Non-Computer
Aug 9, 2007
Post comments count0
Post likes count2

How do I get the handle of the primary monitor?

Raymond Chen

The primary monitor by definition has its upper left corner at (0, 0). Therefore, you can use this function: To make double extra sure (belt and suspenders), we also tell it, "If you're not sure what monitor to return, give us the primary." Sure, this sounds obviously simple, but I actually found somebody who fumbled around in the dark passi...

Code
Aug 8, 2007
Post comments count0
Post likes count0

Bowling coming to Bellevue, and given the location, it's naturally upscale

Raymond Chen

The Lincoln Square mall in Bellevue will have a new tenant: An upscale bowling all^H^H^Hlounge. Expected to open before the Christmas holiday season, there will be two bars, full-service dining, lots of big plasma screens, all the stuff that makes bowling better. The lounge be positioned on the second floor, beneath Parlor Billiards, a business...

Non-Computer
Aug 8, 2007
Post comments count0
Post likes count1

Email tip: I don't have my bug numbers memorized

Raymond Chen

Far too often I'll get email like this: From: X Subject: 27183 Have you started looking at this one yet? It may surprise you to learn that I do not memorize all my bug numbers. Please include a brief description of the bug in your message so I have a clue what you're talking about. The bug title is a good start. It's like going to a doctor an...

Otheremail