the ned net/ nedlog
urxvtd: a terminal daemon

urxvt (rxvt-unicode) is a terminal emulator with Unicode support. I recently switched from uxterm to urxvt because uxterm didn't properly parse key combinations including the Alt key and didn't always display non-Latin characters. Neither are particularly major annoyances.

While looking through the man page to find how to turn off the scroll bar, I learned about urxvtd: a daemon that opens multiple terminal windows in the same process. The advantage for doing so is faster creation time and reduced memory usage. I found that neither amounted to much in my case - the startup time improvement is barely noticeable and for the ten or so terminal windows I may have going, the memory savings appear negligible. It's still a nifty idea, and in any event the Alt key combinations work properly and characters I don't understand display as they should.

To use urxvtd, put the following in your ~/.xinitrc or ~/.xsession to start the daemon on login and exit on logout:

urxvtd -q -f -o

Then run the client with urxvtc. That was quick.

I'm using the following X resource definitions to make it look pretty:

URxvt.background: AntiqueWhite
URxvt.foreground: black
URxvt.scrollBar: off
URxvt.font: xft:DejaVu Sans Mono-12
Posted early Tuesday morning, July 10th, 2007 Tags: software
Adventures with 22 Inches

I decided it was about time to upgrade my monitor situation. For the past few years I've used a 15-inch and a 14-inch at 1024x768 to give me two windows of usable text and been very happy, but when my father and I temporarily swapped monitors for troubleshooting I realized that I had been missing a lot. You can fit an awful lot of code on a large monitor.

I thought that having a widescreen monitor in portrait/pivot/tall mode would be the most useful option. Instead of having the monitor be extra wide, rotate it around and have it be extra tall. While this isn't terribly useful for web pages or video games, it seems like a fantastic idea for programming: you can still fit 80 characters across, but instead of 35 lines down, you suddenly get 70 or 80 - that's double the code!

Monitors with rotating stands are uncommon, but I found a 22-inch HP w2207 in town and set it up. It's a very nice monitor: glossy screen, heavy base, easy rotation, DVI and VGA inputs, plus two USB ports and speakers. It's native resolution is 1680x1050, which in portrait/pivot/tall mode is twice as many pixels high as a 15/14-inch monitor in 1024x768, and slightly wider. Great.

Problem 1: rotating the display to present correctly is hit-or-miss and annoying at best. Make sure you video card driver supports the "Resize, Rotate and Reflection" (RANDR) extension; an easy way to check is to look at the output of xdpyinfo:

$ xdpyinfo | grep RANDR
RANDR

xorg's nv drivers do, its radeon drivers do not, and in any case, you may not currently use RANDR with XINERAMA, the extension that allows you to treat multiple monitors as one. If you don't use XINERAMA, you need to run multiple window managers and can't share windows or the clipboard between them - that's annoying.

Rotating with the command-line utility xrandr is easy, but I found when rotating back that my xterm's fonts were screwy - sometimes way too big, sometimes way too small. I bound a script to flip screen orientation to the Windows key (most useful it's ever been), but I found that depending on what I wanted to do, the widescreen might have been more convenient, and flipping the display and the physical screen was just more effort than it was worth.

Problem 2: a 22-inch portrait/pivot/tall is just too big. My neck hurt from moving my head up and down to read, and the difference in color and picture quality on different parts of the monitor becomes very apparent when you switch back and forth between the top of the screen and the bottom.

However, when the screen was in pivot/portrait/tall mode, and I was hacking away in vim with the taglist and vimproject plugins providing sidebars, it worked great until my neck started hurting. Maybe if I had gone with a 19-inch widescreen it would have been better, but I ended up taking the HP w2207 back and getting the less expensive and less featureful 22-inch Acer AL2216W.

Besides not having a pivoting stand, the big difference between the two is that the AL2216W does not have a glossy screen. I've decided that I prefer the traditional matte screen instead of the glossy one; while movies certainly look better on a glossy screen, I found it harder to read text and it was very distracting to see my face in the mirror the entire time I used the monitor. The effect was annoying with background lighting, but when I opened the window it was just unbearable.

As for fitting 80 characters of text per line, I found that with a 12 point DejaVu Sans Mono I could fit two windows side-by-side perfectly. Even better, I could have vim open on one half of the screen and split the other half between two windows - maybe a window for compiling, an interactive REPL, quick documentation, revision control, whatever. It's great.

Without the need for RANDR, I can go back to using XINERAMA and use two monitors conveniently. The second monitor is still invaluable for tasks like web browsing, email, and especially for API documentation.

As Ferd said, "Alec, welcome to the 90s."

Posted Thursday night, July 5th, 2007 Tags: hardware programming
vim QuickFix

vim QuickFix is a nice feature that figures out how you screwed up your code by looking at compiler errors. It repositions your cursor over the first offending line and will show you the other errors on demand.

By default, it's set up for C/C++, but it's easy enough to set up for Java if you're using Ant. Set your 'makeprg' to ant without logging adornments:

:set makeprg=ant\ -emacs

And make a mistake in your Java code. Run ':make', and vim will background while ant runs. When you return to vim, your cursor should be over the error and you can run ':cl' to see the other errors in the compilation. Cool.

You'll need to make sure that your current working directory contains the build.xml file; I do this by using vimproject.

Posted Thursday evening, July 5th, 2007 Tags: code software
Meddies on YouTube

Several videos of the Meddies performing have made their way online:

Posted Friday night, June 1st, 2007 Tags: bowdoin meddies
Scientia Combinatoria

Karen said:

After reviewing my diploma, I am intensely curious to know just how they wrote "Computer Science" in Latin on your diploma.

It's written "Scientia Combinatoria", which doesn't seem right - the French and Italian translations look like the English word "informatics", and the Spanish one actually has "computation" in it. I got curious and turned to the oracle of all knowledge, Wikipedia, which happens to have a Latin edition. The entry on Computer Science is titled Informatica, and "combinatoria" seems to be used to refer to combinations from probability, so I guess that settles that.

The real news in all of this is that there is a Wikipedia written entirely in Latin. I browsed over to the front page and the featured article of the month is Pong cervisiale. Wow.

Posted Friday afternoon, June 1st, 2007 Tags: bowdoin computer-science funny
Graduated from Bowdoin

I graduated from Bowdoin on Saturday.

Posted at lunch time on Sunday, May 27th, 2007 Tags: bowdoin life
CS Dinner

Scene: the Bowdoin Computer Science lab during finals week.

First Student: "CS dinner? Yeah! Who's up for it?"

Second Student: "What is CS dinner? We all get bag dinners so we can come back to the lab and work?"

Hmm...

Posted at teatime on Wednesday, May 16th, 2007 Tags: bowdoin