[ Content | Sidebar ]

plague and pestilence

October 2nd, 2005

I think (though I’m not completely sure) that we’re done with our lice infestation. But we’ve also had some diseases running through our house recently; the cold wasn’t so bad, but last weekend was Liesl’s turn to get the flu, and this weekend was mine. (Where by “weekend” I mean four or five days for Liesl, and at least as long for me.) I hope to return to normal existence at some point, but I can’t imagine when.

I really hope Miranda isn’t going to come down with it; that won’t be fun for any of us. She might have had a mildish version of it a few weeks ago; we’ll see, I guess. I should probably work from home for a few days even once my brain becomes capable of programming again, both to preserve my strength and to reduce the chance of infecting my coworkers. Pair programming is great for knowledge transfer, but disease transfer is a side-effect that I’d rather avoid.

a’s postmortem

September 28th, 2005

The A’s were eliminated from the playoffs last night. Unfortunate, though a third (or a half?) of the way through the season most people would have considered it a miracle that they’d come this close. A bit of a let-down after the amazing tear that they went on, though.

All things considered, I’m quite happy with the season. Their preseason nominee for Rookie of the Year turned in a credible but not stunning rookie season (no surprise; I didn’t think he had RoY material myself); what I was not expecting was for him to be the fourth best rookie on the team. I’d never heard of Dan Johnson before; I had heard of Joe Blanton and Huston Street, but I was not expecting them to be quite possibly the two best rookies in the league. (Hmm; hometown bias showing. According to Baseball Prospectus, though, Blanton leads the majors in VORP among rookies (edging out Joe Mauer; does he really qualify as a rookie?). Street is third in rookie pitcher VORP (behind Blanton and Toronto’s Gustavo Chacin), and among all rookies, he’s also behind Tampa Bay’s Jonny Gomes and Detroit’s Chris Shelton. Personally, I’d give him several bonus points for being a closer, though: that gives him fewer opportunities to accumulate VORP, and he was one of the best relievers in the league, rookie or not. I don’t care that he didn’t pitch as many innings as a starting pitcher: a rookie closer with a 1.63 ERA is stunning.) (Hmm: judging from that list, it looks like a bad year for NL rookies…)

And Bobby Crosby and Rich Harden both had excellent sophomore seasons; I was expecting that from Harden (though he surpassed my expectations somewhat), but I was not expecting that from Crosby. Also, Mark Ellis came out of nowhere and had a great season, and the Mark Mulder trade already looks like a steal (Danny Haren pitched just as well as Mulder this year, is younger and has more upside, and apparently one of the position prospects we got in the deal is really good). I’m still not thrilled with the Hudson trade, but he didn’t pitch as well as I was expecting this year (all the more surprising because he was in Atlanta), and Zito put in quite a nice season. The relief corps is in much better shape than last year (Justin Duchscherer was also excellent, with a 2.26 ERA). I have a hard time imagining a more solid starting rotation (Kirk Saarloos, our fifth starter both conceptually and statistically, had a 4.10 ERA), but it actually could get better: all five are young, all five will be around next year, and we have at least one more prospect waiting in the wings. And the Jay Payton deal turned out nicely.

Downsides: Eric Chavez continues to obstinately refuse to step up his hitting to the next level, and in fact rather regressed. I thought the Jason Kendall deal was a good one, but he sucked. (He hasn’t hit a home run in his last 800 at-bats.) More key injuries than I was happy with. Our outfield can’t hit. Too bad that Durazo was out all season, but that made an opening for Mark Johnson to come up, so I won’t complain about that too much. And, as good as they were in the second half of the season, they were awful awful awful for a while there.

So I’m looking forward to next year, and for years to come after that. I’m worried about the hitting; I’m worried that some of the pitchers won’t be able to match their numbers this year. But with so much young talent, with a well-stocked minor league system, and with Billy Beane, they’ll be contending for the indefinite future.

fire emblem

September 26th, 2005

A while back, I wondered if I’d ever buy another GBA game, and decided that the answer was probably no. Which would have been correct based solely on the quality of upcoming games for various systems, but I couldn’t exactly bring my copy of Resident Evil 4 on vacation. (Well, I suppose I could have brought it, but I couldn’t have played it. Just as well: it was hard enough to get to sleep with jet lag, and dreaming of (not-)zombies would not have been an improvement.)

