Archive

Archive for the ‘Python’ Category

Using waf to build LaTeX Documents

September 29th, 2009 Alan LaMielle No comments

I’ve finally made the migration away from make and the horrible system of autofoo and Makefiles.  A few years ago I discovered a build system called waf that does everything make can do, only better!

Read more…

Reversing Python list/string objects

May 4th, 2009 Alan LaMielle No comments

I was interested in the relative performance of reversing a python list using the idom list[::-1] rather than the reverse method of the list class. Additionally I wanted to see if this idom was efficient for reversing strings compared to converting to a list, reversing that list, and joining the elements again using ''.join(reversed_list). Here are the results:

Reverse list, slicing: (0.58000000000000007, 0.64144396781921387)
Reverse list, method: (0.20000000000000018, 0.19551301002502441)
Reverse string, slicing: (0.45000000000000001, 0.49545693397521973)
Reverse string, list: (3.71, 3.7981550693511963)

Read more…