[ Content | Sidebar ]

maintaining a steady state of books

June 15th, 2007

In response to my previous post, Stuart asked: “So, what do you do with all your books?” The answer got a little long, so I’m forking it out as a separate post.

I don’t have any great solutions. But, if you assume a fixed capacity, there are basically two tacks you can take: get rid of existing books, and limit acquisition of new books.

For a while, I was successful in getting rid of existing books: I would go through my shelves, and, for each book, ask myself “what would cause me to reread this book?” (Or read it for the first time – at the time I started doing this, I owned way too many books that I’d never read.) If I couldn’t think of a good trigger, I would then ask myself “then why am I keeping it around?” Often, I didn’t have a good answer to that, either, at which point it would go on the stack to give away. And I still revisit my shelves periodically with this question in mind: if I ask that question about a book twice a year for five years, and I haven’t actually reread the book over those five years, then my brain is sometimes willing to accept that as evidence that, perhaps, I don’t need to keep the book around.

Also, it’s useful to remind yourself that it’s okay to make mistakes. If you give away a book that you want to read five year later, you’ll probably be able to find a copy five years later. (Which is one of the nice ways in which the world has changed in the last decade and a half!) There are certain rare out-of-print books that I’ll probably never give away, but if it’s some random novel from a non-tiny press, I’ll be able to track down a replacement copy if I want one. Which means that you shouldn’t sweat over being perfect: as long as you don’t just give away books willy-nilly, chances are that the replacement costs of mistakes will be much less than the savings from reduced storage.

This helped a lot. Having said that, in recent years, my rate of book reduction has slowed. Fortunately, we still have some amount of blank wall space in our townhouse. (True story: when moving to California, our first landlady gave us a choice between one apartment with windows on three sides of the living room and one with windows on two sides. We chose the latter: sunlight is all well and good, but we really needed the wall space for bookshelves.) So we’ll buy a few new bookshelves this summer, and I imagine that will last us for a while. (Miranda is actually the one who really needs more bookshelf space.) My guess is that we’re giving away enough books that we’ll last for another decade and a half or so without bursting at the seams, at which point Miranda will be living in her own apartment and we can take over her bedroom!

So that’s the “get rid of books” side. The flip side is: how do you make yourself happy about not buying tons of new books? One answer is the library: if I don’t have reason to believe I’ll want to reread a book or use it as a reference book, I check it out of the library if possible. (And Mountain View has access to a good interlibrary loan program, which I use pretty heavily – I miss Harvard’s libraries, but having interlibrary loan access to several decent smaller college libraries is good enough most of the time.) Another answer is to reread books that I already own: as part of the pruning books exercise, I’m making claims that I want to reread most of the books on my shelves at some point. Which means that I should be happy to test those claims by actually rereading them! If I’m finding that I don’t want to reread those books, well, that’s interesting information too.

For a while I was on a fixed schedule where I’d read a new book, then a book I already owned, then a book from the library. That was useful as far as it went, but I’m hoping that, now that my queue has gone away, I can relax that schedule, reading even fewer new books while still being happy. So if I’m in a mood to, say, reread all the Jeeves and Wooster books (which I already own), I can just go and do that without worrying about screwing up any schedule; if there’s some new book that I’m curious about right now, I can go and read that, but I’ll try to get it from the library most of the time; and I’ll try to browse random books at the library periodically so I get exposed to new authors.

I suppose I should set a target here, just to make my planning empirical. Maybe I should try to restrict myself to, on average, acquiring at most one net new book every two weeks? (Which I can meet either by not buying many new books or by giving away old ones.) I don’t see any reason why I shouldn’t be able to do that (if for no other reason than that work prevents me from spending as much time reading as I’d like); I usually buy 6 foot by 3 foot bookshelves, so if the average width of books I buy is a little less than an inch, then I’d only have to buy a new bookshelf once a decade under that plan. Seems workable to me.

finished book queue; rorty

June 14th, 2007

Looking back, I had my lean book-buying revelation more than a year ago. As I said at the time, “right now, I have … lots of books to read before I can start buying again”, and while I have hardly sworn off from buying books since then, I have made an effort to read down my stack of unread books.

And now I’m done: there are no books left in the stack of unread books that I’d bought before that time. Well, the main stack: there are still some French-language books from my last trip to Paris, not to mention the complete Pali canon (in a 45-volume edition with elephants on the spines) and maybe a hundred or so other unread books firmly entrenched on my bookshelves. Those latter stacks had already been filed away as “sunk costs” for some time, but the main stack contained books that I really did intend to read.

If I’d been asked to predict at the time what the last book in the stack was that I’d get around to, I probably would have guessed correctly. (I hope that the shock of my finally getting around to reading the book wasn’t the last straw for its author.) Which raises a question: am I ever going to get around to reading the third volume of Rorty’s philosophical papers? If not, is that a good thing or a bad thing? In the old days, I would have tossed it onto my next Amazon order along with 20 or 30 or 40 other books, and gotten around to it eventually. Now, though, I won’t get it until I feel like I really want to read some more Rorty right now. (At which point I’ll probably check it out of the library rather than buy it, actually.)

My guess is that I will read the third volume eventually: I’ve read enough philosophy over my life that I think I’d be a bit sad if I stopped completely, and Rorty’s quite interesting and readable as philosophers go. And I’m enjoying the second volume; it’s not life-changing or anything, but pragmatism is interesting enough to me that I really would like to dig into it somewhat more, because I get the impression that Rorty is saying lots of things that I really do agree with. Also, it’s complicated enough that I’d need to revisit his writings eventually, to test my vague memories with what he actually says, and to see where I should think more.

So that’s half of the question. What about the other half? I think that there, my answer is: if I don’t ever read it, that’s okay. I’m happy and confident enough with how I spend my time these days that I don’t think I need to worry about feeling insecure about not getting enough highbrow culture.