So before we went on vacation I got a copy of Fire Emblem: The Sacred Stones, as well as the Zelda II remake. To get the latter out of the way first: I only bought it out of historical curiosity and the fact that it was on sale for ten bucks; I played it for a couple of hours, enough to decide that it probably would have been a decent game in its time, but that I have better things to do now.

Fire Emblem was better, though. I’d played the earlier GBA version up until around the next-to-last level, at which point I got sick of the length of its levels. It’s by the same team that does the Advance Wars series, and like it is basically a turn-based strategy game. The main difference between the two series is that Fire Emblem works the levels into an RPG theme, so you have persistent characters instead of faceless troops. Or rather, they’re persistent until they die; when they’re dead, they’re dead. So you end up playing levels not simply to win but to massacre your opponents without losing a single one of your characters. (Actually, it’s a bit more gruesome than that: because of the way the experience system works, it’s best for as many of your characters to take their cuts at an opponent before somebody finally gets to kill it.)

Which doesn’t thrill me, but I can deal with it. Of course, it combines this with a more traditional annoyance of RPG’s: you have a cast of thousands (well, dozens), but you can’t actually use them all in any given battle, forcing you to pick and choose among your characters to decide whom you are going to level up and whom you aren’t. This is not something that I enjoy, this is not giving the player a constructive choice of options: this is lazy game design.

I don’t have much else to say about the game. It was a good choice: I could play it when lying awake at night, and basically enjoyed it. By the time I was over my jet lag and had better things to do, I was also done with the game. I wouldn’t recommend that people rush out and buy it, though. Of the two series, I recommend Advance Wars much more highly; then again, the second game in that series was a total rehash, while the story elements in Fire Emblem meant the sequel felt reasonably fresh.

(Still playing the superb RE4 and Shenmue II, though I’m near the end of both. Just went out and bought Killer 7 and Battalion Wars.)

author improvements; dynamic typing

September 24th, 2005

Author pages now contain links to their books and series, and I can now handle books with two authors. (Not three, not four, just two. Or one, of course.)

I wrote my first generic Java method; whee. There was one mystery there: Book is a subtype of Entity, and at one point, I passed a Collection<Book> to a function expecteding a Collection<Entity>, and it worked. But then I did the same with a Collection<Series> (where Series is another subtype of Entity), and it didn’t work. I understand the latter, but not the former; is it a bug, or am I missing something? Anyways, making the method generic, expecting a Collection<T extends Entity>, worked fine, as expected.

I also got rid of a legacy exception that was annoying me; I’m still not at peace with Java exceptions, and there’s no sense doing extra typing because of code I don’t need any more. I did give in and pass a Collection where I would have liked to use an Iterator, though…

Hmm. Now I’m starting to wonder: exceptions and generics are both places where Java is statically typed and C++ is dynamically typed; in both cases, I like the C++ solution. I really should try a dynamically typed language sometime soon; maybe once I do that I’ll switch back to the dynamic typing crowd.

linux cameras

September 23rd, 2005

I finally got around to plugging the digital camera I bought before going on vacation into my computer. It’s only been just over two months since we got back; to put this in context, right before going on vaction we developed a roll of film that contained pictures from not only Halloween 2004 but also Halloween 2003. There is a reason why my pictures page hasn’t been updated in just shy of three years, though with luck that will change soon.

Anyways, I wasn’t surprised that I got it to work in Linux; I’d heard good things about gphoto, it’s a mainstream camera, and I’d just talked to Jordan the previous weekend about his successful experience with cameras in Linux. I was pleasantly surprised, though, to find that I didn’t have to lift a finger: I plugged the camera into the USB port, turned it on, and up popped a dialog on the computer.

So: yay for Linux. Nice to see that more of what the rest of the world considers basic functionality works there, too. Now I just have to sort through the pictures, remind myself how gimp works, and do a bit of cropping and resizing. The last time I tried this, gimp was easy enough to use; I just have to stop being lazy.

french history, arcades project

September 19th, 2005

