[ Content | Sidebar ]

immigration

April 2nd, 2006

I was really glad to see all the pro-immigrant protests last week. Nice to see a bunch of students willing to cut school for that, which I totally wasn’t expecting – I wouldn’t have though a priori that immigration would get that sort of response. Shows how much I know, I guess. (Of course, I like to see students cutting school in general, but that’s a separate blog post.)

I’m somewhat unsure of the correct response to immigration. My moral standards suggest that there is almost no reason to restrict immigration at all. It is a fact of life that people have dramatically different rights and access to resources based on factors of their life over which they have no control. In many instances in the past, we’ve come to the conclusion that such discrimination is morally abhorrent; why is it so much more acceptable to treat people differently based on where they were born than it is to, say, treat people differently based on their gender?

But I suspect that there are some reasonable answers to that question that I haven’t seen yet – just because nativist bigots get most of the press, along with my governor equating illegal immigration to anarchy (hmm, actually I’m sympathetic to anarchists too, come to think of it), doesn’t mean that there aren’t good arguments to be made. And the pragmatics of the situation deserve a good look, which I haven’t seen. (I would have a hard time evaluating pragmatic arguments, admittedly; I should spend more time learning about economics, I think.)

How the World Works had a good post on the subject. Good blog, that; makes it worth clicking through the Salon ads every day.

2006 baseball season

April 2nd, 2006

I haven’t been all that excited about the upcoming baseball season so far, but here it is. Kicking off with an Indians / White Sox game; I can support that.

I picked up the new Baseball Prospectus yesterday. Some nice tweaks to PECOTA (their player forecasting system), and the articles on the Indians and A’s were both interesting and cause for hope.

And then, for Jordan’s sake, I read the article on the O’s. A couple of quotes:

The 1978 Oakland A’s. One of the most disorganized teams of all time, worse even than the 2005 Orioles. Winners of three straight World Series just four years earlier, owner Charley Finley was unable and unwilling to adjust to the free agent revolution. He dumped everybody in an effort to save money, including his entire front office, eventually running the team himself with the help of a teenage kid who would latter become MC Hammer.

In case you’re curious, this is in the context of teams who were 14 games over .500 at some point in the season and later fell to 14 games under .500. (As the O’s did last year, while last year’s A’s and Astros managed the reverse.) Another “interesting” bit:

The best aggregate DH performance by a Baltimore team this millennium is the weak .250/.329/.398 posted by the 2001 squad. Since then, they’ve actually declined every year.

Ouch. Last year, in case you’re curious, their DH’s produced a BA/OBP/SLG line of .210/.277/.362.

mac, nano

April 1st, 2006

The mac is pretty well set up now. I’ve finished transferring all my music to it; the long part was just getting it on the USB drive from the old computer. (And I’ve even ripped a few more CD’s: I was really running out of room on the last computer’s hard drive.) The only thing that didn’t get transferred was my subscriptions to podcasts for which I didn’t have any episodes currently saved; I can live with that.

I made an account for Liesl. Safari hung the first time she tried to use it, which is pretty weird; hopefully that won’t repeat itself.

I’ve installed X. Still some futzing to do there; xemacs comes up from panini (the new Ultra 20, for those of you who aren’t closely keeping score) with ugly fonts, so I guess I’ll have to give my .Xresources file a look. xterm is clearly inferior to Terminal.app (or whatever the appropriately mac-savvy way is to name the beast); fortunately, if I set my DISPLAY in Terminal and log in, everything works just fine, but I wish X11 didn’t insist on bringing up an xterm when it starts. Does the mac have some hidden preferences somewhere that I can tweak behind the scenes?

I still need to figure out how to get Safari to behave the way I want, or for that matter how much I care. Or maybe I could switch to Camino and try to get it to behave the way I want; I’m not yet motivated to do so, however. And, in general, I should probably read through documentation to see what I’m missing about things. (The last time I got a new mac was 1989; the last time I regularly used one was 1998. I hadn’t quite realized that it’s almost 8 years since I left grad school…) Which is a big change from Windows – there, I felt dirty touching the thing, and had no desire to learn anything about it. (To be sure, that has at least as much to do with me as with Windows.)

The wireless reception in the front of my house would seem to be a bit spotty; unfortunate. Weird, too – we’re talking about 20-30 feet here. Maybe I’ll get another access point or something.