We’ll see how it plays out. While typing this, I’ve been browsing his works at Amazon, and there are a few interesting looking ones there that I didn’t know existed. (And I didn’t know a fourth volume of his philosophical papers was published earlier this year.) So maybe the answer is: I’ll actually read more Rorty sooner rather than later. Still not sure when I’ll get around to the next volume of his papers: it looks like it will take me about three weeks to finish this volume, and I don’t lightly spend that much time on a single book these days. But some of his other books are less dense.

We’ll see how it all plays out: in the meantime, I’m just happy that I have one fewer big queue in my life, and I’m also happy that I’ve stuck with this queue-removal plan for more than a year and it’s turned out well. Though at least one decent-sized queue remains, but that’s the topic for another post…

pasta procope

June 13th, 2007

It’s been more than a year since I posted a recipe: it’s not clear that anybody is interested in them, and while that doesn’t stop me most of the time, it seems particularly pointless in the case of recipes. Still, every once in a while, somebody comes over for dinner and wants the recipe for whatever we serve them, so the blog posts have done some good.

Anyways, we cooked this recipe tonight, as we do every month or two, it’s really easy and good (waiting for the water to come to a boil is the longest step), and I’m in the mood to food blog. So here we are again. We actually ate at the Procope restaurant when we were last in Paris; nothing like this recipe on the menu that time. Good food, though; not sure I’ll make a point of going back, but I’m happy to have gone.

One caution: this recipe leans heavily on oil-cured olives, and good oil-cured olives are hard to find. Actually, oil-cured olives in general are hard to find, unless you patronize high-end grocery stores; and many places that have them only have one kind, which may or may not be any good. So be warned: you may have to go through a bit of searching before finding some that you like. I suspect the recipe would be okay with, say, kalamatas, but I won’t guarantee it.

You don’t really need 1/2 pound of prosciutto, but we regularly use about 6 ounces when making this, and I’m sure the extra two ounces wouldn’t hurt. I’m not the biggest thyme fan; fresh thyme isn’t the sort of ingredient that we measure carefully, but I suspect that the amount I prefer is less than the 2 tsp called for below.


Pasta Procope, from Patricia Wells’ Bistro Cooking

1/4 cup freshly squeezed lemon juice
salt to taste
1/2 cup olive oil
8 oz prosciutto
1/2 cup oil-cured black olives, pitted
2 tsp freshly snipped thyme
grated zest of 2 lemons
black pepper to taste
1 pound thin pasta (capellini, angel hair, etc.)

Mix lemon juice, salt, olive oil in a small bowl. Combine everything else. (Except for the pasta, of course!) Cook the pasta, mix everything together.

sun street cred

June 12th, 2007

One other fun thing about the Fowler-DHH interview that I mentioned recently: about 37 minutes into the podcast, the conversation turns to large companies and their involvement in open source in general, Ruby in particular. They initially start off dubious about the concept, with Microsoft as their example, which made me wonder “hey, what about my employer?” And, right on cue, DHH brings up Sun: Rails may have started partly as a rebellion against some aspects of Java, but that doesn’t mean that the Ruby and Rails communities don’t appreciate JRuby. (Which just released version 1.0, yay!)

Not that it was a big Sun love-in, or anything: the discussion mostly went back to Microsoft bashing, spurred by their recent “253 patents” threat. That discussion was interesting from a Sun insider point of view, too: they speculate that some important people at Microsoft were really annoyed at those threats, but Microsoft is too disorganized to have a strategy in this regard. Which I can’t imagine happening at Sun right now: I’ve been really impressed recently at how coherent we’ve been on our strategy. Sure, we have a Chief Open Source Officer who’s doing a great job, but the open source support goes all the way up and back down. (I get the feeling that Sun wasn’t so coherent in the years before I showed up; don’t have direct experience, though, so I could be wrong.)

We still have a way to go, admittedly. There was a thread half a year or so ago on a red-bean mailing list in which some of the participants were annoyed at the open source talk coming out of Sun, feeling that our talk outpaced our performance, so clearly we have some work to do to build up our credibility. But I’m hearing more and more kind words from the community these days. Which speaks to the openness of the open source community, too: I’ve been very impressed in particular by how we’ve been welcomed by the free Java community. Clearly there are a lot of people there who just want the best free Java implementation that they can get, and are willing to accept help from wherever they can get it, not letting inertia and preconceptions get in their way. (Which has been evident for some time: I was floored by Tom Tromey’s proposal a year and a half ago saying that he thought the best thing for gcj was to throw away code that he’d spent a lot of time working on and replace it with the Eclipse compiler.)

And then I see Eben Moglen saying something along the lines of “In fact Sun could, moving forward, in principle be seen as the commercial avatar of the FSF.” Which is just amazing, and it’s not the only piece of support the FSF have given us recently. (Incidentally, I didn’t realize that Balaji was an open source supporter; he’s on the StreamStar team! And I see some other StreamStar programmers in that picture, too! Alas, StreamStar is not currently open sourced; I’d be happy to present my point of view on that should anybody care, but it has a lot more to do with the extremely small size of the team than with any active desire to keep the software proprietary, and I can easily imagine us open sourcing it in the future.)

I suppose I might as well get my Sun boosterism out of the way all at once, on the theory that people who are turned off by that stopped reading a couple of paragraphs ago. So:

  • Go Constellation! I’m far from a blade expert, but I get the impression that it’s quite a system: a good job of balancing processor, memory, I/O bandwidth (not sure how much I can talk about it, but we have some very impressive evidence to that end coming up soon), and a good job of avoiding proprietary lock-in. (E.g. using PCI express for I/O cards instead of inventing an interface that other people would have to license.) And while Opteron chips have served us well, I’m really glad to see a product with Intel chips launched, and that we can mix and match with Niagara as well. My favorite part, though, is the rack-sized blade chassis that you can see about 15 minutes into the third part of the launch video: I just like big honking products these days.
  • ZFS has been out for a little while now, but I’m glad to see that people are continuing to take notice of it. Here’s the most recent example that I’ve seen. Certainly none of my disk experiences over the last half year have given me any reason to doubt the excellence of ZFS’s ideas…

good fsck!

June 10th, 2007

