Saturday, October 31, 2009

Resistance is really futile

That is if you name is David Nutt .
But, if you are made of ABS plastic, then it looks like it could be hours and hours of fun, 'you shall be assimilated'.

Friday, October 30, 2009

So long and thanks for all the fish

Today was my last day gainfully employed... for an unknown interval it would appear. I thought this subject-line would be an friendly goodbye, but it appears it was a bit too accurate. I've gone from Angry to disappointed, and just grumpy and nervous. Don't ask how to get grumpy and nervous all at once, I just am. Now I'm disappointed all over again.

Synopsis :,_and_Thanks_for_All_the_Fish
Buy the book :

It's gonna be a chilly weekend in the UK, so we are going to huddle together and watch more telly.

Friday, October 16, 2009

First Donation

I have recieved my first donation (hence the picture in the post before this one) from Melvin Philips on an Open-Source project I published ages ago.
So it's not that I'm turning to drink, I am just celebrating 3 years of open-source contribs.

Tuesday, October 13, 2009

Programming STDERR

It's frustrating when you want to get something to work, and nobody's solution fits. I had already gotten quite far on a problem and had it almost done when I found this neat solution to the problem of piping error messages sent to STDERR to a file on MSDN.

I needed to either write a huge perl-script(and without a debugger that's a cramp) or reidirect the stderr and stdout from a static code analysis tool called splint so that I can gather statistics on any dodgy lines of 'C' code.
Why a beer? Well that's a celebration of a slight change in the wind. Where it will go is probably nowhere, but it's a change nonetheless.

Returning to the redirecting of standard error and pipes, the downside it the default pipe-buffer size, in fact although you can easily increase the pipe buffer size, we all know a huge buffer is in-efficient. You see, unlesss you can empty a smaller buffer in the background while the child-process is filling it, the child will get blocked if it tries to overflow the buffer. A very bad thing, normally solved by spawning a thread to process and empty things while you wait for the child to terminate. I hate and love threads, so forgoing a complex solution, I solved this by simply waiting 100ms for the child to terminate, and then emptying the stream buffer in between by polling using WaitForProcess(). It appears to solve the problem, but exactly how?.... because someone has to close the stream in order to detect the end and not get blocked yourself in the parent waiting for a read on a dead stream?
As it so happens, the parent can happily close it's copy of the redirected stream handle and then keep reading from the duplicate knowing all will unblock when the child terminates (because the handle closes in the child when it does so). Problem solved.

Tuesday, October 06, 2009

It often looks too far away to even work

It was said Goliath could throw his spear half the length of a football field, so that's probably how far David was from him. Furthermore, Goliath had body armour protecting him from head to toe, except for a small opening between his eyes and his forehead. That's what David aimed for.

Thursday, October 01, 2009

black thief in my yard

Black squirrel entering the back-yard over the fence....

Yep, he's carrying something there.
They are easy to photograph up close (contrary to some reports) and I soon got within 3 meters of this one because black squirrels are more aggressive than their gray cousins. The black colour is actually caused by melanin, coming from a dominant gene.

Zoom in and you can see, it's a nut!