[ Content | Sidebar ]

plain and simple

February 13th, 2006

It will take me a while to process Plain and Simple. (Which I learned about from the bibliography of the XP book, for what that’s worth.) Some facets:

  • There can be well thought-out, stable systems of behavior that are strong enough to exist for quite some time next to American society without being absorbed.
  • It’s not necessarily a good idea to spend time thinking about whether you enjoy what you’re doing at a given moment, or whether it’s drudgery.
  • If your brain is trying to tell you something, listen.
  • Be careful of following a path because it’s what your past experiences and environment have set you up to do.
  • Having good aspects in one area does not mean having good aspects in all areas.

Don’t get me wrong – I’m actually quite happy with the way my life is turning out. But it is good to be reminded of these things.

fit

February 13th, 2006

Acceptance testing has not been one of my fortes. Honestly, it took me a long time to be convinced by it – why isn’t unit testing alone enough? I’ve been caught out enough times by acceptance tests which I put off writing and which, when written, turned up bugs, that now I’m pretty religious about writing them. But, even so, I can’t say that I still completely “get it” (and it may be that those bugs are just places where we didn’t do as good a job of unit testing as we should); in particular, I still have yet to be in a situation where I really need acceptance tests to communicate with the business side.

Anyways, it seems like all the trendy agile people these days are using Fit (usually combined with FitNesse) these days to do their acceptance testing. And there’s a new book out about it, Fit for Developing Software; it’s gotten good reviews, so I gave it a read.

It’s a very good book; extremely readable, and I suspect that it should be readable by business types, not just programmer types. In fact, the entire first half of the book doesn’t talk about programming details at all: it talks about how you can use Fit to enable business people and programmers to clearly communicate their expectations, and the wonders that will result from doing so.

Anyways, what Fit does is let people from the business side (the Customer, as XP would say) write automated tests in as simple and natural a way as possible. The form that tests take is tables (e.g. on a wiki page, though you can use straight HTML or even Excel, if you wish); the tables give inputs and expected outputs, along with enough information to enable programmers to write a bit of glue code (a “fixture”) saying how to interpret those tables. And then you can easily run the tests expressed by those tables; it will color the cells corresponding to expected outputs either green or red, depending on whether or not the tests passed!

There are two basic kinds of tests: ones to test calculations and ones to test events. The former look pretty much as you’d expect: an example might be an application handling rentals, where you would want to calculate the late fees based on the kind of item, the rental period, and the time that the item was returned: you could then have a test with four columns, where the first three columns gave that data, the fourth column gave the expected late fee, and each row was testing a different late scenario. Then the cells in the fourth column would turn either red or green, depending on whether or the code calculates the late fee as expected.

The others are action based. I’ll give an example from the book, using vertical bars to separate cells, since I’m too lazy to figure out how to do tables in HTML:

| fit.ActionFixture |
| start | BuyActions |
| check | total | 00.00 |
| enter | price | 12.00 |
| press | buy |
| check | total | 12.00 |
| enter | price | 100.00 |
| press | buy |
| check | total | 112.00 |

So the ‘check’ rows are ones that test if some output is as expected; the other rows represent actions. (Except for the first two, which set up the fixture.) You can think of this as, say, representing a user entering data into a form on a web page, clicking on buttons, and looking at the updated web page, and you could even write a fixture that did just that; if your application is architected correctly, then the web page details will be abstracted away in a presentation layer, and you can hook your fixture into a somewhat lower layer, making the test faster and more robust to change.

Some things that I found interesting:

  • I’m not used to seeing action-based tests expressed that cleanly; it’s definitely a vision to aspire to.
  • I’m used to thinking that “acceptance test” equals “end-to-end test”. You can use Fit to do that (and probably should, to some extent), but Fit also allows the customer to write tests that get a little closer to the underlying models. Which is good; it makes for faster tests, and for clearer discussion of the underlying issues. In fact, some of the Fit tests look pretty similar to unit tests; I wonder how much unit test / acceptance test duplication turns out to be a problem? As problems go, though, that one is not so bad.
  • I don’t want to go into details here, but I was impressed about how easy it looked to write the fixtures connecting the tests to the underlying code base.

I’m not about to lobby for switching our current project over to Fit, and I’m not sure Fit is the best fit for many of the issues that my team has to face. (We have some hard testing problems that are different from what is front-and-center in most XP environments, I think.) But I’ll definitely keep it in mind in the future, and the reminder that people from the business side might be interested in non-end-to-end tests is a good one.