One of the things I realized while reading The Arcades Project: I don’t know squat about French history. There was this revolution at the end of the 18th century; I don’t think I care about French history before then. (1789? Yes, says the wikipedia; I guess I should read that article, shouldn’t I?) It’s supposed to be very important, but the only facts that stuck are that lots of people were guillotined, and Napoleon came to power soon after. There was also a Napoleon III at some point (1840 or so?), but no Napoleon II worth mentioning; I don’t think their terms were consecutive, and for that matter I think Napoleon I’s term had a gap in the middle, but I don’t know what happened in the gaps. When I started reading about anarchism, I heard favorable mentions of the Paris Commune, but I never hear about it from mainstream sources. (I did get a book on it when I was there this summer; who knows when I’ll get around to reading it.) There was l’affaire Dreyfus some time around the turn of the century. At some point they turned into a standard democracy; I’m not sure exactly when, or what the key events were. I could mutter vaguely coherently about a few facts related to the world wars, but I won’t if for no other reason than the book in question doesn’t directly address that time period. (Though its writing was certainly affected by it…)

At this point, I imagine my European readers are rolling their eyes and muttering something about ignorant Americans. To which I would have to plead guilty. (Or maybe they’re not; maybe Europeans focus on the history of their country just as much as we focus on the history of ours.) I imagine that Americans approach other countries’ history from a particularly bizarre standpoint: we have this idea that a country’s history should basically start with a revolution, after which its political structure is more or less fixed. Which is, of course, not the norm in many parts of the world; for that matter, it’s not necessarily accurate even as a picture of American history.

Anyways, The Arcades Project cast a rather different light on French history, or at least Parisian history. It makes it sound like a constent hotbed of revolution, affecting the structure of the city itself. For example, according to the book, the streets were paved in cobblestones until the citizenry started using them as weapons (dropping them on the heads of the police or soldiers or whatever from high on buildings); and while I’d heard something about Haussmann and his boulevards, I had not heard that one of the reasons for widening the streets was to make it harder for people to build barricades across them. (Is it true that one of the motivations behind the architecture of Harvard’s Currier House was to make it easier to control student revolts?)

And the book is full of references to revolutionaries that I’ve never heard of. This is, I think, a systemic flaw in history as it’s taught in American schools; we can hardly help mentioning Marx and Engels, but we avoid putting them in any sort of context whenever possible, preferring to see them as an eccentric and tragic aberration in the course of human progress. Similarly, various utopian writers get mentioned, of whom Fourier is the only one that I’ve heard. (Should I read him at some point? I’ll probably never get around to that, but who knows.) Judging from A People’s History of the United States, we have similar blinders even towards our own history…

Really, just understanding the French Revolution would be a good start for me: like I said, American schools can’t manage to avoid talking about it, but it’s usually presented in a context of mindless bloodshed. Which begs the question of why the French stubbornly insist upon its importance. I think the subtext here is that, while of course we revere the American revolution, we also revere elites, and we don’t like it when they get killed. (Is it true that twenty times as many people were killed when putting down the Paris Commune as were killed in the French Revolution? But of course the deaths of the citizenry is hardly worth mention.)

All issues of politics aside, the book is wonderful. The book had been sitting on my shelf unread for a couple of years: it’s big, and I wasn’t that thrilled with Illuminations. But Samuel R. Delany has written interestingly about The Arcades Project, and of course Trilectic is enough to make me give Walter Benjamin another shot, so I finally gave it a try. I’d forgotten how much I enjoy books written as a series of disjointed paragraphs; it pulls out all sorts of fantastic tidbits (about things I’d never thought I’d care about: expositions, use of glass and steel in building construction, arcades, paving stones, boulevards, utopias, the stock exchange, …) vaguely relating the paragraphs but also letting them stand quite well on their own as interesting curiosities.

And the RIAA (and its other content-producer allies) would like to make books like this impossible to write in the future. Sigh. Just a month or two, I’d been reading some books that, among other things, emphasized the importance of sampling in creative works; at the time, I agreed intellectualy that sampling should be legal but wasn’t convinced that its loss would be so tragic (aside, of course, of idiocies like preventing people from having a snippet of a TV show appearing for 5 seconds in a movie background), but now I see how wrong I was…

volumes with their own titles

September 19th, 2005

My reading list continues to give me high-priority requirements: the gorgeous Kabuki: Dreams makes me deal with series whose titles aren’t simply Title of Series, Volume XXX.

It was easy enough that I got it out of the way right now, instead of waiting until the weekend.

caleb!

September 19th, 2005

Congratulations to Jordan and Tanya on the birth of their son Caleb on September 15!

french volumes

September 17th, 2005

