The B-List is the personal blog (entries, links) of James Bennett (about, contact), a web developer in Lawrence, Kansas.

ADVII: Nine Programmer’s Notes — Link published January 5, 2009 (read comments)

Oldest files meme

Entry published January 3, 2009

Doug Hellmann has brought a meme to my attention, and I’d be remiss in my duties if I didn’t act upon it.

Here’s how it’s supposed to work. Save a copy of this Python script, say as a file named oldest.py:

#!/usr/bin/env python
"""Print last-modified times of files beneath '.', oldest first."""
import os, os.path, time
paths = ( os.path.join(b,f)
                    for (b,ds,fs) in os.walk('.')
                    for f in fs )
for mtime, path in sorted( (os.lstat(p).st_mtime, p ...

Read full entry and comments

Terry Pratchett knighted in Queen’s new year honours list — Link published December 31, 2008 (read comments)

Scrapy — Link published December 30, 2008 (read comments)

What Colour are your bits? — Link published December 30, 2008 (read comments)

Users and the admin

Entry published December 24, 2008

So, for as long as I can remember the single most-frequently-asked question about the Django admin has been some variation of “how do I set a foreign key to User to automatically be filled in with request.user?” And for a while the answer was that you couldn’t do that, really; it was and still is easy to do with a custom form in your own view, but up until a few months back it wasn’t really something you could do in the admin. Now, as of the ...

Read full entry and comments

Why I like pip

Entry published December 15, 2008

So yesterday I explained some of the reasons why I don’t like setuptools. In essence, my objections boil down to one idea: application packaging and application development should be orthogonal concerns. The way setuptools works, however, seems to tend, inevitably, toward coupling them to each other. I gave one example — the way the default behavior of installing zipped packages (an ironic twist: the man who so eloquently explained how Python is not Java has spent so much time and effort trying to implement Java packaging conventions in Python) leads ...

Read full entry and comments

On packaging

Entry published December 14, 2008

So currently there’s a bit of a to-do involving Debian’s Ruby packaging team and the Ruby “gem” system. This document does a good job of summarizing the issues from Debian’s perspective. And of course, the Ruby side of it is no less heated; an example is here.

A lot of this is the usual back-and-forth between (on the one side) application developers working in one particular language, who want to distribute their applications to the widest possible audience and so use an operating-system-agnostic but language-specific tool for ...

Read full entry and comments

Dr. Horrible’s Sing-Along Blog (Amazon.com Exclusive) — Link published December 6, 2008 (read comments)

Bookmarks Extension — Link published December 6, 2008 (read comments)

Let's talk about Python 3.0

Entry published December 5, 2008

There’s an old joke, so old that I don’t even know for certain where it originated, that’s often used to explain why big corporations do things the way they do. It involves some monkeys, a cage, a banana and a fire hose.

You build a nice big room-sized cage, and in one end of it you put five monkeys. In the other end you put the banana. Then you stand by with the fire hose. Sooner or later one of the monkeys is going to go after ...

Read full entry and comments

Aaron Sorkin Conjures a Meeting of Obama and Bartlet — Link published September 22, 2008 (read comments)

AN IRRELEVANT LICENSE IS PRESENTED TO YOU FREE-OF-CHARGE ON STARTUP — Link published September 14, 2008 (read comments)

1965 World Series — Link published August 18, 2008 (read comments)

Suggesting solutions we don’t use ourselves — Link published August 17, 2008 (read comments)

ponybadge