13 June 2006

The 7 (f)laws of the Semantic Web

When it comes to the Semantic Web, you might call me a disillusioned advocate. I’ve been dipping in and out of the technologies for the last 5 years or so, but am increasingly frustrated by the lack of any visible progress.
Source: The 7 (f)laws of the Semantic Web.

09 June 2006

Not on my watch!

Our resident IntelliJ plugin guru Rob has been at it again. For a while we've been dreaming up ways to automate a build breakage notification, so that it's really in your face. Rob's solution?

Will wonders never cease?

07 June 2006

Why do they hate us?

The hypocrisy of the US administration astounds me constantly (and they're not alone unfortunately).

For a textbook example of why we are hated, consider Gaza and the West Bank. There, a brutal Israeli/U.S.-led cutoff in aid has been imposed on the Palestinians for voting the wrong way in a free election.

...

Query: who, besides al-Qaeda and recruiters of suicide bombers, can conceivably benefit from persecuting the Palestinian people like this? Does President Bush or Condi Rice think the Palestinians will respect an America that did this to their children, after we urged this election, called for Hamas to participate, and preached our devotion to democracy?

...

The White House says we don’t negotiate with terrorists. But when we had to, we did. FDR and Truman summited with Stalin at Yalta and Potsdam. Nixon met with Mao in Beijing. Kissinger negotiated with the Viet Cong and North Vietnamese at Paris. Bush I allied with Assad in the Gulf War. Clinton had Arafat to the White House too many times to count.

Source: The Persecution of the Palestinians.

05 June 2006

Ruby early return considered harmful (for idiots like me)

I've been playing with some Rails code at home to support some of the work we do at the day job. I'm building a search tool that detects the kind of input and performs searches based on this type. I've been working with Ruby's regular expression support, and test driving a class to find UUIDs. Here's what I started with (please don't comment that it could be simpler, I was starting simple... :).

class Uuid
  REGEX = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/

  def Uuid.isUuid(fragment)
    if fragment =~ REGEX
      return true
    end
    return false
  end
end

Thinking that this could be simplified be removing the return keyword, I removed it!

class Uuid
  REGEX = /[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/

  def Uuid.isUuid(fragment)
    if fragment =~ REGEX
      true
    end
    false
  end
end

This caused all sorts of funny problems, which in hindsight are painfully obvious, but at the time are just a pain. Removing the return causes the if to essentially fall-through, always returning false.

Discussing this at work, perhaps I've hit up against a potential maintenance issue with Ruby. I'm hoping this isn't the case (you can do similar stupid things in most languages), but some of the things you can do with Ruby make me a little nervous. I'm holding my tongue for a while (I did the same thing with XP and am hooked) to see where things go, I'm sure it'll all be fine...