December 27, 2005
We took Owen to see Night Trains at the Twin City Model Railroad Museum in Bandana Square. I'm not into trains, but this is amazing. They've built an enormous model of the Twin Cities that fills the room. For Night Trains they dim the room lights, light up the trains and show off their work. Everything is designed and built by hand from scratch. Many (all?) are modeled after real trains: one guy talked about building a train that a buddy of his had driven for years, complete with a miniature model of his friend inside. Owen loves it. Highly recommended.
December 27, 2005
I have to transfer a tape to CD — actually, to MP3 then to CD. Anyone have good ideas for how best to do this?
We have been playing Salman Rushdie's Haroun and the Sea of Stories for Owen when he goes to bed at night. From the day he was born until about when he turned three, we played a National Geographic lullabies CD for him, both for his afternoon nap and at his bedtime (yes, Garrick, that's why I thought you might like it). He started to resist the CD at naptime, though, ("No! I'm not tired!") so we switched to Haroun. It's a wonderful story. We used to keep several extra copies on hand just to give away. The audio version is actually read by Salman Rushdie, and Owen loves it. But it doesn't seem to be available on CD, which I would prefer because then we could avoid the loud "clunk" of the tape stopping that wakes the boy up when he's almost asleep. Plus, eventually it's just going to wear out and I'd like an archival copy.
December 27, 2005
If you visit this site in a browser instead of reading the RSS feed, as very few of you do, you've probably noticed the out-of-hand blogroll over there in the sidebar. I build that using a Perl script that periodically grabs my Bloglines OPML file and converts it to a static HTML file that gets included when this page is generated. For a long time, I was doing some really fragile XML parsing in the conversion. When I started using subcategories and the OPML changed, the parsing broke and the blogroll was incomplete. I knew it was coming, but rats!
I'd intended to use XPath for a long time, but never quite got around to setting it up. It's not as if XML::XPath is a difficult module to use -- Matt Sergeant knows his stuff and has done wonders for using XML in Perl -- but somehow other things took priority over figuring out how to go about this.
Then I started learning Ruby. The XML library that ships as part of the Ruby Standard Library looked easy to use, so my very first attempt at writing something in Ruby tackled the problem I'd been avoiding:
require 'rexml/document'
require 'rexml/text'
require 'uri'
include REXML
xml = Document.new(File.open("blogroll.opml"))
links = {}
xml.elements.each("//outline") do |o|
htmlUrl = o.attributes['htmlUrl']
unless (htmlUrl.nil? || htmlUrl.empty? )
links[ o.attributes['title'] ] = htmlUrl
end
end
links.sort.each do |title,url|
puts "<li>
<a href=\"#{ Text.normalize( URI.escape(url) ) }\">
#{ Text.normalize(title) }
</a></li>"
end
I'm sure it could be improved in any number of ways, but it worked! And writing it just felt natural. Unfortunately, my web host has an older version of Ruby without REXML. I could probably route around that, but now that I'd written the code I knew the way forward with Perl. A few minutes later, I'd updated the script and was in business.
This is why I like the idea of learning at least one new language a year: I'm exposed to new ways of thinking about a problem, or am inspired to work on something I might otherwise avoid.
But something else is happening, too. I use several languages, but have long felt most at home in Perl. That's beginning to change. Writing Ruby code feels right, it fits how I want to write code. Maybe some of that's just the heady rush of a love affair. Certainly some of it is an extension of a approach to programming that I first discovered in Perl and that makes both Ruby and JavaScript fun to work with. (More on that later.) It's not important, really: I'm having fun. That's enough.
December 23, 2005
I mentioned a while back that I couldn't get Rails installed on Jaguar. Actually, RubyGems was the problem. Something I'd read led me to believe it was a core ruby problem, but after a bit of thinking that just didn't seem right. So I kept trying different things, and still kept getting a message "stack level too deep".
At this point two things became clear:
Finally I found an answer. I added ulimit -s 8192
to my .zshenv (yes, I'm a Z shell user), which increases the stack size. After that, everything worked like a charm. Editing the same line to /etc/rc.common should also work, but I played it safe by affecting only my account and am happy so far.
I'm especially happy because now I can dive into Rails with gusto. Until I got it working at home, my Rails exploration was limited to staying an hour late at work once a week.
December 23, 2005
The iBook's back. We dropped it off for repair on Tuesday, and it was back on Thursday in fine condition. This might not seem impressive until I tell you that they shipped it from St. Paul to Tennessee. They overnighted the thing to Tennesee and back, at no charge to us. Mighty fine.
At least I thought it was mighty fine until I got to thinking about how strange it is that the laptop had to be shipped out of state -- at no small expense -- just to crack it open, replace a card, and put it back together. Seems a waste. Apple has three retail stores in the Twin Cities, after all, and we have FirstTech… surely there are Apple certified techs in town.
But hey, the iBook's back, the screen works, and we barely noticed its absence. And as a bonus, the wireless works better. It had been flaky. Yay!
December 22, 2005
Wow, in the last 12 hours a whole lot of spam has made it into my GMail inbox. That's unusual. I think I've seen more in the last day than I have all month.
December 21, 2005
Kiara brought our iBook into the Apple Store yesterday. Owen filled me in on the details this morning:
"Papa, there's no computer here for you to use."
"Oh no? Why not?"
"Mama brought it to the Apple store. It has a board inside that's broken, so when you use it, the screen doesn't work!"
"Oh no!"
"They took it and they're going to put in a new board so it will work."
"Well that's good. How long will it take?"
"They said they would keep it there for seven days."
That about sums it up. Don't believe for a minute that young children don't understand what's going on around them (Owen turned three a month ago).
The video card is shot. After the computer warms up, the screen goes bonkers and displays a not-entirely-pleasing set of vertical lines. It seems the card is placed above a significant heat source and over time, all the expanding and contracting of the connections wears them out. Although the iBook itself is out of warranty, this is apparently a known issue and is covered by some special hardware warranty, so we're told the repairs will be done at no charge. I doubt it will take a whole seven days: the repair status page shows that it arrived in the repair center the same day it was dropped off in the store.
December 06, 2005
Just a few days ago I was bemoaning the absence of a Perl Advent Calendar this year. I didn't moan too loud, though, because I know it's a lot of work and frankly I don't have the time to do it myself, either.
A short while later, Drew McLellan launched 24 ways to impress your friends with web development tips and tricks. Nice.
I started to wonder if there were a Ruby Advent calendar. As it turned out, no. But then Joey deVilla started posting one (archived in the Ruby section over there on the Farm).
Today I read that there is an alternative Perl Advent calendar, put together by a kind soul with hopefully adequate time.
I never celebrated or observed Advent growing up, but I sure do now!
Update: Now there's a Catalyst Advent Calendar, too. I do miss mod_perl.
Update: And a Symfony Advent calendar. Which reminds me that I need to look at Symfony.
December 05, 2005
Adrian Holotavy just announced the Washington Post's U.S. Congress Votes database, which lets you browse every vote back to 1991. Marvellous. There are RSS feeds, of course, so now it will be trivial to keep track of my representatives/senators. Subscribed.
I can't wait for the mashups.
Update: Garrick Van Buren wasted no time putting together MNRep: How Minnesota's Congressional Representatives Vote.