[ Content | Sidebar ]

boot problems

December 26th, 2005

Forty minutes or so ago, I turned on the computer (actually, Liesl rebooted it out of Windows), and when I selected ‘Linux’ from the boot menu, it wouldn’t boot. Either things went black immediately or it said “GRUB” at the top of the screen and froze. Not good.

At least Windows was still booting. So I did some browsing to remind myself how I had dual booting set up in the first place. This page is a fairly accurate description; it suggests that the boot sector isn’t right. So either a bit went bad on the copy of the boot sector I use or a formerly functional boot sector magically stopped working.

I actually had two copies of the boot sector lying around: the one that actually gets used, in an NTFS partition, and another copy, in a FAT32 partition that exists only to transfer files between Windows and Linux. But I don’t know how to compare files in Windows, so I couldn’t directly test the “bit went bad” hypothesis. So I ended up just copying the version from D: to C:, and rebooting.

Which didn’t work. So either a formally working boot sector has simply stopped working, or something worse has happened.

So: the next step is to generate a new boot sector from the actual contents of /dev/hda7. (And if that fails, reinstall Linux, I guess? Good thing I backed things up a couple of days ago.) But how do I do that? I don’t have anything useful like a bootable rescue CD around; that would be too sensible.

But there’s a Linux distro called Knoppix that boots from a CD; maybe that will do the trick. Easy enough to download an ISO image for that; surely if I stick a blank CD into the drive, Windows will give me an option to write the ISO onto it?

Well, no: it gives me three options for writing music CD’s, and one option for assembling files myself to burn onto a CD, but no option for burning a preexisting image. Can it really be the case that Windows doesn’t come with a tool for that? After some googling, the latter really does seem to be the case. Sigh. But I can find a free program to do it easily enough.

So: burn Knoppix CD, boot from it, it comes up. Yay. I can’t say that I’m thrilled with the design sensibilities, but the functionality is great; I could look at all the filesystems (both Windows and Linux), browse the web, etc. So, at the very least, if I need to reinstall Linux, it will be easy enough to back up my home directory first. And I compare the two saved boot sectors I have; they are identical, as suspected.

So I should generate a new boot sector; what I need is the first 512 bytes of /dev/hda7. Hmm: I’m not root, so I can’t read /dev/hda7. What’s the root password? It turns out that there isn’t one, but you can run root commands by doing sudo. (Among other mechanisms.) So now I have a copy of the boot sector in /tmp.

And it’s different from the one I had been using. Which is good! Now: how do I get it onto my Windows partition? It’s mounted read-only, but the FAQ tells me how to fix that. So now it’s on D: (the FAT32 partition; writing to NTFS from Linux isn’t recommended).

Reboot into Windows, copy it to C:, reboot. And here I am, everything is working fine.

I still don’t know what happened between yesterday and today that cause the old boot sector to stop working. Admittedly, I’ve reinstalled the OS at least once (I think?) since I created the original one, so it’s not a complete shock that the boot sector has changed. But if that were the case, it should have stopped working a long time ago, not yesterday.

Ah well; it’s working now. Yet another sign of the fragility of my computer setup; I’ll improve matters over the course of 2006, honest I will.

ils peuvent etre des geants

December 24th, 2005

When I was looking for podcasts, I ended up going to iTunes and browsing the top rated ones. I found some that I like, but the best is the They Might be Giants podcast. Only one episode so far, but it’s really good; I should go and get more of their albums.

Other podcasts I found on iTunes that I’m still listening to: This Week in Tech, Next Big Hit, All Songs Considered, and Motley Fool. I’m not sure I’ll stay subscribed to all of them indefinitely, but they’re entertaining enough for now.

games magazine

December 24th, 2005

I’m in the habit of, when going on a plane trip, picking up a copy of Games magazine. (If I can find a copy; it doesn’t get very good distribution, and in particular airport stores almost never have it.)

Which I just did; it turns out that the magazine has changed recently. They used to have several articles and maybe 15-20 pages of puzzles; this issue has fewer articles, I think, but 40 pages of puzzles. Good ones, too; there are several new puzzle variants that I’ve never seen and that I like. Nurikabe seem like a nice idea, for example. I think I’ll subscribe to the magazine, given that my brain seems to be in a puzzle-solving mood these days.

