Older blog entries for ianmacd (starting at number 87)

I spent a couple of hours today adding the ability to determine Ruby module dependencies to rpm. rpm 4.1 already does this for Perl modules, so it seemed a worthwhile addition to be able to perform the same magic for Ruby, since I pretty much use that language exclusively these days (apart from bits and bobs in C, but that's usually just for extending Ruby).

Anyway, I've submitted the code to Jeff Johnson, so perhaps it will make its way into the CVS tree.

Another year arrives and another passes by. The headlong march into decrepitude continues. This will be a year for major decisions and major consequences stemming from those decisions. One thing's for sure: it's going to be difficult, adventurous, exhilarating and revolutionary.

On a different note...

I'm tired of working with over-zealous twenty-something sysadmins who think they number among the profession's elite and yet have no awareness of their limited experience and the resultant myopia that distorts their view of the field and hinders their judgment.

Working in Silicon Valley can make you feel your age if you've been around the block a few times, lived in other cultures and worked for a variety of companies, both pre- and post-Internet explosion.

Sigh... the old bastard is feeling distinctly cantankerous today, isn't he?

Christmas is almost here and Sarah has departed for Providence, RI. That leaves me alone with my laptop and a bunch of unopened DVDs. Somehow, I think I'll make it through the weekend. I, myself, depart for Providence Monday evening.

I passed my California Driving Test today. What a joke that was. It's a mystery to me why you can't obtain an American licence on the basis of possessing a European licence, since European countries require a much more stringent driving test.

The timing was rather grand: my Dutch licence expired two days ago, so it's nice to know that yet another piece of bullshit bureaucracy is behind me.

I got offered a job in Purmerend the other day. This was an actual, real job; none of your recruiter-spun pie-in-the-sky, but a real honest-to-goodness job back home. This is encouraging. There really are still jobs available back in The Netherlands and my CV is still worth dropping me a line for, even though countless numbers of qualified people back home are on the dole and looking for a job.

I'm currently reading Teach Yourself Ruby in 21 Days by Mark Slagell. The Teach yourself books are often dodgy, but this is a great one. Even though I've been programming in Ruby for coming up on a year now, I've found quite a lot in this book that I either hadn't found in other books or hadn't been able to fully understand.

After years of inefficient use of both Emacs (for e-mail and DocBook) and vim (for everything else), I've finally decided to get to know vim inside-out and abandon the use of Emacs altogether.

Both programs are sufficiently complex that I've grown tired of not having mastered either in all the years I've been using both of them. It's time to unlearn my workarounds and harness the full power of my editor in the hope that it will improve my productivity.

Finally, never mind The Lord of the bloody Rings; go and see Bowling for Columbine instead.

We're back in the USA after travelling across Thailand, Laos and Vietnam and trying to adjust to the doleful drudgery of daily life.

Although we now feel thoroughly relaxed and refreshed, as always, it'll be interesting to see how long we can hang on to that holiday afterglow.

We had a fantastic time in Asia and took lots of photos. I can't wait to arrange a trip back, so that we can cover southern Laos, central Vietnam and Cambodia.

Just a couple more weeks until we head to Providence for Christmas. Another year flies by.

On the immigration front, I now have my employment authorisation card (which theoretically relieves me of the ball-and-chain that ties me to a single employer) and an advance parole travel document, the latter of which isn't all that much use in view of the fact that I already hold a work visa.

My fingerprints have been taken, I'm in the FBI computer, and the green card process continues.

26 Sep 2002 (updated 9 Dec 2002 at 03:10 UTC) »

Another month has passed and much has happened.

For one thing, I'm now married. Check out the wedding photos that our guests have sent us and the professionally taken photos.

The honeymoon was a big project that could be postponed for another day, so we chose to give ourselves one less thing to worry about and concentrate on all the trivial crap that goes into making a successful wedding.

With that now out of the way, though, we've been free to concentrate on the honeymoon, and we've decided to spend a month trekking around Thailand, Laos and Vietnam. So now we're busy reading Lonely Planet books and arranging visas.

Speaking of visas, I've started doing the paperwork for a green-card. I have no desire to stay in the USA long-term, but it would be more convenient to have one than to not, so it seems worth the hassle. My employer is paying for the application, anyway.

Can you believe that the INS wants me to prove that I don't have syphillis or tuberculosis? I suppose there must be enough of that here already.

I've written a new extension to Ruby, this time an interface to Steltor's CorporateTime calendar server. It's called Ruby-CorporateTime.

I'm not usually one for spending time and energy a proprietary product in this way, but we use it at work and I haven't found a decent calendaring solution in the free software world, so it seems reasonable to spend some time on this until something better appears.

Speaking of open source calendaring solutions, whatever happened to Dave Sifry's OpenFlock? The home page hasn't been updated for going on two years.

Today's the day the teddy-bears -- or Google employees in this case -- have their company picnic in San Jose.

This evening, Sarah and I fly out overnight to Providence and then drive up to Port Clyde, Maine for the wedding next Friday.

It's still hard to believe that when I return, I'll be a married man. Hmm.

Another month flies by.

I often whinge about having tno time to do anything, but things are really starting to come to a head now.

The wedding is just three weeks ago and there are still quite a few preparations to be made. I don't have any weekends left, though, as friends from overseas will be starting to arrive on the west coast soon, before making their way eastwards for the wedding at the end of the month.

To distract myself from the pain of impending domesticity, I treated myself to a Sharp Zaurus PDA. What a nice little thing, this is.

It was a bit of a hassle to get my low-power Socket Wi-Fi card up and running on my WLAN. This required cross-compiling a new kernel on my laptop and flashing the ROM of the Zaurus, which was a little nerve-wracking, considering it was the very first thing I did with my unit.

Since then, I've been cross-compiling cool applications like Kismet and adding essentials like OpenSSH, rsync, wireless-tools, Perl and Ruby. It's very cool to have a Ruby and Perl interpreter in my pocket wherever I go.

Syncing with the desktop required a kernel patch to get the peer-to-peer IP over USB working with the totally unsupported Qtopia software for Linux, but it worked without too much arsing around.

In conclusion, the Zaurus is an awesome little toy and I even find it useful for actual work, but it's probably too complicated for the masses. It locks up with alarming frequency when installing new applications and performing other operations. In addition, really exploiting the coolness of the thing requires pulling up a bash prompt on the thing and dicking around in config files. Anyone without Linux knowledge (or a very strong desire to quickly acquire it) would be swimming at this point.

Anyway, as practically every minute of my time from now until the wedding is spoken for, I'll quit this diary entry and go and do something more productive instead, like write my speech. Ugh!

Time for another diary entry, I think.

The move to Menlo Park was a disaster. On the recommendation of no fewer than three Google colleagues, we hired a local firm to take care of the two mile move from Palo Alto to Menlo Park.

Well, what a bloody disaster. They damaged furniture, dirtied upholstery, lost screws and bolts in the bushes, brought a truck that was too small, brought no tools (not even a screwdriver), brought no shrink-wrap to wrap upholstery and dresser drawers, and to top it all, they ran late because of all of these mistakes and have now charged my credit card for twice what they quoted us for.

Bastards. Needless to say, I'm disputing the charge with the credit card company.

On the plus side, we now have an apartment with three bedrooms and two bathrooms. It's nice and roomy and feels like a real home. There's a balcony here and swimming pool, but we've had to forego the pool table that we had at the old place.

The wedding is now just over fifty days away and the implications of this are finally starting to dawn on me. There's still so much to do: a cake to be chosen and ordered, suits to be ordered, music to be chosen, people to be instructed on what to wear, where to be, what to do, etc.

There's just no time left for anything any more. The move has consumed the last few weeks of our lives, but we've settled into the new place now and got most of our stuff unpacked.

The move from PacBell DSL to Speakeasy went like clockwork with just a couple of hours of downtime as the servers were moved. Trying to get the Speakeasy circuit up at the new place before losing connectivity at the old place was no easy task, with Speakeasy, Covad and PacBell all involved in a unholy love triangle of inefficiency.

I noticed tonight that bash-completion is now a part of Gentoo Linux, so there are probably even more distributions out there that have incorporated it.

I've been buying a lot of crap on eBay lately. Most of it has been CDs and old video cartridges for an Atari Lynx that I picked up. I also managed to get hold of a good inflatable mattress for when we get visitors in the new place, as we don't have a lot of furniture.

I was offered a job last week for a higher salary than I've ever earned; in fact, a higher salary than anyone I know has ever earned. The only problem is that the job would be with a financial institution in London.

I have no desire to live in London again. It's a great city, but I don't think I'll ever want to live in the UK again. It's too damn repressed.

What's that you say? Yes, the USA is even more repressed than the UK, but then I don't have any intention of settling here either. I'll continue to hang out in Silicon Valley for the time being, enjoying the Californian sun and vesting in my Google stock, and then when the time is right, it'll be back to Amsterdam to buy a nice canal house, preferably on the Brouwersgracht. Amsterdam is the only place I've ever really felt at home and I still miss it terribly.

Another distraction in the new apartment is the DirecTV satellite TV that we've invested in. Now I can watch umpteen church channels, Hispanic minority channels, the game show channel, the love channel and innumerable other stations broadcasting mind-numbing anaesthetic drivel designed to pacify me and turn me into a drooling conformist couch-potato.

Great. I only wanted BBC America, anyway, but it's nice to have OLN for the Tour de France, the HBO channels and things like Discovery, National Geographic and Animal Planet. The rest is absolute bollocks, not fit for the TV room in a hospice full of dementia patients.

Oh well. Time for bed.

Time for another diary entry, methinks.

Sarah and I are moving to Menlo Park next week. It's just a couple of miles up the road from where we are now in Palo Alto, but trying to get DSL organised for the new place is proving to be a great challenge. Even now, I'm not sure we'll be able to make the move without some period of downtime.

Ruby-DICT finally made it out the door a month or so ago. That's another project destined for total obscurity. Still, I find it very useful for my own use, so it wasn't without purpose.

This month's project was borne out of necessity at work last week. I needed an interface to CrackLib to enable me to check the strength of user-supplied passwords, but no such interface existed for Ruby. As is the ideal, I wrote one, which is no small feat for one who sucks so badly at C.

Anyway, check out Ruby-Password if you have a similar need.

Work is getting busier and busier. It's so hard to find time for all the things I have going on in my life right now: work, continuing to gain skill at Ruby, preparing for the wedding, packing and organising our move, etc., etc. I'll be really happy to put this phase behind us.

It's been a very busy month, I can tell you.

Ruby/Google is at release 0.4.0 now. This is a beta release and will probably be the last for a while. All the useful features that I can think of are now present and, to the best of my knowledge, functioning correctly.

bash-completion continues to do well. It's in Debian and Mandrake's Cooker release, but was pulled from Red Hat 7.3 for the fourth beta. Oh well...

I'm currently working on Ruby/DICT, which will be a client and client-side library for the DICT protocol, as defined in RFC2229.

I really can't speak highly enough of the Ruby programming language.

Just look at this piece of code:

module HTML
  def method_missing(methId, data, attrs={})
    tag = methId.id2name
    attr_str = ''
    attrs.each do |key, value|
      attr_str << sprintf(' %s="%s"', key.upcase, value)
    sprintf("<%s%s>%s</%s>", tag, attr_str, data, tag)

Assuming that has been saved as html.rb, you now have a very simple module that returns strings marked up as HTML, just like CGI.pm in Perl.

You call it like this:

#!/usr/bin/ruby -w

require 'html' include HTML

puts a('Google', 'href' => 'http://www.google.com/') puts ul(li('item1') + li('item2') + li('item3'))

The output looks like this:

<A HREF="http://www.google.com/">Google</A>

Voila, no more arsing around with HTML tags in your scripts.

This is how it works. You simply call the tag that you require as if it were a method in the module HTML. However, no such method is defined, so Ruby invokes the method method_missing to handle the error. By default, this method is, itself, undefined, which leads Ruby to raise an exception.

However, in the module above, the method has been defined. As its argument, it is passed the method as a symbol name, then the original arguments to the non-existent tag method. The last argument is optional and is a hash of attribute/value pairs, common in so many HTML tags.

The method then converts the tag and attributes to upper-case, formats the tag around its content, and ultimately returns it to the calling code.

The thing that's remarkable about the above code is how brief it is and how easy it was to write. It took me all of five minutes. Consider how the same code would look in Perl or Python.

Sarah and I are leaving for a long weekend in Vancouver, Canada on Friday. I'm rather looking forward to that. It will be another nice break, probably our last in the run-up to the wedding in August.

It looks like we're going to have to move. Our landlord wants to sell our apartment and we're not about to cough up the $425,000 he wants for the place, so we're going to be on the move again.

I think we're going to end up in Menlo Park this time. We've seen a couple of really nice places and I hope to sign a lease later this week.

It'll be a shame to leave this place. I really like Palo Alto and being close to University Avenue has been fantastic, but there just seems to be a dearth of large apartments in this town. Menlo Park's just up the road, though, so it's not like we'll be travelling very far.

Dinner with Dave Thomas and a bunch of other Ruby users was good fun. The second meeting will be held next Sunday at Pizza Chicago in Palo Alto, where we'll hopefully decide on a name for our motley crew.

Dave also came in to give a Ruby talk at Google today. I'm not sure how many people will now go away and play with the language, but I'd like to believe that one or two will be intrigued enough to try it out.

It was a very enjoyable talk and I'm very grateful to Dave for taking the time to come in and present it.

Ruby/Google 0.3.0 is now out. This version returns slightly different data structures to previous versions, so be warned. It's not labelled alpha code for nothing.

78 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!