February 2003

« January 2003 | Main Index | Archives | March 2003 »

Okay. While I still can't sleep, a quick straw poll. Whoever wrote the Java interface to Applescript for OS X was:

  1. So comfortable with AppleEvents that he or she just wanted to replicate them verbatim in a new syntax, instead of providing a useful abstraction
  2. Completely ignorant of the Java Language
  3. A sadist
  4. All of the above

If you answered 'd', you're most likely correct!1 I spent a very frustrating Sunday afternoon putting together what should have been a simple servlet that puts my current iTunes song in the side-bar of the front page of this site. 75% of that time was spent with me being frustrated trying to decipher the totally opaque NSAppleEventDescriptor object that the AppleScript call returns. The whole class is so encrusted with legacy cruft and assumed foreknowledge, it's almost impossible to work with.

1If you answered '4', your browser's list-style-type support sucks

Ouch.

  • 4:13 AM

It's 5am. I was woken up about an hour ago by my own head. It feels like it's over-full, like somebody needs to drill a hole in my skull to let the pressure leak out. It's really quite painful. I can't get back to sleep, because even after two Neurofen, my usually quite comfortable pillow feels like it's made of concrete.

This sucks. I hate being sick. If it's something stupid and my own fault, like a hangover, or the time I tried to leap over that rope at work and gave myself concussion, I tend to just grit my teeth and get through it, but at times like these when it's just my body letting me down against invading microbes, or whatever-the-hell environmental toxins or internal failings that cause headaches, I tend to get whiny and pissed off with myself for not functioning correctly.

Sure, I could treat my body better. It could do with more exercise, and a better diet. (or maybe this is my body reacting violently to the fact that I actually fed it a large quantity of salad yesterday, and it was unused to the nutritious content?) But still, it's let me down this morning, and I'm not going to forgive it easily.

Ouch. Still hurts. Must get email off to work telling them I'll be late, and go back to that concrete block.

You know you've been hacking too long when...

You see the band-name ZWAN (link warning: obnoxious colour-scheme and dancing spam), and your first thought is “What does the Z stand for?”

The last interview I did was over the phone, for a job halfway across the country. Now that was stressful. Doing a phone interview makes you realise just how important body-language is, especially that attitude in an interviewer that says ‘OK, you've talked enough now, finish what you were saying so I can ask another question.’ Over the phone, in the absence of such clues, the interview tends towards you talking until you've bored the interviewer to tears, or tailing off into embarrassing silences where both sides try to work out which is due to talk now.

Read the rest of this entry…

Here's a LazyWeb idea I don't have time to implement myself. It illustrates a few of the things I wrote about earlier about applications cooperating over data.

For each of my NetNewsWire subscriptions, attempt to download the blogger's FOAF file. Extract the personal information from that file, and integrate it into my Address Book.

