Posted on June 22, 2008, 4:20 pm, by Paul Butler, under
Python.
I’ve written a little python function which I have found to be very helpful for debugging. It takes a function, and returns a function which is identical to the original except that it prints a message to the console with useful information every time the function is called or returns.
Here is the function:
# Number of [...]
Posted on February 13, 2008, 1:22 pm, by Paul Butler, under
Python.
A while ago I posted a PHP implementation of a diff algorithm I came up with1. Since it was well received, and it’s a useful little algorithm to have, I created a Python version as well.
There are a few performance improvements as well. The PHP version creates an array in memory proportional to the square [...]
Posted on December 13, 2007, 7:58 pm, by Paul Butler, under
Python.
After spending a lot of time in Scheme, it’s hard not to think in recursion from time to time. When I recently started to improve my Python skills, I missed having Scheme optimize my tail recursive calls.
For example, consider the mutually recursive functions even and odd. You know a number, n, is even if it [...]
Posted on June 27, 2007, 9:05 am, by Paul Butler, under
Python,
Ruby.
I recently came across an interesting post on the Powerset Blog recently about garden path sentences. Garden path sentences are sentences that lead you down the wrong path through a string of words with multiple meanings. For example,
The complex houses married and single students and their families
In this case, most readers would probably think complex [...]