I reported my problem to the author of fsck yesterday; today, I had an e-mail waiting for me, saying he thought it was a bug he’d fixed recently, and asking me to try a new version. I did, and at first it seemed to get stuck in the same place; while I was poking around and composing a response, though, I noticed that it had made it further, and the scan did eventually complete. (Reporting no problems.) So either the new version fixed the problem, or I wasn’t patient enough the first time.

Certainly nice to get such a quick response. Now I’m curious what caused the strange pause in the check – is the disk dying on me or something? I hope not… Though, even if it is, I have more disks like it lying around, and all the data on it should be stored somewhere else as well, so it’s not the end of the world if I have to replace it.

isolated podcast episodes

June 9th, 2007

I recently ran into a couple of interesting episodes (if that’s the term) of podcasts that I don’t regularly listen to. Hanselminutes had an interview with Martin Fowler and David Heinemeier Hansson; great stuff. Lots of good talk about design, beauty (I didn’t know that Japanese Ruby code apparently has a rather different aesthetic than American and European Ruby code), constraints.

One of my favorite moments was in a talk about naming: my understanding is that, in general, the Rails codebase is quite small, but apparently they spend some time on automatically generating plurals of English words, handling various exceptional cases, just to get table names and the like right. The reason why this struck a particular chord with me is that I actually have lines like this in my code:

  class AuthorWriter < Writer
    names(:authors, "AUTHOR")

Here we have various forms of “author” showing up three separate times; tomorrow, I’ll probably get around to adding a fourth time. Some of this is me being needlessly varied in my naming conventions, and maybe I’ll clean that up once I have the codebase converted from Java to Ruby and can get back to altering the database; having said that, I do want a table named “authors” and a class with “author” in its name, so some duplication will remain that would go away if I had a pluralization engine around!

The other neat one-off podcast was an interview by John Udell with Leonard Richardson and Sam Ruby. The two of them just wrote a book on RESTful Web Services, and I’d been thinking I should check it out from the library; I’m now thinking that I should buy a copy and read it sooner rather than later, because I’m starting to think more about that sort of thing, and am realizing that I have a lot more questions than answers.

The above are two of the podcast episodes that I’ve enjoyed the most over the last month or so. But I’m not going to subscribe to either podcast: most of the episodes are on topics that I’m not interested in, and iTunes doesn’t provide a particularly good mechanism for me to subscribe to a podcast feed but only grab isolated episodes. (You can do it, it’s just not natural.)

What I’m doing (at least for now) is subscribing to the podcasts in Reader, so the feeds get mixed in among my regular blog reading; if I see individual episodes that I like, I can copy them over to iTunes. Which also doesn’t work very well with iTunes: if the podcast is available through the iTunes store, then it’s easy enough to grab individual episodes once I’ve decided I’m interested in them, but if not, then iTunes sticks the episodes with my music instead of my podcasts, with various unsatisfactory consequences. Sigh.

Anyways, the main thing that I’ve learned is: I need to keep my antennae open for podcasts that I’m not interested in most episodes of, but that have occasional episodes that I’d quite like: I’m sure there are a lot of such podcasts out there, I just don’t know about them. Unfortunately, it’s not so clear how I’ll learn about them—I learn about new blogs by reading articles that are linked to from other blogs, but blogs don’t link to podcast episodes as often. Still, now that I’m actively looking for them, I doubt it will take too long before I have a reasonable stack of podcasts to choose from.

At which point, I suppose, I’ll have to prune my list of podcasts that I listen to every episode of, because I don’t have a whole lot of slack in my iPod listening time. (In fact, my queue was pretty out of control between the time I got back from vacation and three or four weeks ago.) But I’ll deal with that when it becomes a problem…

bad fsck!

June 9th, 2007

I just rebooted my computer, and it decided that some of my filesystems needed to have fsck run on them. (It had been more than 20 reboots since they were last checked.) And fsck decided to hang 4.6% through the initial check on one of them. Rebooting didn’t help: after every reboot, it noticed that it hadn’t checked the filesystem recently, checked it again, and hanged at the same place. (To be fair, I don’t know if it’s an fsck problem, a kernel problem, or what.)

No idea what went wrong, or how to fix it; I’ve e-mailed the author, and perhaps he can give me some suggestions. (It’s reproducible, and I’ll be happy to go through a few rounds to try to debug the issue.) Fortunately (I suppose?), the filesystem in question is where my backups live, and it doesn’t even include (either of) the backups of my home directory, so I can live with potential corruption indefinitely if necessary. Still, it doesn’t make me happy.

If anybody else finds themselves in this situation, a workaround is:

  • Make sure your computer has a root password, and you know it! (Not always the case in this sudo world.)
  • Type Ctrl-Alt-Delete when you notice the hang, and log in with the aforementioned root password.
  • Edit the line in /etc/fstab for the corresponding filesystem and set the sixth column (fs_passno) to zero
  • Reboot.

If you don’t know the root password, hopefully you have some sort of recovery DVD that you can boot from to get to where you can edit the fstab.

punch-out

June 7th, 2007

Punch-Out (or rather, Punch-Out!!, which actually apparently came in two versions, Punch-Out!! Featuring Mr. Dream and Punch-Out!! Featuring Mike Tyson, identical except for the sprites and perhaps sounds of the final opponent) is an NES game that I’ve been hearing about for a long time. So when it showed up on the virtual console and I was running a bit low on games to try, I thought I’d give it a try.

The virtual console buying experience was a little tedious, though I suppose it wasn’t any more tedious than necessary for a credit card purchase through your TV. (I don’t think I even had to enter my full mailing address, though I did have to enter my county.) I hope Nintendo is remembering most of that information on a secure server somewhere, so I don’t have to re-enter all of it the next time I refill my points. The download itself was very fast, which in retrospect is completely unsurprising given the size of NES ROMs.

And then there’s the game. It was fun. Nominally a boxing game, but it was mostly about pattern recognition. To start off, you have simple patterns: your opponent might be just standing there blocking most of the time, so you can’t do any damage. (And vice-versa.) But sometimes he pulls back his arm. If you just stand there, you’ll get hurt. But if you dodge, he’ll miss, and then you can punch him four times in a row before he’ll managed to block you again.

