Also on twitter ( twitter.com/nutrun )

Archive for April, 2007

Breakfast of Champions

Sunday, April 22nd, 2007

Breakfast of Champions

The Champions’ Ice Coffee

You feel you have achieved something yesterday? Why not have a Breakfast of Champions?

Ingredients: 3 spoonfuls of crappy instant coffee, 1 spoonful of sugar, 10ml of milk, 1 trophy cup

Test Code and Production Code – two distinct beasties

Wednesday, April 18th, 2007

“Test Code and Production Code – two distinct beasties”. Better late than never, they say…

How microformats will simplify the web

Tuesday, April 17th, 2007

For the humorous sake of it, let me start with what I don’t like about Microformats. To cite the site (heh..) Microformats are “Designed for humans first and machines second”. Every time I see the word “humans” in relation to something to do with technology, I kind of turn red. Partly because I’m the sort of person who would always choose to use the ATM instead of going through the Human Bank-Employee, partly because everything designed for humans is going to end up being used most and foremost by spammers.

You see, there’s no denying that software is meant to be used by or facilitate the lives of humans, things like Microformats however are only interesting – and, at least at a low level, are destined to remain so – to a very specific subset of humans: Programmers. So I’d be way better off spared the hippy humane talk.

Having gotten this semantic (there we go…) complaint off my chest, I think Microformats are great. In fact, I find them to be an idea as big as REST over SOAP style Web Services.

The magic lies in the simplicity that escorts Microformats and the household status of their platform. There’s no funny/strict schema in a mile, only mere semantic enhancements to one of the most widely used mediums on the web today: HTML (primarily, although I think it should be exclusively).

Let’s take the following example of something reminiscent of a weblog post:

<html>
  <head><title>Who needs Atom?</title></head>
  <body>
    <h1>Who >needs Atom?</h1>
    <h2>
      Posted on Friday, April 13, 2007
      by Dave Mustaine
    </h2>
    <p>
      Really... Who needs it? Or RSS, come to think of it...
    </p>
  </body>
</html>

Now, let’s add a tiny bit of non-intrussive, albeit meaningful semantic coating to our mark-up:

<html>
  <head><title>Who needs Atom?</title></head>
  <body>
    <h1 class="title">Who needs Atom?</h1>
    <h2>
      Posted on <span class="date">Friday, April 13, 2007</span>
      by <span class="author">Dave Mustaine</span>
    </h2>
    <p class="content">
      Really... Who needs it? Or RSS, for the part?...
    </p>
  </body>
</html>

Suddenly, our document can say a lot to a syndication engine or human developer with a website scraping API at hand. And there’s no need to maintain a feed.xml, or anything similar. The website really is the weblog.

What Microformats, alongside REST are proudly showcasing is how much can be achieved by concentrating on two simple things: Meaningful URLs (Where the resources are and will be) and meaningful mark-up (What the resources are about). Once this is achieved, anyone can do whatever they want with them, because the only thing a website needs to qualify as a weblog, resume, web-service API – and the beat goes on… – is a little bit of meaning.

Life getting a little easier…

Friday, April 13th, 2007

Well, thank god for that…
I got a new job recently on a London media / display company, and all is well and cool -except, it is a PC shop.

Oh dear.

I’ve always been self-employed up till now, and I always owned a Mac of some sort.
So, I was kind of bummed by having to work on a PC -albeit a quite decent one.
BUT, at least I found the thing I miss the most from current Macs: Quicksilver.

God, Launchy was a gift from heaven for me! I mean, seriously, quick launch and Windows Start menu just doesn’t work for me. Not even Dock works for me since I first used Quisksilver. Why don’t the OS X people just incorporate it to their product I’ll never know…

Nevertheless, Launchy is still a bit rough around the edges, but -hey! It works! It might be not as beatiful, and some details might have escaped the creators, but it really is a decent app. I could do with it disappearing when the focus moves away though…

Etch

Tuesday, April 10th, 2007

I can’t believe it’s been 21 months already, because it feels like yesterday when Debian 3.1 was released. Two days ago, the good people over at Debian HQ announced the official release of Debian 4.0, code-named Etch.

Completely upgrading a live system with a mere aptitude -f --with-recommends dist-upgrade with no interruptions and zero downtime never seizes to amaze me, and you can expect it to work when upgrading from Sarge to Etch.

Don’t forget your back ups when kicking off such a dramatic process. This explains it very well.

Hpricot is: Enjoyable website testing

Wednesday, April 4th, 2007

Hpricot is certainly much more than that. In fact, Hpricot is A Fast, Enjoyable HTML Parser for Ruby. Even though the possibilities are limited by one’s imagination, I find testing websites with Hpricot particularly breezy:

require 'rubygems'
require 'hpricot'
require 'open-uri'
require 'test/unit'

class GoogleTest < Test::Unit::TestCase
  def setup
    @base = 'http://google.com'
  end

  def test_language_tools_title
    page = click_link('Language Tools')
    assert_equal('Language Tools', page.at('title').inner_html)
  end

  private

  def click_link(link)
    doc = Hpricot(open(@base))
    link = (doc/'a').detect { |e| e.inner_html == link }
    Hpricot(open("#{@base}#{link[:href]}"))
  end
end

Add the flexibility of the Ruby Net::HTTP API to the mix – for submitting forms, authentication, accessing resources behind proxies, etc, stir and serve chilled.