Showing archive results for 2007

Apr 27, 2007
Post comments count0
Post likes count0

News Flash: Not being able to watch Jay Leno is not an emergency

Raymond Chen

The Mesa (Arizona) Police Department reminds us in a press release that 9-1-1 is for emergencies, and the inability to watch Jay Leno due to a power outage does not qualify as an emergency. (Noting, because everybody else will, that this is not the same as the unconfirmed of the woman who called 9-1-1 for a cheeseburger emergency.) Update: Firs...

Non-ComputerNews flash
Apr 27, 2007
Post comments count0
Post likes count1

Stupid debugger tricks: Calling functions and methods

Raymond Chen

Back in the old days, if you wanted to call a function from inside the debugger, you had to do it by hand: Save the registers, push the parameters onto the stack (or into registers if the function uses or ) push the address of the function, move the instruction pointer to the start of the function you want to call, then hit "g" to resume executi...

Code
Apr 26, 2007
Post comments count0
Post likes count0

The intermediate value theory helps your table but not necessarily your beer

Raymond Chen

An Australian mathematician applied intermediate value theory to the problem of keeping a table from wobbling: Just rotate the table and you'll eventually find a spot. A few things struck me about that article. First, that it explains that intermediate value theory "is the same principle underlying the fact that there will always be two points wi...

Non-Computer
Apr 26, 2007
Post comments count0
Post likes count1

Using the "gu" debugger command to find the infinite loop

Raymond Chen

Somebody says, "Your program is consuming 100% CPU" and hands you a debug session. Usually, this happens because one thread has gotten stuck in an infinite loop. And if you're lucky it's the type of infinite loop that's easy to diagnose because it's just one function that isn't returning. (The more complicated types are where a function does some ...

Other
Apr 25, 2007
Post comments count0
Post likes count0

There's something about Christopher Walken

Raymond Chen

Actor Christopher Walken has such a peculiar speaking style, he's inspired a theater show: All About Walken. The run ends soon, so if you're going to see it, you'll have to act fast.

Non-Computer
Apr 25, 2007
Post comments count0
Post likes count1

Identifying an object whose underlying DLL has been unloaded

Raymond Chen

Okay, so I gave it away in the title, but follow along anyway. Your program chugs along and then suddenly it crashes like this: Instantly you recognize the following: This is a virtual method call. (Call indirect through register plus offset.) — Very high confidence. The vtable is in . (That is the base register of the ind...

Other
Apr 24, 2007
Post comments count0
Post likes count0

How much time does it take for a pedestrian to cross the street?

Raymond Chen

It sounds like the set-up to an old joke, but it's not. It's just one of the random bits of trivia that I wondered about. For intersections with both high pedestrian and high vehicle volumes, I was able to find the Federal Highway Administration recommendation, which is to give pedestrians a head start to allow them to cross one lane of traffic be...

Non-Computer
Apr 24, 2007
Post comments count0
Post likes count3

What is the underlying object behind a COM interface pointer?

Raymond Chen

When you're debugging, you might have a pointer to a COM interface and want to know what the underlying object is. Now, sometimes this trick won't work because the interface pointer actually points to a stub or proxy, but in the case where no marshalling is involved, it works great. (This technique also works for many C++ compilers for any object ...

Other
Apr 23, 2007
Post comments count0
Post likes count0

Given a choice between two options, you influence the result by adding a third, inferior, alternative

Raymond Chen

Shankar Vedantam wrote a Washington Post article and also appeared on NPR to discuss The Decoy Effect: Given a choice between two options, introducing a third, clearly inferior, option can influence your original decision. You won't pick the third option, but a clever choice of the bad third option can sway the decision toward either of the oth...

Non-Computer
Apr 23, 2007
Post comments count0
Post likes count1

Psychic debugging: When reading unfamiliar code, assume it's mostly correct

Raymond Chen

You may be called in to study a problem in code you've never seen before or be asked to look over a proposed change to some code you've never seen before. When this happens, you have to take shortcuts in your analysis because following every function call to the bottom would not only take far too much time, but also take you so far away from the c...

Other