ready to start using sql

February 12th, 2006

I’ve finished working through the examples in that SQL book, I’ve read a JDBC tutorial, and I’ve downloaded a JDBC connector for MySQL. So I guess I don’t have any excuses not to start getting my fingers dirty. (I first typed “getting my features dirty”; I hope that isn’t a Freudian slip…) Next weekend is a three-day weekend; we’ll see what I get done then.

Good thing, too: just a week after finishing a book with no author, I’m about to start a book with three authors. And I currently can’t handle that, either, and I’d really rather not do so until after the SQL conversion.

JDBC seems straightforward enough. One weird thing: it has yet another iterator variant. This time, rather than leaving accessing, advancing, and querying validity as separate operations (as I prefer), or combining accessing and advancing, as Java traditionally does, it combines querying and advancing. Which is kind of strange – it means that your iterator starts out pointing before the first element, for example – but it does have the advantage that you can go through elements with a simple while loop. Also, it combines the iterator with the object pointed to, which actually isn’t so bad in this case: there’s no real reason to have a separate Result object outside of a ResultSet, I suppose.

choice of url

February 12th, 2006

I’m beginning to feel like my choice of URL for this blog is hopelessly unstylish. Back in the dawn of time, I used my job for e-mail and web pages: carlton@math.stanford.edu, http://math.stanford.edu/~carlton/, and so forth. But when I realized that I was going to be leaving academia, that strategy obviously became inappropriate, so I grabbed bactrian.org. Which is definitely a good move; honestly, everybody should grab a domain name for their own use.

I still stuck with the ~carlton at the end of my home page; the theory was that Liesl or Miranda might want to start using the domain at some point, too. Which is a possibility that I might still want to allow; but there really aren’t a lot of people using URLs with tildes in them these days, are there? I suppose I could just get rid of the tilde, or go to something like http://carlton.bactrian.org/ – after all, the ‘www.’ part isn’t exactly pulling its weight, either. I’ll stick with http://www.bactrian.org/~carlton/ for the time being, though – there’s no compelling reason to change, and honestly I don’t spend enough time on my home page to really care how people access it.

The more blogs I read, though, the stranger the URL for my blog looks. And I did get a separate domain name for my go bibliography; I’m spending more time on this blog than I did on that bibliography, and I’m not planning to stop any time soon; why not get a domain name for it, too?

Here’s the current (tentative) plan; no ETA for carrying it out.

  • The current URL will continue to work, presumably being forwarded to the new one, so there won’t be a need to change RSS feeds to point to the new location.
  • I’ve just bought the domains malviasiabianca.{com,org}. I’m planning to use the latter, with the former redirecting to it.
  • While my fingers still habitually stick www. into a URL, I’m pretty sure that’s going the way of the dodo. Plus, just typing ‘malvasiabianca’ is already enough work. So the official URL for this blog will become http://malvasiabianca.org/.

Another possibility would be to use malvasiabianca.bactrian.org. But that’s way too much typing; and malvasia.bactrian.org sounds wrong to me, too. Besides, domain names are cheap enough. Anyways, I think my mod_rewrite skills should be enough to carry all of this out without too much work.

2003 miranda pictures

February 11th, 2006

I finally got around to putting up some 2003 pictures of Miranda. Which is good; it was embarrassing to have skipped an entire year. Acceptable when one’s child is older, but, up until recently, she looked quite different from year to year. (And yes, I know there aren’t any 2005 pictures up, either; they will appear soon, honest.)

They were taken just outside Boston in the late winter or early Spring; you can see the snow on the ground in one of the pictures. We were visiting Liesl’s grandparents, Miranda’s great-grandparents, who I’m happy to report are still going strong.

perplex city

February 11th, 2006

I’ve never been interested in collectible card games, but Perplex City sounds pretty cool. It probably wouldn’t be wise to indulge, though: if I enjoyed it, I would be tempted to spend rather too much money on it…

meteos

February 11th, 2006

Meteos is a DS puzzle game. It’s in the “objects falling from the sky” genre; a new take, enabled by the touch screen. The goal is to line up three blocks of the same color (either horizontally or vertically); you can do this by moving blocks up and down in a column using the stylus. When you do this, the blocks in question and ones above them launch up; typically they start falling back down, though, so you have to create more lines of blocks out of the chunk of blocks that are falling down. (DS features used: the touch screen is essential to the game, but the second screen isn’t used in any important way.)