(In other news. Is there an AppleScripty way to manipulate Safari bookmarks? I'd like to be able to mirror my NetNewsWire subscriptions there, too)

It's been pointed out to me once or twice that I don't enable comments on my posts. Today, I read that this is the number one habit of highly annoying bloggers. Oh well, I'm innocent of the other nine.

My rationale is pretty simple: if someone wants to comment on a post I've made, I'd much rather they post the comment in their own blog and link it to me, rather than putting the comment in my blog. Why?

  • If I post something interesting enough to pass comment on, a link gives the original post a wider audience.
  • A comment will be read only by those people who view the article after the comment is posted.
  • If I respond to a comment in the same forum, chances are the original commenter isn't going to read it, because they'll forget to check back.

Essentially, responses in the blogosphere promote conversation, and widen the field of discussion. Responses in comments tend to bury it. That said, it seems that I'm in the minority, and being annoying. I'm going to experimentally start enabling comments for a while, just to see if anyone actually wants to comment on the drivel I produce.

As my inaugural comment-enabled post, I'd like you, dear reader, to introduce yourself! Do you read my weblog, and I don't read yours? Post a comment and tell me where I can find you. Do you read my weblog and don't have one yourself? Post a comment just to say hi. I'm curious. I get about 3,000 hits a day even on days don't post anything at all, so there must be a few of you that I have no clue about.

(Oh, and to anyone reading this syndicated on livejournal, you'll have to click-through to the original post to get at the comments page here: I don't read the ones posted to livejournal)

Organised Cows

  • 5:19 PM

Don't miss Alan's explanation of Software Development Cows.

Merge Cows
Trying to put your cow into the same part of the code somebody else already put a cow.

I'm sure some people in the office wonder why the three of us greet each other in the morning with a hearty “moo”. Or maybe they don't. Programmers tend towards eccentricity anyway.

I've been trying to write this article for at least six months, but after three or four false starts, it's never quite come out right. So now I'm going to just sit down and get the words out, and not try to be a perfectionist about it.

This all started back when I first tried Spaces. All credit to Diego, it's a very impressive application, bringing together a lot of diverse data and trying to present a unified interface to it. But after about half an hour of playing, it became clear to me that I had substantial philosophical problems with a program that wanted to be a RSS aggregator/blogging tool/mail manager/calendar/God knows what else.

Read the rest of this entry…

It was recently brought to my attention that The Fishbowl's front page doesn't render properly in Internet Explorer for Windows: for some reason the whole page stops at the bottom of the right-hand sidebar. Seeing as I do most of my browsing from OS X, I haven't noticed this. I'll hopefully fix it some time this weekend.

It would be nice, if this were to happen again in the future, if someone were to send me a polite email to let me know...

Update: I moved the sidebar onto the left, and the problem went away. Which is a pity because I don't think the site looks as good with a left-hand sidebar. A few months back when I was first setting up this weblog, I said this...

This isn't the first time I've had problems like this with Internet Explorer and CSS. Not by a long way. In a normal competitive environment, a browser that behaved so flakily the moment you tried to do anything complicated would lose market-share to its more able competitors, and be forced to improve its rendering. However, once a product attains the near-monopoly position that IE has, a reality distortion field comes into effect. It's no longer IE's fault that my page doesn't display correctly, it's my fault for writing a page that triggers one of IE's bugs.

This is not a good state of affairs.

From Livejournal's status page:

LiveJournal is currently under a Distributed Denial of Service attack, and has been since about 5:30pm PST (1:30 AM GMT) tonight. We have been working with our upstream providers (including several major backbones) to filter traffic as quickly and effectively as possible.

Due to the fact that a DDOS attack involves potentially tens of thousands of hosts all working together against a single target (in this case, us), it is extremely difficult to find one group of IP addresses to block to prevent the attack from affecting our services any further. Our upstream providers are currently filtering somewhere around 1/4 of the IPs on the internet from reaching LiveJournal. Unfortunately, these filters also block legitimate traffic from some users. When the attack has subsided we will remove the filters.

We will continue to monitor and block hosts as we gather more information regarding this attack. We seriously apologize for the inconvenience, and hope you understand we are doing everything in our power to get the site back functioning as normal.

Additionally, if you have any information as to who or what may be responsible for this attack, please email attack_info@livejournal.com.

Firstly, this is a really good argument against centralisation. If you have 500,000 users on one server cluster, that becomes a honking big target, and an attack on any one of them becomes an attack on them all. It used to be just IRC servers that got this sort of treatment, and occasionally the bigcompany websites. Now the precedent has been set for knocking Livejournal off the air, look for this sort of thing happening to more mid-size web services that somebody takes a dislike to.

Secondly, I bet if you were to find the person doing this, and asked them why, they'd say “Because Livejournal's lame, you know?” It still sucks that a couple of idiots with no moral sense can screw up such a popular service.

Thirdly, my sympathies to the sysadmins who have to deal with this mess.

I'll have to write an article about DDOS soon. You can tell I've been working hard recently by looking at the calendar: all the posts are clustered on weekends, and they've not been about programming, because my mind's been trying to avoid thinking about that when I don't necessarily have to.

Last political post for a while, I promise.

If there are 500,000 on the [Stop the War] march, that is still less than the number of people whose deaths Saddam has been responsible for. If there are one million, that is still less than the number of people who died in the wars he started. —Tony Blair, speaking about the February 15th march against the war in London, a protest attended by between 1 and 2 million people.

This is scarily disingenuous. Every single death that Blair talks about, is a death that the West, and the USA and UK in particular, are complicit in.

Aside from supporting Palestine (which hardly makes him unique amongst Middle-Eastern rulers) there's no credible (or even circumstantial) evidence of Hussein being involved in terrorist activity outside his own borders (and certainly not even the slightest suggestion that he was involved in the WTC bombing. The closest they've come is showing that one of the conspirators may have talked to an Iraqi agent in Egypt, once). Most of the crimes we accuse him of, such as the gassing of the Kurds, happened when he was our ally, using weapons we (the West) continued to sell him for years afterwards. These crimes only became an issue a decade later when he turned into Public Distraction Enemy #1. Even before the first Gulf War, he was told by the US Ambassador to Iraq that the USA would 'take no position' on his dispute with Kuwait.