Not that I actually am on a trip. I couldn’t possibly need a flu shot, since I’ve already gotten the flu once this year, right? Oops. I could do without this, though I could certainly think of worse ways to use up my stock of bad luck…

self pingbacks

December 21st, 2005

WordPress has an option to do ‘pingbacks’ on links referred to in your blog.

I thought I’d had this turned on for a while, but I don’t really know; at any rate, when upgrading the blog, I found that I’m now pinging back my own blog.

Which, on further reflection, is probably actually a good thing: if I write post A and then have further thoughts about it in post B, I probably want readers of post A to be able to find post B as well.

upgraded wordpress version

December 21st, 2005

I’ve upgraded to WordPress 1.5.2. I still don’t know what was causing the problems I had the last time I tried this, but it seems to work now.

Let me know if there are any problems.

interesting use of rss

December 19th, 2005

In an RSS feed, you get some text plus a link. The link is the link to the original article that the entry in the feed corresponds to; the text is either the entire original article or an abbreviated version of it.

Or at least that’s the way it’s conventially done. But in Simon Phipps’ The Daily Mink, while the above is true for some articles (ones that Simon wrote himself), there are a fair number of entries where the RSS feed just contains a sentence or two of introduction/commentary, and the link sends you straight to the article (written by somebody else) being commented upon.

Which led to a couple of minutes of confusion – I normally always jump straight to the original article, skimming (at best) the text from the feed – but it seems like a reasonable enough way to do things.

sql

December 18th, 2005

I finished reading an introductory SQL book. (Which seemed decent enough.) So now I don’t really have many excuses to avoid starting the transition of dbcdb to an SQL back end.

Which I don’t really feel like doing, even though it’s clearly the right thing to do next. This means one thing: I should split my stories.

So: what are the steps? I have existing data stored in a custom representation, and I don’t want to throw away that data. So I need a tool to dump the data to SQL. It doesn’t necessarily have to be the most robust tool in the world, but it’s hard to do without.

I could imagine writing a tool to go the other way as well, but I don’t really see the point of that. So let’s skip that step.

After I have the data in SQL, I should transition my software to generate the web pages straight from the database.

Once that’s in place, I won’t have any more need for my custom Java representation. So I’ll need to write tools to update the database directly, instead of updating my custom representation and dumping it to Java.

That’s the high-level plan; let’s drill down a little. The first part is to dump the data into an SQL database. So I guess I need to come up with a database schema. And I need to learn about ways to interact with SQL from Java; JDBC seems to be the tool to use. I should think about how to test this; I guess I can do acceptance tests by sending SQL queries from a shell script, but I’ll need unit tests, too. (I could skip it, given the throw-away nature of the code, but I don’t think skipping it will save me any time.) Michael Feathers says your unit tests shouldn’t interact with the actual database; I could either look into an in-memory database, or I could ignore the advice. I think I’ll do the latter until it starts biting me: right now, build times are much longer than test times, and I doubt the database-level unit tests will take that long to execute. I think writing the data out is conceptually straightforward, though I can’t quite envision what the abstractions will be in my code.

Next: generate the web pages straight from the database. For books, this will be completely straightforward. For authors, it will be almost as straightforward; I’ll have to redo the way I generate my list of books by an author, but that’s no big deal. And once I have all the individual objects under by belt, hopefully the indices will be straightforward enough. So there should be an easy task breakdown there, with a natural order of the tasks.

Updating the data is an interesting issue. I could actually just go and edit the database directly, using some tool like phpMyAdmin. Or I could write a Java CLI tool. I don’t think I want to write a custom web tool for this just yet: that will come much later in the project. Honestly, it will be a little hard to write a CLI tool that’s as easy to use as my current format (there might be a lesson to be learned in that), but I guess the CLI tool will be easier to use than mucking with the database more or less by hand. Shouldn’t be too hard to do; I’ll plan it in detail once I come to that.

Sounds like a plan; hopefully there’s enough detail here to get me to stop procrastinating. Clearly I should start learning about JDBC, at any rate.

the new methodology

December 17th, 2005

Martin Fowler just revised his The New Methodology paper; it’s a nice introductory exposition/justification of agile methods.

meyers-briggs personality types

December 17th, 2005

