Russell's Blog

New. Improved. Stays crunchy in milk.

To Boston and Back

Posted by Russell on November 06, 2006 at 2:59 p.m.
I'm on the airplane, flying back to L.A. after visiting Mimi in Boston. The time difference and flying on the red-eye really screwed with my head, so I was at best three-quarters conscious most of the weekend. Somewhere along the way, I also managed to see Adam, Billy, Chris, Kevin and Tom.

Mimi and I had all sorts of ambitious plans for the weekend, but mostly we ended up sleeping in. I don't think I can imagine a better way to spend a weekend!

On the downside, I realized I left my shaver and toothbrush in Boston. Also, my homework failed to do itself, despite the fact that I carried it around in my backpack all weekend. Maybe I should have shaken it more vigorously, or something.

Mimi! Hurry up and graduate already!

Tasty Python Snacks

Posted by Russell on November 06, 2006 at 2:51 p.m.
Languages like Python are great for tasks that require manipulating complicated data. The main complaint about such languages is that they aren't as fast as compiled languages. For scientific computing (and a lot of other things), that's a show-stopper. However...
from weave import inline
a = 25
code = \
	"""
	int i = a;
	while( i > 1 ) {
		printf("a number: %d\\n",i);
		i = i / 2;
	}
	return_val = i;
	"""
inline(code, ['a'])
===output===

a number: 25
a number: 12
a number: 6
a number: 3
1
My mind just spins thinking of all the horrible, horrible things I can do with that.