[ Content | Sidebar ]

populated database

March 5th, 2006

I’m now fully populating the database with information from my collection. It took longer than I expected; I’ll keep that in mind the next time I plan to work in a unfamiliar area. (It wouldn’t have been so bad, of course, if I were working in chunks larger than an hour or two at a time.)

The process was reasonably pleasant, and I ended up with a nice abstraction layer hiding the details of the SQL code. Some sort of layer was necessary just for testing purposes, though perhaps I could have found a pre-written testing layer. But writing my own testing layer wasn’t very hard – right now, I’m using a very small subset of JDBC, and doing just a handful of SQL queries – and it actually ended up making the code much more readable. For one thing, it helped me make a clean separation of SQL code from non-SQL code – I only used java.sql classes in three short source files, and the only job of those files is to translate into java.sql classes. (For the curious, they are implementations of abstract interfaces called SqlRow, which is an abstraction of a single row in a table; SqlRows, which is an abstraction of a collection of rows in a table; and SqlSource, which is an abstraction of a connection to a database.) And, for another thing, the abstraction layer gave me a convenient place to translate from my custom types into standard types – otherwise, I’d either have had to come up with a layer whose only job was to do that translation or done the translation by hand in many places.

Maybe the single most annoying thing was handling dates. I was aware that Java has a class java.util.Date which is now frowned upon, in favor of a superior class java.util.Calendar. And I’m even somewhat sympathetic to that idea – it’s good for people to have to deal with internationalization issues, and time zones are certainly part of that. But I don’t care about time zones for this project – all I care about are dates, and I can’t say that I’m too interested in the argument “not everybody uses the Gregorian calendar”. So the upshot was that I had written my own Date class (which was useful for other reasons, e.g. to handle books that I’m in the progress of reading right now).

But when writing out to SQL, I wanted to do things the appropriate JDBC way, which meant using its class java.sql.Date when writing out SQL dates. I was hoping that I could easily convert from my own Date class to the JDBC Date class – after all, an SQL date is just a date, it doesn’t have a timestamp, so there’s no need for, say, abstractions to handle time zones. And the JDBC Date class does have a constructor taking a year, month, and day, which I could have used, but it’s marked as deprecated. Instead, for better or for worse, you’re supposed to use the constructor whose argument is the milliseconds that the date started after January 1, 1970. (The argument can be negative, for dates before 1970, though the docs weren’t crystal clear on that matter; they also mutter something about normalization, which I can’t say I understand, either.)

After a while, I finally came up with the correct code: the right thing to do turns out to be

new java.sql.Date(new java.util.GregorianCalendar(date.year(), date.month() - 1, date.day()).getTimeInMillis())

Which is wrong on several levels. For one thing, when converting from one abstraction of a date to another abstraction of a date, I shouldn’t have to talk about milliseconds. For another thing, “getTimeInMillis” is a lousy method name. And for a third thing, why are months numbered from 0 to 11 while days in a month are numbered from 1 to 31? Sigh. I am glad that I’m starting to understand how to use Java dates “correctly”, but I’m not impressed with this aspect of JDBC’s design.

Anyways, I’m pretty sure I have the database populated correctly now. (And doing so turned up a couple of mistakes in my database schema, too.) The next thing is to write code to read from the database. I’ll have a bit of free time in the middle of the week, so I’ll be able to get it started soon; at first I was optimistic that I’d actually be able to finish it in the middle of the week, but now I’m thinking it will be a bit trickier than that. If it were just a matter of writing JDBC code to read from a database, then I don’t think that would take too long – it would take a little while, because I’ve never done that before, but I think I understand all the ideas, and have a pretty good idea of what most of the new necessary abstractions are.

(To be sure, I’ll probably spend a fair amount of time playing God of War instead of programming. Good game, though not quite as superb as some people make it out to be; not something to play while Miranda is around, though, while I can program when Miranda’s around, so I’ll probably spend a fair amount of time on that. And I have some blog reading and writing to do; in particular, I want to talk about the stunning Killer 7.)