Pleasant enough; I probably would have played it more if I hadn’t had a zillion other games to play at the same time. Or if I weren’t constantly reading blogs or writing blog posts. Or if I could pry the DS out of Liesl’s hands. (Not that I blame her: there’s a reason her game of choice is sometimes called Animal Crack. She likes Meteos too, by the way.) I’ll happily bring the game along the next time I’m travelling.

One nice thing: you can use the blocks that you send off into space to buy stuff: new places to play (with slightly different physics models), new items that occasionally appear instead of blocks, and music to listen to. More and more games include stuff like this; honestly, I don’t understand why every game doesn’t have some sort of store aspect to it. It’s easy to do; it gives another way for people to feel like they’re making progress; and if people don’t like it, they can just ignore it…

beatles christmas records

February 11th, 2006

I did not know about these.

responsive blender

February 9th, 2006

I’m really not sure what to say.

ta-da

February 9th, 2006

One of the trendies of new companies is 37 Signals. They have three claims to fame:

  • They’re one of the early AJAX pioneers.
  • They take a delightfully minimalist approach to software design: they figure out a set of core features giving you the value, and make those features as useable as possible.
  • They wrote Ruby on Rails.

So I’d been looking for an excuse to give their stuff a try for a while, but nothing had really clicked. But then I was at work, and thought of a blog post that I wanted to write. But I didn’t want to write it at work, or even log into the blog from work, and I don’t really like e-mailing stuff to my personal account to then be transferred to the “future blog topics” list. Normally, when this happens, I just trust myself to remember the topic, which works well enough, but this time I thought about ways to set up a list which I could easily access from both home and work. Which one of their free products, Ta-da Lists, is suited for, so I decided to give it a try.

And it’s totally charming! All you can do is add entries, check them off, and edit them or move them around; I have yet to use the latter, and the UI for it is correspondingly less intrusive. It requires a minimum of mouse clicks. (Well, almost a minimum: I wish there were a keyboard shortcut to get to the “add new entries” mode, but once you’re in that mode, you don’t have to click on the mouse again to add multiple entries.) It’s nice and responsive, and a single click of the back button (or alt-left-arrow, in my case), and I’m out of it.

Like I said above, I’d been looking for an excuse to try their software; I didn’t honestly think that the result would be superior to other alternatives I could come up with. But I really like it; now I not only have a forthcoming blog topics list, but also a miscellaneous to-do list for stuff that I’m thinking of at home or at work to do in the other place. And I may well add other lists as well. I don’t have any current needs that seem like a fit for any of their more complicated software, but if I did, I wouldn’t hesitate to use it, and to pay money for it. They also seem to be suitably non-possessive of your data, providing XML export of your data and web services APIs to manipulate it.

chocolate mousse

February 9th, 2006

Somebody was just asking about this recipe recently, so here it is. From the excellent Bittersweet; I’ve presented the version that is for standard bittersweet/semisweet chocolate (50 to 62 percent); if you’re using darker chocolate than that and want to know how to modify the recipe, buy the book! I did include some of the other variations; in particular, you can make this non-dairy if you wish.

We had chocolate mousse many times in Paris; in general, I liked their texture a bit better than mine (it was somewhat firmer), but mine tastes better. For which I can take no credit: I think I was just using slightly better quality chocolate than they were. (Scharffen Berger; I do hope their acquisition by Hershey doesn’t spoil them.)

I’m writing this for a double boiler, but you can just float a stainless steel bowl in a wide skillet of simmering water instead. Also, if you’re paranoid about egg yolks, you can heat the egg mixture in a double boiler (or substitute) until they reach 160 degrees. Do this before beating it, but whisk the mixture first.

Works well with whipped cream on top, but even better is the cocoa bean cream from the same cookbook. And if you don’t have ramekins around, just put it in some coffee mugs or something.


Chocolate Mousse, from Bittersweet, by Alice Medrich.

6 ounces bittersweet or semisweet chocolate, chopped
1/4 cup water, coffee, or milk, or 1/2 cup heavy cream
1 1/2 Tbsp brandy, rum, or liquor of choice (optional)
3 large eggs, at room temperature
3 Tbsp water
3 Tbsp sugar
Six to eight 4- to 6-ounce ramekins

Place chocolate and water/coffee/milk/cream in the top of a double boiler over barely simmering water. Stir frequently until the chocolate is nearly melted. Remove from heat and stir until it’s completely melted. Stir in the liquor, if using, and set aside.