I was planning to make dbcdb look beautiful (well, something other than butt-ugly) this weekend, but reality intervened in the form of books that I’ve read that didn’t fit into my existing setup. And keeping it up-to-date with respect to my current reading list is my current highest priority, so I spent a couple of hours today adding a few more features.

For Un monde pluriel mais commun, I had to add the ability to link to Amazon France. Which, fortunately, took about 5 minutes to get right; it turns out that (unsurprisingly) both sites use a similar link structure, so I could just swap in .fr for .com and I was all set. Actually, I feel a little uncomfortable with the way I’m handling the Amazon links: it’s not a priori obvious that clicking on the ISBN should bring you to Amazon. But I couldn’t think of a better key-value pair to contain the appropriate link, and I didn’t feel like breaking the key-value mold. Maybe I’ll come up with a better solution later.

The other problematic recently read book was Nextworld, Volume 1. I couldn’t treat that like a regular book both because, when I get around to reading and entering volume 2, I want there to be some connection between the two, and because I wanted the “Nextworld” part italicized in the title but not the volume part.

That took rather more work. The class structure used to be an Entity base class with Author and Book subclasses. Now I’ve inserted a BookLike subclass (for things with titles and authors, basically; yes, it’s a lousy name) between Entity and Book, added a Series subclass of BookLike, and a Volume subclass of Book. There are still aspects of the class structure that I’m not completely comfortable with (e.g. BookLike contains data members that end up being unused in the Volume case), but it’s the simplest way that I can think of to write the code now. (And this is far from a final form, but future changes can wait until I’ve added kinds of data to force those changes.)

Still, while that took more than 5 minutes, it was only an hour or two (1:48, subversion tells me), and the code proved quite capable of accepting such a change without much fuss. (I also took the excuse to delete some of the code from December that would have gotten in my way.) And there’s still one further high-priority change before I can get around to fiddling with CSS: I’m in the middle of reading a book with two authors, which I don’t handle properly. I’ll probably also take the time to add a list of books to the author pages: those pages are horribly bare right now, after all, and now that I’ve done something similar with series pages, I know what’s involved in carrying that out.

weird controllers

September 16th, 2005

When I first heard about the Nintendo DS, I thought it was a gimmick. And I still think it’s a gimmick, though one that’s doing surprisingly well: the system is consistently outselling the PSP in Japan, for example. (No idea how they’re doing in the US.) Part of that is due to cultural differences: some of the top sellers in Japan are quiz / teaching games, which presumably work well with the UI. But that’s not the only reason; when I first saw videos for Nintendogs, I finally started to get it. I’m really impressed by the amazingly tactile feel the game has, the way you use the touch screen to pet your dog, play tug with your dog, throw things for your dog to get, etc. And it’s extremely well done; it seems about as realistic a pet sim as I can imagine right now. (They use the microphone to good effect, too.)

Still, I won’t get Nintendogs, if for no other reason than that I’d feel disloyal to Yosha and Zippy were I to do so. But maybe I’m not the target audience for the DS, anyways; as suggested in Foxtrot last week, it’s expanding its audience beyond traditional video game players, and if it can do that, more power to it. And if the result is lots of experimentation in new genres, I’m all for that, too. And probably Animal Crossing DS will be fabulous, especially if you have DS-owning friends. Maybe that will be the game that convinces me to buy one?

Of course, the reason why I’m posting on this right now is the Revolution controller announcement. I have to say, I was not at all optimistic about that; I like standard video game controllers, and while Nintendo can experiment with a gimmick in the portable space, I don’t see how they can do that in the non-portable space and still remain a serious competitor there. But after seeing the teaser video, I’m completely sold. I love the idea of playing a sword-fighting game by swinging the controller around. Normal genres should be able to adapt profitably to the new controller – playing Metroid on a touch screen sounds like it would incapacitate my hands in about 15 minutes, but playing it with a joystick in my left hand to move and a pointer in my right hand to aim and shoot sounds like a great idea. (Plus, they’ll release a standard controller shell, for unimaginative publishers.) And if it manages to expand the gaming audience by allowing weird new genres (I love the bit in the video with two people conducting an orchestra), great!

Nintendo still has their work cut out for them: other publishers won’t necessarily want to take the time to think how to best use the Revolution’s controller, so they’ll have to carry the console on their own shoulders to an unhealthy extent. But their shoulders are more than capable of such a feat; it’s great to see them taking a chance like this.

