Author Archive

Things to be thankful for

Posted by on Monday, 24 November, 2008

The great thing about being an amateur photographer is that every thousand photos or so, you get a winner. Here are my two sons.

Subversion over HTTP: soon with less suck!

Posted by on Tuesday, 11 November, 2008

So everyone knows my job at Google is to tech-lead the team responsible for our Subversion servers, as part of our larger open-source project hosting service. Thus, having come to a reasonable temporary stopping point with my previous 20% project, I’ve turned to a new 20% project: making Subversion itself better.

Specifically, I want to right a wrong, undo something I’ve felt nasty about for years. Subversion’s HTTP protocol is very complicated and unintelligible to mere mortals. Honestly, if Greg Stein and I got hit by buses, nobody would really understand what’s going on inside mod_dav_svn. What’s the backstory here? Basically, we tried to make mod_dav_svn implement a reasonable subset of DeltaV, which was a mostly-failed spec written long ago to implement Clearcase^H^H^H^H version control over HTTP. Eight years later, this extra complexity hasn’t bought us any interoperability with other version control systems — just a big headache to maintain and a icky performance penalty. The Subversion client, in being a “good DeltaV citizen”, isn’t allowed to directly talk about URLs that represent revisions, transactions, historical objects, and so on. Instead, it has to play dumb and continually issue a series of requests to “discover” opaque URLs that represent these concepts. It’s sort of like the client playing a formal game of 20 Questions, when it already knows the answers.

So after some chats with Greg Stein and others, I’ve collected ideas on how to streamline our existing protocol into something much more simple, tight, and comprehensible. Way fewer requests too. You can read our evolving design document and send questions/feedback to dev@subversion.tigris.org. Subversion 1.6 is planned to be released at year’s end, so if we’re lucky we’ll see this new protocol in Subversion 1.7 next summer.

Speaking of Subversion 1.6, however: a smaller sort of glastnost is happening there as well. In this new spirit of HTTP openness, we’re officially ending our policy of “not telling people how to access older revisions” over HTTP. If you recall, the Subversion book has always said:

Q: Can I view older revisions?
A: Your web browser speaks ordinary HTTP only. That means it knows only how to GET public URLs, which represent the latest versions of files and directories. […] To find an older version of a file, a client must follow a specific procedure to “discover” the proper URL; the procedure involves issuing a series of WebDAV PROPFIND requests and understanding DeltaV concepts. This is something your web browser simply can’t do.

I’m here to break the chains! Reveal the lies! RELEASE THE KRAKEN. In Subversion 1.6, we’ve gone and implemented an official public query syntax for accessing older (revision, path) coordinate pairs:

http://host/repos/path?r=REV
http://host/repos/path?p=PEGREV
http://host/repos/path?p=PEGREV&r=REV

This query syntax offers the same peg-revision concept that one sees in the Subversion commandline client. The first syntax means “start at PATH in the latest revision, then follow the object back in time to revision REV.” This works even if the object was renamed and exists at a different place in the older revision. The second syntax allows one to pinpoint an object with no history tracing: just jump to revision PEGREV, and find PATH. The third syntax is very much like running “svn subcommand -r REV path@PEGREV”: start at PEGREV, find PATH, then trace the object back into older revision REV.

In any case, this means source code browsers and other tools can stop using “secret” internal urls to access older objects.

Ramblings of a man on paternity leave

Posted by on Sunday, 26 October, 2008

[cue Doogie Howser theme music]

Dear diary,