Put yourself in Hussein's shoes, just for a moment. It's no secret that the CIA helped you into power, because a secular government in Iraq would prevent it from allying with the Moslem extremists under the Ayatollah in Iran. For a decade, you waged a brutal war against Iran, supported openly by the USA and the United Kingdom, who gave you billion dollars of aid from one hand, and sold you weapons from the other: including "Weapons of Mass Destruction": missile guidance systems, chemical weapons and seed stock for biological warfare. Even as Saddam was preparing to invade Kuwait, the US were preparing to send him advanced nuclear reactors for his weapons program. (Common joke: George Bush addresses the United Nations. "What do you mean 'how do we know Iraq have chemical and biological weapons?' We've still got the receipts!") These sales continued, despite the fact that we knew he was using these "Weapons of Mass Destruction" against the Kurdish people in his own country.

Anyway, for a decade you do what you were put in power by your American masters to do: fight Iran (estimated casualties for both sides, more than one million people. Presumably this is where Blair gets his numbers from). Then one day it all changes almost overnight. In 1989, with the war on Iran over, you were being told that you were "a force for moderation in the region, and the United States wants to broaden her relationship with Iraq" (John Kelly, US Assistant Secretary of State, visiting Baghdad). In 1990, you were apparently the most evil man in the world. In 1989, the US and Britain were selling you missile technology, diverting it through third-parties to obscure the paper-trail. A year or two later, you are told to destroy it all.

And even after the Gulf War, you were still permitted to slaughter the Kurds, in the name of "regional stability".

So yes, Hussein a monster who is responsible for the deaths of more than a million people. But what does that make us? The governments, the nations, the people of those nations that supported him in fighting Iran, in gassing the Kurds, in bringing a brutal dictator to power and giving him rein, that blood is on our hands. We (the West) backed him all the way, right until he wasn't useful any more. We backed him to the tune of billions of dollars of aid... money we knew we'd get back in arms sales. The only moral path is to clean up our own back yards before we invade anyone else's. And the best way to prove we are now clean, is to come up with a peaceful solution to this problem we have created in the Middle-East.

And that means changing focus away from weapons, and towards democratic reform. At the same time weapons inspectors continue to disempower Saddam, we should be helping the people rebuild roads, and the critical infrastructure that brings people electricity and clean water, and takes away their sewerage, all those things that were bombed into oblivion throughout the 1990's. Don't pursue "regime-change", which just replaces one dictator with another (who will probably turn into Saddam in ten years time). Empower the people. Pursue democratic reform. Eventually, and this may take a decade to come to fruition, the UN can oversee free and fair elections, as it has in many other countries making the transition from dictatorship to democracy.

Now that would be victory.

These pictures really don't do justice to the size of the crowd that turned up in Sydney today to protest against Australia's involvement in any war in Iraq.

“A democratic society depends upon an informed and educated citizenry.” —Thomas Jefferson, quoted today by Rogers Cadenhead.

The death of democracy is inextricably linked to the transformation of the news media from journalism into entertainment.

News as journalism seeks some approximation of ‘the Truth’, to inform and educate its public. As such, it must:

  • Present a balanced viewpoint, including both sides of any issues covered.
  • Cover (and emphasise) stories based on their overall importance to the target audience.
  • Ask difficult questions of those in power, and demand answers.

