Thursday, 28 May 2009

Stuck in a rut

Don't get stuck in a rut! Don't miss the wood for the trees!

The other day, I was working out some long, convoluted workaround for dealing with the fact that vector iterators can become invalid if the vector resizes.

Then someone reminded me that you can access elements of a vector by index. D'oh!

Wednesday, 27 May 2009

If in doubt, wiggle

A few years ago, part of my job involved making large print runs in Microsoft Word - in the region of 500 to several thousand pages per job. While doing this I discovered an unusual quirk.

In the status bar a little animated icon appears alongside a counter that tells you how far through your print job you are. Quite frequently with the large print jobs, I noticed that the counter would freeze on quite a low number. The printer would catch up to the counter and then nothing would happen for a little while.

But if you wanted, you could "remind" Word to carry on printing, by wiggling the moue over the status icon! While the mouse was moving, the status icon's counter was counting upwards - as soon as you stopped moving, the counter stopped counting.

An obvious explanation might be that the counter only repainted when mouse moved over it; but I experimented - the printer didn't print pages unless the status counter was incrementing. Whenever the counter froze, the printer stopped, and as soon as I moved the mouse over the icon, printing resumed.

How odd.