The nano is nice. I wish it had a bit more storage, but that will get fixed in a year or two. And I hadn’t realize that I had a full 2GB of podcasts stored; I suppose it would help if I didn’t have all sixty or so episodes of JapanesePod101 saved up. (Most of them are around 10 minutes each, but it still adds up.) Don’t ask me when I’m going to get around to listening to them; I have not the slightest idea. I was a little worried about how managing the collection would work, given that the nano doesn’t have enough space to store everything I’ve got, but it turns out that iTunes is happy to sync the podcasts automatically and leave music syncing up to me to perform manually. Which should work just fine.

Nice screen on the nano. My first reaction was that the form factor was a little small, and that I wished they’d kept the original iPod’s dimensions (other than the thickness – thin is good), but it seems to work fine. So maybe I was worried about nothing. I was also surprised to see that it didn’t come with a charger – does it use little enough power that plugging it in weekly for my podcast updates will keep it charged? If not, no big deal – after all, I’ll be using the mac frequently, unlike the situation with XP. (And even if I only plug it in once a week, I’ll be happy to leave it plugged in longer.) Will the other iPod’s charger (which worked through the firewire cable, which isn’t provided with the nano) work, or will it damage the nano somehow? I guess I’ll google. Also, I restored the old iPod to its factory settings while I was playing around with things, so now it uses the mac filesystem instead of FAT32. It looks like iTunes wouldn’t have complained too loudly if I’d left it in FAT32, but on the other hand it was insisting on deleting all the music stored there, so restoring it didn’t add significantly to the time to get the old iPod working with the new computer.

Hmm: this editing page doesn’t look right on Safari – the buttons to control formatting, add links, etc. aren’t there. That could be an annoyance; I’ll investigate that, but I could imagine that pushing me to use Camino.

I still need a name for the new computer; any suggestions?

the mac is here

March 31st, 2006

I’m typing this on my new Mac. Which is adorable, and seems to work well enough, though there’s still a bit of work to do. I don’t have my music transferred yet – I tried sharing my music folder from my old laptop, but for whatever reason I can’t get the mac to see it. I have no idea where the problem is, but I don’t really want to become a samba expert, so I’m just copying all the data to a USB hard drive. (Those things are coming in surprisingly handy.) Which is taking a couple of hours, though I’m not quite sure why – is USB 1.0 (which is all the old computer has) really that slow? I guess so. And I need to get X working, but that shouldn’t be too hard. And figure out what my workflow will be, which will be a little harder, but I’ll manage.

intrusive collections

March 29th, 2006

Each of my dbcdb web pages corresponds to an instance of a class called Entity. And each entity has a key, which is the number used in the web page. The class Collection represents the collection of all the entities.

Currently, each entity knows its key. As part of the change that I’m about to make, I’ll have to have each entity know the collection that it’s part of, too: right now, each series, for example, keeps a list of the volumes that are part of it, but I want that information to be found by querying the collection instead. After a bit of thought, I decided that the right way to handle this is to just stick the collection in the key (which is, fortunately, already a class instead of a plain int), rather than pass the collection in as another constructor argument.

Last night, though, I realized that my thoughts on this matter are somewhat inconsistent: in the past, I’ve held a strong conviction that members of a collection shouldn’t store any sort of indexing information, shouldn’t know that they’re part of a collection at all. So what are these keys doing there, and why am I making matters worse by having the members be able to get at the entire collection?

My reasons for that in the past were that it’s a violation of a proper separation of concerns, that it leads to potential inconsistency, and it makes collections inappropriately non-generic. Which are all good reasons – for example, I wouldn’t claim that it makes much sense for elements of an array to have to know their indices. (Nor would anybody else, but when it gets to lists, there’s less of a consensus.)

The collection in question doesn’t claim to be generic, so the third reason isn’t relevant. The second reason is, I think, not at all likely to be a problem in practice in this case, though I suppose I’ll make some member variables final just for the sake of documentation. The first reason is potentially a show-stopper, though. So: why did I make the key accessible from the entity in the first place?

It’s really only used for one reason: each entity has a method called pageLink that prints a representation of an HTML link to that entity. And the href refers to the key, so that method has to have access to the key somehow. But it could get it from an argument, perhaps. After all, I was considering passing in the collection when generating the list of volumes contained in a series, instead of having the series extract the collection from a key; maybe this whole argument is a sign that I should go down that route instead.

