The evolution of HRESULT_FROM_WIN32

We figured they were more actual guidelines. — Pirates of the Caribbean Macros are wonderful things.  I love macros.  They’re exciting and dangerous.  Every time I write a macro I salivate at the power I am wielding.  It’s like using a blowtorch. It is perhaps no coincidence that many coding standards put big warning signs…

1

If you see a fact, try to see it as intuitively as possible

Insight is a tricky thing.  To a certain degree people are born with it (or without it) – but if you are gifted with a measure of it, you can develop it (as though it were a muscle) by working at it. The late mathematician George Pólya had a number of helpful problem-solving mottos, one…

0

Calculating timeouts with a clock that wraps

There are several ways to get a number that represents “the time right now.”  Some of them wrap; some of them don’t. Some that wrap: GetTickCount() QueryPerformanceCounter() timeGetTime() Some that don’t: time()  (well, this will wrap in 2038… unless you use the 64-bit version… which is the default…) DateTime.Now A common programming meme is to…

0