LJ Plugin for WordPress

I’ve made enough references to LiveJournal users like and enough that I got tired of copying and pasting the standard LJ HTML to link to them.

So I did what any good hacker would do, and wrote a WordPress plugin to expand <lj username> tags.

You can download it .

Software Enzymes for Musical Composition

When
I last wrote about using evo-devo to compose music,
I had gotten stuck on the problem of implementation. In particular, I couldn’t figure out how to write a seed organism that would develop into a simple composition that I could then use to evolve other tunes. I also wasn’t sure how to get the various genes to actually work together, not at a level at which I could start coding.

After some thought, it occurred to me that enzymes and proteins act sort of like functions in software: they bind to molecules (take arguments), which they can then modify, and sometimes release another molecule into the surrounding medium (return a value). So I just needed to come up with the software equivalent of an enzyme.

Read More

Happy 20th Anniversary, SN1987A!




On this day in 1987,
SN1987A,
my favoritest supernova ever, blew up. According to
this diagram at the
University of Virginia,
the star started burning neon in 1971, oxygen in 1983, silicon in 1987, and blew up ten days after that. Let that be a lesson to you, young stars: neon is a gateway drug that leads to inevitable self-destruction.

How to Prevent Lines from Wrapping in Emacs

By default, Emacs’s buffer list truncates lines at the right edge of the screen: if you’re editing a file with a long name, it doesn’t wrap around; you have to use C-x < and C-x > to scroll the viewport left and right.

I’d always wondered how to do that, since it can be useful when editing files like ~/.ssh/known_hosts, where the useful information is at the beginning of the line, and the wrapped keys get in the way.

Now I know:

(setq truncate-lines t)
Removing Accents in Strings

I’ve been ripping and encoding a bunch of music. Since I’m a hacker, naturally I have scripts that take a file with artist, album title, and track titles, and finds the corresponding .wav or .aiff source files, encodes them as MP3 and tags them.

A lot of the music I have is in French or German (and some Spanish and Russian), so there are accented letters in names and titles. My input files are in UTF-8 format, so that’s cool. But one problem is that of generating a filename for the MP3 files: if I want to play the song “Diogène série 87” by H.F. Thiéfaine on his album “Météo für nada”, I don’t want to have to figure out how to type those accents in the file and directory names. I want the script to pick filenames that use only ASCII characters.

Read More

No, It Doesn’t Play Pong

Steve Jobs says
that he wants to keep third-party applications off of the
Apple iPhone:

Mr. Jobs also appears to be restricting the potential for third-party software developers to write applications for the new handset — from ringtones to word processors.

“We define everything that is on the phone,” he said. “You don’t want your phone to be like a PC. The last thing you want is to have loaded three apps on your phone and then you go to make a call and it doesn’t work anymore. These are more like iPods than they are like computers.”

Read More

77.1 µHz…

The frequency at which PZ Myers has been posting to Pharyngula, on average.

Me, I’m in the 4.4 µHz range.

How Do You Spell the Names of the Months?

One construct that I’ve seen (and used) a lot in Perl is a hash that maps month abbreviations to numeric values that can be fed to POSIX::strftime:

our %months = (
    "jan" => 0, "feb" => 1, "mar" => 3, ...
);

This is useful for parsing log files and such. It works, it’s quick and easy, and it doesn’t require a whole tree of dependent modules (which are always on the wrong side of the Internet) to be installed.

But what’s always bugged me is that this is the sort of thing that the machine ought to know already. And besides, it’s US-centric: what if the person running the script is in a non-English-speaking country?

Fortunately, I18N::Langinfo knows the names of the months. Read More

Unexpected Science Song

We all knew that They Might Be Giants
know stuff,
but even so, I was pleasantly surprised, while listening to
this month’s episode
of their podcast, to hear
Cut the Strings:

Read More

Pirate Mode Code

I don’t know whether anyone noticed, but on Talk Like A Pirate Day, all the text on this site was converted to pirate lingo.

This was done through
that I consed up for the occasion. Feel free to steal download and use it.