For the pageLink case, though, that won’t work: an entity never calls pageLink on itself, it only calls pageLink on other entities that it knows about. For example, a book has a data member storing its author, and it calls author_->pageLink() when generating the Author: line on its HTML page. But the book doesn’t know what the author’s key is, it just knows about the author entity. So either it has to ask the author for its key, store the author’s key instead of (or in addition to) the author entity, or ask the collection what the author’s key is.

The second suggestion just sounds weird to me, valorizing the keys over the entities. The third suggestion might be sensible in some contexts, but in this case I can’t see any concrete benefit to it. So I’ll stick with the first suggestion.

So: what’s the lesson? One, if you have to do a back mapping from elements of the collection to indices, then storing that back mapping in the element might make sense in a special-case collection. Two, don’t be dogmatic. Three, don’t feel too guilty about being dogmatic: strongly held instincts that can be justified and whose justifications can be compared against particular situations are okay.

art museums

March 28th, 2006

Every time I read My Name is Asher Lev, it makes me want to spend hours hanging out in art museums. Or even start drawing or painting, but I always come to the conclusion that I don’t want to take that up only to drop it before I get even vaguely competent, and I never have the time to do that.

But what are the good art museums around here? San Francisco isn’t exactly famous for them (though I did enjoy the Asian Art Museum last month), and San Jose is, well, San Jose. Stanford is closer than both of them, and its art museum has a quite nice Rodin sculpture garden outside; I’ve never been inside, and I can’t imagine that what’s inside is nearly as good as what’s outside, but it must be worth a look. So I guess I’ll give that a try.

This train of thought always leads to the conclusion that I should become rich, retire, and move to Paris. Aside from the practical difficulties with the former, I probably don’t really want to do (most of) that, but frequent visits to Paris are good. Which Miranda would support, I think. Of course, there are other places in the world that I’d like to travel to, as well. Hmm. Vacation plans are set for this year (relatives plus Canadian theater); maybe next spring?

career paths

March 27th, 2006

I planned to say more about First, Break All the Rules, but I seeem to have gotten excessively sidetracked on computer and programming geekery, and worse yet geekery of relatively limited interest. For which I apologize: I’ll try not to let it happen again to quite that extent. Anyways, one last thing that I liked about the book: it has a very refreshing approach to how career paths should ideally work.

Recall that the book’s focus is on having employees spend as much time as possible doing what they’re most talented at. Unfortunately, many traditional career paths involve changes requiring quite different skill sets: a programmer might traditionally be promoted to a manager role, for example, or if a programmer resists that but still wants to move up, then he or she might turn into a software architect.

I happen to like managing and I happen to like designing software, and I wouldn’t claim that my programming skills are irrelevant to those ends, but ultimately the skills required for the jobs are different ones. And I’m not sure that I enjoy either managing or software architecture more than simply programming. So it’s refreshing to see somebody say “we shouldn’t present those job transitions as the only goal for our best programmers”. And the authors back up those words with, for example, recommendations that employees and their managers should have overlapping salary ranges, with the employee potentially earning more than the manager.

But, now that I write that, I realize that my take on the matter is rather different from the authors’. I don’t want to give up programming; but that doesn’t mean that I don’t want to, for example, have a say on the architecture of the software that I’m working on. The truth of the matter is that I want to exercise a range of my own skills, so I’d rather not have the pigeonholing that is present either in a traditional programmer-to-software architect career path or in this book’s presentation of those as distinct roles with less of a hierarchy between them. And it’s not just my skills: I’d be happiest if everybody around me was doing a mix of getting their hands dirty while improving the software architecture. (Part of the reason why I’m attracted to XP, doubtless.) Of course, this might change if I’d seen a situation where having separate software architects worked really well; in my brief programming career, I haven’t had that experience.