As you progress, of course, this gets more elaborate. In particular, later opponents often have special moves that knock you down with a single blow if you don’t do exactly the right thing (which can take a while to guess and can require precision to pull off), but if you do do the right thing, you’ll typically knock them down with a single blow instead.

I played through the first two series of opponents. By the end of the second series, I was getting a bit tired, though. That series was four opponents long; it took me ten minutes or so to get to the last opponent, and if I lost to him, I had to go back and fight the next-to-last opponent again. And if I lost three times, I had to start the series over. This meant that I only got a few chances each hour to try a new counter to the last opponent’s special move. Which was okay, actually, but when I got to the next series, and learned that it was six opponents long with the average difficulty higher than before, I could read the writing on the wall, so I stopped there.

Still, I can see why people speak favorably of the game. I enjoyed the time I spent on it; if I’d had more free time and less spending money, and was living in an era of primitive video game design, I doubtless would have finished the game. Sure, it’s no Super Mario Bros. 3, but what is? As it was, it was a fine way to spend a few bucks and a few hours; and I’m pretty sure I stopped playing at the right time.

more memory

June 6th, 2007

I finally got around to upgrading my Ultra 20 from .5GB to 1.5GB. Sun’s web site wasn’t very useful in trying to understand the machine’s somewhat picky requirements (something about the Opteron memory controller requires matching DIMMs, I believe), but fortunately Crucial’s excellent memory finder was up to the task.

As with the x2100, the DIMM slots were pretty stiff; I would have been nervous I was about to break either the DIMM or the motherboard if I hadn’t gone through this before.

Kind of amazing that I’ve survived more than a year with only .5GB of memory and with rarely running into much swapping, especially given that I run it 64-bit native. Or maybe not: it’s not like I’m doing much with the computer that I wasn’t doing with computers a decade ago. And .5GB of memory is 10,000 times as much memory as my first computer, though that one was admittedly not up to running Emacs or a web browser.

good pitching

June 6th, 2007

A couple of months into the season, I was not expecting the Harden-less A’s to have the 1st, 3rd, 11th, and 18th slots in AL starting pitcher ERA.

I am not, however, surprised that, despite that pitching performance, the only reason they’re four games over .500 is that they’ve won their last five…

The Indians are suffering from no such unbalance, fortunately.

this american life; iraq

June 5th, 2007

When I first started listening to podcasts, I checked to see if This American Life had one: I very rarely listen to the radio, but it is one show where I regret reaching my destination if it’s on the radio while I’m driving. Unfortunately, a podcast wasn’t an option: you could listen to the show for free over a streaming player, or you could pay to download episodes, but neither of those was a solution that I was willing to use.

I checked again recently, and I was pleased to discover that they’d added a free podcast. They only make the last week’s episode available at any given time, so you can’t use it to delve into their back catalog, but that’s okay with me.

The episode that I listened to on the way to and from work today, The Center for Lessons Learned, had some really striking moments. (It’s already vanished from the podcast feed—I didn’t get around to listening to it last week—but there’s always the streaming version.) The title is taken from an Army office whose job is to learn from the past; what a neat idea! In general, the episode is about things we might or might not have learned, taken from issues surrounding our current war.

About which, some random thoughts.

It seems to me that there might have been two defensible reasons to support going to war in the first place: either you thought it would be good for the American people, or you thought it would be good for the Iraqi people. I didn’t support the war at its inception because I didn’t believe either of those reasons: “good for the American people” in this context basically meant some combination of fighting terrorists plus preventing WMDs, and even at the time you could see Bush’s active dishonesty behind his claims to that effect if you just poked around a bit. (Saddam Hussein and al Qaeda working together? Give me a break. The Democrats still have a lot to answer for, in my opinion.)

Good for the Iraqi people was a bit harder. (And almost entirely absent from the administration’s original justification, though they’ve tried to stick it in there retroactively.) I’m quite willing to believe that Iraq was very much not a place where I’d want to live, and that the Iraqi people would have been better off with another government in place. From a pragmatic point of view, though, I wasn’t particularly convinced that we’d do a great job of bringing in a better government. I wasn’t sure, though, and the truth is that the pragmatic argument wasn’t what was important to me: it didn’t seem to be my job, or my government’s job, to tell the Iraqi people that they’d be better off with us changing their government. If I had reason to believe that the Iraqi people wanted to be invaded, I would have supported it; in the absence of such a belief, the idea of invading them for their own good seemed patronizingly paternalistic (at best).

Still, I didn’t have any particular foresight as to how things would actually turn out. Before the war, I read some articles saying that it could turn into another Vietnam; I didn’t seriously consider that the authors could be right, and was surprised at how quickly we won the war. And then things got worse, and I started to be more impressed by those articles. Now, my feelings are a bit more complex: it’s turning into a remarkable misadventure, and I’m sure many productive analogies with the Vietnam War could be made, but (from my naive point of view) the details seem quite different: here, we’ve conquered a country which is now fragmenting and descending (has descended?) into civil war, while there we never managed to defeat our single, well-organized opponent.

That is the past; the question now is: should we stay or should we go? Again, the possible justifications are the same. This time, though, few people seem to be able to take the “good for America” argument seriously. (Other than in the sense of “our ego would be bruised if we left”, a justification for war and occupation that I consider morally abhorrent.) The “good for Iraq” argument gets more plausible, despite our amazing attempts to undermine that. (Free tip to future occupiers: if you claim that you’re invading a country to save its people from being tortured in its dictator’s prisons, you should avoid torturing its people in the prisons that you set up!) While things are awful now, it seems plausible to me that if we leave, matters will get even worse in the short term, quite possibly a lot worse, and who knows about the long term.

