Category Archives: Computers

I Am an Official Regex Day Winner

Ben Nadel declared June 1, 2008 the first National Regular Expression Day, and to celebrate he hosted a giveaway of regex-related prizes, including Jeffrey Friedl’s Mastering Regular Expressions. As you can see, I won the book and got it in the mail yesterday. I use regular expressions all the time—in PHP, JavaScript, Perl, sed, grep, [...]

Webmonkey.com Returns

When I was first learning web development about ten years ago, I frequently consulted Webmonkey.com for tutorials about how to do all things “DHTML.” I still remember how an article comparing frames to a cafeteria tray made it all click for me, for some reason. I also picked up some bad habits that I had [...]

OpenID Servers: Allow Redundant Means of Access

That’s the lesson I take from Kyle Neath’s critique of OpenID (HT: Ma.tt), from his first point, the one that I think has the most traction. OpenID servers should allow users to associate their account with several OpenID providers, if they want, and/or an email address.

sed and Multi-Line Search and Replace

I’ve been experimenting with getting regular expression patterns to match over multiple lines using sed. For example, one might want to change <p>previous text</p> <h2> <a href="http://some-link.com">A title here</a> </h2> <p>following text</p> to <p>previous text</p> No title here <p>following text</p> sed cycles through each line of input one line at a time, so the most [...]

A Good Enough addEvent

Several years ago, PPK of Quirksmode sponsored a contest to come up with a new version of the trusty JavaScript addEvent function. The original addEvent was created by Scott Andrew LePera in 2001 as a way to merge Internet Explorer’s attachEvent with the W3C’s addEventListener. Both addEventListener and attachEvent allow you to attach a JavaScript [...]

How I Rip and Encode MP3s on the Ubuntu Linux Command Line

I like to know how to use the command line for everything I can. Here are the tools and commands I use to make mp3s. First, I rip from the CDROM to a wav file. cdparanoia 1 prokofiev1.wav cdparanoia lets me specify the input device, but I don’t need to, since the default—/dev/cdrom—is what I [...]