But, setting aside other matters competing for my time, the next step will also force me to approach certain notions from a quite different angle than I’m doing now. For example, right now, when I create a book, I add that book to an internal table attached to that author, so that, when I ask the author to generate its HTML page, it can list all the books by that author. But, in the new world, the right way to generate that list is to look it up in the database; so, instead of keeping a collection of Books in each Author, I’ll either want each Author to contain a pointer to some sort of database abstraction, or I’ll want to pass a database abstraction to the method on Author that generates the HTML. Right now, I’m leaning towards the latter, but it’s not entirely obvious to me what the pros and cons are; I can easily imagine proceeding a fair way down one path, realizing that it’s a mistake, and backtracking and heading down a different path. (Hey, I just thought of a way to get the former to work well – each entity (Author, Book, whatever) already has a ‘Key’ associated to it; I could stick the database backpointer in that Key. That would only require minimal alterations of my current code, and it’s not immediately obvious to me that doing so would be inelegant.)

I am looking forward to the day when I can get back to adding new features. I really want to add a list of links to each entity, so I can have pointers from dbcdb to the blog, not just pointers in the other direction. And I just finished a book with three authors, which I currently can’t represent. And I’m thinking that it’s time to add more media types – CDs, certainly, and eventually DVDs. And at some point I want to switch to Ruby: I already suspect that working in a typed language will make my next step harder than it could be.

bok bun ja

March 5th, 2006

Last night, I had dinner with friends at Korea House in Santa Clara. (Which I recommend.) They had a raspberry wine on the menu, which I decided to try; it was okay, but the best part was the explanation of the name (punctuation, grammar as in the original):

A hungry monk, eating wild black raspberry on the mountain by chance found his chamber pot turned over while urinating the follow morning. He knew his urine was too strong because the wild raspberries had reinfonced his stamina. As a result, the fruit was first called ‘Bok-Bun-Ja’, ‘Bok’ meaning ‘turning over’ combined with ‘Bun’ representing ‘chamber pot’ and ‘Ja’ which stands for ‘man’.

shopping for computer

March 4th, 2006

I just got back from a shopping trip for accessories for the Ultra 20. I ended up at Micro Center, which was a good choice – fine price and selection, focused on computers (unlike, say, Best Buy), and not only do they treat people who enter in their store as potential customers instead of potential thieves (which is why I refuse to go to Fry’s), they even have a good number of sales staff (unlike no end of stores out there). I will be happy to patronize them in the future.

So now I have a monitor (19 inch 1280×1024 LCD, nice to see how cheap those are), a keyboard with a touchpad built in (good thing, saves me from having to find a pointing device that won’t kill my hand and figuring out where it will live), and a few cables. And I was in a good mood, so I bought an external DVD writer (hmm – why didn’t I buy an internal one? I thought I had a reason for that choice, but I can’t remember what it was), so I can back up the computer, and a couple of external hard drives. The main purpose for the latter is to back up my CD collection – a lot of the CDs are starting to go south, and I’d rather back them up raw instead of as MP3s. (Disk space is cheap, after all.) And having that in an external hard drive means that I can store the backups off-site. (We just got a larger safety deposit box; I have to fill it up somehow!)

The Ultra 20 and the networking stuff should be here by Thursday, so I guess I’ll spend the end of the week setting that up, and moving my home Linux use off of this laptop. (I’ll still use this laptop as an X terminal until the new laptop arrives. And probably even occasionally after the new one arrives, since Liesl will want to use the new one during those rare moments when she can pry herself away from Animal Crossing.) The only remaining task before then is to download and burn a set of x86_64 FC4 CD’s; easy enough to do.

showing all but first line from a file

March 4th, 2006

Just in case anybody needs to know this: one way to see all but the first line of a file is to run the command sed '1 d' on it.