Google is probably one of the only companies in the U.S. that gives an actual paid paternity leave (7 weeks!)… why, it’s almost as civilized as living in Europe. It not only gives us a chance to bond with babies, but try to reset our lives as we walk around in a sleepless stupor. Highlights of my downtime so far:

  • When mommies and babies are sleeping, it’s still possible to practice the banjo with the magic of Mike’s Mute, the mostly highly rated of mutes on all of Banjo Hangout (where the cool kids are!). The photos don’t do it justice. It just clamps onto the bridge and makes your banjo as quiet as an unplugged electric guitar… yet it still sounds like a banjo!
  • Did you know that the bottom of a newborn baby’s foot, being completely unused, looks exactly like the bottom of a hand? Delicate little lines everywhere — the same ones palm readers look for. It’s amazing to think that those features are hiding under the thick dead layer of smoothness on the bottom of adult feet. In that same vein, did you know that when a newborn straightens out his arm, all one can see is a single puffy tube of flesh? There is no visible elbow, no indication of how or where the arm bends… thus proving my scratchy elbows are a product of nurture, not nature.
  • As the temperatures drop into the 40’s in Chicago, our pantry is overflowing from potatoes delivered by our local community supported farm. It’s time again to dig into my favorite recipe for potato leek cheese soup. Seriously: just boil some potatoes and leeks, add cream cheese, and you’re in heaven. Blending with a stick blender is strictly optional; I can’t get enough of the stuff. Go make this soup right now.

Back to the diapers.

a Mercurial “super client”

Posted by on Tuesday, 14 October, 2008

One of the cool trends I’ve seen is the use of distributed version control systems as “super clients” against Subversion. You suck down the entire history of a Subversion repository into a local, private repository, do all of your commits locally, make branches, experiment all you want, then “push” back up to Subversion again. On the internet, nobody knows you’ve been using DVCS (or that you’re a dog.) What’s particularly cool about these bridging tools is that they allow users to try out DVCS before deciding to officially convert a whole project over. Or, if a project happens to be using Subversion but you still want most of the power of a DVCS for local work, it’s a perfect solution.

For all the blabbing I’ve done about distributed version control systems, I’m still a big fan of Mercurial. Of all the DVCSes, I think it’s the easiest to learn for svn users. It has a small, tight set of commands, and the community which runs the project is polite and sane.

In any case, there have been a collection of Mercurial-Subversion bridges available for the last couple of years, but they’ve all been deficient in various ways: either not capturing svn history entirely, or being unable to push back to svn correctly (or only very awkwardly). So I’ve pretty much stayed away. But today I want to plug a new bridge written by a friend of mine (Augie Fackler) who finally did it Right: he wrote a bridge called hgsubversion which (1) uses the actual Subversion API to pull history down (which is faster, more accurate, and long-term sustainable), and (2) actually knows how to push changes back to Subversion correctly. I want the world to be aware of this tool, because I think it’s the first Mercurial-Subversion bridge which deserves to be promoted into the popular ranks with tools like git-svn.

The tool is still young and not generally installable by the public (i.e. you’re not going to find any magic .rpm, .dpkg, .zip or .dmg for it yet)… but here are my cliff notes if you want to start playing with it.

Requirements

  • The latest (unreleased) Mercurial
  • Local Subversion libraries, at least 1.5, with swig-python bindings built
  • A Subversion server that is 1.4 or later

To get the latest Mercurial:

$ hg clone http://selenic.com/repo/hg hg-latest
$ cd hg-latest
$ make
$ sudo make install

To get the latest Subversion python bindings:

$ # if you don't have a binary package for svn-1.5-python-bindings already,
$ # this is a summary of subversion/bindings/swig/INSTALL instructions:
$ svn checkout http://svn.collab.net/repos/svn/tags/1.5.3 svn
$ cd svn
$ ./autogen.sh && ./configure
$ make
$ sudo make install
$ make swig-py # make sure you have swig 1.3 installed already
$ make check-swig-py
$ sudo make install-swig-py

To get hgsubversion:

$ hg clone http://bitbucket.org/durin42/hgsubversion/ ~/hgsubversion
$ cat >> ~/.hgrc
[extensions]
rebase=
svn=/home/user/hgsubversion
^D

To make sure you’re ready to go, do a final sanity check:


$ python -c "import svn.core; print svn.core.SVN_VER_MINOR"
5
$ # if you get something less than 5, you may have conflicting
$ # versions installed, and may need to set PYTHONPATH

