My grandfather is 94 years old. He is sound of mind and body and that is probably because he gets more exercise than most people in their twenties. He spends about forty five minutes each morning doing these exercises – not because he enjoys them but because he believes that they are important. Doing these exercises is no guarantee that you will stay healthy, but I’m sure it improves your odds.
With his permission I have included his exercise plan below, written up four years ago and still followed today.
I was looking at an xperf (ETW) trace recently and needed to know who had started a particular process. The parent process ID was stored in the trace so I could find its parent, and its parent’s parent, and so on, but doing this for many generations in WPA is tedious.
Luckily the 8.1 version of the Windows Performance Toolkit has a tool for exporting arbitrary data, so I used that and a bit of Python to write a tool that would create a process tree for an ETW trace.
A few months ago I saw a blog post touting fancy new SSE3 functions for implementing vector floor, ceil, and round functions. There was the inevitable proud proclaiming of impressive performance and correctness. However the ceil function gave the wrong answer for many numbers it was supposed to handle, including odd-ball numbers like ‘one’.
The floor and round functions were similarly flawed. The reddit discussion of these problems then discussed two other sets of vector math functions. Both of them were similarly buggy.
Fixed versions of some of these functions were produced, and they are greatly improved, but some of them still have bugs.
Floating-point math is hard, but testing these functions is trivial, and fast. Just do it.
Over the course of a year I fix a lot of bugs – that’s part of my job. But I’m not going to write about that. Instead I want to write about bugs that I found in other companies’ code, which they fixed in 2013. These are bugs that I blogged or tweeted about that then got fixed, and these make me happy.
The VC++ compiler generally maintains a high degree of binary compatibility between compiler versions, allowing objects to be passed between DLLs made with different compiler versions. However VS 2013 made changes to the layouts of some classes in 64-bit builds.
Luckily this only affects a tiny percentage of classes, and if you do hit this problem there is a simple solution. This simple solution can also be used to reduce the size of classes in both 32-bit and 64-bit builds.
Using macros to implement Min and Max has numerous well known pitfalls that can be avoided by using template functions. However the definitions of min and max that are mandated by the C++ standard cause VC++ to generate inefficient code. Until the VC++ compiler fixes this it may be best to use custom Min/Max template functions to avoid this problem.