But I still have the same misgivings about that justification as I did when starting the war. What it basically comes down to now is “you broke it, you bought it”. The problem with that here is that I don’t think the Iraqi people consider their country to be for sale. I’ll listen with respect to any case for “you broke it, you make it right”, as long as the discussion for what it means to do to make it right is focused on what Iraqis actually want. If they want military support, sure. If they want police support, sure. If they want training, sure. If they want goods, money, sure. But it has to be about what they want, not about what we want, not about assuaging our guilt by continuing to occupy their country over their desires. (And, it goes without saying, not about a desperate attempt by our president to cover his ass while simultaneously burying his head in that same ass.)

But what do I know about what the Iraqi people want? For one thing, they’re individuals, not some collective hive mind. For another thing, being human, they doubtless have conflicting desires; what if they want both to avoid further chaos and to not be occupied, and what if we can’t figure out a way where our departure won’t make things worse? Not good. Despite which I continue to think that the contradiction is the Iraqis to resolve, not ours. And that an urgent issue is to figure out what a cross-section of Iraqi society thinks would be best to do next. (And no, a puppet government doesn’t count as an adequate representation of a cross-section of Iraqi society.)

Having said all that, I can understand why others might say that, if we’d managed to get Hussein out and a good government in place, even over the Iraqis’ protests, it would have been worth it. Sometimes people need to get extricated unwillingly from a bad situation through an outside intervention, and if that’s true for people, why can’t it be true for countries? After all (as always, based on my admittedly shoddy understanding of history), we’ve done occupations and reconstructions successfully before: as far as I can tell, our postwar reconstructions of Germany and Japan worked out great. (Except for the whole partitioning Germany thing; I’ve been given reason to believe that we might have been able to avoid that, but I’m not an expert on the details.)

One of the sad things about the podcast was listening to people talk about how it could have gone better, if we’d just spent some time learning about what we were getting into and about similar situations in the past. Of course, prediction is always easier when it’s about the past, but there were people who had spent a lot of time studying what happens after wars end, and what actions lead to better outcomes, what actions lead to worse outcomes. But those in charge were too full of their messianic dreams to admit the possibility of imperfection (let alone disaster): in such situations, planning, learning, thinking is shunned as evil.

Can we do anything now to salvage outcomes? What lessons can we still learn from the past? I wish I knew; I wish much more that the people who are making decisions knew. But the debates seem completely uninformed by such studies, as far as I can tell. And I’m too lazy to do much digging on my own; so I to will fall back to my default position that being there isn’t good for us, and (much) more importantly the Iraqis don’t seem to want us there, so we should respect their wishes, get the hell out of there ASAP, start trying to heal our country and let them try to heal theirs.

puzzle quest

June 4th, 2007

Puzzle Quest is a combination of two genres that I quite enjoy separately, but never expected to see together: RPGs and puzzle games. Seemed like just the thing for me and, probably for Liesl; which latter guess proved correct, as evidenced by the fact that she’s sitting on the sofa playing it as I write this.

I liked it, too. The core gameplay mechanic is based on Bejeweled, an apparently phenomenally popular puzzle game that I’ve missed out on because of my console focus. There’s a screen full of different objects; you have to swap adjacent objects to make three (or four or five) in a row or column, at which point they disappear and the objects above them shift down, with new objects appearing at the top to take their space.

You use this mechanic to battle enemies, alternating turns on the same grid. One of the kind of objects is special: if you match skulls, you damage your enemy. Also, if you get four (or five) in a row, you get an extra turn. So the basic algorithm is pretty mindless: if there are any four-in-a-rows you can create, you match those first. Otherwise, if there are any skulls to match, you match them. Otherwise, you match something else.

And the something else is where more of the fun comes in. Some of the other objects to match are kind of boring: extra gold, extra experience. But there are also four colors of spheres that you can match to build up “mana”, which you can use to cast spells. And these spells are built into the gameplay: no matter what type of character you choose, you still have access to a wide range of spells (the fighter’s spells are just more focused on doing damage than, say, the mage’s spells), and you can get access to more via other means (capturing monsters, riding a mount). My favorite spell, for example, was one that did some damage to my oppenent as well as causing it to lose a turn. I tried to always have enough mana in reserve to be able to cast it: when I saw a move that looked great except that it would set up an attack for my opponent, I cast that spell first, giving me two moves in a row.

All in all, a good puzzle game. Not Tetris, or even Bust-A-Move, but enough to keep me happy for a while. As far as the RPG elements go, though, I was pretty nonplussed at first. The plot is, to be gentle, less than compelling, and there’s no wandering around towns. Or dungeons or overworld: you just move from area to area on the world map. Which is, of course, a time-honored tradition in alternate forms of RPGs (strategy RPGs and the like, e.g. Ogre Battle or Fire Emblem), but not what really draws me to RPGs.

Still, it was fun, and once I got twenty levels or so into the game, I was pretty well absorbed. (Not as much as Liesl: I had to wake up early in the morning on weekends to get to the DS before her.) A solid gameplay mechanic, enough plot trappings to hold my interest. And they made some good choices: for one thing, if you lose a battle, you can simply fight the same battle over again. So there’s no extra state that they try to preserve, no arbitrary penalties thrown in: you start every battle with full hit points. Also, they mix up the gameplay: battles aren’t timed (by default), but you get timed battles if you level up mounts, there’s a logic puzzle mode to capture monsters, there’s an endurance mode to learn spells from captured monsters.

And then, as I got into the final series of quests, I noticed that I’d stopped leveling up once I hit level 50. And my class’s level 50 spell, together with the spell I mentioned above, made me pretty much unbeatable. By this time, I’d put enough time in the game (20 hours? 30 hours?) that I was happy to just see it to the end, without finishing off every side quest. (Liesl’s finished them all off, though, and liked them.)

Quite good game. Which fits in well on the DS, too: no reason not to play it on a portable system, and it uses the screens and stylus well. (Having said that, apparently it works just fine on the PSP, too.) Nice to see niche games like this not only getting published but apparently turning out to be surprisingly popular.

i love ruby

June 2nd, 2007

Recent non-work programming projects: I’ve been getting back to working on dbcdb, converting the database editing part from Java to Ruby. And, last Tuesday, BayXP had a hands-on session where we all did some pair programming getting us exposed to Behavior-Driven Development in Ruby. (See the RSpec web page.)