(I was sure there was a good Unix way to do this, but it took me about 20 minutes to find it.)

break out your chocolate bars

March 3rd, 2006

You’ve (or at least I’ve) got to love this:

Among those who ate the most chocolate–averaging more than four grams a day–average systolic and diastolic blood pressure was 3.7 and 2.1 millimeters of mercury lower than their chocolate-spurning peers. This result did not hold true for other sweet foods nor did it vary among men who also smoked, were inactive or consumed a lot of alcohol. And, despite being strongly associated with greater intake of calories, chocolate lowered the overall risk of cardiovascular or any other disease by as much as 50 percent.

I was a little dubious, though: the high consumption group only averaged four grams a day? A bit of googling turned this article up:

The 4.18g/d intake of cocoa in the highest tertile is equal to 10 g of dark chocolate a day and about a 10th the dose used in most intervention studies, Buijsse said. This suggests that a small amount of cocoa may lower blood pressure.

So that 4g is cocoa powder, and even dark chocolate (by which they mean what exactly – 50%?) contains a fair amount of other stuff. Still, 10g of chocolate is a really low amount: most evenings, for example, we split a bar of good chocolate three ways; that gives us each an ounce or so of chocolate, which is a good deal more than 10g. So I guess I can’t really use this as an excuse to further increase my chocolate consumption; but I’m not about to stop eating the stuff, either.

I would appreciate it if researchers could next turn to proving that milk fat is good for you. I suggest cheese as a place to start – honestly, does it sound all that implausible that some kinds of cheese might have mysterious health benefits? I suppose ice cream would be a bit of a stretch, though…

oldest saved post

March 3rd, 2006

I finally got around to knocking off the oldest saved post in my RSS reader today; only 79 more to go. If that were my mail inbox, that number would be just fine, but I kind of doubt that I’m going to take the time to seriously think about (and blog about) what’s in those posts. So: time to wield the axe a bit, I think.

Having said that, I’m glad that I finally got around to listening to the webinars mentioned in that blog post: good to firm up my understanding of what product managers, project managers, and program managers do.

plum blossoms

March 3rd, 2006

One of the most pleasant surprises about this townhouse was that we discovered, a few months after moving in, that the trees in between the houses are flowering plums. It’s really beatiful for a week or so every year; like having our own cherry blossom festival.

I was hoping to share some pictures with my new camera, but this year has been a bit of a downer. I’m not sure exactly what the cause is, but it probably has something to do with the weather – two weeks ago, we had record-setting highs (the paper said mid seventies, but I think it hit eighty one day), last week was kind of chilly, and this week had quite a bit of rain. So the trees probably didn’t quite know what to think; two of them bloomed a week and a half ago, and the rest have finally decided to send out some number of blossoms, but they’re not putting much conviction behind it.

living with the animal kingdom

March 3rd, 2006

When I got home this evening, I noticed that one of the dogs had pooped on the carpet. Which sometimes happens; they’re wonderful in many, many ways, but housebreaking is not their forte. Anyways, I took them out, and the phone was ringing as I got back in, so I ran to answer it. Once I finished that (vacation plans firming up, yay), I surveyed the damage; it turns out that they basically had the trots all over the downstairs carpet. Sigh; good thing that we were planning to do a round of steam cleaning this weekend.

So I started cleaning this up. Then I noticed little circles of poop in the kitchen. A bit of inspection revealed that, in fact, I’d tracked it in there; I guess I stepped in something while running to the phone. Oops. I hope I got rid of all of the manifestations; not sure.

At some point during this, I looked around in the kitchen, and noticed that the ant trails had increased. For whatever reason, we’ve had a lot of ants in our kitchen the last half-week or so; maybe the wet weather is driving them inside? They’d mostly been walking over the cutting board, which I really don’t understand – I suppose there must be some food ground in there (the turmeric stains suggest as much), but really, not a lot. At some point today, though, they discovered the Honey Nut Cheerios, which were very much to their tastes. The rest of the cereal cabinet seems okay for now, though. (And we learned long ago to store the high-risk stuff in ziplocs.)