Now you can clone your favorite svn repository, and use it locally:


$ hg svnclone http://svn.example.com/repos hg-repos
converting r1 by joe
A trunk/
committed as 24dfb7b51d606a921333e2b8f19a9a6aa5661a69 on branch default
[...]
converting r100 by jane
M trunk/goo
M trunk/moo
committed as 54dfb7b51d6d6a931333e2b8f19a9a6005661a62 on branch default
$

The tool currently assumes a ‘standard’ svn layout of /trunk, /branches, /tags, and then tries to pull them into sane mercurial equivalents. After you’ve made a bunch of local commits, you can push the changes back to subversion:


$ # First merge the latest public svn changes into your repository:
$ hg svn pull
converting r101 by pinky
A trunk/awesomefile
committed as e85afd44dc83d5df2599157096a95b0868de6955 on branch default
$ hg up -C
3 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ # We now have two hg HEADs, because the public svn changes are
$ # considered a different line of development from my own.
$ # For now, rebasing is preferred to merging:
$ hg up -C 9985f017b3ab
3 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg svn rebase
saving bundle to /home/user/project/.hg/strip-backup/c4b9dfce6b09-temp
adding branch
adding changesets
adding manifests
adding file changes
added 4 changesets with 4 changes to 4 files
rebase completed
$ # At the moment, each changeset is pushed separately;
$ # changeset flattening not yet implemented
$ hg svn push

√2 is irrational: proof by poem

Posted by on Tuesday, 7 October, 2008

i found this scribbled in chalk one day, on the sidewalk outside the University of Chicago math department:

Double a square is never a square,
and here is the reason why:
If m-squared were equal to two n-squared,
then to their prime factors we’d fly.
But the decomposition that lies on the left
had all of its exponents even,
But the power of two on the right must be odd,
so one of the twos is “bereaven”!

Here’s my translation of this poem. It’s a simple proof by contradiction.

  1. Assume sqrt(2) is rational, so sqrt(2) = (m/n)
  2. By squaring both sides and dividing, we get m^2 = 2*n^2
  3. Reduce m and n into sequences of prime factors:

    (p1 * p2 * …. * pv)^2 = 2 * (q1 * q2 * …. * qw)^2

  4. Apply the square to each element in parenthesis:

    p1^2 * p2^2 * … * pv^2 = 2 * ( q1^2 * q2^2 * …. * qw^2)

  5. Examine the right side, remembering that all p’s and q’s are prime numbers. One of the following things must be true:
    • There exists a q = 2. In which case, we can combine our lone “2” into it, giving us a 2^3 term.
    • There is no q = 2. In which case, our power of 2 is simply 1, i.e. 2^1.

    Either way, we’ve proven the the right side contains an odd power of 2.

  6. But, the right side contains only even powers of primes. Contradiction.

Isn’t math fun?

Dear Mycologists

Posted by on Sunday, 28 September, 2008

Following on the heels of this old post, can someone tell me what the heck this weird fungus is? It popped up on top of a pile of mulch in our backyard this week:

Hyphenated last names

Posted by on Monday, 25 August, 2008

Someone at work asked me today about how I liked having a hyphenated family name, because she was thinking of doing it herself. My reaction: BIG mistake, don’t do it.

I seriously regret hypenating my last name, because it creates an endless source of confusion.

  • When people ask you for your name, it takes ten times longer to explain, and always requires spelling it out and stressing the hyphen. Over the phone, it’s even more painful.
  • It tends to break computer systems. They hate hyphens. They hate spaces. Sometimes, if you’re lucky, computers just smash the two last names together, often truncating them anyway, since the combined last name is often ‘too long’.
  • Even when people see it printed correctly, it confuses them. If they see your printed name as “Benjamin Apple-Banana”, many will just call you “Benjamin Apple” or “Benjamin Banana”. It’s like their brain just can’t handle the concept of a double last-name, so it automatically drops one. Which means the whole romantic (or political) point of “encompassing both names” is basically lost on the public.