Some management writers that I respect think that it’s worth learning about Meyer-Briggs personality types, on the theory that you need to realize that most people are different from you, and that there are concrete differences in their motivations, approaches, and so forth that can be helpful to know. The Meyers-Briggs types categorize your personality along four dimensions:

  • Extrovert or Introvert
  • Sensing or iNtuitive
  • Thinking or Feeling
  • Judging or Perceiving

So you can take a test which will give you a four-letter type: ESTJ, INFJ, ESFP, etc. And you can find various descriptions of the sixteen possibilities.

The specific approach that one of the sources recommended is Keirsey’s, so I read his Please Understand Me. Keirsey actually thinks that not all distinctions are equally important: he focuses on whether people are SP (“Artisan”), SJ (“Guardian”), NF (“Idealist”), or NT (“Rational”). He talks about how authors over the last two and a half millennia have divided people into four groups which can easily be made to correspond to these categories.

Before reading the book, I took an online test (I can’t remember the link); it had me as I, N, and P, but I was tied on the T/F axis. Looking at the description, I thought it was pretty obvious that I was a thinking instead of feeling, making me an INTP. But then I took the personality test at the front of Keirsey’s book; it actually had me marked as an INFP.

This would make me an Idealist instead of a Rational. I will admit that I do have idealistic tendencies, but that still seemed a little strange; maybe the part of me that was answering the test would like to be an F even though I’m not. Keirsey, however, had different meanings for the letters, thinking that Meyers’ original descriptions weren’t the best:

  • E: expressive or I: reserved
  • S: observant or N: introspective
  • T: tough-minded or F: friendly
  • J: scheduling or P: probing

Looking at the T/F distinction that way, it’s not so clear to me. And, reading more of Keirsey’s descriptions, I definitely have some F in me: I find conflicts quite unpleasant, for example.

Still, whenever I see something like this, I’m suspicious: is this really a natural division, or is it just one way among many to divide up people? Not that there’s anything wrong with the latter, but it’s perhaps not quite as interesting. And if I can’t even figure out which of Keirsey’s four main types I am, then that adds to my suspicion.

Reading more, though, it was at least clear which of the types I’m not: I clearly have the least sympathy with SJ’s, and I should probably work on understanding them better. And I’m not an SP (e.g. flamboyant artist types), though at least it’s an idea that I find attractive. I could definitely see myself in parts of the NF description, but I’m pretty clearly an NT. What sealed the latter for me was his description of INTPs’ parenting styles; it wasn’t a priori obvious to me what, if anything, INTP’s would have in common in their approach to parenting, but his description says:

Architects [INTP’s] are devoted parents; they enjoy children, and are very serious about their upbringing. Each of their children is treated as a rational individual, with rights, privileges, and as much autonomy as that child can handle safely. INTPs encourage their children to take responsibility for their own lives and to chart their own course. They do not visit their own expectations on their children and never attack them physically or verbally. When safe to do so Architects let the natural consequences of their children’s actions teach them about reality. When this is unsafe, they somehow contrive to design logical consequences to inform their children’s actions.

And I would have to plead completely guilty to that. So: INTP (“Architect”) it is, and maybe there’s something to this sorting method after all.

To him, the most important distiction is the S/N disctinction, which he frequently characterizes concrete versus abstract. The significant majority of humanity fits in the former category, though doubtless most of you are in the latter. (And doubtless most people who like to think about this sorts of categorization are in the latter category as well; maybe that has something to do with why they consider it an important distinction, even if most of humanity is on one side…) For example, his claim is that, in most successful marriages, the couple is either both S’s or both N’s, but that for the other letters their being the opposite works better. Beats me; I haven’t closely observed enough marriages to have an opinion about this. I don’t even know what Liesl’s personality type is, though it wouldn’t surprise me if she’s an N; if she’s an S, I don’t think she’s too strongly on that side. (I suspect Miranda is an INFP, but I could be wrong. He does claim that INTP parents and INFP children get along quite well, which is nice.)

At the end of the book, he has a “four types sorter” designed to tell you if you’re an SP, SJ, NF, NP. The results there were interesting: I was an NP, but my scores were something like 32 points for NP, 35 for NF, 37 for SP, 56 for SJ, with the lowest score winning. So the lesson here is that, whatever I am, I’m not an SJ, which fits with my observations earlier.

