Older blog entries for ianmacd (starting at number 79)

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
    tag.upcase!
    attr_str = ''
    attrs.each do |key, value|
      attr_str << sprintf(' %s="%s"', key.upcase, value)
    end
    sprintf("<%s%s>%s</%s>", tag, attr_str, data, tag)
  end
end

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>
<UL><LI>item1</LI><LI>item2</LI><LI>item3</LI></UL>

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.

I'm having dinner with Dave Thomas tonight, one of the authors of The Pragmatic Programmer and Programming Ruby, a.k.a. the pick-axe book.

Dave's coming into Google on Tuesday to give an introductory talk on the Ruby programming language. I wonder how many of my colleagues will be inspired to give the language a try after his talk.

Sarah and I spent much of this weekend putting together wedding registries at some of the shops in Stanford shopping mall, a truly mind-numbing experience.

We still need to work out where we're going to go for our honeymoon. Another short break in the meantime would be nice, too. Maybe we'll manage to get away for a long weekend in Vancouver in May, although I'd still like to visit Amsterdam, too.

So many things to do and places to go, but so little time, as ever.

This week, I released my first piece of Ruby code to the outside world. Ruby/Google is a Ruby interface to the Google Web API that was released earlier this week.

If you haven't already looked at the Google Web API, you should. It's a great way to programmatically query Google for standard search results, cached pages and spelling corrections. You're limited to 1,000 queries per day, but you can still do a lot with that. It seems to have created quite a bit of buzz on the Web.

United States: Je naait 't steeds

Coincidence? Toeval?

22 Mar 2002 (updated 13 Apr 2002 at 21:43 UTC) »
Allemachtig, nog maar 161 dagen tot de huwelijk.

My Ruby hacking continues apace.

I'm writing a system to write DSA keys into a MySQL database for account management purposes. This uses the Ruby DBI and is proving very educational. I could have written this much more quickly in Perl, but I took the opportunity to get to grips with an aspect of Ruby that I wouldn't really use otherwise.

At home, I've written a simple whois client, just to try out some network programming. Perhaps I'll even release that for the hell of it.

I hope to have my Ruby coding skills up to the level of my Perl skills within a few weeks (months?), at which point I'll be able to code pretty much anything I need.

Friday tomorrow. Thank God.

Learning Ruby is turning out to be a lot of fun. If you're a Perl fan, do check out this relatively unknown language. Mark my words: a few years from now, it's going to be in extremely widespread use.

The next release of bash completion will feature the ability to complete on remote paths when performing scp completion.

Why the hell are flights to Amsterdam so damn expensive? I can purchase a return ticket to San Francisco from Amsterdam on-line for $450, but a return ticket in the other direction would cost me over $700. It would be great to get to go home for Koninginnedag.

jules finally updated his diary. Bravo!

By the way, Jules, I like your dingen page. Web logs definitely seem to be the flavour of the month right now. It looks great, too.

Well, the save-the-date cards have gone out. That's one more wedding item taken care of. Now, all that's really needed is to arrange some music for the ceremony and possibly book a videographer, although I don't think we'll bother with the latter.

bash completion is doing really well. The next release, which I'll probably put out on Monday, will contain vastly expanded completion for cvs, making it much more useful than it currently is. As usual, the new release will also contain lots of bug fixes.

jules, it's really getting time for you to update your diary. 11 months and counting.

So many people no longer seem to update their diaries. I, myself, am posting my first entry in more than two weeks.

Back in 2000, it seemed like everyone was posting here. The updates were fast and furious. I guess the passing of the age of innocence of open source software left many people feeling disenfranchised and with no sentimental attachment to the more frivolous aspects of the scene, such as Advogato.

The bash completion project continue to gather momentum, with some 14,000 URL hits on Freshmeat now. I'm not getting as many patches as I'd like, though.

gcc completion still needs to be done; someone should add comprehensive dpkg support for Debian; rpm completion needs to be broken out into smaller functions, so that rpmbuild and rpmquery can easily be covered.

Much more work could be done, but I guess not many people spend their time hacking shell code if they have the choice. I should really be devoting more time to other pursuits, too.

I'm vaguely considering a week in The Netherlands, probably in late April or early May. Getting there for Koninginnedag would be nice.