one year

September 16th, 2005

I’ve been blogging for a year now. If the counters are to be believed, this is my 151st post, though it’s possible that I wrote some drafts that I deleted before posting. And I don’t seem to be done yet, despite the lack of posts this week. (We’ve been laid low by plague, while our scalps are not yet free from pestilence.)

Thanks for reading!

tao te ching

September 11th, 2005

This version of the Tao Te Ching is pretty cool: click on any character and you’ll get loads of information about it and its possible meanings.

Can you tell I’m spending a few hours going through my backlog of links to look at? Alas, going through the backlog is as likely to increase its size as decrease it, because of further tantalizing references linked to therein…

recycled knowledge

September 11th, 2005

This blog is remarkable.

Alas, its only feed is in Atom, which Gnus doesn’t understand. Hopefully in half a year or so I’ll know enough to be able to write my own feed reader in Ruby.

ruby on rails demo

September 11th, 2005

The Ruby on Rails demo is pretty amazing.

author pages, more fields

September 10th, 2005

My sample page now looks significantly different. The ‘Author’ field links to another web page (a very sparse one currently; more will be added eventually). And there are ‘Last Read’, ‘Rating’, ‘ISBN’, and ‘Own’ fields (all optional). The ISBN field links to an appropriate Amazon page.

A quite pleasant afternoon of programming, all things said. For historical reasons, there were already separate ‘Book’ and ‘Author’ classes that inherited from a common ‘Entity’ base class, so adding the author pages largely consisted of moving methods from ‘Book’ up to ‘Entity’. One of the methods in question was a ‘printField’ method; that method made it basically trivial to add more fields to the book pages.

And it’s getting very easy indeed to add new acceptance tests. If I want an acceptance test that checks that a new field is working properly, now all I have to do is add a new entry to the database where that field is present and stick a file ‘fields-NN.html’ (for an appropriate number NN) with the expected output. No need to modify the acceptance test proper at all, and that acceptance test is all of three lines long:

  #!/bin/sh
  source setup.sh
  run WriteFields

Hidden behind the scenes is functionality to compile the program, generate a target web directory, run the program with the output going in the target directory, do some wget calls to the web server I’m running on my laptop, and compare the results to the expected html output.

Which is pretty slick. I’m embarrassed to say that, at work, I don’t get my hands dirty with acceptance tests as much as I should, so I’m glad I’ve been getting the experience here. And I’m starting to understand how a tool like FitNesse could work, allowing a customer (an actual customer, not a program) to write new acceptance tests just by modifying some simple configuration files.

I’m also proud the test that checks that my Amazon links are correct by digging the link out of my web page, fetching the linked-to page from Amazon, and checking to make sure that it actually links to the book that it’s supposed to. So if Amazon ever changes the format of their links, my tests will let me know!

At this point, dbcdb is quite useful; the database now contains every book I’ve finished reading since I started the project, and the resulting pages have almost all the info I’d like them to have. The next thing I’d like to do is plug in an appropriate style sheet, because they look like crap; that will require essentially no programming, but I’ll have to learn more about cascading style sheets. (And acquire some design sensibilities, which is a good deal harder.)

I spent a little bit of time learning about Ant; I’m not sure I like it very much, though. In particular, one aspect of Java that I’m using is that different classes can each have their own ‘main’. This means that, if you’re interested in one particular program, you probably only want to compile a subset of the classes in your source directory. I don’t know if ant supports that, but the tutorials I’ve found online certainly don’t explain it if it does. Whereas make handles that sort of stuff with its eyes closed. But I can’t get make to handle dependencies correctly (I found another dependency bug, so now I do ‘ make clean’ in my first acceptance test, which means it takes more time than all other tests put together), so I guess I’ll have to move to ant eventually.

kepler’s r.i.p.

September 8th, 2005

Kepler’s Books in Menlo Park closed last week. It’s vaguely possible that it will reopen – a lot of people miss it – but I won’t count on it. This is sad. Not that I went there all the time or anything, but I suppose I would have a decade ago if I’d been living in the area. That difference being, presumably, is why it closed.