Journalism as entertainment, on the other hand, has the sole aim of gathering, and keeping an audience, usually to funnel the audience to advertisers. As such, it must:

  • Present a viewpoint that does not offend the opinions of its target audience.
  • Cover (and emphasise) stories based on their immediate emotional impact on the audience.
  • Ask only those questions sanctioned by those in power, so that they continue to favour your organization with appearances and information.

Of course, things were never as pure as the first list, neither are they now as corrupt as the second. My mother told me a frightening story last week about my uncle, who was a Fleet St editor, and quit the business because between the interests of the paper's conservative owners, and the threats of the socialist printing unions, he had very little leeway to report anything. Even given that, it's pretty clear that the world of the media has been sliding down the slope between the first and the second extremes for quite a while now.

As an aside, this is one reason weblogs aren't journalism. Weblogs present a single side of an issue (the author's), and cover stories based on the interests of the author. Since people gravitate to opinions that match their own, it is unlikely that a weblog will ever challenge your prejudices, or at least it is unlikely that you will read it again after it has. The one thing weblogs have been good at, is in asking questions that the mainstream media is no longer able to.

The downfall of political reporting is well-documented. Politicians always knew they needed the media, which gave the media power. However, one day the politicians realised that the media needed them just as much. By selectively giving exclusives and interviews, politicians can condition the media. It's Pavlovian. Don't ask the difficult questions, you get more interviews. Report favourably, and you get leaked more information. Get more interviews, scoop your competition with the new stories, and you rate better than those who have the questions, but nobody to answer them.

Which means that while it's good that weblogs can dare ask questions that the mainstream media aren't asking, they're unlikely to ever get answers to them, unless there's so much noise that the mainstream media is embarrassed into action.

It's getting to the point where opinion polls on war in Iraq contemptuously ignored by my country's government, because those in power trust the power of their media allies to convince us they're right, and we're wrong. Where we all have questions we want to ask our elected officials, but get no answers because those in the position to ask them for us have their own agenda.

The public are not informed and educated. We are pandered to, and fed information that suit the agendas of those who dispense it. Don't think I'm excusing myself here. I am a socialist. I gravitate towards media that validates my opinions just as much as any die-hard American Republican glues himself to Fox News. I just wish there were a middle route.

Moving, maybe...

  • 12:31 PM

Disadvantages of the apartment I just applied for: I hate moving, $100/wk more in rent, not as convenient for 7-11 or restaurants. No built-in wardrobes.

Advantages, on the other hand: Slightly bigger. Cable already installed. And, er...

A really great view of the Sydney Harbour Bridge.

For a long time, I've considered Javascript to lie somewhere beneath my contempt as a language. Which is a pity, because it's not really Javascript's fault. Browsers' support of the language has always been underwhelming, and grossly incompatible. in the past, whenever I've tried to do anything with Javascript it's taken far too much time, and because the capabilities just weren't there, it never never quite worked the way I wanted it to.

Javascript itself is a small language, but that wasn't the problem. The problem was that what we generally refer to as being ‘Javascript’ is really the intersection of the language itself, plus the DOM (and to some extent CSS) support of whatever browser it's being run in. And it's only in the last year or so that web browsers have had anything approaching decent DOM/CSS support.

Secondly, the annoyance factor of so many people not being able to tell Java and Javascript apart (curse you, Netscape marketing weenies!) made me prejudiced against the language whenever it was mentioned.

