FakeFile

A tiny python library for faking out filesystem operations for tests.

July 2, 2014 · 1 min · Ohad Lutzky

Translationese

As part of my M.Sc. studies, I’ve recently completed a small laboratory project in natural language processing. I’ve learned quite a bit from it, and had a chance to use a few of my favorite technologies. The project was coded in Python, which is not my favorite programming language - Ruby is. However, since Python is more popular at my workplace, and seems to have a richer ecosystem around it (sometimes, at any rate), I’ve grown to love it almost as much over the years....

March 24, 2013 · 4 min · Ohad Lutzky

Faster Languages

Due to an exercise in an AI course, I’m forced to confront an old nemesis - C++. Part of the reason is that the exercise contains a time-limited tournament, and the code needs to run very quickly. Another reason is, I guess, the fact that C++ serves as a sort of lowest common denominator in the course (which used, by the way, to be taught in LISP, along with the language)....

April 16, 2008 · 3 min · Ohad Lutzky

On Threading vs. Processing

Writing multi-threaded applications in Python is often a headache because of the Global Interpreter Lock - only one Python thread can run at any given moment, which makes multi-threading useful only in the case where all modules but one actually run C code. However, thanks to the impressive new Python Magazine, I’ve stumbled across a package called processing, paraphrasing python’s built-in threading package. Essentially, the package provides an API identical to Python’s threading, but uses processes and pipes (or other mechanisms on non-posix operating systems) instead....

October 13, 2007 · 2 min · Ohad Lutzky

Exception handling, decorators, and python

Lately I’ve been working on a project that has me using DBus a lot. After trying to figure out how to work DBus with C, and seeing how easy it is to do in Python, we figured we’d try to use embedded Python to do this. Fortunately, it’s very simple to use - especially thanks to this guide. It later turned out to be much easier to do in C, as described in Faster Languages....

September 16, 2007 · 2 min · Ohad Lutzky

IPython

The more I use Python, the nicer it becomes. I’m currently working on a project for a course, which involves somewhat heavy-duty database and algorithm work. Python is my language of choice for it - let’s hope it works out well. In the meantime, I’ve found a really nice python shell called iPython (available in apt) - it adds a bunch of stuff to the python shell which I sorely missed from irb - autocompletion, auto-indentation, and - it seems - adds a whole lot more....

March 4, 2007 · 1 min · Ohad Lutzky

Really liking the whole Python thing

I’ve converted my Antigibberish script1 (converts “broken hebrew” into proper hebrew, useful for sent-offline ICQ messages) to Python… it’s quite a nice language, and the interpreter is FAST! I’m really torn between it and Ruby :( Used to have a copy of antigibberish.py, but it’s been lost in the mists of time. It used to do the equivalent of this: iconv -f utf-8 -t iso8859-1 | iconv -f iso8859-8 -t utf-8  ↩︎

February 25, 2007 · 1 min · Ohad Lutzky