At about this time, Liesl came home; with her help, it didn’t take too long to get the ant problem dealt with. And, honestly, the whole thing wasn’t that bad; one side effect of having a kid is that you get pretty blase about poop – it’s just a fact of nature. I’m glad this sort of thing doesn’t happen every day, though, and it’s just as well that we’re going out with friends on Saturday instead of inviting them all over for dinner – they might think twice about eating our food if they saw the number of ants in the kitchen.

Anyways, I hope that I have brightened all of your weekends!

i want a customer

March 2nd, 2006

A few months ago, I finally started appreciating the Customer role in XP: it made a real difference to us when we stopped doing our iteration planning ourselves (with advice from others, to be sure), and started having somebody else pick the stories for each release. (We still plan the work in our weekly iterations ourselves, within the framework given by the monthly release plan; this doesn’t seem to me to be a particular problem right now, thought it’s something to think about in the future.)

But that’s only half the work that the Customer is supposed to do: the other half of the work is that the Customer is supposed to write the acceptance tests. (With the help of a Tester, to be sure.)

We’re not doing that; I’m starting to realize how it’s hurting us. A week or two ago, for example, I started discussing the user interface for a feature we were implementing with somebody who is more customer-facing; it turned out that his ideas for how it would best be designed were considerably different from our ideas for that. I’m really glad we had that conversation; it would have been nice if similar conversations had happened at other times recently. As it is, I’m worried that there are other features that I consider “done” that will magically flip to being un-done when somebody else looks at them and discovers that they’re not implemented the way they should be. Or, more frighteningly, the features make it out to the wild as-is, and real customers don’t like them because of things that we could have fixed months ago, if only we’d communicated better.

And it’s not just that I privately consider them done: I’m being asked to sign off on features as being done without feeling that I really know how other people are interpreting my sign-off. Which is an uneasy situation to be in: part of my job is to take responsibility for certain things, and I’d like to know exactly what other people see me as taking responsibility for.

Of course, it’s not like I’m without options here: I should start pushing back more on these issues. It will be a bit delicate figuring out the most productive way to do so – our current resources aren’t going to magically change, and there’s nobody who’s a perfect fit for the Customer role in our current setup. Hopefully we can start making incremental improvements. And it helps a lot that we don’t have much of a culture of blame: it’s a lot easier to be courageus in situations like that.

turn me into a mac expert!

March 1st, 2006

I’ve ordered the new computers and the network equipment. The Ultra 20 and the network stuff will arrive in a week or so; the Mac will take more like four weeks. Which is just as well – it will give me time to transition my home directory and other assorted data away from this computer and onto the Ultra 20, without being tempted to play with the Mac at the same time. And I still need to shop for some of the hardware in person – I didn’t see any reason to order a keyboard, mouse, and monitor online. (But where to buy them, given my antipathy for Fry’s? Best Buy? Circuit City? Some place smaller?)

There are still a few things to do; the biggest is that I should learn how Macs work these days, since it’s been most of a decade since I used them regularly. So: what do I need to learn about?

more home network thoughts

February 27th, 2006

My current network plan is as follows:

  • There seems to be a consensus that the Linksys WRT54G is the router of choice. Or at least a member of that family; the cool kids these days sometimes get the WRT54GL.
  • I’m thinking that a wireless bridge is the way to connect the upstairs computer; I like connecting cables more than dealing with cards and Linux drivers, and enough other people have agreed with me that I don’t think I’m crazy to feel that way. I don’t have a firm idea of what bridge to get, but the Linksys WET54G is the leading candidate.

I’ll think about it a few more days; I don’t want to order anything until next month, and it will take a week or so for the Ultra 20 to arrive.

go jdbc!

February 26th, 2006

Hey, this JDBC stuff really works!

