Backgrounds

I've been playing with The Gimp a bit recently, using edge-detection, colorization, and some other filters on some of my photos to make vaguely-abstract desktop backgrounds. I think it's worked pretty well, so I'm posting a few of the things I made here. Well, more specifically, over at Flickr]. Let me know what you think.

*nix Tip of the Day: vim modelines

vim logo{.lfloat} As you may know, in the editor wars, I come down firmly on the side of vim. Vim is a lean and effective modal editor, contrasted with emacs. One of the features of Vim that I enjoy using (but did not know about until recently!) is modelines. A modeline is a small piece of text that you can put at the end of a file to give your editor an instruction. It is generally placed in a comment. For example, if I'm editing Python, I never, ever want to use soft tabs (well, I generally don't like soft tabs anyway), so I might put something like the following at the end of a file:

# vim:expandtab ts=4 sw=4

When vim opens this file, it will parse that line and pass the space-separated arguments to "set". So this is equivalent to my typing in :set expandtab ts=4 sw=4.

Another great usage of these is for setting syntax highlighting. Vim is generally good at guessing the file type for syntax highlighting from the stuffix of the file. For example, file.py will be detected as a Python file and highlighted appropriately. But what about a file like /etc/apache2/vhosts/default.conf? It should be highlighted as an Apache configuration file, but the suffix .conf tells Vim nothing. The solution here is to use a modeline. My Apache configuration files end in the line

# vim:syntax=apache filetype=apache

which makes it a lot easier to read them.

Formats

There are a few different formats. The first (and simplest) is what I have shown above: a comment character, a space, the text "vim:", then a space-separated list of arguments. There may not be any non-argument text on the line. This means that the following is invalid:

/* vim:expandtab ts=4 sw=4 */

Obviously, this is a bit annoying, because there are lots of comment-formats that require both an opening and an ending (C, Pascal, and SML come to mind immediately). There is, thus, an alternate syntax:

/* vim: set expandtab ts=4 sw=4: */

Note that the set statement is now delimited by colons on both sides. This is important! If you leave off the trailing colon, Vim will get very unhappy with you.

Another handy feature of modelines is that you can limit them by version. For example, if I want to use something that was introduced in Vim 6.0, I could use the following:

# vim600: set expandtab

The vim600 means "any version of Vim 600 or later", where 600 in Vim versions translates to 6.0.0.

Caveats

  • Modelines are not generally enabled for root. Since they're possibly-sketchy code that runs automatically when you open a file, it's considered (wisely) a security risk to run them as root
  • Modelines might not be turned on in your default config at all. To turn them on, add set ml to your ~/.vimrc

Enjoy! If you want to learn more, I recommend reading the Vim documentation section on modelines or the Vim Tips Wiki article Modeine magic.

awesome window manager

First, some background for the non-technical among you. A window manager is a piece of software that controls the windows on your computer. It will do things like placement, drawing, keybinding, et cetera. If you're on Windows or Mac OS X, you have a window manager built-in to your operating system and cannot easily change it. However, if you're on a more traditional *nix (Linux, Solaris), you are free to select your window manager. In this post, I'll talk a little about what I use and why it's awesome.

read more

Summer Employment

Offer letter Well, my job search is over. As of today, I've accepted an offer from Google for a summer internship. I'll be in New York City from June 1st through August 21th, working at Google's 9th Avenue office. I'm not sure where exactly I'll be living (I'm looking to apartments, student housing, etc., but haven't settled on anything yet), but I'll try to keep you, my loyal readers, up to date.

It was a hard decision (I had a few offers, including DreamHost and DirecTV, plus more interviewers interested), but, I mean, it's sort of hard to say no to working for Google. It also didn't hurt that they offered me the most money. :-)

Anyhow, whee! Now I can go back to worrying about work now, instead of three months from now. For the time being, though, it's back to spring break with me.

minus

So, I working on my algs problem set just now; which is to say, I was browsing the web and trying very hard not to think about amortized runtime analysis. Anyhow, I found this awesome webcomic called minus. I know, I know, I'm years behind the curve, and it's a little... odd. But it has a persistently beautiful surrealism to it. Anyhow, you all should go read it. And, of course, all of the other webcomics I read are listed under "Links" above.

WordPress 2.7.1

WordPress 2.7.1 has been released1. And I'm sure that you, my loyal cadre of imaginary readers, will be glad to know that I've upgraded. :-)

1

http://wordpress.org/development/2009/02/wordpress-271/

Fishbots

For the past couple of weeks, I've been hearing from a number of "Fishbots". If you don't know what I'm talking about, well, there's this service called Project Upstream which runs a network of AIM bots with names like ThemedSalmon and "SweptCoho". The idea behind these bots seems to be that they collect AIM nicks and then randomly connect pairs of people. It's sort of a cool idea, if you think about it. Random, and completely anonymous, one-time contact with a person.

read more

A Beautiful Day To Be Outside

CHWP

Today was an absolutely beautiful day. Clear blue skies, mid-70's temperature, low smog, completely perfect. So, like any other sane human being, I decided to take a walk. Specifically, I hiked up to the Claremont Hills Wilderness Park, which is a nice little place a few miles north of campus. On the way there, I was really struck by life in California. Here I was, walking along on one of the most beautiful days of the year, and I didn't see more than a half-dozen other pedestrians on the two-and-a-half mile walk up to the park. Of course, I saw several hundred cars, trucks, and SUVs. I saw people driving from their homes on Mills down the street to Vons and back again. It's so weird here — on the one hand, a lot of people seem to be "fitness freaks" and very concerned with "wellness", but on the other hand there's this overbearing car culture...

read more

Andrew Bird - Noble Beast

Noble Beast cover art

So, I picked up a copy of Andrew Bird's new album Noble Beast today. Yes, I know that today is January 18th and it's not released until January 20th. That's why this post isn't going to be published for two days.

Anyhow, the album is excellent. Everything you know and love from Bird's previous releases is here, but more polished. Some things that I thought particularly stood out:

  • The instrumental beginning of Effigy. And the double-stopping soloing in the middle. Really, the whole song.
  • Unfolding Fans. Makes me think of Brian Wilson, but in a more minor key

Yeah, I know, this isn't much of a review. Well, I'm not much of a reviewer. So I'll give you my bottom line -- go buy the album now.

Back at Mudd

Well, break's over. I'm back at Mudd. Hopefully, I'll keep updating as the semester goes on.

Ciao.