Monthly Archives: November 2009

Infovisualization: The Age of Our Senate

Age of Senate

I have always wondered whether there was a correlation between party and age. It just turns out that I had some free time so I pieced together a small program that automatically generated the above infovisual. (Please click on…

Posted in Blog, Miscellaneous, Portfolio | Tagged , , , , , , , , , , , , , | Leave a comment

Gettings the most out of your bits

The following will produce the bit representation of an ord(byte) in python

def bit(chr, i=0, str=''):
    if i > 7: return str
    coef = (2**(8-i-1))
    if chr >= coef: return bit(chr-coef, i+1, str+'1')
    return bit(chr, i+1, str+'0')

Posted in Blog, Programming, Python, Snippets | Leave a comment