Posts in July, 2007

I have many ideas in the course of any given day. They are dredged up from the depths of my subconscious and placed on my mental in-tray, to be sorted in to mental heaps. Most are placed on to the "that'll never work" heap, others are thrown on the "better not, that's probably illegal" heap or the "plutonium isn't available at every corner drug store you know" heap. Occasionally though, some make it to my mental out-tray. continue reading…

I pride myself in my ability to make decisions. If I have all the variables and criteria then I can typically select the best course of action, or at least a good choice of action. As an engineer, this is invaluable because most problems in software development are of this type; you have all the facts and a desired outcome. If you meet the desired outcome, then you can safely say that you made the right decision. If not you can go back and try again. continue reading…

The consequence of this tale of woe is that I have released Food File as open source, so that I can collect on karma rather than hard cash. The source and Win32 installer is now available on Google Code, so those nice folks at Google can pick up the bandwidth bill. I hear they are not short of a few cents. continue reading…

Just uploaded a new version of Postmarkup (1.0.5), my bbcode parsing engine. The only significant change was a fix to a potential thread safety issue. It would only have occurred if you used the [list] tag, and even then only rarely (if at all). I figured it would be worthwhile since many people are using it in the context of a multi-threaded web application.

I decided not to bother with a win32 installer since its only a single Python file, and can be installed with easy_install. Use the following command line to install, or upgrade, Postmarkup.

If anyone really wants a win32 installer then let me know, I'll probably oblige.

See the Postmarkup homepage on Google Code for more information.

What do you mean its not the new year? Yesterday was 32 AW, today is 33 AW. That's After Will. Which also makes it my birthday. continue reading…

After my previous post regarding the the is_power_of_2 and next_power_of_2 functions, Richard Jones pointed out that Pyglet has an implementation that used the bit-twiddling method. Since I had something to do a direct comparison with, I wrote a script to test the run time of the two methods.

This produced the following results on my humble PC.

The results are conclusive - bit-twiddling is still a big win in Python. I figured that the bit-twiddling is_power_of_2 function would be faster than the float math version, but I was surprised by the next_power_of_2 result. It pays to profile!

I also tested it with Psyco, and got the following results. continue reading…