I could really do without checked exceptions, though: every single time I call a JDBC function, I have to add four lines of try/catch wrapper code, because an SQLException could be thrown at any time. Sigh. And I can’t think of a good way to avoid that, given that I want to wrap the JDBC code in an abstraction layer as quickly as possible, so I need to translate exception types; occasionally, a try block covers multiple statements, but not very often.

I’m still not writing all the data out – for now, all I’m writing is the table mapping entity numbers to entity types. I was going to first write the code (using my abstraction layer, not the real JDBC stuff) that would add all the data for each entity to the appropriate table, but I realized that, if I started there, then it would be too long before I could verify my work via acceptance tests. (And, in particular, I’d be able to put off using JDBC for too long.) So I changed my focus to getting to JDBC calls verified with acceptance tests as quickly as possible; that was a good move, and I’m honestly amazed at how easy it was to get a passing acceptance test. It should be smooth sailing from here on out – the rest of the code shouldn’t involve any new tricks and will be easily unit-testable. (Though I will throw in acceptance tests as well, of course, being a good boy.)

breaking the rules and xp

February 25th, 2006

As a manager who is drawn to XP, one question that reading First, Break All the Rules raises is: how compatible are agile methods with the book’s recommendations? Let’s start by going through the questions.

1. Do I know what is expected of me at work?

This is a strength of XP (and other agile methods): work is broken down in to chunks, is explicitly prioritized, and there’s a clear mechanism for resolving questions (ask the Customer).

2. Do I have the materials and equipment I need to do my work right?

XP talks about this to some extent; Scrum highlights it.

3. At work, do I have the opportunity to do what I do best every day?

Hard to say about this one: if what you do best is a core part of XP, then yes, otherwise no.

4. In the last seven days, have I received recognition or praise for doing good work?

XP seems neutral on this one, too.

5. Does my supervisor, or someone at work, seem to care about me as a person?

XP is probably positive here: you spend quite a bit of time talking to other people, which increases the chance that they’ll care about you.

6. Is there someone at work who encourages my development?

XP is probably slightly positive here: everybody works on everything, which should tend to encourage development.

7. At work, do my opinions seem to count?

XP should do well here: any two people can modify any piece of code, and retrospectives are a frequent practice. Of course, the flip side is that other people’s opinions count, too…

8. Does the mission/purpose of my company make me feel my job is important?

XP tries hard to make sure that people are working on high business value stories at all times.

9. Are my co-workers committed to doing quality work?

XP is very focused on quality.

10. Do I have a best friend at work?

Everybody works (or at least should work) with everybody, for better or for worse; it should give scope for friendships to develop. (But you don’t want them to be too exclusive.)

11. In the last six months, has someone at work talked to me about my progress?

XP is probably neutral here.

12. This last year, have I had opportunities at work to learn and grow?

My answer here is the same as to question 6.

Okay, that’s not too bad; XP seems no worse than neutral on any question, and is positive on several of them. Which is, to be sure, nothing to crow about – most methodologies are going to avoid actively screwing these things up, and will focus on a couple of them. Still, it’s a start.

But what about the rest of the book? They recommend that, after specifying the desired outcome, a manager should give employees as much free leeway as possible in the methods that they use to accomplish their tasks; the expectation is that different employees will take different routes based on their different talents. And here, it’s hard to say that XP does so well: it places quite tight constraints on how you get your work done (TDD, pair programming, constant refactoring, collective code ownership, …).

The situation isn’t completely bleak, to be sure. For one thing, an XP has several distinct roles: the programmers, the Customer, the Coach, and even testers (who help the Customer translate needs into acceptance tests). So there’s some room to place people with different talents into different roles. And for another thing, XP doesn’t expect people to be “plug compatible programming units”; in fact, one of the benefits of pairing is that it acknowledges that different people have different experiences and strengths, and allows those different strengths to work together to effectively tackle a problem.