Inmiddels is het avontuur hier zo goed als afgelopen, wat mij betreft.

Toen ik hier kwam wonen in maart 2000 was alles ongekend spannend. In hartje San Francisco wonen tijdens de explosieve groei van opensource software en de dotcoms, werken voor een bedrijf als Linuxcare met collega's die zich tot de beste hackers ter wereld mochten rekenen. Na de Red Hat-fiasco was ik toch eindelijk wel terechtgekomen. Misschien zou ik zelfs een paar centen maken op de beurs, maar dat interesseerde mij niet zo erg veel.

Ik had het idee dat ik in het oog van de orkaan zat. Alles was nieuw; alles was superspannend.

Toch vervaagt na verloop van tijd iedere bevlieging en deze vormt daar geen uitzondering op.

Open source stortte in, collegavrienden werden ontslagen, visumellende zorgde voor veel hoofdpijn. Andere verschijnsels van persoonlijke stress droegen bij aan een gevoel van vervreemding in dit anders toch al heel vreemde omgeving.

Om een lang verhaal genadig kort te maken, ik heb het hier wel gehad. Ik heb het gevoel dat als ik er straks niet bewust tussenuit duik, ik op de een of andere onbewuste manier toch voor mijn eigen lot zal zorgen door de boel te verzieken.

Vooral na elf september vind ik dit een gestoord en onprettig land om in te wonen. Het is niet moeilijk om eerstehands aan te zien waarom dit volk (maar vooral zijn regering) alom gehaat wordt.

Tja, niet dat ik dat niet begreep toen ik nog in Nederland zat, maar toen kon je tenminste naar de tv wijzen en zeggen van, "Kijk, die gekken Amerikanen zijn alweer bezig." OJ Simpson, een oorlogje hier, sancties daar, niet meedoen aan een verdrag ergens anders. Altijd hebben die klojo's hier hun vingers in andermans zaken, en wordt de wereld hier nou een beter op? Zet je televisie of radio aan en beslis zelf, zou ik maar zeggen.

Ik zou op dit moment in mijn leven ongelooflijk gelukkig moeten zijn, maar dat ben ik niet. Het enige waaraan ik kan denken is teruggaan naar Nederland en een paar maanden op mijn reet zitten, opnieuw ontdekken waarom ik van Nederland en vooral Amsterdam hou, misschien een nieuwe computertaal of twee leren.

Historisch gezien zijn de periodes van werkloosheid altijd de drukste geweest van mijn leven. Op geen ander moment krijg ik zo veel voor elkaar, leer ik zo veel nieuwe dingen, produceer ik zo veel, vind ik mijn levenslust terug, bouw ik zin in het werk weer op.

Na twee harde stressvolle jaren in de VS ben ik op. Ik heb niets meer te bieden aan mijn omgeving hier en kan er zelf ook niets meer uit putten. De enige gedachte die dag in dag uit door mijn hoofd spookt is wegkomen hier uit die zooi. Als ik me nu kon terugtrekken, kon dit alles nog makkelijk de geschiedenis ingaan als een heel bijzonder, merkwaardig hoofdtuk in mijn leven.

Ik ben gewoon weer aan vernieuwing toe. De rups moet weer vlinder worden, om het maar zoetsappig uit te drukken.

Misschien gaat dit gevoel uiteindelijk weer vanzelf over. Ik hoop het natuurlijk wel, maar kan niet ontsnappen aan het geloof dat het toch wel veel meer is dan alleen een gevoel. Stay tuned.

Maui was great. There's something about whale watching, standing atop a volcano, beautiful beaches, crystal clear seas, lush vegetation, great food, the company of a beautiful woman and not having to work that somehow brings out the best in me.

I don't know if I could live there for more than a year or so without going crazy, but I would really like to find out.

Meanwhile, the homesickness continues unabated.

I seem to have got my main server to stop spontaneously rebooting. What was the problem? It appears to be temperature related. If I close the window in the server room at night, all is well. If I leave it open and it's a particularly cold night, the machine stands a good chance of rebooting or hanging.

As strange as this sounds, there's strong evidence to suggest that this is, in fact, the case.

The hits on bash completion continue, which is very pleasing. It looks like this stuff is going to make it into the next releases of Red Hat and Debian Linux, which is very gratifying.

70 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!