Code

I like to write code, and often I find good reason to do so. Here I will try to keep a mostly-complete collection of neat hacks I've done. Comments, suggestions and patches are welcome at danb@cs.utexas.edu.

All of this software was written on Linux. Things like desktop hacks probably won't translate to other operating environments, but some larger undertakings should be cross-platform.

scourse: A course scheduler

Use Browse Source

Paper is dumb. Computers are smart.

Plan your course schedule with a web browser. It queries course information from UT's website, caches it locally, and presents an information-rich, responsive, visual scheduling interface to the user.

It's so... automated Choices, choices

MPD + mute: Patch to add muting to MPD

MPD has volume control, but no mute feature. I decided to add it.

I added some simple volume control logic and state maintenance to the daemon. I extended the network protocol and status reporting to allow clients to communicate information about the muted state of the player. And so that I could actually use the feature, I added a mute command to MPC.

Status: working, pending inclusion.

MPC + song format: Patch to add custom output formatting to MPC

MPC is a scriptable, command-line client for MPD. Its song output format used to only include artist name and song title, but I also like to know the album name and track number.

I added an option to the client to specify the output format of songs. The format string is a printf-style template with long format specifiers. If the option isn't used, it defaults to a format string consistent with the old output behavior.

Status: accepted.

pplayer/hplayer: A multi-client, multi-playback audio service

I like music. I like to listen to music when I'm at home, at school, at a friend's, or in the bathroom. I even like for my friends to listen to my music. But I only want to store music in one place, knowing that today's broadband services easily support outgoing music streaming. What if there was a service that could make a local collection of music available in all of these situations?

I dream of a program that can manage a number of active playlists simultaneously for an arbitrary number of listening clients. Users should be able to manage the playlists and playback in a variety of ways (e.g. desktop client, web, command line) asynchronously. Playlists should support a variety of elements, including songs, albums, artists, entire genres and more. Listeners should be able to include local sound devices and remote streaming clients.

I've partially implemented this idea twice: once in Haskell and once in Python. The Haskell code came first, but I later ported the effort to Python because it had better Gstreamer bindings at the time.

Status: long-term suspension.

jlookup: Japanese dictionary lookup

Download Browse Source

Feed it Japanese (kanji, kana, or romaji), and it will pop-up a gtk2 window with a response from Jim Breen's WWWJDIC dictionary server. Bind some keys in your desktop environment to invoke the program with output generate by xclip (like: jlookup `xclip -out`), and you can highlight Japanese text and easily look it up in a good online dictionary.

Implemented in less than 150 lines of Python and more than 2 days of utter frustration. The Python was almost trivial; the character conversions weren't.

Requires: Python 2.2, python-japanese-codecs, and a patch to improve ISO-2022 compliancy of the codecs (written against python-japanese-codecs 1.4.9). The Japanese codecs should be built into Python 2.3 (and they might even be fixed).

A hack that I haven't maintained for a long time. It probably won't Just Work. In fact, it doesn't even work for me anymore.

Decyphering character encodings Debugging ISO-2022 codecs It works! Music: enjoyment of sound

makebook: Online book archiver

NOTE: According to the current Terms of Service at Safari Books Online, the use of this program is expressly prohibited. This was brought to my attention when they told the University of Texas (my proxy) to tell me to remove the software from my website — which I did because they're bigger than me.

A hackish collection of Bash, Python and C to locally archive books from Safari Books Online (provided that you have access). Useful for customization of interface, advanced searching and organization of data, or just to avoid network latency.

For a discussion of this program with regards to their Terms of Service, see the included README.