The Worst README in the World

While trying to install some drivers on a machine, I ran across for them.

CONTENTS

1.0	About this README file
1.1	  Who should read this README file
1.2	  How to get help
2.0	IBM2105.RTE Change History
3.0	Procedure for upgrading AIX OS, Host attachment, and/or SDD
4.0	User license agreement for IBM device drivers
4.1	  Background / Purpose
4.2	  Definitions
4.3	  License grant
4.4	  Responsibilities
4.5	  Confidential information
4.6	  Limitation of liability
4.7	  Termination
4.8	  Representations and warranties
4.9	  General provisions
5.0	Appendix A
6.0	Notices
7.0	Trademarks and service marks

How anal is it to include a table of contents in a README? I just hope that the section numbers are updated automatically. It would really suck to be the guy in charge of manually renumbering the table of contents when someone edits the file.

At any rate, note that the only interesting part is section 3.0, the actual installation instructions. That section reads, in full:

3.0  Procedure for upgrading AIX OS, Host attachment, and/or SDD

     Please refer to the latest SDD readme file for the detailed procedure.

Wow. Three lines. Out of a 522-line file. And all to say “this is not the file you’re looking for.”

I think the stick up IBM’s ass has officially taken over the entire company.

Fabric Brain Art

The Museum of Scientifically Accurate Fabric Brain Art.

Fabric brain

On one hand, people like this obviously have too much time on their hands. On the other hand, damn, that’s cool!

(HT Neurodudes,
Fresh Brainz.)

Truncated Songs on iPod

Every so often, I’ll update the MP3 file for a given song. For instance, if I record an LP to MP3, then buy and rip the CD, I’ll just update the MP3 file on the back end and tell iTunes to reread it (with open -a itunes /path/to/file.mp3, for those who care).

Unfortunately, when I do this, I’ve noticed that iTunes plays the new file properly, while the iPod tends to hang a few seconds befor the end of the song, or, in more extreme cases, reset itself.

Read More

Making Emacs Do Stuff at Startup

Like many users, I start an emacs session in .xinitrc and use it throughout the day. Since I’ve recently started using Emacs Planner, I wanted it to start up automatically in that first Emacs session (but not subsequent ones, if I just want to edit a file).

Read More

Soft Coding

Over at Worse Than Failure, Alex Papadimoulis has an article on soft coding. Hardcoding is when something is written in the code when it ought to be in a header constant or an external config file. Soft coding is the opposite, when something is put in a config file that really ought to be in the source. For instance, the number of days in a week isn’t likely to change any time soon, so you may as well just use “7” in your code. You might

#define DAYS_PER_WEEK 7
#define WEEKS_PER_YEAR 52
#define LOAN_DURATION DAYS_PER_WEEK * WEEKS_PER_YEAR

to make it clear what you’re calculating, but putting it in an external, user-configurable file is just absurd.

I’m guilty of softcoding, myself. In my experience, it comes from trying to be too generic. Code that’s too specific, too hardcoded, is hard to maintain and extend, so a good programmer will ask himself, “What requirements might change in the future? How should I write this so that when it changes, I can do it without too much pain?” This leads to things like declaring configuration constants at the top of a script, in a Makefile, or in a header file; or having the code read messages from an external file, rather than hardcoding them as strings.

But it’s also easy to overcompensate, and start making everything customizable, or overly generic. So it’s important to remember that at some point you have to actually make the code do something.

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