I don’t have much to say about the details of this (BDD in particular I can take or leave), but I really enjoy programming in Ruby. I missed the previous month’s BayXP meeting, where they did BDD in Java, but I can’t imagine that the code they came up with was as simple as what we came up with this month. (Even setting aside the fact that Ruby makes implementing BDD easier by letting you add methods to Object.)

And the more I program in Ruby, the more I wonder how I could have been so blind to the fact that internal iterators are so much better than external ones. Or, in general, that I forgot how wonderful creating functions on the fly could be; while I still maintain that destructors are a fine thing, I don’t feel their lack in Ruby the same way I do in Java because I can write functions like

    def perform_and_close
      begin
	yield self
      ensure
	close
      end
    end

which I then use as in

    def edit(id, db)
      db[table_name].perform_and_close do |table|
	write_row(table.find_id(id)[0])
      end
    end

(And yes, you can put the body on one line, with slightly different syntax: I only wrote it that way to avoid making the lines too long.) Which really isn’t any more typing than creating and using an RAII class in C++. (For this example, at least; I don’t have enough experience yet to make general statements.)

I need to get back to programming on the weekends. I’ve done it twice in a row, which is a start; a streak worth continuing.

that was unpleasant

May 27th, 2007

Following a suggestion from Chris, I gave the desktop effects from Ubuntu 7.04 a try; not the nicest experience. To be fair, it warned me that the feature was experimental, and gave me a chance to turn it off right after selecting it; for better or for worse, though, I didn’t realize immediately that something had gone wrong. (I’m not sure that turning it off would have helped, though, in retrospect.) Basically, turning the effects on collapsed my windows from all my desktops onto a single desktop (which I didn’t worry about, I (correctly) figured that I could move them back manually), but also removed my window manager decorations. (E.g. the bar at the top with the window name, close box, etc.)

I put my windows back where they wanted; that let me see a rotating cube animation which kind of made me roll my eyes. (Not sure if I would have left it on or not.) Playing with windows and menus was weirder, though – there was this strange shaking effect, which was actively annoying. I could have just turned that off, but the box animation bit by itself wasn’t enough for me to want to use these effects, so I looked for a way to turn it off and restore my windows back to normal.

And I couldn’t find one. There were boxes to uncheck, so the effects went away, but my window decorations never came back. In retrospect, I suppose my window manager simply crashed, and maybe I could have found a way to relaunch it; I decided instead to log out without saving my session.

And then I logged back in, and still no window manager. To make things worse, the logout button stopped working! After randomly fiddling with things for a while, the logout window popped up; not sure if I triggered with it (by selecting a random, unrelated, system administration menu item??) or if there was some timeout.

The second time I logged out, I brought up a text console, did an ls -alrt, and restored the recently changed directories from backups. (Yay backups.) After logging back in, my window decorations were back, but not all of my startup items were there, and again I couldn’t log out! After a minute or two, though, the logout screen appeared, along with my remaining startup windows, and it’s been fine ever since. Not sure what happened to heal matters; I am not planning to experiment further.

All in all, I am nonplussed. For one thing, the bug (or bugs?) that I ran into were pretty bad; not clear how I would have fixed this if I weren’t backing up my home directory every night, and even with that, there were some delicate moments. Still, I’m willing to accept that there might be something weird about my configuration that’s triggering problems, though I’m not sure quite what, and they did warn that the feature is experimental. (It must work better for Chris than it did for me…)

Setting that aside, though, the feature is crap. It has two parts, one of which is meh and the other of which is actively annoying. Maybe this is a sign that desktops and fancy graphics cards don’t mix too well, but I can’t completely convince myself of that: translucency, properly done, can be kind of neat in a desktop, and I can imagine shadows and perhaps even mirroring having a place. But there was no sign of that, just shaking menus.

Not ready for prime time.

i don’t completely suck

May 27th, 2007

After my post yesterday, I picked up Gradius III again; this time, on my first try, I not only made it through the first level for the first time, I made it through the second level on that same first try. The latter is a fluke, but I am managing the former fairly reliably now. Though not as reliably as I’d like: I need to improve my strategizing/memorization. And to play the game in situations where there are few distractions from daughters and dogs: you really have to focus when the ships and bullets are flying.

I quite like the Wii classic controller, by the way. Great for games like this, with a huge D-pad.

And I made progress on Etrian Odyssey today. On the off chance that anybody reading this blog is going to play it, I will warn Spoiler Ahead! Namely, the monster at the start of the third level really is way too hard for you, but you can avoid it if you’re careful and make it to other parts of the level. Interesting touch, and I still find it a bit nerve-wracking; I don’t recall seeing a game before where most of the monsters are invisible random encounters but where the major monsters (rare, but more frequent than even mini-bosses from other games) are visible on the map and move around. So now I’m happy again: leveling up wasn’t that bad (it gave me some things to think about, since you really do have a lot of options in how you customize your character), but the real reason why I bought the game is so that I can explore the dungeons and draw maps.

I suppose I should explain the game a little further, given that I seem to be talking about it. It’s a dungeon crawler, targeted at people who spent the 1980’s mapping out dungeons (and other areas) in computer games. The nearest analogue that comes to mind is Wizardry: it’s all about delving deeper and deeper into a single dungeon, with a town at the top that exists only to give you a place to rest, save, get items, and reorganize your party. And by “mapping out”, I really do mean mapping out: your view is on the top screen, while the bottom screen contains a map that you have to draw yourself with the stylus. By default, the game will color in the floor squares that you’ve walked on, though you can turn that off; it is entirely your responsibility, however, to draw in walls, stairs, doors, chests, etc. (There are icons provided for this purpose, which you can drag to the map.)

As far as the party goes, you’re in complete control – no acquiring new characters through exciting plot developments or anything like that. You can create as many different characters as you want, choosing from nine classes (only seven are accessible to me now, though I have ideas about how to get the latter two); the leveling up system improves your basic characteristics automatically, but it also gives you customization options in terms of which spells to learn, which extra skills to buff up, etc. Quite nice, and means that, in practice, two characters from the same class can play rather differently should you choose different paths to level up along.