I’m not sure quite what to take out of this, but I guess I should spend some time observing my coworkers and seeing how they fit in. We’re a bunch of programmers, so we may well all be NT’s. But perhaps I’ll be able to find situations where I’d been inappropriately treating people as having similar motivations and feelings to myself, and use that knowledge to work more effectively with them. Or perhaps the mistakes I’m making have nothing to do with these types, and my idiosyncracies lie along different lines. Or perhaps I’m not making mistakes! (Yeah, right.) We’ll see.

Do actual psychologists find these divisions useful? Jordan, what does Tanya say?

more brainbashers

December 16th, 2005

More changes at my sudoku site of choice:

First, they’ve added a new tool to help you solve puzzles: they’ll highlight all squares where you’ve filled in a given number (either as the only choice for that square or as one of the possibilities for that square). Which I appreciate: for one thing, it helps the algorithm that I use when starting to solve a new puzzle, and for another thing, it eliminates some of the mindless searching in the middle of solving a puzzle, where you just haven’t noticed that a square that used to be 134 is now just 14 because you’ve since filled in a 3 in the same row.

They’re doing a very good job of allowing me to eliminating the parts of filling out sudoku that I don’t enjoy (making stupid mistakes like two 4’s in the same row, mindless searches for numerical conflicts) while still leaving me enough to do that I have to spend some time thinking. I also find that I enjoy being the person who actually fills in the number that must go in a square: they have another optional feature “auto pencil marks” which fills in the possibilities for each square using a naive algorithm (eliminating all numbers that would conflict with the given row/column/block); I don’t use that, because I assume it would find a unique solution for several of the squares, and I want to find those unique solutions myself! So I’m willing to trade some amount of tedium for that feeling of accomplishment.

After my first sudoku post, Chris commented that he didn’t do them because he didn’t like puzzles that he could write a Perl script to solve. Which is a quite reasonable point of view, but it turns out that what I like is puzzles where I could write a Perl script to do a fair amount of the automation while leaving me with most of the thinking.

The second recent change is that they’ve gone from three to four to five difficulty levels. Honestly, I didn’t notice a big difference when they went to four (a little difference, but not a big one), but today is the first day with five difficulty levels, and, for the first time, my standard algorithms didn’t let me solve the puzzle. (Or at least the first time recently: previous puzzles have forced me to add to my bag of tricks.) So I had to figure out a new algorithm to get past that one; fortunately, the new algorithm was made easier to carry out by the “highlight all squares with a given number” feature.

The upshot is that I can still do their hardest sudoku more quickly than I could have done it when their hardest was significantly easier but I didn’t have as much automated help, and that I enjoy it more because I’m spending less time doing tedious searching and more time thinking. And it’s less of a time sink. A win all around.

(Enough with the sudoku posts, I know.)

weird

December 15th, 2005

Gosh.

calming signals

December 15th, 2005

I just read On Talking Terms with Dogs: Calming Signals. Its core is a list of about thirty different signs that dogs do when trying to calm themselves or each other dog. Some of which make sense in retrospect, like not walking straight at a dog if you don’t wan tto make it nervous (arc around it instead), but some of which I never would have realized (yawning, licking your nose).

Apparently the signals work on dogs when humans do them, too. (At least some of them; it’s kind of hard for humans to lick their noses.) Which is the main reason I got the book: Yosha was barking quite a lot a few months ago (he’s gotten somewhat better recently, mercifully), and I’m willing to try things to calm him down. I’ll be quite impressed if the techniques work on him, though: he is quite the bundle of nerves.

Even if they don’t, though, it’s an interesting way to look at dog behavior. If nothing else, I’ll spend the next few weeks paying more attention to when my dogs lick their noses.

(Not available from Amazon, for some reason, but you can get it here.)

planning improvements

December 14th, 2005

As I said last month, we’ve finally started doing a full planning game; we did it again this month. And I’m really glad we did: for one thing, November’s planning rubbed in our faces some of the things we were doing wrong.

One basic issue, as I see it, was that we were focusing too much on using real units for our planning. We were doing lots of measurements, but at the end of it, the main thing we got out of our measurements was that, in a week, we spent a week working. Which isn’t very useful!