The conventional explanation is that it was done in by the one-two punch of Border’s and Amazon; I assume the conventional explanation is correct. A decade ago, there was a lot of talk about how the evil Border’s and Barnes and Noble were putting stores out of business. And, to be honest, I had no patience with those arguments. I believed that bookstores were going out of business – the number of bookstores in Harvard Square probably dropped by half at about that time. (Not that I quite understand the cause and effect there, since no Borders plunked itself down there; it was probably just a part of the gentrification of Harvard Square.) But I didn’t believe that having those bookstores replaced by a Borders was a bad thing.

Lots of the complaints were of the form “having bookstores disappear and be replaced by Border’s will limit your choice”. Which looked to me like baloney; the bookstores that I saw disappearing were the indifferent smallish non-specialist bookstores, so the only choice that I was losing was the choice of ten stores to get the same bestsellers from. The Borders that opened up in downtown Boston at about that time probably had five times the number of different titles available than all of the disappearing Harvard Square bookstores put together. And Borders always treats me like a potential purchaser instead of a potential thief.

And the good bookstores in Harvard Square stayed open: general ones (Wordsworth, the Harvard Book Store), specialist ones (Pandemonium, the incredibly customer-hostile Grolier, though I assume the latter is financed as a sort of hobby). And the Harvard Coop during that time went from a slightly larger indifferent quality bookstore to one that was quite striking both in terms of its selection and in terms of its architecture. They hired Barnes and Noble to manage it; in general, I don’t like Barnes and Noble, and there was a whiff of that taint in the new Coop, but only a whiff. (As far as architecture goes, I have to say that I like the basic Border’s two story with huge staircase/balcony architecture, even if it does feel a bit repetitive at times. Sure, the library stacks denizen in me would like two stories crammed full of books without a huge open space in the middle, but there’s something nice about the cathedral of books associations that the more open architecture gives.)

My coworkers will laugh at this, but it actually took me a while to accept the second punch, Amazon. Don’t get me wrong: being able to order any book you want is a godsend. But I’ve been special ordering books for two decades (I must have spent more time leafing through Books in Print than almost any teenager in the country), so this wasn’t a new concept for me. (It didn’t help that Amazon was charging extra for some of the more esoteric books.) But after a few years, I realized that it was a waste of my time for me to go into a bookstore with a list of fifteen books to special order, to have to read all the names to a clerk (Delany, D E L A N Y, no, no E, just N Y. Tales of Neveryon. N E V E R Y O N. Right. Same author: Straits of Messina. S T R A I … yeah. M E S S I N A. No, I’m not done yet. Is Babel 17 in print? B A B E L, like the tower. Oh well, too bad), all the time considering myself lucky if the clerk would at least tilt the computer’s screen so I can see the misspellings. Much much better for me to be the one sitting at a computer typing.

When I moved out here, I did about half my book buying on Amazon and half at bookstores, both in infrequent large purchases. Since then, my purchases have gotten smaller (and it’s been a couple of years since I’ve done a large single purchase at a physical bookstore), and a lot of my purchases in physical book stores have been at specialty stores or in general purpose book stores that are particularly good at some specialty. For example, the Sunnyvale Border’s has a particularly good computer selection, surprise surprise. (For that matter, their comics selection isn’t half bad, either.)

And Kepler’s ended up getting left out. It’s a bit far away for me to drop in randomly: now that I’ve stopped going to the go club, I almost never end up randomly in Menlo Park. I often went to Kepler’s when looking for a birthday present and don’t have any specific ideas, but even there Amazon is doing increasingly well for me, and of course saves me from having to deal with shipping. And they didn’t have a cafe, which doesn’t matter to me but seems to be the trendy but effective way for bookstores to improve their profit margins.

So I can see why it closed. And its closing won’t have much of a concrete effect on me. But I still miss it.

king felix

September 6th, 2005

We saw a game at Oakland for the first time this season. Liesl’s company has season tickets to the Giants, so we’ve been there, but not Oakland. The game featured Felix Hernandez, whom Baseball Prospectus ranked as their top pitching prospect coming into the season, against Joe Blanton, whose star had dimmed coming into this year but who has managed a 3.51 ERA over 28 starts, an excellent rookie year. (My vote is still for Huston Street, though.)

I hadn’t realized that Hernandez had already been up for almost two months. And he seems to be living up to his billing: seven starts is enough for a 1.59 ERA to mean something, and nothing about his performance yesterday made me think he’d been getting lucky. Admittedly, it’s hard to tell against the A’s: their offense these days seems to either score double digits of runs or none at all.