Really, I would gladly have changed my last name to my wife’s if I could go back in time. It would have made life so much easier.

And don’t forget: if you’re male and thinking of changing your last name, be ready for some serious institutionalized sexism!

American Tuna

Posted by on Tuesday, 5 August, 2008

O Albacore! Aged
and most prized, but highest in
deadly mercury.

So PC! From a
certified sustainable
tuna fishery,

And caught by “fishing
families” as well. As they say,
“Families that fish…”

Open the can, and
suddenly surrounded by
cats. A hopeful sign.

Bouquet: ocean brine,
like the bottom of a dock.
Cooked in its own juice.

Solid round of flesh,
not ground bits of cheap-o stuff.
Firm succulent loin!

First slice hard to dig;
tearing a single muscle,
my teeth sink right in.

Nice starting flavor,
like a fine steak on a grill
a long smooth middle

With just a whisper
of smokiness. But alas,
a sub-par finish:

Touch of bitterness
on the tongue. Perhaps the fish
was not so merry.

But au jus delights,
Blithely bathed in own fluids
Salty without salt!

So rich and intense,
there’s my albacore quota
for the remainder.

Recommendation:
Pair with soft autumn mornings
or moonlit beaches.

A Week in Portland

Posted by on Friday, 25 July, 2008

Just got home from OSCON the big Open Source computer convention in Portland. This is the only convention I attend regularly, and every year my buddy Fitz and I give talks about the culture and methodology of developing software in a “volunteer driven” environment (to put it kindly.) Our clik-and-clak routine of bickering, questioning each other, and finishing each other’s sentences has become a bit of a famous gimmick at this point, though we certainly never intended that to happen. Still, it’s one the reasons we record a podcast now and then.

Normally we only give one or two talks at the conference. After all, the real reason people go to conferences isn’t to watch presentations, but it’s to hang out in divey bars with other well-known members of your field and blather gossip. (Right?)

This year we got two 45-minute talks accepted, and were also talked into doing a 4-hour “tutorial” session with four other lecturers. Quite a bit of work! However, a couple weeks before the conference we were reminded that we had also agreed to be panelists in a public discussion, and then once we arrived at the convention we got asked to do another talk at an “unconference” for newbies. And then O’Reilly asked us to do a 40-minute video interview about the 2nd edition of our upcoming book.

So in total, that makes six talks in three days. Absurd! I was so busy running around to blab, I only had time to watch two presentations! And I developed a nasty head cold in the middle of it all. After three days of being hopped up on Dayquil and talking till I was hoarse, I told Fitz that next year we were going to do ONE talk. That’s it, no more. Our routine had officially crossed the line from “fun talky guys” into mouth-flapping whores. On our sixth talk, we had the pleasure of announcing to the audience that it would be the last time we even gave our “Poisonous People” talk, ever. If
anyone ever wants to see that talk again, it’s been up on YouTube for more than a year. 🙂

We had a lot of fun outside the conference too. We got to hang out with our buddies Jim Blandy (now a Portland native!) and Karl Fogel quite a bit, as well as Bryan O’Sullivan. I took a three hour self-guided walking tour of Portland with my big SLR camera too. I’m amazed at how beautiful the city is. I’ve never felt so “politically compatible” with a city before… every corner seems to have either a vegetable stand, bike shop, or microbrewery. Free range meat is absolutely everywhere! Upon wondering into the wondrous neighborhood of Ladd’s Addition to attend an ad-hoc bluegrass jam in the park, I discovered my very first Burgerville restaurant. I had never heard of this fast food chain before; it looks like Burger King or In n’ Out Burger, but if you read the signs it’s about as food activist as one can be. Local vegetables (Walla Walla onions), local cheese (Tillamook), non-frozen beef from free-pastured Oregon cow herders. I was in heaven.

Really, truly. I could move to Portland right now. I’ve never said that about another city before. I hope Chicago forgives me.

