Skip to main content

Posts

Showing posts from February, 2009

Weave

Weave is a python module that includes a method of including C and C++ code inline with python. Has a slightly bigger overhead than the swig approach but is a lot easier to implement. And the code can be any dynamically created string. For example this block of python code calculates the fixed point multiplication of var1 and var2. The code is modified from a matlab algorithm worked on during my summer internship at Tait Electronics . from scipy.weave import inline as inlineC r = rounding and 1 or 0 # Blatent hack to convert from pythons True/False to 1/0 for C/C++ exp = """ signed int K,result; signed long int temp; temp = (long int)var1 * (long int)var2; signed int sign = temp/abs(temp); if(r) { K = 1 << (numBits-1); temp = temp + K; } result = sign*(abs(temp) >> numBits); if(result > fp_Max){ result = fp_Max; } if(result < result =" fp_Min;" return_val =" result;">

Gentoo on the ibook G4

Well I finally decided to try be a real nerd... I have installed Gentoo on my laptop. I installed it for the worst possible reason too - because I managed to break my ubuntu install when trying to upgrade to the jaunty beta... First I went through the awesome manual at http://www.gentoo.org/doc/en/handbook/handbook-ppc.xml . Then decided to break a bit so I went through the awesome manual at http://www.gentoo.org/doc/en/handbook/handbook-ppc.xml . Then decided to break a bit so I went through the awesome manual at http://www.gentoo.org/doc/en/handbook/handbook-ppc.xml . Then decided to break a bit so I went through the awesome manual at http://www.gentoo.org/doc/en/handbook/handbook-ppc.xml .... Eventually I have a lot more knowledge about how awesome chroot is, how to manually set up a wired and a wireless connection, how to emerge and USE. Immediately noticed a speed increase, and things like the hibernate on closed lib when on battery... just work. That never happened on Ubuntu intr