Saturday, December 22, 2007

I'm Very Disappointed In You People

Annie G. was voted only the second cutest dog in Baltimore, coming in behind a frankly not-that-cute mutt that had the good sense to yawn for the camera. People, you're making me look like an asshole. How am I supposed to bring home the bacon if I can't deliver votes?

Tuesday, December 04, 2007

The Key to Reserva

This is awesome. As H says, there's nobody better than Martin Scorsese:


I'm obviously not going to shoot them as I would, but... can I shoot them as Hitchcock? I don't think so! So, who will I shoot them as? This is the question. This is the question and this is the process.

Fair warning: it's a commercial.

Sunday, December 02, 2007

The Cutest Dog in Baltimore

Annie on the Rug
This is my friend Mike's dog Annie. Annie is the kind of dog that will jump up onto the couch and lay her head in your lap and look up at you with just exactly this look in her eyes. In short: she's cute. But is she the Cutest Dog in Baltimore? I'd say so, but it's not up to me. It's up to you: the people of, um, Baltimore. Vote early and vote often.

Monday, November 26, 2007

Morrissey Rocks

Morrissey Rocks
We found this strange tombstone in Calvary Cemetery in Queens. No date of birth, no date of death. Just "Morrissey Rocks." Is this the grave of some devoted, anonymous Morrissey fan? An man with an unusual name? Or did some hipster buy a plot and put up a stone, just for kicks? Would the cemetery allow that? I suppose I could call the management company and ask, but I'd prefer to let the Internet spontaneously reveal all.

Mm, Pot Pie

The NY Times recipe for Turkey pot pie with chipotle and cheese is awesome, although I did make a few modifications. Instead of the "cheesy stick" lattice top, I made a biscuit topping from this Gourmet magazine recipe (I forgot to add the cheese and they didn't really rise, but whatever). I used homemade Thanksgiving-turkey-carcass stock. I used 1 cup of heavy cream and 1 cup of whole milk (because I didn't have enough cream). I added about a 1.5 cups of sliced shitake mushrooms and 1.5 cups of mixed grated Cheddar/Monterey Jack/Colby along with the turkey and veggies. I sprinkled about 1/2 cup of the cheese on top of the biscuits.

I don't think any of these modifications made a huge amount of difference, although I can testify that it turned out plenty creamy without 2 cups of cream. I would not recommend attempting the cheesy stick lattice.

xkcd: Success

This is pretty much exactly how it went down when I upgraded to Gutsy.

Success

Consider this a standing endorsement of xkcd.

Sunday, November 25, 2007

Gnome Sessions

I tentatively clicked "Remember current running applications" in Gnome Session Preferences (aka gnome-session-properties) and lived to regret it. What this does is it restarts any currently running application when you login. This is useful for, e.g., your online backup daemon, but kind of annoying for, e.g., five Emacs windows, Last.fm, some random Nautilus directory window, etc.

Now, first I tried checking and unchecking "Automatically remember running applications when logging out", as the window layout makes it seem as if these two settings are related. They are not. Then, I was tempted to fix this by futzing with the "Startup Programs" or "Current Session" lists. This is Not Right.

The Right Thing is to close all your programs (or just the offending ones) and then click again on "Remember current running applications". That is to say: the only way to change the "remembered" snapshot is to take another snapshot*.

Note: Session Preferences has a Help button, but the Gnome manual page on it doesn't mention "Remember currently running programs" or "Automatically remember running applications when logging out". This is annoying.

* Presumably there is a text file tucked away somewhere that controls this (maybe ~/.gnome2/session?), but I haven't the patience to find out.

Style Guidelines for People

In the midst of some unrelated Googling, I came across Luca de Alfaro's style guidelines for student co-authors. This is good stuff. I particularly like "one sentence per line" b/w "fill-sentence macro". It's an elegant solution to a frequently annoying deficiency of diff, which is unfortunately the baseline for anyone collaborating via CVS or SVN. I tweaked his macro to get nice indentation in AucTeX:


(defun fill-sentence ()
(interactive)
(save-excursion
(forward-char)
(forward-sentence -1)
(indent-relative)
(let ((beg (point)))
(forward-sentence)
(if (equal "LaTeX" (substring mode-name (string-match "LaTeX" mode-name)))
(LaTeX-fill-region-as-paragraph beg (point))
(fill-region-as-paragraph beg (point))))))
(global-set-key "\ej" 'fill-sentence)


[UPDATE 1/20/07] Fixed an off-by-one error when the cursor is on the first character of the sentence by adding (forward-char).

BSG Is Back (Then Gone Again)!

BSG: Razor is basically a very solid, two-part flashback episode in TV movie form. Admiral Cane is resurrected* for some Hot Lesbian Action and to dictate a torture memo** ("Pain, degradation, fear, shame... Be as creative as you feel the need to be"). Eighties vintage Cylons are resurrected for no apparent reason. New characters are introduced and then killed off with ruthless efficiency. There was a bit of the old, vague mytho-babble ("All of this has already happened... and will happen again") pointing towards the next season, which makes me terribly worried the show will end badly, in grand X-Files and/or Twin Peaks style.

It doesn't look like Razor is scheduled to re-air, if you missed it, but it will be out on DVD next week (in an annoyingly expanded version). Season 4 is scheduled to begin in March (or April?). Till then, work...

* Not in the "she's a Cylon" sense.

** Isn't it fun how "torture memo" is now a cultural reference?

LaTeX Letters

I was trying to write a letter in LaTeX the other day:


\documentclass{letter}

\address{Nowheresville}

\signature{Me}

\begin{document}
\begin{letter}

\opening{To Whom It May Concern:}

Hello, there.

\closing{Sincerely,}

\end{letter}
\end{document}

This led to the following two errors, which shed little light on the situation:

! LaTeX Error: There's no line here to end.

See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...

l.10 \opening{To Whom It May Concern:}

and (on a different example)

! Incomplete \iffalse; all text was ignored after line 66.

\fi
l.16 \end{letter}

Runaway text?
\@mlabel{}{\unhbox \voidb@x \ignorespaces \global \let

The problem, as it was gently explained to me, is I had omitted the second mandatory argument of \begin{letter}, which is the address of the recipient. The following is correct:

\documentclass{letter}

\address{Nowheresville}

\signature{Me}

\begin{document}
\begin{letter}{Foo Corp.}

\opening{To Whom It May Concern:}

Hello, there.

\closing{Sincerely,}

\end{letter}
\end{document}


[UPDATE] I just realized that the reason I got so confused about this is that I was working off a previous business letter that was formatted like:

\begin{document}
\begin{letter}
{
Foo Corp. \\
... \\
ATTN: Warranty Dept.}
...

I'm not sure if I intended it to be the case (probably not), but LaTeX picked up the braces around the address as the argument to letter. When I used this as the template for a personal letter and deleted the address, all hell broke loose.

Wednesday, November 21, 2007

All Merchandise Missing, Empty Carton Discarded

Huh. I've never seen a "shipping status" like this before:


Package Progress
Date Time Activity Location Notes
11/15/07 9:11 AM DAMAGE REPORTED / DAMAGE CLAIM UNDER INVESTIGATION SECAUCUS, NJ
11/15/07 9:04 AM MERCHANDISE IS MISSING. UPS WILL NOTIFY THE SENDER SECAUCUS, NJ
WITH ADDITIONAL DETAILS. / ALL MERCHANDISE
MISSING, EMPTY CARTON WAS DISCARDED. UPS WILL
NOTIFY THE SENDER WITH DETAILS OF THE DAMAGE
11/14/07 12:54 PM UNLOAD SCAN SECAUCUS, NJ
11/14/07 9:58 AM ARRIVAL SCAN SECAUCUS, NJ
11/13/07 11:00 PM DEPARTURE SCAN GROVEPORT, OH
11/13/07 9:30 PM ORIGIN SCAN GROVEPORT, OH
11/14/07 11:33 PM BILLING INFORMATION RECEIVED

BTW, the damage has not, to my knowledge, "been reported." To me, at least.

Sunday, November 18, 2007

Starving Like Cats and Dogs

Substitute "cat" for "dog" in this little drama and you have a good idea of what pretty much every day is like around here:


Dog: I am starving.
Me: Actually, no. You aren't starving. You get two very good meals a day. And treats. And Best Beloved fed you extra food while I was gone.
Dog: STARVING.
Me: I saw you get fed not four hours ago! You are not starving.
Dog: Pity me, a sad and tragic creature, for I can barely walk, I am so starving. WOE.
Me: I am now ignoring you.
Dog: STARVING.
Dog: Did you hear me? I am starving.


From there, it takes a turn towards the slightly-less-universal (and incredibly funny). Read the whole thing.

Thursday, November 15, 2007

Fake project directories in tarballs

To make a tarball where all the files are in a subdirectory FOO (as per best practices), where FOO doesn't really exist on your disk (e.g., FOO may be PROJECT-vX.Y.Z and the files are in directory PROJECT), just do


tar cvf NAME.tar --transform=s,^,FOO/,g FILES

Note that the argument to transform in this case is just a sed command with commas instead of slashes.

Saturday, November 10, 2007

Eye Candy

The difference between "Desktop Plane" and "Desktop Wall" in the Ubuntu "Visual Effects" options (aka CompizConfig Settings) is that the latter allows windows to overlap a viewport* and the former does not. (Along with this comes a lot of incidental options and visual fillips, like the ability to drag a window entirely from one viewport to another.) Although this does not sound like a big productivity booster, I'm going to give the Wall a chance.

I'm not going to give the "Desktop Cube" a chance, because it won't let me place viewports above and below, as well as left and right, seemingly out of some wrong-headed sense of pseudo-three-dimensional literalism (although your "cube" can have an arbitrary number of faces, they must be arranged linearly from left to right: Euclidian topologies only).

* For some reason the "Desktop Plane," "Desktop Wall," and "Desktop Cube" options all use viewports and not workspaces**, so they don't work well with the Gnome Workspace Switcher.

** For some other reason, Gnome has two distinct ways of implementing virtual desktops (viewports and workspaces) even though theres no discernible advantage to one over the other (except for compatibility with this application or that).

[UPDATE] Visual Effects lead to intermittent system freezes. Fun! Going back to boring old workspaces.

Problems, I've Had A Few (Fresh Pasta Edition)

The problem with making fresh pasta dough by the well method is that, if your eggs should overtop their flour walls, they will move quite rapidly towards the edge of the counter and, from there, to the floor. In my case, I actually managed to let a significant quantity of egg matter seep into the dishwasher.*

The problem with making fresh ravioli is that it's actually quite tricky and you're bound to screw it up the first time, especially if you'd like to stuff them with a mash of fresh pumpkins that is unexpectedly wet. (You've got to walk before you run, kids.)

The problem with Mario Batali is he doesn't say any of this in his recipes.

* Bonus tip: there's no way to save a pasta dough once you've incorporated too much flour (e.g., because you started desperately flinging it at a rapidly advancing torrent of eggs). The dough quite decidely "locks" and won't react to additional liquid/eggs in any useful way.

Friday, November 09, 2007

Fun with Keyword Analysis

Noted without comment: as of now, this blog is the #5 result (of "about 1,040") for the Google search "irresponsible assface".

Tuesday, November 06, 2007

Updating for Daylight Savings Time on Ubuntu

My system clock has been all wiggy since Daylight Savings Time ended (or started?) (it's ended) on Sunday. Believe it or not, it was actually flipping back and forth between correct and one hour ahead for no apparent reason. I did two things which together seem to have fixed things.

First, via Fast Track Sites, I found that my system timezone information was out of date. The test for this is:


% sudo zdump -v /etc/localtime | grep 2007
/etc/localtime Sun Mar 11 07:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 CST isdst=0 gmtoff=-21600
/etc/localtime Sun Mar 11 08:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 CDT isdst=1 gmtoff=-18000
/etc/localtime Sun Nov 4 06:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 CDT isdst=1 gmtoff=-18000
/etc/localtime Sun Nov 4 07:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 CST isdst=0 gmtoff=-21600

If the output doesn't exactly match the above, you have a problem. Download the latest tzdata2007X.tgz file (where X is a lowercase letter) from the National Cancer Institute (seriously). For gorey details, see the Fast Track Sites post cited above. (I don't think you really have to do the ln step, which sets your timezone to EST5EDT instead of, e.g., America/New_York. I skipped it.)

Now your system ought to know the right start/end dates for Daylight Savings Time. But your clock is probably still out of whack.

Now, via Ubuntu Forums and Stephen Sykes, use ntpdate to reset the clock. The trick(s) here are: (a) you have to shut down ntpd first, (b) setting the clock back an hour will convince sudo that you're trying to do something nefarious ("timestamp too far in the future"), and (c) I had to give ntpdate the -u option to get past some unseen firewall.

% sudo /etc/init.d/ntp-server stop
* Stopping NTP server ntpd [ OK ]
% sudo ntpdate-debian -u
6 Nov 17:00:00 ntpdate[13693]: step time server 66.36.239.104 offset -3598.042737 sec
% sudo /etc/init.d/hwclock.sh restart
sudo: timestamp too far in the future: Nov 6 17:59:56 2007

Oops. Using the "Adjust Date & Time" applet, manually set the clock one hour forward. Now, run sudo -k. Now, set the clock back to the correct time (again using "Adjust Date & Time"). Starting over:

% sudo ntpdate-debian -u
6 Nov 17:00:00 ntpdate[13693]: step time server 66.36.239.104 offset -3598.042737 sec
% sudo /etc/init.d/hwclock.sh restart
* Saving the system clock
% sudo /etc/init.d/ntp start
* Starting NTP server ntpd [ OK ]


All done. Enjoy.

[UPDATE 3/12/2008] It looks like this might be a semi-annual ritual: my system pulled the same schizo act when DST started this week. On Gutsy, ntp-server has become ntp. It's easier springing forward than falling back, because sudo just times out when you set the clock forward.

Monday, November 05, 2007

Heckuva Job, Bernie

Rudy Giuliani on Bernard Kerrick, the mobbed-up, bribe-taking, tax-evading, mistress stalking, ex-personal driver, ex-police commissioner, ex-Iraq occupation official, and ex-failed nominee to a George Bush's cabinet*:


If I have the same degree of success and failure as president of the United States, this country will be in great shape.

He continued, "My shit tastes like lollipops, 9/11, 9/11."

* And remember: you can personally authorize torture and still be confirmed to George Bush's cabinet.

Saturday, November 03, 2007

For Want of Hobo Jokes

Hey, look, official Funniest Man Alive John Hodgman has a blog:


I actually admire the sheer, misanthropic brio of those Lockhorns. After all, it can't be easy to distill all the drunken, marital loathing of WHO'S AFRAID OF VIRGINIA WOOLF? and pour it all into a single, hate-filled funny pages panel day after day after day.

Friday, November 02, 2007

Alternative Status Hierarchies

Joel Stein, everybody's least favorite ex-Entertainment Weekly columnist, covering the Republican fringes:


Representative Tom Tancredo ... tells me after a debate in New Hampshire, one of his staffers walked up to a guy in a shark costume and asked him if he was a Ron Paul supporter. "No. They're all nuts," replied the shark. "I'm just a guy in a shark suit."

Monday, October 29, 2007

Getting to the Florence Airport (If You're a Cheapskate)

I don't recommend flying in to the Florence airport in general—it's cheap and convenient to get to Pisa or Rome by train—but it may be the case that your itinerary just works out that way. There is an "official" airport shuttle bus which will take you to the Santa Maria Novella train station for 4.50 Euros (about US $7). But if you are intrepid and very, very cheap, you can take a regular city bus to and from the airport in about the same amount of time for just 1.20 Euros. This is an especially reasonable option if you have to get to the airport from downtown in the middle of the day.

I'll give the instructions from the train station to the airport. To get to the train station, reverse them.

You need to take the 29 or 30 bus, which go every 20 or 30 minutes through most of the day.

First, buy a bus ticket. There are several newstands that sell bus tickets inside the train station.

The buses start on Via Luigi Alamanni, near the NW corner of the train station. If you are in the train station, facing the trains, turn left, walk out of the station, cross the street, turn right, walk down the sidewalk and cross one street. The bus stop (along with many others) is along this block. The train station is ringed with various bus terminals, so you'll have to be careful to find the right one (29 or 30, they're at the same stop).

Get on the bus and, of course, stamp your ticket. The trip takes 15 or 20 minutes. The bus will take a few turns and then travel primarily down Via Francesco Baracca, a big wide thoroughfare with strip malls and gas stations on it. You want to get off on Via Pratese. You'll know you're getting near it when you pass a big fork in the road (Via Pistoiese) and you'll know you're there when the bus lurches decidedly leftward after having travelled straight a good long while. Press the button to get the bus to stop.

You'll be on the North side of Via Pratese. Here's a map that might help. Walk back the way the bus came to Via Del Motrone and turn left. Don't fret, you're almost there. The street winds for 100m or so and you'll reach a big complicated intersection with an overpass. That's the A11 freeway. If you peer under the overpass, you'll see the entrance to the airport.

Cross this intersection, being careful not to die. You are now at the airport. Congratulations, you have saved yourself 3 Euros!

Italy Report

We have returned from our trip to Italy, thoroughly relaxed and unprepared for real life. The pictures are on Flickr. A taste...

Here's what it feels like to pay 9 Euros just to get into the Boboli Gardens.
9 Frikkin Euros!

But here's what we looked like most of the time.
Napping off a bottle of wine

And here's the kind of thing one could expect "strolling" around Cinque terre.
Another cat, more scenery

Unfortunately, here's how we felt by the time we got to the airport.
We hate the Hotel Garibaldi Relais

Random points:


  • My 30th birthday passed uneventfully. I was last in Italy on my 21st birthday, and I now plan to spend every birthday congruent with 21 modulo 9 somewhere in Italy, drunk on red wine.


  • Antico Noe still exists! Cibrèo is still awesome! And it's still impossible to grok the menu! (Unless you ask!)


  • We need some instruction on how to properly book hotel rooms in Europe. We booked through the Internet and, in each case, paid too much for too little. For instance, we booked an "apartment" in Florence. We thought this meant we would have a small kitchen. It actually meant no front desk and no maid service, period.

    In two out of three cases, the accommodations were disappointing but not disastrous. However, in the last case, I must tell you that Hotel Garibaldi Relais on Via Pratese in Florence is a scam. It is a dank, unhappy place run by unpleasant people; it has a sewer-y smell; the proprietor has spammed various online booking sites with listings under multiple names (e.g., B&B Caffelatte) and fake positive reviews (e.g., this gem from Crivellaro in Alabama (!): "It was so lovely ambience and good and friendy staff.
    During the afternoon it's literally italian caffellatte in a romantic hall of small hotel."); they claim it's "close to everything" when it is actually across the street from the airport; and so on.


  • The Fiddler's Elbow, which seemed to me on last visit a terrible place, over-stuffed with drunken foreigners, is a very fine place to pass the time over a pint instead of sitting in your stinky hotel room.



[UPDATE] In the interest of PageRank boosting (will it work if I admit that?) and general piling on, here's H's Boo.com review of the decripit hotel...

Monday, October 08, 2007

An Update On My Mother's Brain

For those of you who care enough to check the blog, but not enough to call or write (I kid!), I am happy to report that my mother has been released from rehab. She is able to move about with minimal assistance (though she won't be happy until she can turn a somersault) and is bickering with my father and grandmother at 100% capacity. I choose to ascribe this happy outcome to the Power of Prayer and not to the skill of her surgeon, the quality of her nursing care, or the astonishing resiliency of the human organism.

You're Welcome, Afghanistan

So, the U.S. is trying to eradicate Afghanistan's opium crop again. The sheer, neck-snapping cluelessness of this leaves me practically speechless. All at once, we are trying to:

a) Make the Afghans like us, get them to appreciate our good will, and therefore convince them not to join or lend assistance to the Taliban.

b) Destroy their livelihoods.

In an additional sign of brilliance, the U.S. government* conflates the drug trade with the profits that the Taliban skims off the drug trade. Basically, the Taliban is shaking down rural farmers and drug traffickers by "levying taxes." Does the Bush Administration think that, if the drug trade were ended or replaced with equally profitable legal transactions, the Taliban would just stop shaking people down?

Really?

This is like trying to reduce robbery by deciding that nobody is allowed to have money.

* In olden times, instead of "the U.S. government" or "the Bush administration," I would say "we," as in "we Americans" or "our U.S. government, of, by, and for the people." Nowadays, when somebody says "we" and means "the U.S. government", I think: "Who's we? Speak for yourself, buddy."

[UPDATE] If you like a dash of facts with your outrage and colorful metaphors, see Mark Kleiman (via Mr Yglesias). Bottom line, our policy priorities should be: first, defeat the Taliban, distant second, control the drug trade. And: steps taken to control the drug trade should probably have some measurable effect on the drug trade greater than or equal to their (deleterious) effect on priority the first.

Thursday, October 04, 2007

Hung!

Well, then! Congratulations to Chef Hung! I think it was as simple as (to paraphrase Howard Hawks) "one great dish, no bad dishes." I was very surprised to see Casey self-destruct in that way. I think she had a more than 50% chance going in and then... what happened? The only dish the judges like was... Howie's? And she admitted it too! (Take that, Tiffany!)

A note to future cheftestants: I do not advocate ever making a dessert. If it's good, the best you'll get is a "meh" (as Hung did last night) and, if it's bad, your judgment will be called into question ("Why did you choose to make a dessert? Was that the very best dish you could have presented?"). You will not get points for "daring." Nor does it matter that any paying customer would demand something sweet at the end of a tasting menu: the judges aren't paying customers and you aren't a pastry chef. Stick to what you know.

Wednesday, October 03, 2007

Top Chef Pre-Show

My heart is with Hung. Dude's got mad skills. The worst charge leveled at him so far is that his food lacks "soul" and is not "him."* I have a feeling, if he stays focused, produces at his usual high level, and surprises them with some tasty, "soulful" food, he can take the prize. I don't know, somehow I just identify with the cerebral social outcast. He is Marcel's revenge.

I will not be in the least surprised or upset if Casey wins. She's been consistently excellent, especially in the second half of the season (with the notable exception of the Onion Incident). She's smart, likeable, and cute as a button. If Bravo has anything to say about it, she's a shoe-in.

I will be surprised but not terribly upset if Dale wins. He has a tendency to lose his head in the heat of competition (e.g., miscounting his servings, forgetting his sauce) and is far more prone to misfires (especially, for some reason, adding too much hot pepper) than either Hung or Casey. He also has a hideous faux-hawk. So there's that.

* I love the following, from a Village Voice interview with Hung: "What does that mean, when [Colicchio] says 'We don't see Hung.'? What should I do, make sweet and sour chicken and wontons? I'm trained in French food. I love French food. That is me."

Sunday, September 02, 2007

World Tour Postponed

Due to inclement weather. Healing light, damn you! Healing light!

Monday, August 27, 2007

A Post? Woohoo!

Wow, that was my longest blogging gap in the post-India era. And it's going to get longer, unfortunately. I've been really busy with pretending to be a graduate student, plus my mother is having brain surgery (feel free to do whatever you think may help in this Godless, wicked world... perhaps you could envision a healing light), plus I'll be gone for a few weeks touring the Continent. I promise all my slobbering fans I'll be back in September with outraged liberal me-too-ism, boring posts about OCaml, and Top Chef finale-blogging*. A più tarde, i miei amici...

* I would've put Tre at 3-to-1 to win the whole thing. The smart money is now on a Hung/CJ final. (Casey would be a contender if she could chop an onion.)

Tuesday, July 24, 2007

V1agra Cheap!!! Teen Sluts

The last few posts have been delayed because Blogger thinks I may not be a real human being, but rather a sophisticated spambot sent back from the future to corrupt everybody's .emacs file.

Hill Country, NYC

The New York Times review on Hill Country—the new Texas-style barbecue joint in Chelsea—is correct in every particular. I would add that I found the fatty brisket too fatty (I'm not one to complain about fattiness in general) though still absolutely delicious, and that Hilleary and Stephen were terribly offended by the number of lines involved.

A Dubious Assertion

Being a conscientious software engineer, I try to be good about putting assert statements in my code. And being a verification guy, I find myself tempted to express fairly deep correctness properties in my assertions. And this fills me with such satisfaction, that I am such a wise and clever programmer, that I should do such things.

But then I'm trying to optimize some code so that it runs in something like an acceptable amount of time and for some reason I just can't shake this routine out of its stupor... What's going on here?

Don't add assertions that change the asymptotic complexity of your algorithm. That's just dumb. (Of course you can always compile your code with assertions turned off, but even in testing the difference between O(n) and O(1) can pinch.)

And now look at how much more wise and clever and self-satisfied I can be.

Monday, July 09, 2007

Changing your PATH in Emacs' compilation mode

[UPDATE: This is not really wrong, but not really right either. See below.]

I was a bit surprised at this problem, but I suppose most people use standard make or gcc to build... I want to build my project with a version of OMake that I have compiled and installed in my home directory. I have ~/tools/bin in my PATH, but for some reason M-x compile still gives me

/bin/bash: omake: command not found

The trick is that Emacs invokes the compile command in a non-interactive, non-login shell, which means that neither your .bash_profile nor your .bashrc (or any variations thereof) are going to get read.* The workaround is to set BASH_ENV to point to a script file that sets your PATHbash reads the file pointed-to by BASH_ENV in non-interactive mode. Here's my solution:

~/.bash_profile:
. ~/.bashrc

~/.bashrc:
export BASH_ENV=~/.bash_env
. "$BASH_ENV"

~/.bash_env:
export PATH=/home/chris/tools/bin:$PATH

There's probably a good reason why this is a bad idea, but it works.

* A quick refresher course: .bash_profile is for login shells; .bashrc is for interactive, non-login shells; BASH_ENV is for non-interactive, non-login shells (which, confusingly, will probably be a sub-process of an interactive and/or login shell, which is why the above example works).

[UPDATE] The compilation shell being non-interactive and non-login is a red herring. While this is certainly the case, a non-interactive, non-login shell will inherit the environment of it's parent process. So, for instance, if your PATH is properly set in your shell and you invoke Emacs from the command line, things should be fine.

What was really causing my problem is that I was invoking Emacs from the Gnome Panel. The environment that Emacs inherits in this case is Gnome's, not Bash's. How do you change the PATH in the Gnome environment? Um... Eh... gnome-session-properties? .gnomerc?

The solution I've settled on is to create a .xsession file as follows,
~/.xsession:
#! /usr/bin/bash

if [ -f ~/.bash_env ]; then
. ~/.bash_env
fi

exec gnome-session

where .bash_env is as above.

NOTE: If you leave off the last line, your X session will end before it begins. The .xsession script is the X process: when it ends, the X process ends. Execing gnome-session replaces the script process with the Gnome session process.

[UPDATE 2] Of course, another option is to just use setenv in your .emacs file. TMTOWTDI, in Emacs and Perl alike.

Saturday, July 07, 2007

Lessons in Vegetarian Cooking

Sautéing tofu dogs is a bad idea.

Tuesday, July 03, 2007

A very witty observation that could render my education worthless

"There is no silver bullet—but there are no werewolves."
From No Name: Just Notes on Software Reuse by Robert Biddle, Angela Martin, and James Noble. In response to Frederick Brooks.

The Post-CD Universe

I have recently finished ripping our entire CD collection to MP3. We now officially live in the post-CD universe. From now on, all of our music will be acquired in digital form (from eMusic, when possible). The final stats according to iTunes are: 16,804 songs, 42 days playing time, 77.04 GB (that's 60% of the usable space on my shiny new 400GB hard disk).

The project took me about a month of evenings and weekends, processing the 50-75% of our CDs that had never been ripped (or had been lost in one of the great iPod disasters of '04, '05, or '06 (Never again!)).

Over that month, I've heard the following objections expressed by multiple guilty parties.

Objection: "But I like CDs. I like the medium. I like the having them."

Response: You are a fool. You are a human being, not a magpie: you don't need a pile of shiny discs to validate your existence. Compact discs have no inherent value beyond the information that is encoded upon them.

Objection: "But the sound quality is not as good."

Response: You are talking to someone who cut his teeth listening to DIY 7" records, cassette demos, and entire albums recorded on boomboxes. I ripped everything, including the jazz and classical, at 192kbps/VBR (i.e., "near-CD quality"). And that is good enough for me. If you have a problem with that, you are a wanker. If you persist in this objection, I will ask you to leave. (This includes you, Hilleary.)

Remember When? (Summer Fruit Edition)

I just had a damn satisfying bowl of cereal with strawberries and blueberries in it, made all the more satisfying (but at the same time dismaying) by all my failed attempts to have this same bowl of cereal with strawberries and blueberries for the last several months. Apparently they are now actually in season and so they actually, you know, taste good. But even though they previously weren't in season and didn't taste good, the grocery store kept putting them out there for me to buy (at tantalizingly reasonable prices) anyway.

It's ironic, in this world where you can buy summer fruit in January and winter vegetables in August*, where global supply chains are devised to deliver to the consumer everything he wants when he wants it without respect for climate or geography, that we've actually lost a convenience that was intrinsic to the old order: the strawberries, blueberries, apples, peaches, plums, and nectarines only showed up at the grocery when they were good (or just a little bit before. And stayed around just a little bit after). You didn't have to be a student of agriculture with a sharp eye for quality to know when it was and was not OK to buy strawberries: it was OK to buy them for the 3-4 weeks that they were available in grocery stores. Now, it's just a constant exercise in mental discipline and delayed gratification. Ick.

Perhaps this is why I should do more shopping at the farmers' market.

POSTSCRIPT: Hilleary should not read anything in this post to confirm insane and inconvenient ideas developed while reading The Omnivore's Dilemma

* Who wants winter vegetables in August?

Sunday, July 01, 2007

Una Pizza Napoletana

Last night, H and I wandered pretty much randomly* into the latest pizza lovers' obsession, Una Pizza Napoletana. The menu is suicidal. There are exactly four food items, all pizzas. No appetizers, no sides, no desserts. The choices are: Margherita (plain), Marinara (no cheese), Bianco (no sauce), or Filetti (with cherry tomatoes instead of sauce). No slices, no toppings, no substitutions. A basically-individual 12-inch pie is $21 (ouch), any variety. There is a similarly limited and uniformly-priced list of wines and beers, which are served lukewarm in a plain drinking glass.

So the pizza better be pretty fucking good, right? Well... it is. Pretty fucking good. Perfect crust: crunchy, chewy, salty, etc. Nicely balanced sauce, nice cheese, fresh basil. Not my favorite pizza in the entire world, which is still either Di Fara in Midwood (a moment of silence...) or Vito's Pizza of Hamilton, NJ, which was for me like mother's milk. Still, damn good.

But... can we cut the crap? I've had una pizza Napoletana. In Napoli. And they have toppings. Nice toppings. Like arugula and prosciutto. Or artichokes. Or ricotta.

I mean, for fuck's sake, people, loosen up. You're doing good work. Now give me some ice cream.

* Momofuku had a wait and we were trying to catch a movie (Ratatouille, which was entertaining, as expected).

Friday, June 29, 2007

Browsing gzipped tarballs in Emacs

Somehow the presence of a hundred billion .tar.gz files on the Internet prevents Google from giving me this very simple tip. Just opening a .tar file in Emacs will let you browse it as if it were a directory. If the file is gzipped, you need to enable auto-compression-mode: either do M-x auto-compression-mode or (setq auto-compression-mode t) (e.g., in your .emacs file).

Google Desktop for Linux!

Hooray! Beagle search for Gnome? Boo! Go away!

Google, if I give you all my data, do you promise to be gentle?

Thursday, June 14, 2007

Taking Direction

Is there a way to give feedback when Google Maps gives you a bum steer? This morning, I was driving from Westfield to Murray Hill in New Jersey and Google Maps advised me to turn North on Union Ave in Scotch Plains and cross Route 22 (here). The only problem is that there's a concrete divider on Route 22 at Union Ave (which is clearly visible here) and it's not possible to cross there. I had to go a few miles East on 22 to Glenside Ave. Luckily, I knew where I was at that point; if not, I would have been screwed.

Now, I'm the kind of good citizen who fixes grammar on Wikipedia and blogs about bugs in GCC. I'd like to tell Google about their terrible mistake and give them a chance to make it up to me. But I can't find any email address or web form that seems appropriate.

It may be the case that they don't want feedback. After all, why should they trust me on this? Oh, well.

Tuesday, June 12, 2007

Fixed Gears, Fun?

I've seen and heard a lot of content-free snark about fixed-gear bikes lately, as in this recent NY Times Style article, but I've never successfully gotten anybody to explain to me why they are fun to ride? For the record, if you are interested, one Mr. Sheldon Brown makes a pretty compelling case and the Wikipedia has a characteristically objective take. This makes me want to try one out. Although I must say , as a novice city bike rider who huffs and puffs his way up the gentle slope to Prospect Park, I enjoy coasting. Coasting is fun.

Friday, June 01, 2007

Did you know AA alkaline batteries could explode?

I'm sitting in the living room and BLAM! like a shotgun blast. I walk into the kitchen and the clock is laying on the floor, one half of an AA battery lying next to it. On the wall—five feet away!—there's a splatter of some battery-related gunk. On the counter—several feet in the other direction—there's some kind of wadded-up, gunky something-or-other.

You may have heard that laptop and cell phone batteries can explode (see here, here, and, for video, here), and this seems to be a concern for rechargeable batteries in general. But plain alkaline AAs? Who knew?

Having now seen what the humble AA can do, I'm going to rethink holding my laptop on my lap and/or keeping my cell phone in my pants pocket.

Wednesday, May 30, 2007

Multi-line Comments in Make

You see, this is why I hate Make. Did you know that a backslash at the end of a comment line extends the comment to the next line? For example:


# This is a comment \
and this is still a comment


This is all very nice and logical—a trailing backslash means the same thing no matter where it appears in a file—but it has all the niceness and logic just exactly backwards. The behavior of (line-based) comments in every other programming environment I know of is: a comment character (in this case '#') introduces a comment that is terminated by the end of the line; if a line is not preceded by a comment character, it is not a comment.

This may seem harmless. But consider the following:

FILES = \
file1 \
file2 \
file3

Now suppose we decide to temporarily remove file1:

FILES= \
# file1 \
file2 \
file3

Does FILES equal "file2 file3"? No! FILES is empty. And that's if you're lucky and you didn't get some weird syntax error.

Tuesday, May 29, 2007

Is Bush a Neoliberal? No.

Do me a favor here... is it really 2007? And is Richard Cohen really writing this column on how George W. Bush is a "neoliberal"? Are there no limits to the sage pundit's lazy contrarianism?

Cohen says he "never really knew what [neoliberalism] meant", but the term should be revived because George Bush is "more liberal than you might think." The evidence for this is: (a) No Child Left Behind (a bunch of meddling, liberal do-gooderism), (b) all the incompetent blacks, women, and Latinos in his administration (hiring poorly qualified minorities is just so liberal), and (c) conducting a botched foreign war and justifying it with high-flown Wilsonian rhetoric (losing wars is just so liberal).

Mr. Cohen, I do know what neoliberalism means (if you want to know, you might have Googled it; it's not that complicated). George Bush is not a neoliberal. And items (a), (b), and (c)—while they ring nicely of the conservative caricature of The Left—are not evidence of neoliberalism. Quite the opposite in fact.

I understand the urge to paint George Bush as "not conservative" (this has been Andrew Sullivan's bread and butter for about four years), but "not conservative" is not "neoliberal." (Duh.) And what we really don't need right now, at this point in history, is a supposedly "not conservative" columnist in the Washington Post using the word "liberal" as an essentially meaningless all-purpose insult.

Wednesday, May 23, 2007

The Annals of OCaml Compiler Errors

X is not a compilation unit description.

X is not a file type that the compiler expected to receive as input. For example, X is a .cma file and you'r running the compiler with the -a flag—.cma files are only expected on the final link; linking a library into a library doesn't make any sense.

Saturday, May 05, 2007

Happy Free Comic Book Day!

Go out and get yours! Your local comic book store will only be a semi-intolerable madhouse.

You would think there would be one lousy freebie on offer—and in past years, this was the case—but in fact there are 10 or 12 free comics, ranging from Archie to The Hulk to The Simpsons to The Lone Ranger. Something for everybody.* And you can take them all, if you want. I ended up buying $10 worth of non-free comic books too. So it worked!

In other strolling around Fifth Avenue news: the Sabbath-observing jeweler resized my wedding band for $12 bucks. Trying to cheat me, Upper East Side? (I think the $80 price was to cut and re-join the ring. Whereas it really only needed to be compressed. Jerks.)

And: Empanadas, still delicious!

* Everybody who hasn't passed through puberty.

Friday, April 27, 2007

Ubuntu Names

Oddly enough, Ubuntu has a web page about the names. Apparently, it just didn't occur to them to go in alphabetical order until after breezy. But why did they skip C?

I think Adjective Animal would be a great name for their 27th release.

Azureus

What's the story with this piece of crap? Azureus seems to be every right-thinking Linux geek's favorite BitTorrent client, but I have never once had it succesfully download anything. It hangs and/or crashes pretty much immediately. This has been the case on multiple computers and four different versions of Ubuntu. Is it me? Is it SafePeer?

[UPDATE] There was a widespread, virulent bug in Azureus. I've been able to work around it, though I'm not quite sure how. It really is a great BitTorrent client...

Feisty Fawn

I upgraded my laptop from Ubuntu edgy to feisty last night and I'm please to report (after a rather unpleasant experience upgrading from dapper to edgy, documented here, here, and here) that the whole thing went off without a hitch. The upgrade process asked a lot of annoying questions about whether or not it should clobber various config files, but I just said "Yes" to all of them and have seen no ill effects. It even gracefully downgraded my nVidia driver to the latest version in the Ubuntu repository and Suspend still works. Who knew that was possible?

Are there any great benefits to upgrading? Um... not that I can tell. The version of Liferea is more recent and there's a search button in the Panel. These are hardly blockbuster features. The main benefit to me is that "are you running feisty?" will not be the first and last response to every question I post to the support forums. (This will be replaced with "are you running gutsy?" within a month.*)

* Speaking of which: I am really fond of the names Breezy Badger, Dapper Drake*, Edgy Eft, and Feisty Fawn. But, Gutsy Gibbon? Yuck.

** Does anyone know the story behind the naming scheme? I.e., how Ubuntu went from Warty Warthog and Hoary Hedgehog to the current Sue Grafton-esque release-naming convention? And why they skipped A and C?

Wednesday, April 25, 2007

Profiling OCaml... Revealed!

Profiling OCaml code is kind of a hassle. The simplest thing is to use ocamlopt with the -p option, then apply gprof as usual. The problem here is that the debugging symbols produced by the OCaml compiler are of limited usefulness. For example, fun expressions show up with names like camlModule__fun_2397 (where 2397 has nothing to do with anything) and, I think, continuation-passing transformations in the back-end can lead to confusing call graph relationships where functions that shouldn't be compute-intensive at all end up looking like hot spots.

Now, you may think this is all due to the conversion to C calling conventions and the corresponding loss of high-level information at execution time and therefore the solution would be to profile bytecode. So you might try to compile with ocamlcp, the profiling bytecode compiler. Along the way, you'll figure out that ocamlcp doesn't allow the -pp option... No problem—if your project is sufficiently small or your Makefiles are sufficiently modular—you can just run the preprocessor separately and pass the preprocessed files in to ocamlcp (just add pr_o.cmo to your camlp4 command, to dump the pretty-printed version of your code instead of the AST object).*

Then you'll discover** that what ocamlprof gives you is not a data dump like the output of gprof, but a source file annotated with execution counts for each expression. And you'll realize that this is in some ways useless—you really need time information to do effective profiling. For example, the polymorphic equality function (that's, um, = for you non-functional programming types) is going to have a massive execution count in just about any program you write; that doesn't mean you need to rip it out and hot-rod it.***

Now, here's where I made an interesting discovery: the byte- and native-code compilers seemingly dismantle the source code in similar or identical ways. You can take the execution count for an anonymous fun expression from the gprof output and match it up with the execution count on the source expression from ocamlprof.

Here's an example. gprof tells me the following:


Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
28.57 0.08 0.08 1064344 0.00 0.00 compare_val
17.86 0.13 0.05 82370 0.00 0.00 camlAtp__itlist_116
10.71 0.16 0.03 2284937 0.00 0.00 caml_apply2
7.14 0.18 0.02 1657397 0.00 0.00 camlMlss__fun_1052

The far left column tells you what percentage of the execution time was spent in the function named on the far right. The column in the middle tells you how many time the function was called. The first three rows name built-in and generic functions—it's not surprising that the program spends a lot of time comparing things, iterating over lists, and invoking functions. The fourth row names camlMlss__fun_1052, an anonymous function, which accounts for 7.14% of running time. Where is this function?

gprof outputs the following call graph information:

-----------------------------------------------
28217 camlMlss__fun_1046 [167]
1629180 camlAtp__itlist_116 [11]
[16] 12.0 0.02 0.01 1657397 camlMlss__fun_1052 [16]

In other words, camlMlss__fun_1052 is called from some other anonymous function and from a generic list iterator. That's not very helpful.

But if we go over to the output of ocamlprof, we find this:

let saturation_rule2 f terms theta =
(* 546 *) itlist
(fun fm r ->
(* 28217 *) try
let g = f fm in
itlist
(fun fm r ->
(* 1657397 *) try g fm @ r with
Match_failure _ -> r)
theta r
with
Match_failure _ -> r)
theta []

The numbers in comments are invocation counts. The innermost fun expression is called 1,657,397 times. Does that number look familiar? Notice also that the next enclosing fun expression is called 28,217 times, which is exactly the number of calls attributed to the anonymous parent of camlMlss__fun_1052 in the gprof call graph data. We have found our hot (er, warm-ish) spot!

I'm not sure how reliably this works in general. The cited results were obtained by running ocamlcp with the -g and -p f arguments. It might be fun, if one could find some spare time, to write a utility that used the ocamlcp output to annotate the gprof data with (probable) line numbers.

* Note that the pre-processed file must have a .ml extension or the OCaml compiler will refuse to have anything to do with it. Note also that foo-pp.ml is not an option, because the filename must be a valid module identifer when the first letter is capitalized (i.e., your canonical [A-Za-z][A-Za-z0-9_]* identifier).****

** We assume throughout that you are a foolish person like me: that you only read the documentation for such things far enough to get them running and are consequently constantly surprised by what programs actually do, since you assume that they ought to do what they seem to be intended to do.

*** Although you may run into trouble if you use polymorphic equality on big, complicated (or, gasp, cyclic) data structures.

**** Note to self: is there a reason the OCaml convention is to use lowercase file names when the module system implicitly capitalizes it and for use as a module identifier and a capitalized file name is also accepted by the compiler? I.e., why don't we match the case of file names and implicit module declarations? Oh me, oh my, why, why, why?

Sunday, April 22, 2007

The Universe (Sort Of) Hates Me...

Well... Let's call it a patent dislike.

I specifically left the house this afternoon to get my wedding band resized—an errand I've been meaning to run for about six months now*—only to find that every jewelry store in Park Slope is closed on Sunday. What's the deal?

But you know who is open on Sunday? The 5th Avenue empanada lady. You know how much an empanada costs? A dollar twenty-five. And you know what they are? Delicious.

Eat that, universe,

* The band has seemed a little too big since I got back from India, probably because of the 10 pounds I lost there (which have oddly stayed off, even after I returned to my customary diet of cow, pig, and Ben & Jerry's ice cream). The band has fallen off my finger twice: once on the street in Sunset Park and once on the beach in California. I haven't determined the precise combination of external/internal/body temperature and humidity/sweatiness that puts it in the danger zone, but I find that I self-consciously walk around with my hand curled in a fist, lest the band leap from my finger and into a sewer and/or the jaws of a whale.

[UPDATE] Upper East Side jewellers have a better work ethic, but $80 to shrink a platinum band a half size? Is that really how much it costs?

Friday, April 20, 2007

That word. I do not think it means what you think it means.

Today's NY Times article about Harry Reid contains the single most idiotic piece of argumentation I've ever heard from a Republican (and that's saying something):


Representative Peter Hoekstra, a Michigan Republican, said: “If Harry Reid believes that this war is lost, where is his plan to win this war?”

Blogging from Jury Duty!

Free public Wi-Fi in the courthouse!

Totally, Man. They Didn't Even Have MySpace Back Then.

Quote of the Day: "Twentieth century? Why, I could pick a century out of a hat, blindfolded, and come up with a better one." -Oliver Larrabee, Sabrina (1954) (not the compromised second draft)

Thursday, April 19, 2007

Straw Men in Jars

Shorter David Brooks: We are not brains!

(Sorry about that pay wall.)

Tuesday, April 17, 2007

Women in Computer Science

It's always been a problem and, apparently, it's getting worse. (Though, in fairness to the discipline, enrollments in CS are down dramatically across the board and seem to be down proportionally somewhat less for women, especially at the doctoral level (which I inferred from squinting at this graph)).

What can I say, ladies? It's not all programming, but programming is an important part of it. If you don't like staring at a screen all day... well, then you're probably not cut out for 21st century office work. You can only read so many papers (and even papers don't have to be on paper if you don't insist on it).

CS could do a better job of selling itself as a mathematical rather than an engineering discipline—it's really a little of both, and you can choose the proportion that works best for you depending on your interests (for instance, my work is probably 60/40 math/engineering; most of my peers/colleagues are probably more math-centric). Neither math nor engineering are at gender parity, but math is better than CS and engineering is worse.

On the glass-half-empty side, CS is—and is likely to remain—a male-dominated discipline. And the men you'll find, while not necessarily the classic pocket-protectored nerd (I've never once seen a pocket protector on a computer scientist; I think that's a slide-rule-era stereotype), tend to be socially awkward in one way or another. (But academia, in general, seems to attract introverts.)

On the glass-half-full side, universities, research labs, and funding agencies are absolutely desperate to encourage women to pursue computer science as a career. If you are a math- or technologically-inclined female (especially if you are an American female: China and India produce proportionally more female computer scientists (I think, no data to back that up)), you'll have a comparative advantage in CS vs. math and the physical sciences. Which is not to say you'll get a free ride. But there will definitely be a thumb on the scale in your favor.*

* Must... suppress... white male... resentment... So hard... being white... and male...

Monday, April 16, 2007

Unzip into a subdirectory!

Most folks know this. If you are one of those folks, just move along. I'll wait...

Now. When you make a TAR or ZIP file, make it so the files will un-tar/zip into a subdirectory, damn it! Do you really think I want your files spread all over my /usr/local tree?

This is especially common amongst people who make ZIP files, so I'm usually on my guard for it. But tarballers: come on! Get with it! It's easy: "cd ..; tar cvf foo.tar DIR"

Some Thoughts on Taxes

First, I'd like to observe—uniquely, I think—that people like me ought to pay less.

Second, it hardly needs to be said that it would be both good politics and good policy to simplify the tax code and payment system. You see, if paying taxes wasn't complicated, time consuming, and painful, people wouldn't mind paying them so much. John Edwards is apparently hip to this, as are the wing-nuts. (Via Becks via Neil the Ethical Werewolf)

Finally, if you are a giant corporation with an internship program, a nice benefit you could provide—nicer even than a ping-pong table or free snacks—would be free tax advice. Along these lines, you could also make a little effort not to put your interns in an annoying, complicated tax position.

P.S. Oh, yeah, I meant to say: it's your patriotic duty, blah blah blah.

Saturday, April 14, 2007

Oh, Brave New World That Has Such Feces In It

I've been meaning to blog the LitterMaid self-cleaning litter box for months now. Every time I come into contact with the damn thing it makes me want to call my congresswoman (hi, Nydia!).

If you're not familiar with the product, it's a litter box with a sensor and a motorized rake. A few minutes after a cat jumps in the box, the rake makes a pass over the litter and scoops whatever is clumped there into a little plastic bucket. Sounds pretty great, right? Wrong.

People on the Internet are not happy with this product. A lot of complaints are centered on the apparent fact that the motor breaks down quickly and often. But even with a fully operational motor, this is a deeply flawed product.


  1. If you fill the box up to the line marked "Full"—or even just somewhat near it, say, anywhere above the line marked "Add Litter"—or, actually, to tell the truth, even if the box is not the least bit full but the litter is somehow unevenly distributed into unfortunately placed dunes—the rake will actually get stuck, going back and forth and back and forth all day or night—oh, and did I mention that it's really fucking loud—until you turn it off and remove some (or a lot of) litter and smooth it out and pray.


  2. The rake teeth are about a half inch apart and don't reach down to the bottom of the box. Tiny poops escape unharmed. A layer of fine urine-soaked dust accumulates. Stench ensues. The thing weights 20 or 30 pounds, so dragging it into the bathroom or backyard to scrub it out is a hassle.


  3. With a regular litter box, if you want to ignore it for a week or more, you just have to play chicken with your cat's inclination to go start pooping and/or peeing somewhere else. Usually, at least in our case, the box will become just completely unacceptably stank long before the cats give up on it.

    With a LitterMaid self-cleaning litter box, if you ignore it for more than a few days, it starts scooping poop and urine-saturated litter onto the floor. Thus, the self-cleaning litter box, far from relieving you of the stresses of litter box management, actually makes careful attention to the state of the litter box more important.


  4. Somehow, because of the way the dirty-litter bucket is wedged into a little gap on the side of the box, you are actually more likely to come into contact with cat shit in the process of changing the litter than with an old-fashioned litter box and scoop.



So, to summarize, here is the litter box of the future: it's loud, it's stinky, it scoops shit onto your floor, and then makes you touch it. And then it breaks! It gets my highest recommendation.

Kids, Don't Be Like Me

You probably think there's just no possible way your computer's BIOS could fail to recognize your new ginormous EIDE hard disk—that problem just sounds so DOS-era, doesn't it?—but, yes, this can happen to you. My PowerMac G4 thinks my new 400GB drive is... 128GB. And the best part is: no returns! Who's the tech expert in this house? I am!

Thursday, April 12, 2007

Seriously?

The security guard in my building, who let's me walk by with a nod 9 times out of 10, chooses today, when I've got a bag and an umbrella and a hot cup of coffee, to ask for ID? Really?

I never know where I stand with these people. Am I supposed to do chit chat? I hate chit chat.

Oh, Ubuntu...

It just wouldn't be a system update if it didn't break Suspend.

If, for whatever reason, you have been moved to install the latest version of the Nvidia drivers—eschewing the always classy, always out of date nvidia-glx package—you must must must re-install after a kernel upgrade. The reason being that the driver compiles a custom kernel interface that is, in all likelihood, now broken.

Bonus tip: How do you shut down the server so that you can install the driver?

sudo /etc/init.d/gdm stop
(Or,
sudo /etc/init.d/kdm stop
for you Kubuntu people. (What's wrong with you?)) (Hat tip: TheOS)

Wednesday, April 11, 2007

Television's "Marquee Moon"

Not good treadmill music.

Saturday, April 07, 2007

एक्ष्केल्लेन्त् वर्क, टोबी

Mr. Kellner (who else?) wins the prize, which is no prize. Bonus points if you know where it came from. BTW, my browser doesn't even render this script properly. Something to do with the right-to-left text.

Friday, April 06, 2007

आ गूढ़ ग्लास इन थे बिशोप'एस होस्टल

Blogger snuck a Hindi transliteration feature into the post composer. Why? I don't know. Does it work? Beats me. What does it say above? Does it make any sense?

Thursday, April 05, 2007

Moving to a new Gmail account

Interestingly, it can be done without losing your email, although it is not officially supported. Here's how it's done (with a hat tip to these guys over here):


  1. In your old account, go to "Settings -> Forwarding and POP" and select "Enable POP for all mail".

  2. In your new account, go to "Settings -> Accounts" and select "Add another account"

  3. Enter your old email address and click "Next."

  4. Enter the username and password for your old account. From the "POP Server" drop-down list choose "Other..." and type in "pop.googlemail.com".* Unselect "Leave a copy of retrieved message on the server."** You may also want to tag or archive the retrieved messages, but you can change these settings later.

  5. Click "Add Account." If something goes wrong, fix it.

  6. Now wait. The emails will come slowly and out of order, but they will come. They'll even have all the right timestamps and such. It took about 8 hours for approximately 800 messages to be loaded from my old Inbox. (Presumably, Google throttles the message transfer so that you don't interfere with everybody else's everyday Gmailing.)

  7. When all of the emails have transferred, you can go back, turn off POP, and enable regular forwarding. This will be much faster, in general.


Transferring your contacts is easy. The Export/Import links are in the upper right corner of the Contacts page. There doesn't seem to be any way to get somebody into your Quick Contacts box without sending them an email.

Note: Changing your Gmail account will screw up all your other Google Account stuff. Like your Blogger account. D'oh. [UPDATE: No really, this is probably the worst "feature" of Google Accounts. If I log into Blogger, I log out of Gmail and vice versa. I can probably somehow get around this by inviting the new me to join this blog...] [UPDATE 2: As you may notice in the Contributers bar to the right, there are now two of me contributing to this iblog. This is annoying.] [UPDATE 3: This was a known bug with "New Blogger" that has since been fixed.]

* This is part of the trick. The pre-fab list of gmail.com servers won't let you suck in all of your mail, but this undocumented googlemail.com server will.

** This sounds frightening, so some clarification: Gmail won't let you leave this selected; they've got the POP server set up to complain if you do. However—and this is weird—your mail won't actually be deleted from your old account. This setting doesn't mean what it says, somehow.

Monday, March 26, 2007

BSG 3.20: "Crossroads, Part 2"

Lots of juicy developments, most of which were so vague and ambiguous as to render analysis pointless. To summarize: there is some mystical connection between President Roslyn, Boomer, and Caprica Six which centers in some way on their connection to the human-Cylon baby, Hera; four principal cast members (well, two A-listers and two B-listers) become convinced that they are Cylons—four of the "final five"?—and it's just possible that the last unknown Cylon is either Bob Dylan or Jimi Hendrix; one of the new Cylons had a baby this season, so there is a second probable human-Cylon baby out there that nobody is having any apocalyptic visions about; and a certain supposedly dead Galactican is not dead, is a Cylon, or has transcended such issues in the Fourth Dimension (or else a certain ace pilot, defense attorney, and prodigal son is seeing things in much the same way that certain other people saw certain things before crossing over into a certain Fourth Dimension).

The only issue that's really worth chewing over here is the acquittal of one Gaius Baltar. It is fairly gratifying that the lack of accountability aboard Galactica I have noted a few times in the past was a significant plot point this week. Apollo's speech was fairly convincing in an emotional-impact kind of way, but I was surprised that it carried the day. It seems to me that the signed death warrant—on which Gaeta's perjured testimony could not be contradicted, except by Baltar and a few Cylons—was pretty much grounds for conviction by itself. (The irony being that Baltar can't really be held responsible for the death warrant.... but the jury didn't know that!) That said, it was very clever for the writers to push Baltar into a new situation, where his instinct for survival and skill at improvisation can serve him in new and possibly interesting ways.

Season 4 is scheduled for 2008 and "a special two-hour extended event" will air "fourth quarter 2007." What am I supposed to do till then? Work?

Sunday, March 18, 2007

Buffer-local Dictionaries

If you write technical documents—especially technical computer science documents with code snippets and the like—you're likely to come across a spell-checking dilemma like the following:

Unrecognized word: pBuffer

Replace with: (0) buffer (1) puffer (2) puffier (3) pouffe ...
Space: Accept word this time
a: Accept word this session
i: Insert into personal dictionary

"pBuffer" is not a real word that should go in your personal dictionary, so you accept the word for this session. Say you're going to write 5,000 more drafts of this document. All of those weird little technical words could get pretty annoying after a while.

In Emacs, you can type 'A' instead of 'a' to insert the word in a "buffer-local dictionary." You can also presumably add a Local Words comment somewhere in your file by hand, like

% Local Words: pBuffer

Why is it always so hard to figure this stuff out?

Hat tip to the Linux Documentation Project.

Bonus tip: You want an em dash in your blog post? Try —. You would think I couldn't be so em dash-happy and not know this already, but I am and I didn't.

Saturday, March 17, 2007

\tag{eqname}

So you want to give an equation a name in LaTeX, instead of the number it gets automatically... For some reason, Google will resist telling you how. You may be tempted to use the eqname package. No need! No need at all! Use the \tag command. Why isn't this easier to figure out?

UPDATE: I apologize to the writers of the amsmath documentation, who mention this pretty much immediately after they introduce the concept of equation numbering. I always assume that Google can find these things for me.

Friday, March 16, 2007

Lazy Scholarship

Fill in the blanks: You are ___% more likely to get cited if you include BibTeX and/or EndNote entries for your publications on your web page. You are ___% less likely to get cited if the PDF of your paper doesn't support cut-and-paste.

Monday, March 05, 2007

BSG 3.16: "Maelstrom"

There be SPOILERS ahead.

File this one under: be careful what you wish for. Ballsiness aside, I have a feeling we'll be seeing Starbuck again in one form or another. Which will it be: Cylon, dream sequence, or creature of pure energy?

As much as I've enjoyed Katee Sackoff throughout the series (in those scenes where she wasn't making puppy-dog eyes at Apollo), I think I would prefer if the point of this episode was that Starbuck totally lost her mind and died for no reason, rather than following her spirit into the fourth dimension wherein she will fulfill her Destiny. I'm getting pretty tired of all this Destiny crap.

As H said to me last night, "So, remind me of what it is you like about this show again?" To which I respond... I think the last few episodes of last season and the first few episodes of this were some of the best that BSG has ever done. But ever since "The Exodus" from New Caprica, I feel as if the drama of the show has gone slack. I'm afraid we may have jumped the shark... Here's hoping for a rocking season finale.

P.S. Last week's episode, which barely merits comment, provided some new data for my ongoing research into discipline aboard Galactica: treason merits a slap on the wrist, fomenting a general strike will almost get your family shot.

Sunday, March 04, 2007

Newlines in Regexps

This tip rocks: to search for a newline in Emacs type C-q C-j.

Wednesday, February 21, 2007

Jump, Jump!

Speaking of sharks, remember when that was a website and not just a cliche? The vast majority of people who bothered to vote seem to think The Gilmore Girls took a wrong turn sometime in the last two seasons (this is ignoring "Never Jumped" voters, who are ignorant pigs).

My own feeling is that the show started to decline in quality around the time that Rory started seriously dating Logan and did a nosedive after she became disillusioned and dropped out of Yale. Which, you'll recall, was the same time that she started flirting with DAR membership and stopped speaking to Lorelai---a more severe case of misunderstanding your own show's core appeal I have never seen. It was like sending the cast of ER to spend a summer at the happy puppy farm.

I watch too much TV! It's embarrassing!

Tuesday, February 20, 2007

The Gilmore Girls are Tired

Has any show ever fallen farther faster than The Gilmore Girls? What went wrong exactly? Is it just the ineluctable storyline exhaustion of a sixth season? Is it, as Virginia Heffernan claims, the loss of "despotic creator" Amy Sherman-Palladino?

It's not just the on-again, off-again Luke-Christopher-maybe-Luke-again thrum of Lorelai's love life or the dreary attraction-dating-marriage-baby death-march of Lane and Zach. It's not even Rory's soul-killing romance with a callow trust-fund jerk. It's just... boring. It's flat where it used to be spritely. It's preposterous where it used to quirky. It's deathly dull and obvious where it used to crackle with intelligence.

And... sputter... I'm a man! I didn't ever even properly love this show the way it was meant to be loved.

Blah.

I don't think the show was ever fated to survive Rory's departure for college. It's appeal was too much based on the central relationship between Rory and Lorelai to survive their physical separation, even with Rory driving home for an implausibly large number of laundry loads and local dance recitals. There's too many damn scenes with them yapping on the phone that are cut head shot, head shot, head shot, head shot, "Bye," "Bye," click, end scene.

Argh.

In case you can't tell, I'm typing this while Hilleary watches the show against my will.

Gronk.

Comments in BibTeX

Be warned: there is a @Comment directive in BibTeX, but it doesn't appear to do anything.

UPDATE: @Comment works as expected so long as you use it outside any other directive. E.g., the following will not work,

@InProceedings{ key,
title = {\BibTeX comments considered harmful},
author = {Christopher L. Conway},
booktitle = {Procrastiblog Symposium on \LaTeX Arcana},
year = 2007,
@Comment{ This never actually happened. }
}
whereas the following is fine,
@InProceedings{ key,
title = {\BibTeX comments considered harmful},
author = {Christopher L. Conway},
booktitle = {Procrastiblog Symposium on \LaTeX Arcana},
year = 2007,
}

@Comment{ The above never actually happened. }

Monday, February 19, 2007

BSG 3.15: "A Day in the LIfe"

Roslyn to Adama: "I'd love to turn you on."

BSG gives off the vibe of a show where the stakes are high, but the only semi-major characters who have ever died were Ellen Tigh and Kat.* This is getting pretty unbelievable... How many planets has Starbuck crashed and been abandoned on? Cally and Chief aren't even in fighting trim... they're supposed to survive explosive decompression with nothing more than a burst blood vessel?

I have no use for these bonus scenes. Cut it into the episode or put it on the DVD. I don't need your leftovers.

* The Sopranos benefits from the same perception and suffers from the same problem. You think nobody is off limits, but the only long-term character to die since Big Pussy was Adrianna. Characters like Ralph Cifaretto are blatantly brought on to get whacked---the only surprise in that case was how long it took and why it happened. Would it kill you to lose a Paulie Walnuts just to maintain some believability here?

I assume that in the last season, we can expect a little more blood to flow. Though I also assume, since the idea of a Sopranos movie has been knocked around, that we can expect Tony to survive.

Thursday, February 15, 2007

On Wisdom

Paul Graham is both smart and wise. On the futility of seeking wisdom qua wisdom:


People seeking some single thing called "wisdom" have been fooled by grammar. Wisdom is just knowing the right thing to do, and there are a hundred and one different qualities that help in that. Some, like selflessness, might come from meditating in an empty room, and others, like a knowledge of human nature, might come from going to drunken parties.

Perhaps realizing this will help dispel the cloud of semi-sacred mystery that surrounds wisdom in so many people's eyes. The mystery comes mostly from looking for something that doesn't exist.


On the discontent of the over-achiever:


To me it was a relief just to realize it might be ok to be discontented. The idea that a successful person should be happy has thousands of years of momentum behind it. If I was any good, why didn't I have the easy confidence winners are supposed to have? But that, I now believe, is like a runner asking "If I'm such a good athlete, why do I feel so tired?" Good runners still get tired; they just get tired at higher speeds.

Wednesday, February 14, 2007

BSG 3.14: "The Woman King"

I did not like this episode. Specifically:


  1. In partial answer to Query the Second, it turns out treason and sabotage won't get you court-martialed, but it will get you busted down to administering a refugee camp in the basement.


  2. The last thing in the world Helo needed was for his God complex to get a little boost. This episode would have been much more dramatically interesting if he had turned out to be wrong, if the stress of being the "man (who's not Baltar) who loves a Cylon" was making him paranoid and delusional. The episode could have gone in this direction right up to the last minutes, but opted for the pat, feel-good ending instead.

  3. The Mystery Disease could have been handled in more dramatically interesting ways as well. As Matt Zoller Seitz suggests, if the disease had been incurable, this could have led to an interesting long-term arc that would mirror the AIDS epidemic. If the disease had been more virulent, the theme of public health vs. religious anti-medical conviction could have been developed further.


  4. Where is the constituency that will rise up in insurrection if Baltar goes on trial? Baltar publicly collaborated with the Cylons in the enslavement of humankind. It's as if the writers just take it for granted "every event has a real-world parallel" (in this case, obviously, Saddam Hussein) without going to the effort of setting the parallels up properly: remember, guys, the Galacticans were the insurgency and Baltar was Ahmed Chalabi...


  5. What's the deal with the titles, lately?

Tuesday, February 13, 2007

Developers Can Be Dicks (It's True!)

Take, for example, this bug that I mentioned a few days ago: the Mac OS version of the Thunderbird mail client doesn't integrate with the Mac Address Book. Many people find this annoying and a good many cite it as the One Single Reason They Don't Use Thunderbird On Their Mac.

In a past life, when my Mac was my main computer and Mail.app was getting on my nerves, I voted for this bug in Bugzilla. As a consequence, I am CC'd on any changes to the bug, which I find fairly annoying. Apparently, the maintainer find it un-bjørne-ably annoying:


Peter Van der Beken 2007-02-13 13:37:12 PST

is someone working on this with the intent of AddressBook integration happening sometime 'soon' (hint: not another 4 years, please ...)?

Yeah, I was. But comments like yours have finally made me decide that I'd rather not read more bugmail from this bug.


And, with that, he took his name off the bug and marked it UNASSIGNED.

A little history... This bug was first reported in April 2003. The first patch was committed in June 2003. Since then, there have been about 80 comments attached---a rate of less than 2 per month---and the patch has been modified more than a dozen times to fix bugs or keep it up-to-date with the trunk code. Over 400 people have voted this an important bug, making it the #5 most voted for open bug in the entire Mozilla project database. Despite all of that, there has been never an inkling that the bug fix will be incorporated into a release.

What gives, Mozilla? Has all maintainence been outsourced to unhinged maniacs?

Panser Anti-Bjørne

This documentary is now at the top of my Netflix queue. I suspect---just this once---Hilleary won't mind.



The quick summary: man is attacked by bear, man spends years building anti-bear armor, man seeks out Grizzly for a re-match, and then... ? I'll just have to wait and find out!

(Via Dave-of-the-Long-Box)

A Series of... Pipes?

Yahoo Pipes is pretty cool, though not, I suspect, as easy-to-use as advertised. The idea is that you can take RSS feeds and other "Web 2.0" content, process them in non-trivial ways, and end up with your own filtered, re-mixed, or mashed-up data stream. Things like: personalized Ebay price watches or Flickr photos inspired by New York Times headlines.

I've concocted my own, decidedly less ambitious Pipes: Overheard in New York w/o the Wednesday One-Liners (there's too many!) and Tapped blog posts by Mark Schmitt or Ezra Klein (all those other earnest liberals get boring). Here's another one, just for kicks: Grace's posts on design*sponge and BizBox in one feed.

If anybody can figure out how to make a Pipe that attaches headlines to headline-less RSS feeds, that would be sweet.

P.S.: I should probably give a "via" credit to TWiT---as if they need it---since I was inspired by their idle yapping to check this out.

Thursday, February 08, 2007

Ubuntu's GCC 4.1 and -fstack-protector

Ubuntu quietly made -fstack-protector (i.e., ProPolice support) the default in their GCC 4.1 binary. (I think it's also the default in OpenBSD.) Unfortunately, this breaks some builds, especially (I think) if you're trying to build a kernel module. If you get an error that mentions the symbol __stack_chk_fail_local, like the one below, you got bit by this bug.


/usr/bin/ld: .libs/cr_checkpoint: hidden symbol `__stack_chk_fail_local' in /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS) is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status


Either re-build your libraries with -fstack-protector or add -fno-stack-protector to CFLAGS. If this doesn't work, you can try gcc-4.0, which predates the introduction of ProPolice, but this probably won't work if you're compiling a kernel module, because they have to be compiled with the same compiler as the kernel.

Wednesday, February 07, 2007

Fi, O Fi

When I cut-and-paste from PDF into Emacs, ligatures come out weird. "specific" comes out . (Note that I had to make that an image, because pasting the same text into a Firefox window renders the ligature correctly. The gobbledygook is a control code that is properly understood by the standard GUI fonts. Note also that the cut-and-paste version is a ligature (fi), but the version I type in directly is not (fi).) Of course, there's ligatures besides "fi", and hyphenation is always a problem. Is there a magic Emacs incantation to make this work correctly?

Pop-ups, a Third Way

If you set Firefox to block pop-ups, you get this message when a page requests a pop-up:

This is accompanied by a Preferences button with the following options:

Why only "allow pop-ups for this site"? Why not "allow this one pop-up that I'm pretty sure I want to see, but protect me from future nefarious pop-ups"?

This properly belongs in Bugzilla, but I'm sure the developers would tell me I'm stupid and ignore me. See, e.g., this bug that I voted for, like, two years ago.

UPDATE: As I suspected, Bugzilla has entries for why this isn't really a bug and why you don't want what you think you want.

The Congressional Work Ethic

Correct me if I'm wrong: are these Congressmen (of both parties) actually complaining about how hard, nigh impossible, it is to work five days a week? Is Jon Tester ("We shouldn't complain about a little inconvenience. I got a lot of people in my state working two five-day weeks") the only Senator who understands how ridiculous that sounds? There are poor people who work two jobs. There are middle-income and rich people (and graduate students!) who work nights and weekends (but not mornings!)...

Here's an idea: if you don't like the hours, you don't have to be a Congressman! I'm sure your top-tier law firms and lobbying outfits will give you a week off every month.

Sunday, February 04, 2007

Animals Have Problems Too


Lots more fun here. (Thanks to Vijay.)