International Freedom From Stupid Software Patents Day

LZW – that is, the formerly patented Lempel-Ziv Welch compression algorithm – is free today. The footnote on the Free Software Foundation’s GIF history page says:

The Unisys patent expired on 20 June 2003 in the USA, in Europe it expired on 18 June 2004, in Japan the patent expired on 20 June 2004 and in Canada it expired on 7 July 2004. The U.S. IBM patent expired 11 August 2006, The Software Freedom Law Center says that after 1 October 2006, there will be no significant patent claims interfering with employment of the GIF format.

Handling legacy URLs with Django

One of the great things about Django is its simple and flexible URL handling. If your Django work, like mine, includes converting existing sites, you’ll probably be doing some URL cleanup along the way. Django’s “generic views” system includes a view called “redirect_to” that handles cases like this. A rule might look like this:

urlpatterns = patterns('django.views.generic.simple',
    ('^foo/oldsite/BadOldUrl33247.blech$', 'redirect_to', {'url': '/bar/nice-new-url/'}),
    )

But because the URL pattern building happens in Python, if you have many of these you can do better than filling your urls.py with variants of that line. Here’s the root urlconf for one of my sites:

The "path" module

Somewhat belatedly I’ve started using Jason Orendorff’s path module for Python. It’s great. Here’s a comparison with the stock os.path facilities, grabbed from Jason’s site:

# with os.path.walk
def delete_backups(arg, dirname, names):
    for name in names:
        if name.endswith('~'):
            os.remove(os.path.join(dirname, name))
os.path.walk(os.environ['HOME'], delete_backups, None)

# with path
d = path(os.environ['HOME'])
for f in d.walkfiles('*~'):
    f.remove()

The second snippet is not just shorter, it’s easier to read and easier to write. I’m writing some code to recursively process a tree of short text files (Blosxom entries), and the path module is a godsend. If you’re curious, see the description and examples on Jason’s site; he also posted some interesting comments on Ian Bicking’s blog about the design of the module.

Spam, del.icio.us spam

Like every other web site/service/app/community/thingy that allows individual user contributions, there’s spam on Delicious too. The perp I came across today was “mcloan” – check the page out for yourself – and there are many more. Fred Stutzman has a good post on the subject, and I came across an exchange with naive Delicious spammers on Brian Dear’s weblog from last year.

But what’s Delicious/Yahoo doing about this? Where’s the Craigslist-style “flag this user as a spammer” button?

Dispatches from Blogistan

cover Suzanne Stefanac’s new book, Dispatches from Blogistan, is out. She’s a Well pal and you may have seen her name in the comments here. I haven’t gotten my hands on the book yet, but Suzanne’s blog gives an excellent taste; the glossary entries are particularly worth browsing. Good luck with it, Suzanne – try not to check your Amazon sales rank more than three times per hour!

Think twice before you let those domains lapse

In an effort to shed time-sucking side projects in the past couple years I’ve let a number of sites go dark and domain names lapse. Some of these were ideas that never got off the ground, but one or two were sites with real traffic and Google pagerank (PR 5 in one case, not stellar but not achievable overnight either).

Sadly, some of these domains have now been taken over by those useless squatter pages that manufacture lists of “related links” and “popular searches” and so on to trick people into clicking on ads. This only makes sense – if you were a domain squatter, you’d certainly prioritize grabbing expired domains with high pagerank and many existing inbound links. If you set up your server never to return a 404, some of those linking sites might never even notice the change.

Widescreen as Tallscreen

rotated A little-used new feature in the Displays preference pane in OS X 10.4 is rotation in 90-degree increments. I tried this feature out with the 20-inch Cinema Display on my desk. Novel – it took me back to the old grayscale Pivot I wrote so many columns on in the ’90s. A base that handled rotation would make it nicer. Also, the type and other elements onscreen just don’t look as good at 90 degrees – I don’t know if it’s the disparity in vertical and horizontal viewing angles, or maybe a change in anti-aliasing behavior. (Onscreen is top running in Exterminal.)