But it’s definitely the case that some people have talents that lend themselves more to XP’s demands, and other people don’t. And, given the range of strictures that XP imposes, a single person is unlikely to be talented in all the appropriate areas. I, for example, took to refactoring and TDD relatively quickly, but it’s taken me a while to get used to, say, pair programming and acceptance testing. I’m learning those latter skills, but I wouldn’t say that I’m actively talented in them.

Of course, this doesn’t mean that XP is bad because it works best with people who have certain talents: saying that makes no more sense than saying it’s bad to hire people to program because not everybody is talented at programming. It does suggest, however, that, as a manager, I should pay extra attention to the authors’ recommendation that a manager’s first job is to be very clear about the talents required for roles and to take that into account when hiring: while managers should avoid gratuitously imposing talent requirements, they should face up to the fact that they do require certain talents.

(I’m sure many people will claim that XP does, in fact, gratuitously impose talent requirements. That is not my opinion, but I don’t particularly feel like discussing the matter at the moment.)

This is a particularly urgent question for me right now. In the past, I’ve been cavailier about this when hiring (and my initial team I inherited rather than hired), but I’ve gotten extremely lucky so far: I have a great team, and one that is quite good at XP practices. (Don’t get me wrong, we don’t do full-out XP, but we’re fairly far in that direction.) Unfortunately, one of my team members will be leaving soon; I’ll have to talk this over with my boss and parallel managers, but I expect the conclusion will be that his departure leaves my team understaffed, so I’ll be hiring soon. Something else that I’m not particularly talented at; I’ll do my best…

load game, not new game

February 25th, 2006

When playing a video game, I usually start a new game once, and continue an existing game twenty or so times. So why do so many games default to “new game” every time I boot it up?

Maybe they could even use the annoying logo time during boot to look to see if I already have a save on my memory card, and present me with “new game” the first time, “load game” other times. And then there are games which avoid the issue entirely, presenting you with save spots that are either full or empty. Less common these days, though, now that games normally allow an unbounded number of save spots. (Which is a good thing, to be sure.)

do not buy a philips hdrw 720

February 24th, 2006

I believe I have complained here in the past about my DVD/DVR player that crashes periodically. Today, its DVD drive decided to stop reading disks, too. Sigh; by far my worst electronics purchase. And now is not a good time to be spending more money on stuff like that; fortunately, we have enough other devices in the house that can play DVDs that we’ll limp by for a few months.

help me design my home network!

February 23rd, 2006

I am typing this on a laptop that blinked a strange orange light when I plugged in the power cord, that has a red line on the left side of the screen, and where a large gap has developed in the upper left side of the case. Clearly, I have to be prepared, literally any evening now, for me to turn on the computer and for it simply not to work. I’ve already spent too much money this month; on March 1, however, I will order various pieces of electronics.

I’m comfortable with most of the decision making. But there will be one significant change that I don’t have much experience with: I’ll be going from one computer connected to a cable modem via an ethernet cable to multiple devices (computers and game consoles) connected largely or entirely to each other and the cable modem via wireless. And I’ve never set up, or even used, a wireless network before. (Actually, I’ll have questions on the Mac transition, too, but that can wait for a bit.)

So I offer up my plight to the collective wisdom of my readership. Here’s the setup:

  • I’m planning to buy a Sun Ultra 20 (probably the base model with a slightly less bare-bones graphics card), on which I’ll run Linux.
  • I’m planning to buy one of the new Mac laptops (the stock lower-end model might be good enough).
  • I already have one console with wireless access (the DS); I assume that, in the next generation, I’ll want to connect all the consoles up to the internet, whether through wires or wireless. I will doubtless acquire more networkable devices in the future.
  • There is a cable jack in the den, where the consoles are located; there isn’t a cable jack in the library, where the Ultra 20 will be located.
  • The only external access that I’ll want to allow into my network, at least for now, is to let myself ssh into the Ultra 20.
  • I’m leaning towards not allowing free access to the wireless network, for security reasons.