Photos are forthcoming!

Review of D&D 4th Edition

Posted by on Sunday, 20 July, 2008

Well friends, it’s time for my uber-geeky D&D post. I figure that if you can bear listening to me blab about version control software, banjos, and canned tuna… you can listen to my review of the new 4th Edition D&D rulebooks that came out this summer.

My affair with D&D has been on-and-off my whole life. I played 1st edition in 2nd and 3rd grade, then lost interest. I somehow missed the entire 2nd edition of the game completely. When the 3rd edition came out in 2000, I had just gotten back into the game by playing in NASCRAG touraments, so it was like learning the game all over. And now, eight years later, it’s time for the owners-du-jour to do another round of tax collection: everyone buy new books, relearn the rules.

As usual, the internet is full of people screaming about how the game has been ruined and destroyed, how Wizards of the Coast is evil and greedy and oppressing the freedom of gamers everywhere, forcing us into a treadmill of upgrades. Just like what happened back in 2000. 🙂 This time around, the biggest screams have been “OMG they dumbed it down into a video game!” There’s a grain of truth to the accusation, but I decided to give the new rules a good sincere try before condemning them. So I invited some friends over. Everyone rolled up a character, and we did a three-hour test game.

The verdict is: I really like 4th Edition. It was super fun. And everyone who played was raving about it as well. We’re talking about continuing the game now. The common quote was how somehow the new rules (with all the “powers”) essentially made 1st-level combat feel like 5th level. No more 1st-level magic users with 3 hit points and 11 AC expending a single magic missile, then hiding in a closet until the next morning. Nope, the 1st level wizard was kicking ass just as much as the paladin, and having a blast!

The new edition seems to be mainly a rewrite of combat rules, and done such that combat is much much much more fun. Not less complex, but way more entertaining. No more endless rounds of “I swing my sword for the 17th time” — it’s all about doing funky ‘powers’ each round, which keeps things interesting. (The comparison to World of Warcraft is justified here!) However, my players weren’t spacing out when it wasn’t their turn — instead, they were on the edge of their seats to see what kind of crazy stunts their allies were going to do. When was the last time you saw that happen?

The other big change is that using a battlemat and miniatures is sort of a requirement now. In 3rd edition, the board-game aspect was an optional enhancement, one which made combat more visually accessible and strategic. In 4th edition, many powers are described in terms of the grid (“explodes in a radius-3 burst”), so it’s kind of hard to not have one now. Maybe this doesn’t bug me, because I’ve always used a battlemat anyway.

If anything is to be criticized, it’s the writing and artwork in the new rulebooks. The art is cheap and cheesy looking. Imagine the worst fantasy art you can, and then take it down a notch. It’s almost like the cover paintings on bodice-ripping romance novels. And the writing is horrible as well: a much bigger font, with writing style apparently targeting 9 year olds. I think it’s noble that the new owners want to indoctrinate a “new generation” of roleplaying gamers, but in the process the books have turned into what reads like a cartoonish self-mockery of the entire genre. For example, here’s a lovely excerpt from the new Player’s Handbook:

“Imagine a world of bold warriors, mighty wizards, and terrible monsters […] ancient ruins, vast caverns, and great wild wastes where only the bravest heroes dare to tread. Imagine a world of swords and magic, a world of elves and goblins, a world of giants and dragons […]”

Gag me with a spoon.

Ultimately, though, if you’re an experienced D&D player, this corny writing doesn’t matter at all. There’s nothing stopping you from running a dark campaign, creating characters of real depth and motives, and doing serious roleplaying as you’ve always done. The only “new” thing here is excitement of combat; the storytelling and improv acting hasn’t been taken away.

As I was reading the rulebooks, I took notes as I went. You can read my notes here which compare the old and new rules. I hope they’re useful to people thinking of trying out the new edition!

I’m off to OSCON in Portland tomorrow, and Fitz and I are scheduled to give four joint presentations. I’m sure I’ll have blog updates forthcoming!