So now we’re giving up on measuring actual time; we’re simply estimating our tasks in points, but not measuring how much actual time a point takes us to do. Instead, we total up the points in the cards we finished that week, and there’s our velocity. Simple, much more useful than what we’d been doing.

The other improvement is that we’re getting a lot more serious about breaking up large stories into smaller ones: we’ve basically given up on the idea of a 3-point story (which was a story that we thought that a person could get done in a week doing nothing else), so now all our stories are either 1/2 point, 1 point, or 2 points. (A geometric progression; I don’t think that’s an accident.) This seems to greatly reduce our errors.

The upshot is that, in November, we included a significant slush factor for mistakes in our estimates and still didn’t get close to accomplishing everything that we’d planned, while in December we included no slush factor and are slightly ahead of schedule.

Some of that, to be sure, is due to external factors: in November, we were working in a bunch of new areas, so in retrospect it’s not surprising that we had pretty high startup costs. And then in December we were working on the same areas and made our estimates just before we started getting comfortable with them; as a result, several tasks that we estimated as 2-point tasks ended up being more like 1-point or even half-point tasks. (To be sure, there were still some estimation errors in the other direction. I’d be worried if there weren’t estimation errors…)

I’m also really pleased that we did a good enough job of preparing cards in advance that our Customer could pick all the cards for us to work on instead of him having to say “this sounds like a good thing to work on, pick 5 points to work on once you’ve got cards worked out”, and could do so in about an hour and a half. One of my top priorities before Christmas is to make sure we’ve done enough ground work so that we’ll be able to do the same thing in January.

The Customer also wrote three story cards during the December planning meeting, as a result of our insisting that he pick all the cards. (He’d also written a few cards before then in a previous meeting.) And all three cards have proven useful: two of them turned out to be for things that we thought software we were integrating could do but it can’t do, so I’m very glad we learned that now! And the other involved something that we’d implemented incorrectly and which had slipped through unit testing; oops.

And while we’re on slipping through testing: we’re still running into situations where we realize we haven’t written enough acceptance tests for a feature, we write an acceptance test, and it turns up bugs. I’ve loved my unit tests ever since I started writing them; now I love acceptance tests, too. If you’re ever programming with somebody else, the single most useful thing you can say is “should we write a test for that?”

pirates

December 11th, 2005

I was pretty excited to get Sid Meier’s Pirates!: I’ve spent many a pleasant hour with the various Civilization games, and the reviews talked about how you couldn’t put the game down, how you’d find yourself playing it at two in the morning.

The reality wasn’t so great, however. Its resemblance to Civilization was very faint, certainly no more than its resemblance to many other games. And while it is true that it’s hard to put the game down, the reasons for that have nothing to do with its quality.

The game is a mishmash of various genres: fighting, dancing, rpg, strategy, turn-based combat, probably others that I’m not thinking of at the moment. You’re a pirate, sailing a ship around the Carribean. You recruit crew members, upgrade your ship, capture new ships. Capturing new ships is mostly done with a sword-fighting mechanism, occasionally combined (I hesitate to say augmented) with Shenmue-style QTE’s and ship-to-ship battles. You can dance with governor’s daughters; you can go on quests to find people and treasures. And you can conquer cities, and get special items to improve your skills.

The problem is, these genres are all done in an extremely sketchy fashion, and the game doesn’t combine them in a particularly interesting way. The swordfighting system is very basic. There’s almost never a reason to use your cannons. There’s almost no plot; in particular, the goals that you carry out over the course of the main quest are completely random, and the side quests aren’t any more satisfying.

This lack of plot is why it’s hard to put the game down: you never have the feeling that you’ve just accomplished something big (or even medium), so you don’t have the traditional video game cues to consider stopping. It’s like playing solitaire: sure, sometimes I end up playing game after game of solitaire later into the night than I should have, because it’s always tempting to play just one more game, but that’s hardly a virtue.

bought a ds

December 11th, 2005

I bought a Nintendo DS; the triggers were that we’re going on vacation soon, plus the release of the new Mario and Luigi RPG and the new Animal Crossing. We also got a puzzle game called Meteos, which seems decent so far, and which at least uses the input mechanism well.

name lookup problems

December 11th, 2005

My registrar was having problems yesterday, so name lookups for bactrian.org and gobooks.info weren’t working. Seems to be fixed now.

thomas merton

December 8th, 2005

