Monthly Archives: September 2008

Walker, FileSystem Ranger

As a way to learn a bit of GIO from the green pastures of Python, I threw together a functional programming replacement to Python’s os.walk(). The WalkerTexasRanger class takes 3 functions. One for results, one to clear the results, and one when the walk is finished.
Lets look at how we use this.
import texasimport [...]

python decorator and gtk mainloop

I just put together a neat little decorator to force a method to be called via the default gobject main loop. It does this by wrapping a method call via an immediate timeout of the main loop.
def callFromMain(f): import gobject def dispatch(items): [...]

gnome-do relevance for python

I ported the text relevance engine from gnome-do to Python. You can download it here.
>>> import relevance
>>> relevance.score(’hi there dude’, ‘hi dude’)
0.53480769230769232
>>> relevance.formatCommonSubstrings(’hi there dude’, ‘hi dude’)
‘<b>hi </b>there <b>dude</b>’

Meme(me)

Via Chris Blizzard.

1. Take a picture of yourself right now.
2. Don’t change your clothes, don’t fix your hair…just take a picture.
3. Post that picture with NO editing.
4. Post these instructions with your picture.

Lenovo x300

So I don’t rave about hardware often, but I’ve had this x300 thinkpad for about a month now. I would like to mention how awesome it is to have working suspend in Linux that is damn near flawless. Oh, 802.11n, gig-e, usb2, 4 hours battery with lightweight 6 cell, dvd-rw, solid state disk, [...]