Some more random comments that I don’t have time to string into a coherent essay:

  • I’m probably excessively biased against the notion that programmers’ managers should be ex-strong programmers. The reasons why I don’t like it are that the justifications that I’ve seen for that claim strike me as after-the-fact, and that I learn more every day (or at least every month) about the different skills managers need. But those aren’t the most solid of reasons, and I do accept the fact that, for example, managing a programmer is different from managing an accountant, and that some domain knowledge is probably useful to that end.
  • A counterpoint to the notion that managers and employees should have overlapping pay ranges: one very good point that Andy Grove makes is that an effective manager’s actions will have much higher leverage than a regular employee’s actions, so have more value to the company. Then again, equating value with appropriate salary is pretty naive economics: there is this notion of supply and demand, for example.
  • The book that I’m currently trying to integrate into my thought talks about how job transitions are increasingly horizontal. Which fits in well with the notion of focusing on what you do best.

(badly) generating html from sql

March 27th, 2006

I’m now generating my HTML pages based on the data in the SQL database. I’m still first assembling all the data in memory using Java method calls, and writing that out to an SQL database, but then I throw away the in-memory copy and regenerate it from the database.

I can’t really say that that step is done, though. There are a couple of things wrong:

  1. I’m generating the various indices (e.g. the list of books by a given author, or the list of recently read books) in a very bad way: basically, I read all the data from the database into memory and generate my own lists out of Java collections, instead of using SQL queries. Given that I’m generating all the web pages statically at once, this is fine from an efficiency point of view, but it’s lousy from a “learn about SQL” point of view.
  2. The separation of responsibilities isn’t nearly as clean as I’d like: in particular, I’m using proxy objects which get lazy-initialized from the database (which is fine, though I’m thinking of getting rid of that eventually), but the code gets confused at various points between the proxy and the object that the proxy creates underneath it.

Don’t get me wrong: it works, which is good. And to make sure it works, I even ran the one acceptance test that really matters, namely generating all 344 web pages corresponding to the current list of books/games/authors/etc., and checking that none of them changed betweend the old and new ways of generating them. I was pretty sure that my unit and acceptance tests were good enough that there wouldn’t be any bugs remaining; I was wrong. To be specific, I was generating links for volumes in a series incorrectly in index pages (point 1 above), where the bug was masked in the tests by point 2 above. Sigh, but at least it means that I have reasonable instincts for bad spots in the code.

Fortunately, attacking the first item will greatly ease the second, and I have a pretty good idea how some of this will work. The one problematic aspect is exactly how I’ll generate the indices, in a way that is nice SQL but still easily testable without finding an in-memory SQL database. Take, for example, the list of books by an author: if it were as simple as select * from books where author_id = AUTHOR; then that would be easy to test. But that doesn’t work for two reasons:

  • If a book is by Fred and George, then I want it to be mentioned in Fred’s page, George’s page, and Fred and George’s page. Which means I have to do that query for various values of AUTHOR.
  • If a book is a volume in a series, then its author_id field is NULL: the value is taken from the series’s author_id field.

So the right SQL query to use is reasonably complicated; and I certainly don’t want my testable SQL-like interface to handle that level of complexity. I think I’ll probably add some sort of ‘indexing hook’ that can generate a more complicated SQL query in the SQL version and evaluate custom Java code in the test version; not my favorite solution, but I can’t think of any other ideas offhand.

I’ll do that next. (Which will take a while, I think.) And then I’ll write a CLI tool to add stuff to the SQL database and modify it. At that point, the SQL transition will be more or less complete, and I’ll be able to get back to making changes that actually affect the HTML I’m generating.

Which I devoutly want to do, but this time hasn’t been wasted. For one thing, I’m learning about SQL, which was after all the goal of the whole exercise. For another thing, it’s very interesting watching the changes that the code undergoes as a result of this annealing, and trying to guess how the code will want to change next. I get the feeling that, when I’m done with the SQL transition, I’ll have the same number of lines of code as when I started, but 75% of them will be different and the structure will be somewhat improved. We’ll see.

Incidentally, while I was at it, I finally got around to installing viewvc (a pity there isn’t a released version with Subversion support, but the daily snapshot I grabbed seems to work fine), and tweaking my acceptance test framework to, among other things, print the time that each test takes.  By far the longest test is the one that connects to Amazon web sites in the US, UK, and France, to verify that my links work.

duct tape

March 26th, 2006

The old laptop’s screen is now being held on with duct tape. Truly a marvelous substance.

Fortunately, Apple claims that I’ll get the new laptop in the middle of the week.

panini is live

March 25th, 2006