Plenty difficult, too – it’s not too hard to get into situations where some of your party is dead and the rest of you are trying to make it back up to the exit, and it’s also not too hard to get your whole party wiped out when exploring a new area. You definitely have to think about your approach to some of the monsters; I’m looking forward to having a well leveled-up party, where I’ll really have a range of approaches to consider when tackling a fight. I wouldn’t want most RPGs to be like this, but I can get into class/party management occasionally, and I really like the map-making aspect.

i am teh suck

May 26th, 2007

Just started playing Etrian Odyssey and Gradius III. And both are kind of kicking my butt. I seem to remember being decent at the latter’s predecessor, and finding its initial levels routine; not sure how much of my troubles are that the sequel may be harder, how much are due to my declining powers, and how much are that I need to memorize where every enemy enters the screen before the game will click.

As far as the former game goes, not sure exactly when I’ll get good enough to beat the tough monster at the start of the third level of the dungeon. Having enough fun right now leveling up characters from all the different classes, though, to maximize my options.

Happy with both purchases for now.

feisty fawn

May 20th, 2007

I just upgraded to Ubuntu 7.04; seems to have gone smoothly. Haven’t noticed any vast improvements, but that’s fine: I’d rather have a distribution that subtly improves frequently than one that saves up for big bang changes. Nice to be able to do it (in a supported fashion) by downloading packages over the net, instead of having to burn CDs/DVDs – that’s one aspect of Fedora that I don’t miss.

wii play

May 19th, 2007

Wii Play is a fifty dollar game packaged with a forty dollar controller. There’s not much point in buying it if you don’t need an extra Wii controller; if you do need an extra controller, however, is it worth paying an extra ten bucks to get the game as well?

My answer: sure, why not, but it doesn’t make a big difference either way. It’s a collection of nine minigames, each of which can be played with one or two players. I played through them all once with Miranda; we basically enjoyed it but weren’t blown away. I played through them all again in single-player mode, some of them more than once. I didn’t mind any of them (well, Find Mii was annoying at times), some were rather fun (Billiards, Tanks). I might have spent more time on it if, in the modes that get progressively harder, it had taken less time to get to the difficulty level that I found enjoyably challenging.

So I’ve spent maybe three pleasant hours playing the game, and I have a collection of two-player minigames that might get picked up again in the future. Fine for ten bucks (and I’ve already used the extra controller, my fourth one, so I’ve gotten use out of that aspect of the package, too); people without video game experience might appreciate the way it’s structured as a controller tutorial. (To that end, a Wii plus Wii Play would be a very good combo for some people: a console, two good introductory games, two controllers.) In general, though, not something about which I feel like going into depth here (any more than in real life).

weinberg quotes

May 19th, 2007

I’m in the middle of rereading Gerald Weinberg’s Quality Software Management series, which is motivating me to type various quotes on mailing lists that I’m on. Not sure that they’ll do much without the context (actually, I have no reason to believe that they did much for anybody even with the context!), but if I’m going to go through the trouble of typing it out once, I might as well reuse the effort.

From the first volume, Systems Thinking, p. 110:

I once was called in to consult on a troubled project that was missing all of its goals, much to the puzzlement of its project manager, Simon. As part of my visit, I attended a code review meeting that (against my advice) Simon also attended. Herb, whose code was being reviewed, took a lot of personal abuse from Simon to the point where his eyes started watering. I called for a “health break,” and during the break, Simon came up to me and asked, “Does Herb have something in his eye?”

“Why do you ask?” I replied.

“Well, I noticed that there was water coming out of his eye.”

From the third volume, Congruent Action, pp. 60–61:

If you are acting incongruently, you are likely to trigger incongruent reactions in others. Rather than blaming them for incongruence, ask yourself, “What could I be doing to contribute to their behavior?” Here’s how it worked for Parson, one of my students:

“I was telling one of my project managers that I had to see a plan to get her project back on schedule. As she handed me a folder containing her revised project plan, I became aware that the papers in her hand were rattling. That caught my attention, and I thought, ‘How strange that the papers should rattle like that.’ Looking for an explanation, I noticed she was trembling, that her face was ashen, and finally that her eyes were wet.

“My first thought was, ‘Oh, she’s sick!’ but then I remembered the idea from class that she might be reacting to me. That seemed ridiculous, as I thought I was merely talking to her normally, but I decided to check it out.

“The first thing I noticed about myself was that I was gripping the edge of my desk as if it were a safety rail between me and the Grand Canyon. I thought I should loosen my grip, but then I realized I would probably fall on my face toward her if I did. All this while I continued talking to her about the project plan, until I noticed that I was actually shouting and banging my other fist on the desk. That’s when I had my big AHA!”

From the second volume, First-Order Measurement, p. 109, defending the definition that “Quality is value to some person”:

Why is this definition so troublesome to some people? There are people in the world whose strongest desire is to find perfection, the one right way. Many of these people choose to work with computers, and particularly with software. They don’t like the idea that quality is relative – to people, to place, to time – but it is.

And again from Congruent Action, p. 196 this time:

Avoiding blamers works if you don’t have to deal with them again, but this is exactly the opposite of engaging. If your work requires that you engage the blamer, you need to learn the method of the aikido masters when dealing with all forms of attack, including blame:

When someone hits you, he is extending his ki toward you and it starts to flow when he thinks he will hit you — even before his body moves. His action is directed by his mind. You don’t need to deal with his body at all if you can redirect his mind and the flow of his ki. That’s the secret; lead his mind away from you and the body will folow.

In aikido, you lead the mind away by physical means, though these are always as gentle as possible. The idea is not to further upset the person or draw more attention to yourself, as stiff resistance or a punch would do. In fact, skilled aikidoists often disable their attackers without even touching them, which of course is what you want to do with someone who is blaming you.