The Mariners had another recent call-up who put on a bit of a show: the strikingly-named Yuniesky Betancourt did quite nicely both offensively and defensively. Looking at the stats, though, the former at least seems like a bit of a fluke.

Random stat of the day: in three years of high school baseball, Ichiro Suzuki struck out a grand total of 10 times. And every single one of those strikeouts was on a called third strike.

dbcdb: generated using Java

September 4th, 2005

This page looks the same as it did last week, but it’s being generated using Java. Whee. (And I hope it will look a little different by the end of the weekend.)

I didn’t spend too much time programming: my time was mostly spent managing and understanding infrastructure. There’s now an acceptance test which runs all the unit tests, a program to run all acceptance tests. I had a little bit of confusion with the multiple programs named ‘java’ and ‘javac’ on my system, but now the right one is being called.

My most pressing current infrastructure issue is that I really don’t understand how javac works with dependencies. If Foo.java uses a class Bar and if Bar.java uses a class Baz, then it looks like, if I modify Bar.java and tell javac to recompile Foo.java, it will also recompile Bar.java, but if I modify Baz.java, then compiling Foo.java doesn’t cause Baz.java to be recompiled. Or maybe I need to go one level deeper, or maybe I’m misunderstanding things completely. (Hmm: maybe javac knows that touching Baz can’t change Bar’s interface, so, just from the point of view of compiling Foo correctly (as opposed to having it and all the code it calls run correctly), it isn’t necessary to recompile Baz in that situation.)

For now, I’m using a plain old Makefile. Which isn’t right, either, because dependency info isn’t expressed in the Makefiles, but I’m hoping that make plus whatever understanding javac has of dependencies will be good enough. (As long as I don’t do parallel builds; this machine only has one core, though, so that’s acceptable.) Clearly I should learn about ant; I’ll make sure to do that as part of my next iteration.

Most of the reason why I had to write so little code is that, for better or for worse, I saved the non-GUI code from my last attempt at this. Which was a very small amount of code, but I think saving it was a good move: as it was, the changes required for this iteration took more than my two-hour goal. I still had to learn a little bit of Java: I’d never written a unit test in Java for code doing output to a file before. (Or if I had, I didn’t remember.) Working from C++, the theory is pretty obvious – there must by some abstract “output stream” class – but I didn’t know how the details worked.

So I looked at the documentation (I really like javadoc), and, sure enough, we’ve got java.io.OutputStream. Except that it talks about byte streams, and Java (quite sensibly, but unlike C++) makes a distinction between characters and bytes. Nothing leapt out at me from the javadoc, so I pulled out a book and found that Writer was the interface that I wanted. It’s interface was a little sparse; digging around, PrintWriter is more useful.

My first reaction is that I’m not sure that separation is a great idea – why not put all the functionality on Writer? But the answer is presumably that doing so would make Writer a non-interface (since you would want default implementations of the extra methods), which would limit its flexibility given the way Java does multiple inheritance. It also raises the question of whether the function I’m writing should accept a Writer or a PrintWriter; I decided on the former, since it makes the function a bit more generic. Which I think is good design, even if it apparently isn’t always the Java way.

So that’s the function: what about the test? I seem to recall reading that Java has a class called StringBuilder that you’re supposed to use to construct Strings piecemeal, but it dosen’t have a relation to any of these classes. Digging around, though, there’s something called StringWriter which is a sort of Writer encapsulation of StringBuilder. Why doesn’t StringBuilder just implement the Writer interface directly, though? Beats me, not that I’ve thought about it much.

And then, after all of that, the unit test failed in a very mysterious way. At first I assumed that I was misusing the classes in question, but it turns out that the problem was in my understanding of Java’s compilation model, as mentioned above. Once that was all fixed, the acceptance test passed the first time; yay!

I’ll probably end up deleting some more of the code that I wrote in December, but it’s served its role as a crutch. And the new code is wonderfully pregnant with possibilities: I look at it and I can see how I’ll want to move this method to this class, and I’ll probably want to extract a class out of these functions, though I can’t quite see the details of the latter. But right now, the code is quite clean enough for the current desired functionality; I’ll do those refactorings as appropriate for future iterations. (I’ll certainly move some methods in the next iteration: that’s the right time, while right now is too early.)