The new Ultra 20 (panini) is all set up now – I’ve transferred my home directory, and I’m reading mail from there, doing svn commits there. I still haven’t set up backups properly, but that’s something I wasn’t doing right on the laptop, either, so it’s not a reason to hold up the switch.

Notes:

  • Running in 64-bit mode seems fine. The only problem I’ve noticed so far is that various browser plugins (e.g. flash) aren’t available in 64-bit mode; if I really cared, I’d figure out how to run a 32-bit browser there, but as it is I don’t use those plugins at all frequently, and I’m planning to do most of my web browsing off of the laptop (my old Linux laptop now, my MacBook when it shows up.
  • I learned a bit more about Subversion; rather than try to move the repository using rsync, I decided to dump and restore it the right way. While I was at it, I converted it to use FSFS instead of Berkeley DB to store data, and stuck in an extra directory level in the hierarchy. Following which I got to use ‘svn switch’ for the first time.
  • It took a while to get the local web server working. Which I use mainly for dbcdb testing, though it’s occasionally useful to be able to look at my public_html directory, too. SELinux was the culprit; apparently the security contexts have gotten stricter in FC5. (Either compared to FC4 or compared to whatever I first installed on this laptop; not sure.) I learned about ‘ls -Z’ and played around with running ‘chcon -t httpd_sys_context_t’ on various files; ultimately, due to various peculiarities in my setup (including that ~/public_html is a symbolic link into a directory contained in a directory where I don’t want to fiddle with contexts), I turned off SELinux for httpd. It’s not accessible outside of my local network, so that’s not a big deal; I might still try to play around with more ways to get this right, though.

So that’s largely over with; now I just have to wait for my MacBook to show up (1-3 day lead times? Yeah, right), and I can go through another phase of new computer geekery. And then I’ll be able to settle down and get back to work! (So to speak.)

random links: march 23, 2006

March 23rd, 2006

Hmm: having been confronted with a few posts that look similar to the above in other blogs, I am starting to see the wisdom of delicious (no, I am not going to go and figure out where to put the damn periods): if I were reading this, I’d rather see a couple of links a day than ten all at once, and I’d rather get to the referenced articles by hitting v C-w j than by, horror of horrors, clicking the mouse.

On the other hand, I really don’t like the idea of handing out my own data without saving a copy of my own, and some people may prefer seeing something like the above. So maybe I’ll adopt Simon Phipps’s solution and combine a delicious feed with a periodic list of links aggregated in a single list in the blog.

Let’s turn this into an experiment, and see if just mentioning Simon’s name is enough to get him to notice, or if I have to actually link to his blog: Simon, do you have some software to generate your daily delicious links posts? If so, could I have a copy?

bad joker

March 23rd, 2006

I get DNS service through my registrar; twice this week, it has failed. (The only reason why I can write this is because I’ve edited my hosts file.) Clearly, I should look for other options; problems happen, and I don’t want any more single points of failure than necessary.

The server that hosts this blog runs a nameserver as well; if I can mix that with my registrar’s servers, I’m all set. Otherwise, I guess I should look for a couple more friendly nameservers. I’m sure I can find some, but if anybody has any suggestions, I’m all ears.

i read way too many blogs

March 22nd, 2006

Sigh. But I can’t stand to unsubscribe from any of them!

guess the glyph

March 22nd, 2006

This contest is fun! (Marred by their misspelling of Sanskrit.) I’m quite confident of my answer on ten of them, pretty sure of a couple more, and am much less sure of the remaining four.

how laws get made

March 22nd, 2006

This article rather scares me – while there’s a lot I don’t like about the way my country’s government works, I had taken it for granted that laws were actually passed by the House and the Senate. Apparently not, in one recent case: why bother reconciling details between competing versions, if you can find a version that “was ‘certified’ by the leaders of the House and Senate”? Fortunately, this doesn’t seem to be the norm, but if “Republicans are evoking an obscure Supreme Court ruling from the 1890s to suggest that a bill does not actually have to pass both chambers of Congress to become law” then partisanship has gone way, way too far. (Big surprise, I know.)

We are not the only country dealing with this sort of thing: Tony Blair is apparently trying to make it possible for laws to get passed in Britain without going through the horrible bother of actually having parliament vote on the matter. I confess that I don’t have the background to evaluate this one – I have read reasonable-sounding complaints about how we had a major shift in the US last century when we started letting various agencies impose regulations on their own, and maybe that’s all that is going on here. But the British bill does sound a step beyond that.

It’s been kind of scary reading Blogzilla about British politics: see for example this story about the apparently impending national ID cards. How solid is the reporting in that blog?  And how many administrations are we in the US away from ID cards that are just as bad? I don’t think the answer is “zero”, but I wish I were confident that the answer isn’t “one”…

fc5

March 22nd, 2006

A week after installing FC4 on the new machine, I wiped it and installed FC5. Which one of my coworkers recommended; I was planning to do an upgrade, if for no other reason than to avoid having to burn 5 more CD’s, but it refused to upgrade from local images. (Sigh.) So I had to burn new CD’s anyways, and once I’d burned them, I figured that I might as well start from a clean slate, since there was almost nothing there.

Which was a good move, I think; it only took me about half an hour to get to (a little past, actually) where I was before, once the install was completed. At work I’ll try upgrading just using yum, though…

I guess next I should install Sun’s Java rpms (or am I supposed to get those from another source to make them more FC-friendly somehow?), then migrate my Subversion repository (will rsync work? Who knows, svnadmin is doubtless safer), then move over my home directory, and then I’ll start using it for real.

go france!

March 21st, 2006

I can’t wait to see how this turns out. Don’t get me wrong – the proposed law won’t leave us in an ideal situation, but I am glad to see a real stand for openness, and sensible penalties for making unauthorized personal copies.

On a related note, I laughed at this quote from an interview with Richard Stallman:

Officially, MPAA stands for Motion Picture Association of America, but I suggest that MPAA stands for Malicious Power Attacking All. And RIAA stands for Really Intends to Alienate the Audience.

(Good thing that I’m at least still allowed, both legally and technologically, to cut and paste snippets of text…)

new ip address

March 20th, 2006

The ip address for this blog (and my personal e-mail) has changed; it may take a day or two to percolate. And right now something strange is going on – I can’t resolve my domain names to either the old or new IP address. Anyways, it should sort itself out soon enough.

Many thanks to onShore for providing the hosting for myself and the other red-bean denizens. My bandwidth usage is almost non-existent; the usage for, say, the Subversion book is not so small.

yum update

March 19th, 2006

I upgraded packages on the new computer today. At first, everything went quite well – I was impressed at how quickly it downloaded the 300-odd packages it needed. (Apparently the networking works well!) And then it started installing packages; unfortunately, when it was most of the way done installing, the computer became unresponsive. (Largely: it would, for example, give me a login prompt, but go no further.) Sigh.

So I did a hard reset, and another ‘yum update’. Which got everything upgraded, but there were two copies of most of the packages lying around. I don’t know of any easy way to clean this up, and it was harder than normal to find the duplicates because, for some packages, there were supposed to be two copies (32- and 64-bit) installed! So I spent 30 minutes cleaning that up by hand; I think it’s in a reasonable state now, though chances are I screwed up in one or two places.

Then I decided to get ntp working. I have no idea why Fedora doesn’t turn that on by default; I tend to think that getting the time right is important. After some amount of futzing, I got it started on the new computer, and then decided to add the new computer as an ntp server for the laptop. (For now, I’m also having the laptop slave off of other servers as well; I may get rid of that.) This took a while – the laptop’s ntp.conf file was rather out of date (Fedora used to use inappropriately restrictive defaults), and I also had to punch a hole in the new computer’s firewall. But that seems to be all working now; the new computer’s time is still a little off, but the difference is down to about 30 milliseconds by now. So it should be well-syncronized soon.

from 1970

March 19th, 2006

95¢ A FAWCETT CREST BOOK M1146

Wherever Paperbacks Are Sold

Buy this Fawcett Crest Book from your paperback bookseller. If sold out, send only price of book plus 10¢ for postage and handling to Mail Order Department, Fawcett World Library, Greenwich, Connecticut 06830. If order is for five or more books, there is no postage or handling charge. Please order by number and title. No Canadian orders.

The only serious stab at a global identifier is “Library of Congress Catalog Card Number: 71-88744”.

And then there’s that oldie but goodie “THIS BOOK CONTAINS THE COMPLETE TEXT OF THE ORIGINAL HARDCOVER EDITION.” But where’s the claim that not one word has been altered?