Technology wanted: FFE

When I’m using my PowerBook with an external screen in spanning mode, this sequence happens more often than I’d like:

  1. Working on in Application A on the internal screen, I need to refer to something displayed in Application B on the external screen.
  2. I look over at Application B and read. When I’m done reading I realize I don’t need that window anymore, so I press cmd-W.
  3. Frontmost window of Application A closes – say, a browser window with unsaved content in a web form.
  4. I make an “aaaargh” noise.

In the world of window management, there’s click-to-focus, and there’s focus-follows-mouse. What I really want is Focus Follows Eyeballs.

Random crufty open source release of the day

Last year a client asked for help moving his website to a new host from XO.com. The tricky part was that his 200 pages of content were locked into an obsolescent proprietary tool called “Site Builder” that offered no exporting options. The file format was a flatfile that looked like this:

#Page-Type "html"
#UID "1000"
#Access-PublicRead "on"
#Access-PublicWrite "off"
#Page-Links-Style "links_outline.nhtml"
#addbrs "off"
#hidenav "off"
#HTML ...

The file structure went like this: a parent directory named nss-objects; child directories bearing page names (or slugs, really); and inside each, an empty directory named !data and a text file named !object with the page content as described above. Weird. (I suppose every proprietary one-off system is weird in its own way, so there’s nothing to be gained from dwelling on the specifics, but at least including them in the post raises the chances that somebody who actually needs this thing and searches for it will find it.)

Moving the blog to Django

The long-awaited (by me) conversion of this blog to Django is underway. After a couple hours’ work I have a full set of models and a functioning admin, and working index and detail views of postings and comments. Searching, posting comments, and tags are the major pieces remaining. Because of my busy schedule I’ll only be able to work on it in fits and starts, but I expect the total labor in the end to be about five hours.

Neat new stuff in Python 2.5

I’m looking forward to Python 2.5. In particular:

  • Partial function application. One of my favorite things about Python is how amenable it is to a mixture of procedural, functional, and object-oriented styles. Learning a bit of Scheme last year put me in an especially functional mindset. Can wait to see what else gets rolled into the functional module in the future.

  • pysqlite in the standard library. The incorporation of SQLite into PHP5 (which goes a step further than Python, since it includes the SQLite binary itself) has been a great convenience. Many apps just don’t need a full relational database – and if they eventually do, much better to have started with SQLite than with BDB or some homegrown flat-file solution.

More quick-not-dirty PHP

For larger web projects I’ve moved almost exclusively to Django, but PHP is still handy. Recently I wanted to quickly (really quickly) make a flat-heirarchy site with dynamic pages, with clean urls like example.com/foo and example.com/bar.

I could do this with several directories containing index.php files, but I want to use the Google Maps API on several of these pages, and the separate directories would entail separate Google Maps API access keys – a pain.

The twenty-minute trouble ticket system

People are always going on about how it “only” takes twenty minutes or whatever to knock together some little application. Screencasts don’t count, unless they are screencasts of somebody who hasn’t done any preparation. But damn, I just built a trouble-ticket system in Django in twenty minutes. Really. Of course, I already had a running install, this is just something I added. But it was instantly useful. I assigned four tickets to myself and now I can go have dinner.