Anybody have any good Thomas Merton recommendations? I really liked his autobiography, and I get the impression that he’s the sort of person who might well have written more books that I’d like, but neither New Seeds of Contemplation nor Zen and the Birds of Appetite did much for me.

For that matter, any other Christian book recommendations? (Should I read Augustine’s Confessions; if so, which translation?) As background, I’m an atheist with a soft spot for mysticism who is particularly down on the big monotheistic religions. Which is probably biased by the environment that I live in, where the evil that they produce gets rather more press than the good that they produce. (It would be interesting to see a foreign policy based on turning the other cheek…) Or any recommendations for books about Sufism? The latter seems like a form of Islam that I would find particularly congenial.

video games

December 6th, 2005

And now you can see the video games I’ve played recently.

There’s still a little bit of refactoring to do on the code that I’ve checked in, and a little bit more code to write. But the previous constructs held up reasonably well; easy enough to add the new item types (video games, game consoles, game developers) through a mix of cutting and pasting, reusing existing classes, and one class extraction. A shade more cutting and pasting than I’d like, but I’ll deal with that soon enough. Or at least try; I suspect that I’ll run into more places where C++ templates would be more useful than Java generics.

One interesting non-parallel between books and games is the way I plan to handle series. (I haven’t yet added series of games yet; next weekend.) Some book series are quite straightforward: the books are named Series, volume N. In others, the book names aren’t so predictable, but at least there’s a straightforward order and notion of volume number.

You’d think it might be the same way with video games – surely Resident Evil 4 counts as the fourth item in its series? Well, no: the games in the series so far are Resident Evil, Resident Evil 2, Resident Evil 3, Resident Evil: Code Veronica, Resident Evil 0, and Resident Evil 4. Plus some spinoffs and ports, some of which (the GameCube and forthcoming DS versions of the original) are remakes with more significant changes. So there’s no useful notion of “volume number” in a video game series; you might as well just sort them by release date. Also, different games in a series can be published on different consoles and even made by different developers, so there’s no attributes of a game that you can glean from its presence in a series.

For that matter, even the definition of a series isn’t well-defined – if you take the original Super Mario Brothers, Super Mario Sunshine, Paper Mario, and Mario and Luigi: Superstar Saga, how many different series are they part of? I can imagine any number from 1 to 4 as an answer. So while I think I will add the notion of a video game series, there won’t be the same structure as in the book case, where I had classes BookLike, Book, Volume, and Series in a sort of V-shaped inheritance diagram.

There are a few features I’d still like to add, most notably links to blog posts, but they’re all relatively straightforward. I should really spend more time learning about SQL and Ruby, so I can play around with changing the underlying implementation.

that was fast

December 3rd, 2005

Okay, now I understand, at least a little. It would seem that, if A depends on B, using a part of B’s implementation that, say, returns an object of type C, then modifying C doesn’t cause the depend task to rebuild A unless you set closure to be true. Which is a little weird – I would think of that as being enough to cause A to depend directly on C.

So that’s why, without setting closure to be true, you don’t get the right stuff rebuilt. Having said that, closure also causes tons of extra stuff to be rebuilt – why not use a more useful notion of dependency to begin with? Does it have something to do with the structure of class files? What is the notion of dependency that the task is working with?

dependency checking

December 3rd, 2005

I finally have dependency checking right; I don’t know how I missed ant’s depend task before, but I’m using it now. I’m still a little surprised that the tutorials that I looked at didn’t point it out, and that it’s an optional task; on the other hand, there are enough C and C++ build systems with incorrect dependencies that I suppose the rest of the world doesn’t take this as seriously as I do. (Hint: gcc -MD -MP is your friend.)

There’s still one thing I don’t understand: the depend task’s ‘closure’ attribute. It defaults to false; if turned on, and if A depends on B which depends on C and C changes, then A gets rebuilt. (In addition to B, of course.) I don’t understand why this is necessary, though: thinking about this in C++ terms, it sounds like B’s implementation depends on C, but A doesn’t either directly depend on C or depend on those parts of B’s interface which mention C (if any). In that case, why would we need to recompile A? So there’s something that I’m missing here. I’m leaving it turned off for now; if that causes problems, I’m pretty sure my tests will let me know, at which point I’ll learn why you want to turn it on.