Combine the eggs, the 3 Tbsp of water, and the sugar in a bowl; beat with an electric mixer at high speed for 3 to 4 minutes, until the eggs have a texture like softly whipped cream. Fold a quarter of the eggs into the chocolate. Scrape the chocolate mixture back into the remaining egg mixture, and fold just until evenly combined.

Divide the mousse among the ramekins, and chill them for at least one hour, or until set, before serving.

cost-saving measures: oops

February 9th, 2006

It turns out that I misinterpreted the comment about not sending the new iPod to me because of the cost. So they will be happy to send it to me, if I or a coworker can’t pick it up in person; it will just take a little while, because the person who would take care of that is overworked. I was about to say “as am I”, but the truth is, I’m not overworked, I just never have 35 minutes of empty time in my day where I have nothing better to do than to drive to Menlo Park and back.

ipod number two

February 8th, 2006

I would seem to be quite the lucky fellow: I won another iPod at work. They asked us all to bang on the Sun Grid for a little while before its launch, to try to find some bugs; I did my banging, and my name was drawn out of a hat.

About which I feel a little embarrassed; maybe I should give it to one of my coworkers? Then again, most of them didn’t take the time to bang on the grid. And maybe Liesl or Miranda will find a use for it, or maybe my current iPod will die.

I don’t actually have the thing yet, though: I have to go to the Menlo Park office to pick it up. I asked if it could just be sent to me; the response was “no, that would cost money”. Hmm, let’s see: it would take me maybe 35 minutes to drive there and back; putting it in the mail would cost somebody else maybe 5 minutes of time, plus the shipping costs. So it comes out balancing a half-hour of my time versus the shipping costs; I won’t reveal my exact salary here, but I’m pretty sure that, even without accounting for the overhead in employing me (insurance, the space I take up, the services that I use), Sun would come out ahead by just shipping it to me.

Maybe it’s all a plot to figure out which of their engineers have too much time on their hands, so they can fire them. I dunno. I will ask.

It’s a nano of some sort; better to jog with. I’m not sure how much memory it has, but I do have more than 4GB of music stored on my current one, so I’ll have to pick and choose what goes on it. I hope iTunes handles that well; it probably does, since I can’t be the only person who has to deal with this issue. Honestly, I’ll probably just let it sit in a box until we do the computer upgrade. Which may be sooner than we had planned: yesterday, the laptop screen developed a red line towards the left side of the screen. (What would cause that, anyways?) I don’t think the new MacBooks are shipping, though, and I’d rather give them a little while to shake out bugs. I should get around to doing our taxes soon, at least, to make sure we can afford to upgrade…

more mercury news political coverage

February 5th, 2006

A followup to my earlier complaint about the Mercury News’s coverage of the wiretap story: today, they ran an article (the link will go stale in a week, I think) giving a much more nuanced view of the matter, written by somebody (Cass Sunstein) who actually knows something about the topic. Bully for them.

red turn signals

February 5th, 2006

It seems like a lot of cars these days have red rear turn signals, instead of yellow ones. Am I right in thinking that this is a relatively new thing? And is there any good reason for it? It kind of annoys me; yellow turn signals are a well-established part of cars’ external UI, so why change it? It’s not that big a deal – turn signals are still the only blinking signals on the car (other than the hazard lights, which are the same color as the turn signals anyways), but still.

So: why are car manufacturers doing it? I seriously doubt that it’s because people prefer to drive cars with red turn signals; in fact, drivers are probably unaware of the color of their rear turn signals. (I just realized that mine were red, and we’ve owned the car for almost three years.) Maybe they think that having the rear lights be all white and red will give a more visually appealing look. (Some cars have a yellow bulb but a clear color over the bulb, making the back look white and red unless you look closely.) Maybe there’s some primordial source of this, some recent car that was the first to do this and sold a lot, leading to imitators. Beats me…

j-pop, k-pop wanted

February 5th, 2006

Anybody have any good Japanese pop recommendations? I suspect that there’s music to be found there that I would enjoy, but I don’t have any good routes in. So far, I’m dipping my toes in based on video games and movies, which is fine, as far as it goes. From the former, “Everlasting Love” continues to be excellent, and Miranda and I are big fans of the theme song to The Cat Returns, so I got a CD of music by Tsuji Ayano containing that. But I don’t yet like the other songs on that CD nearly as much, though admittedly they are growing on me, so I don’t think I’m going to seek out much more of her singing. (And ukelele playing!)