I’m also starting to completely rethink the priorities of some of my early iterations. I had planned to, in the next few weeks, be able to save the data in XML and read it from XML. The truth is, though, that doing so won’t actually make life any easier for me as a Customer: it’s very easy to write Java code to add more books to the database. Right now, the relevant code looks like this:

  Collection collection = new Collection();
  collection.createBook("Walter Benjamin", "The Arcades Project");
  return collection;

and I can just add a more createBook lines as necessary.

And XML was always intended as a crutch: eventually, I’ll want to generate web pages on the fly, and it’s a bit silly to do that by reading in the entire book collection in XML format. Instead, it’s better to look up whatever book the user requests from a database. So why not skip the XML step, and go straight to using a database?

I haven’t made up my mind completely; I would like an excuse to get my hands dirty with XML, after all. But the truth is that I don’t need it here, and that, in places where I might need it (controlling my iPod, generating an RSS feed), having used XML here won’t help me directly. Also, XML is pretty simple conceptually, so I don’t get the feeling that I really need to get my hands dirty with it to have a basic understanding of what’s going on.

Unfortunately, I don’t know anything about the databases, so I’ll have some reading to do before I can implement those stories involving a database. So for now I’ll stay away from the relevant stories, and concentrate on stories that improve the web pages that I generate (more fields, more kinds of data, whatever) while I read up on the subject.

podcasts

September 2nd, 2005

I’ve subscribed to my first podcasts: Agile Toolkit and The Sound of Vision. It really is nice that I can enter the URL for an RSS feed into iTunes and it will go and fetch new shows for me. And the iPod is definitely the right place for this sort of thing: if the podcasts were just music, maybe I’d be willing to listen to them on the computer, but those podcasts are spoken word, and the verbal part of my by brain is already quite busy enough when I’m using the computer.

I found both podcasts because they were interviewing bloggers that I respected. I’m not sure how long I’ll keep on listening to them – in the former case, I don’t get the impression that there’s a huge backlog of stuff to be added, and the latter one is more business-focused than I’m really interested in. But I’m interested in business issues enough to give it a try for a while, certainly.

One interesting thing about the Bob Martin interview in the Agile Toolkit: he says that there’s a minimum set of agile practices such that, once you have them, you’ll naturally start adopting the whole kit and caboodle. His candidates are:

  • Very short cycles.
  • An open office.
  • Test-driven development, both at the unit test and automated test levels.

Once you have those, he says, the rest will follow: TDD naturally leads to automated integration, an open office naturally leads to pairing, short cycles with automated tests naturally lead to the planning game. (Though later on he says that maybe the planning game is a fourth necessary seed.)

I really would like to experience an open office at some point. My group is still not completely sold on pairing all the time, though we’re moving in that direction, in a healthy fashion (more on that soon, I hope). I can see how upping the chatter level and having more colleagues in your field of view would help: if you can see somebody, it’s easy to ask them a question, and if people are talking about something that you have something useful to contribute to, then it’s easy to jump in, and both of those could naturally lead to pairing.

And, on a different note, in a noisy room it’s a lot harder to concentrate when working alone than when working with somebody else, so you might as well pair just to get any work done! In Peopleware, DeMarco and Lister talk about how cubicles are bad because people need a quiet place to get into a state of flow, so people should have offices. I tend to think that cubicles are indeed bad, but that there are two stable situations: an open work area or offices. In the former, you get the benefits of free information flow; in the latter, you get the benefits of quiet and privacy. But cubicles don’t satisfy on either count.

Not that our current layout is so bad: there are cubicles, but they only have walls on two sides, leading to more open feel and encouraging more communication. (And less claustrophobia.) But I would like to try an open work area at some point. (With small rooms on the fringes for times when you need privacy.)

(On an unrelated note: lice are not my favorite of animals.)

first story

August 28th, 2005

I’ve implemented my first story; the results can be seen at The Arcades Project. (Of course, if things go as planned, then the appearance of that page will drastically change over coming months!)

I was pretty good about writing an acceptance test first. Which meant that I got to install Apache locally on my laptop, and learn how to configure that; there were some twists and turns, but I got it done. I got to learn a bit more about subversion, too; I got some error messages from subversion that I still don’t quite understand, but it seems to be working acceptably now.

And I’ve added some more planning web pages. I still need to add a bunch of stories to the product backlog, though.