Blaming can be handled in the same way, first by yielding, but in such a way that the blame is unable to harm you. Done properly, this surprising move engages the blamer’s mind, so that you can easily change its direction. For example, suppose that an employee blames you for his failure to develop a specified function. “You didn’t tell me that this function was part of the spec,” he screams. Although you remember telling him, you don’t try to deny the allegation, which only focuses his blame more firmly on you. Instead, you may say, “If you didn’t know it was in the spec, I can certainly understand why you didn’t develop it.”

Saying this, you have agreed with his anger without accepting his blame. Next, you redirect the energy of this blame (the ki, in aikido terms) into something more productive. You have aligned with his energy, so you can push from behind rather than resisting it from the front. You might say, “What’s the best way for you to be informed of functions to implement?” This makes you collaborators, rather than opponents, by turning the energy toward preventing the problem in the future, rather than belaboring the unchangeable past. Even better, you have not become a blamer yourself.

rejection in person; printf debugging

May 16th, 2007

One of the least pleasant aspects of hiring is rejecting candidates. (More actively unpleasant for them than for me, to be sure.) It’s something which, until recently, I did almost exclusively over e-mail.

Sometimes, rejection over e-mail makes sense. I typically put candidates through up to three stages of filters. (Not counting the initial resume screen.) The first stage is a sanity check over the phone: is there some obvious reason why this situation is a misfit that I didn’t figure out from the resume? Almost everybody makes it through this stage; in the few places where a candidate doesn’t make it through this stage, it’s because it’s clear to both of us that their goals aren’t a fit for this position, so we agree that it’s not a match, and it’s simply not a matter of me rejecting them. (One could argue that I should make my phone interview stricter and reject more candidates at this stage; for better or for worse, I’m not doing that yet, and it’s tangential to the issues in this post.) The third stage is a half-day team interview; in this situation, my team discusses the candidate as a group after the interview is over (usually the next day), so I’m simply not in a position to deliver an immediate verdict to the candidate.

The second stage is the tricky one. This is a one hour in-person interview, where I ask some questions and have the candidate do a bit of programming. Sometimes, after the end of the interview, I’m genuinely not sure whether or not I want to bring the candidate back. More frequently, however, I am sure, and the answer is “no”. I can’t remember having second thoughts about my initial no reaction at this stage, so why not deliver the news then?

I think my actions started to bother me because of some blog posts that I’ve read recently, but I just looked at the usual suspects, and I couldn’t find any relevant posts. Certainly one reason why I’m thinking about this, though, is that I’m in the middle of rereading Gerald Weinberg’s Congruent Action. I can’t claim that I’m acting congruently in this case: I don’t believe that it makes job candidates any happier to have to wait and wonder for a day or two. Nobody likes being rejected, but you might as well get the news as soon as it’s available. The only reason why I’m delaying is to avoid in-person awkwardness; it’s just a sign of lack of courage on my part, with no obvious benefit to anybody.

So today I rejected two candidates in person. And, actually, it turned out rather well: both were disappointed, but both took it well, and both asked for advice about what they could have done better. In retrospect, it seems that I haven’t been saving myself any grief: all I’ve been doing is elimimating a potential learning opportunity for the job candidates. (Which raises the question: what learning opportunities might my actions in this regard be costing me?) Nice to have immediate positive reinforcement like that: I will try to continue to behave this way in the future. (And I should spend some time thinking about how to politely reject people in person.)

To be sure, I don’t claim to have any great pearls of wisdom on what the candidates could have done better. But, in time-hallowed blogger tradition, I won’t let that stop me from sharing my thoughts on the subject. The interesting thing about this case was that both candidates failed for the same reason: neither was completely hopeless, their initial attempts at a solution were both reasonable, but both floundered significantly when debugging. (Learning about people’s debugging skills is actually my goal in the programming question: I’m always a little disappointed when people solve the problem without making a mistake, because I know that, no matter whom I hire, they’ll make programming mistakes with some regularity, and I want to see how they deal with that.)

And, in both cases, it seemed like they didn’t know what they were looking for when debugging, or indeed when testing the program before discovering that debugging is warranted. (I tell them to implement a function and do enough testing to convince themselves that it was correct.) I suspect that both of them could be helped by taking a more scientific approach to debugging.

Sometimes, scientists are just gathering data: poking around, seeing if they see anything interesting. But science really progresses when people are making and testing hypotheses. Make a prediction that is concrete enough to be testable, to be falsifiable, and then test it. If the test results match your prediction, that’s always fun; if not, though, you’ve still learned something concrete, and can use that to make further hypotheses.

And this works for debugging, too. At the very basic level: if you think something is wrong with your code, you should know what you expect to have happened, so you can tell whether or not something really did go wrong! But it helps to make concrete predictions at a more refined level than that: “we know that something went wrong overall because we saw X instead of Y. If the problem isn’t in this part of the code, then expression E should have value V, whereas if it is there, then E should have a different value”. If you do this a few times, you should be able to zero in on the problem quite quickly, much faster than you could have by just looking at the code and hoping for inspiration.

This helped crystallize one thing that I think is wrong with printf debugging. Many people’s first reaction, when confronted with misbehaving code, is to sprinkle printouts throughout the code and hope that enlightenment results. This can be great, if you have specific hypotheses about what the output of those messages should be. I think that many people, though, don’t really have specific hypotheses in mind, just a vague feeling of values that they’re interested in. When this happens, printf debugging doesn’t lead to answers very quickly: the messages give you a lot of data, data that can easily lead you down all sorts of unproductive paths, data that can fool you into thinking that you’re learning something when you don’t really know what that data represents. (I suspect that debugging with a debugger is less likely to lead to this problem, if only because it takes more effort to generate lots of values, so you’re more likely to spend time thinking about what values you want to generate.)

Maybe I’m unfairly characterizing printf debugging, but I will stand by the value of concrete hypotheses when debugging. Which raises the question: if it’s so good when debugging, can we use the same ideas when writing new code, code which we don’t yet have reason to believe is incorrect? The answer is yes, of course: that’s exactly what test-driven development is all about.