I’ll try visiting a local Japantown and see what I can find. I’m also in the market for Korean pop: I get the impressing that it’s starting to seriously take off, and the music that I hear in our local Korean restaurant is pleasant enough.

sri lankan chicken curry

February 4th, 2006

The third in our “chicken curry by country” series. Or, I suppose, the fourth in our “chicken curry” series; I don’t have a single Indian version to highlight, but we’ve already seen one from (or at least inspired by) that country, and I’ll doubtless come up with more.

Don’t worry about finding all the ingredients for this one: it will be fine if you leave off lemongrass, curry leaves, and/or cardamom pods. For that matter, if you happen to have access to rampa, feel free to throw three one-inch pieces into the pot; I’m not quite sure what the stuff even is! Also, don’t let the number of ingredients deter you from making this one: all you have to do is chop stuff up, marinade overnight, and dump it in a pot. It’s actually quite nice for evenings when you have a bit of extra energy and want to prepare something simple but (quite) good to make when you come home from work the next day.

I only have this in a xerox copy (I borrowed the book from my Pali professor a long time ago); searching on Amazon, I think it’s the book of that title by Balasuriya and Winegar, but I could be wrong.


Sri Lankan Chicken Curry, from Fire and Spice

Marinade:
1 onion, chopped
1/2 cup celery, chopped
1/4 cup garlic, chopped
1/4 cup ginger, minced
1 tsp each turmeric, ground coriander, ground cumin, and cayenne pepper
4 whole cloves
4 cardamom pods, crushed
1/2 cup soy sauce
1 1/2 Tbsp cider vinegar

1 – 1 1/2 lbs chicken, cut into bite-sized pieces
1 can coconut milk
1 stick cinnamon
salt to taste
8 curry leaves
2 one-inch pieces of lemongrass

Combine marinade ingredients with chicken; marinate several hours our overnight. Dump everything in a pot and cook over low heat for about half an hour.

pictures

February 4th, 2006

I just put some recent pictures on my web site. Some from me at work, either surrounded by what’s important to me there (art by Miranda, books, and Emacs) or outside. The scenery really is gorgeous (and comes with horses!); I will miss it when we have to move to Sun’s main campus. Winter is its green period, because of the rain; in summer, the yellowish brown dried grass makes for an equally striking scene. And some from a visit today to Jordan, Tanya, and Caleb; Caleb is a total sweetie!

I should get in the habit of doing this more often. It’s very easy to take pictures with the new camera, and to transfer them to my laptop. And they are taken at a resolution of 2048×1536, which when halved and quartered make nice large thumbnails (palm-sized rather than thumbnail-sized, but whatever) and full-browser images. Also, the previous digital camera we had (a freebie that came with the laptop three and a half years ago, so very low quality) didn’t have an LCD on the back, so I always had to crop pictures; with the new camera, they get framed properly. And they are much higher quality (at least technically: it’s still me behind the camera most of the time, though my boss kindly took the ones of me); in particular, its flash and autofocus are much more intelligent. Now I really don’t have any excuse to avoid putting up pictures from last summer’s vacation; next weekend!

yoiks

February 4th, 2006

I am juvenile enough to be amused by the phrase “his ancient vocal technique, known as ‘yoik’.”

(From Gierran, by Wimme. The vocals are pretty interesting; I could have done without the decidedly non-ancient accompaniment, but Scott warned me when he lent it to me that he probably likes electronica more than I do.)

books without authors

February 4th, 2006

Despite appearances, I have been making progress on dbcdb recently; it’s just been taking a little while to go through the examples and exercises in Learning SQL, and I was busy last weekend. (As I am this weekend, but I’ll find time tomorrow somehow. I have a big backlog of posts to write here, too.)

Still, it will take some time before the SQL backend is in place. I’d been vowing not to implement any new features until I’d done so, which has been quite annoying since I really want to have links from dbcdb entries to blog posts. But I really do want the SQL conversion to happen as soon as possible; adding other features will delay that, and adding that particular feature will make the conversion slightly more complicated.

But then I started reading a book without an author, which I didn’t support. It wasn’t at all hard to support – I just had to test against null in a few places – but it took me a while to track down all those places. It didn’t help that I didn’t think of all the appropriate unit tests to write, so I had to actually use jdb in order to track down places where a NullPointerException was being thrown, so I could cover them with unit tests and fix the problem. Pretty frustrating; I can’t say that I’m too impressed by that debugger. Still, it’s working now.