So: what should I do? I’m assuming that I want to connect a wireless router to my cable modem in the den; any specific buzzwords I should look out for? Anybody have any favorite routers? What’s worth spending more money on, what’s not? (Presumably I want a device that can do 802.11g.)

As far as security goes, it sounds like WEP is quite bad, but WPA is decent. (And there are multiple flavors of each?) It looks like the DS only supports WEP; will the router support different devices using different encryption protocols (after all, I don’t care how well the DS traffic is encrypted), or is it an all-or-nothing thing?

How should I connect the Ultra 20? A wireless card? A hub? A router? A long ethernet cable? How does security work with wireless hubs? Any gotchas with Linux and wireless cards?

Is AirPort Extreme just Apple’s name for 802.11g, or do they have proprietary extensions?

Anything else that I’m forgetting to ask?

nails

February 21st, 2006

Yay for boys who like painted nails.

pasta alla anna

February 21st, 2006

A total cheese bomb – one pound of cheese is a lot of cheese if you’re pairing it with one pound of pasta. Requires managing three pots simultaneously, but it’s actually about as easy as can be imagined given that. It does take a bit of time, though, partially because of that but mostly because of the baking time.

This would seem to be the first recipe I’ve given from the best cookbook ever. Really, that cookbook was a total godsend – we got it a month or so before Miranda was born, and it’s a wonderful collection of quite good, varied recipes that are easy enough that, even if one of us was too zonked to help with the cooking, the other of us didn’t mind.

If you can’t find orecchiette, shells are fine. But orecchiette really does work better.


Pasta alla Anna, from Pasta Fresca, by Viana La Place and Evan Kleiman.

1 lb orecchiette
olive oil
1 large eggplant, diced
28-oz can crushed tomatoes
3 cloves garlic, minced
pinch red papper flakes
1 lb smoked mozzarella, diced
freshly grated Parmesan cheese
salt and pepper to taste

Preheat oven to 350 degrees. Cook orecchiette. Meanwhile, heat garlic and pepper flakes in olive oil in another pan, add tomatoes, and cook for a bit. Heat more olive oil in a skillet (quite a bit: eggplant is thirsty), and fry the eggplant.

Mix pasta, tomato sauce, eggplant, mozzarella, salt, pepper, and a handful of Parmesan. Put in a 9 1/2 by 12-inch baking dish; sprinkle another handful of Parmesan on top. Cover with aluminum foil, and bake for 40 minutes. Raise heat to 400 degrees, remove foil, and bake for another 5 to 10 minutes more.

my first sql statements

February 20th, 2006

I wrote my first SQL statements today. I haven’t gotten as far as actually inserting data yet – they just create the tables as described here. But it’s a start, and I also started doing the modifications to the code to dump the data to the database. I’m definitely past my programmers’ block now: I have lots of small steps ahead of me, and I’ll even try to work on it some midweek if I can tear myself away from my blog reading/writing.

I’ve decided to stick with Michael Feathers’ dictum to avoid database access in your unit tests; it turned out to be easy enough to throw in a thin SQL-free layer that is forcing me to do most of the necessary code modifications. So I’m happy enough with the parts of the code that actually add entries to the database being only tested via acceptance tests. (The code to create the tables is written by hand, invoked by a shell script, so no Java at all there.)

As I created the tables, and compared them with, say, the SQL dumps of the database backing up the blog, I realized that I don’t know anything about indexing. Something to think about, though it’s not necessarily urgent unless I run into performance problems. Which I doubt I will for quite some time.

popup zen

February 20th, 2006

We spent the middle of the day yesterday at the Asian Art Museum of San Francisco. The first time I’d been there; quite nice, I will go back again. Though my favorite part was just listening to Miranda and Jordan talk to each other while they were walking through the galleries together.

Anyways, I bought a pop-up book of Zen stories while I was there. Which is quite well done. But after I bought it, it struck me that the ideas of Zen and pop-up books are perhaps not the best match…