In the last few days, I've finally had the chance to get down with my two-inch thick O'Reilly DHTML book, and write a useful scripted page for the project I'm working on. Here's what I learned.

  • Javascript's object model is simple, very flexible, and pleasant to use.
  • I really liked having first-class functions and closures. I found myself writing things like ["id1", "id2", "id3"].map(function(item) { return document.getElementById(item); });. A cow orker looked at what I'd written and accused me of being too Smalltalky (and I've never coded Smalltalk seriously)
  • DOM support in version 6 browsers is very good. Manipulating a webpage is surprisingly easy. (Although my point of reference here is the Version 4 browser, when I last attempted this sort of thing)
  • That DHTML book is incredibly good, and no web developer should be without it.
  • This sort of thing is only really practical if you forget that browsers older than Mozilla or IE6 exist.
  • While I had the luxury of targeting my code at a single browser version, everything I did could easily be made cross-browser in half an hour (taking into account the previous definition of “cross-browser”.
  • Being a closet HTML nerd (and thus knowing where to look for things in the HTML DOM, and what CSS to manipulate to make things move around or disappear) helps.
  • Most importantly, spending two days learning a language I've never really programmed in before, in order to fulfil a valuable goal, is a good experience. I really should go back to improving my Ruby skills, too.

Java, being rooted firmly in the C tradition, believes that the first number is zero. Arrays and lists begin at index 0. The first character of a String is string.charAt(0). Thanks to the legacy of time.h, Java even believes January is month 0, skewing up the mental landscapes of anyone used to thinking of June as month 6, and December as month 12. (Someone once told me this originated with the desire for C programmers to be able to map easily between a numerical month, and an array of named months without wasting the first... er... zero-th element of the array).

It therefore came as something of an annoyance to me when, years ago, I discovered JDBC starts counting at 1. I've lost count of the number of times I've been caught out because the first substitution parameter in a PreparedStatement isn't zero, and neither is the first element of the ResultSet. But I've gradually got used to this, annoying as it is.

Then today, I discovered java.sql.Clob#getSubString(long, long). Let's ignore for a second the fact that the java.lang.String#substring(int, int) method sets a precedent for “substring” being a single word, with no internal capitalisation. Thankfully, Eclipse's auto-complete has set me free from that particular trap. Let's instead look at this one, little thing.

The offset parameter in String#substring is zero-based. The offset in Clob#getSubString is one-based. What the hell were they thinking? Every single Java programmer, on seeing that method, will assume that it's zero-based without even thinking. And it isn't. Bastards! I don't care which is closer to the ODBC API. I'm sure 99% of Java programmers don't care either.

Once more, with feeling. Bastards!

From a link passed to me by batty, we find Modern Drunkard Magazine's: The 86 Rules of Boozing

34. If you bring Old Milwaukee to a party, you must drink at least two cans before you start drinking the imported beer in the fridge.

...

55. If you think you might be slurring a little, then you are slurring a lot. If you think you are slurring a lot, then you are not speaking English.

JSR-666

  • 7:35 PM

JSR-666 n. The Java Specification Request from Hell. The one that contains all the ideas that will make Java... well... not Java any more.

Usage:

“Java would be much better if you got rid of static typing and checked exceptions.”
“Yeah, that's one for JSR-666.”

Update: Alan Green, the cow-orker with whom I came up with JSR-666, has compiled the initial list of recommendations., including import *, having a default throws clause for all methods, and the complete elimination of NullPointerException. Further suggestions are welcome.

The Dawn Entity

  • 4:38 PM

Sometimes, I wonder whatever happened to DAwn McGatney.

Shellshocked

  • 3:28 AM

Tonight, just before going to bed, I learned of the tragic break-up of the Space Shuttle Columbia on re-entry, and the probable death of her seven crew. To those astronauts and their families, I send my thoughts before I go to sleep. They are brave pioneers who work to push back the horizons of our world. I hope they found some way to cheat death. I am sure if they are confirmed dead, the world will mourn their passing.

Friday, at around half past six in the morning, a train derailed outside Sydney, killing eight and injuring 41 others. If you don't live in Australia, you probably haven't heard of this. They played their part in making our world. These were ordinary people on their way to work.

Today, probably more than one hundred people died in car crashes in the USA alone.

Who do we choose to mourn? How is this decision made? Can we truly care about the whole world, or is it just too damn big? Can anyone truly comprehend, and care for every single person who died today, or would it destroy our souls to try? And is it disrespectful to elevate any of the dead above any others?

To all who live on this earth, take a moment today to recognise what is precious to you. Cherish that now, for we are all mortal.

This is entirely Lonita's fault. The rest of my apartment will have to wait until I've finished tidying, but I thought I'd do the kitchen beforehand, just for all the beer bottles.

An annotated picture of my kitchen.