Not Invented Here, Not Written By Me, and Reinventing The Wheel

Not invented here and not written by me are both driving factors in reinventing the wheel when developing software. We limit ourselves if we do not build upon the achievements of others. - Chad Dotson Not Invented Here I'm sure everyone has encountered developers that would prefer to implement everything…

C-Style Unions And Python

So, you're creating a C Union (used to create a variant type) and writing it to a file, socket, etc and want to read that in Python. There are two ways to deal with this. Assume the following union definition in C typedef union { int i; unsigned int u;…

A Better AsyncTestCase for Python

If you need asynchronous support in python unit tests, there are a few possibilities.  A simple google search points you to a few packages, one being tornado.  Tornado's tornado.testing.AsyncTestCase seems straight-forward.  However it does have a shortcoming: it's not thread-safe.  Trying to use it with a thread will result in…