

November News
Sunday November 23, 2008
Okay I haven't died yet, it's just been pretty boring on the news front for the blog.
Let's see, I've spent the last two weeks practically home alone: two flatmates in the South Island, one in Australia for a week, means one Jeremy at home cooking delicious food for himself, and playing absurd amounts of DotA. Not that either of these things are bad. I brought DotA to work on my iPod in the hope I could attract some interest and get my workmates to play as well.
I had a flatwarming for three of my workmates last night too. They live about 20 minutes up the road from me, so maybe I'll see them on the bus or walking home or something. But it was a pretty cool party, got to hang out with people and socialise and stuff. Woo~. Got caught by the rain as I went home, but luckily the bus was on time and I managed to minimise the wetness.
I've been doing a lot of web development lately. I fixed some spam bot problem with my Shoutbox a few minutes ago, and I thought I'd blog about something that's been infuriating me for the past few weeks.
The majority of the world have this program installed on their machines and actively use this malicious application. I do not know the exact numbers, but whatever the statistics are, it is far too much for people to being using such filth every day.
I am, of course, talking about Internet Explorer.
Who the hell at Microsoft decided to make a substandard browser with so many security flaws and a blatant disregard for web coding standards just to piss developers off? Morons. Absolute bloody morons.
In this site I've been working on (You know the one, Stephen :O), I have this search box that appears onmouseover, and it disappears when you click outside the box, but should remain visible when clicking inside the box. The easiest way to implement this was to cancel the bubbling effect that events have, that is, clicking inside a table will trigger its onclick, its parents onclick and continue up the chain until there are no more onclick handlers.
So, if the table onclick is specified and the event.returnValue parameter is set to false, I can use this value to prevent subsequent calls to the onclick handler. Thus, when it gets to the body onclick, inside the handler, I just return prematurely if event.returnValue is false.
Yup, that's all great. Works wonderfully on Firefox. This behaviour also works on Internet Explorer too...oh, wait. Hold on a second. By specifying that the event's returnValue is now false in Internet Explorer, all onclick handlers no longer work. That means onclicks for anchor tags and submit buttons. What kind of stupid system is that?
I resorted to using the following code:
<script type="text/javascript">
var eventHandled = new Array();
function myFunction(event) {
if (eventHandled[event.type])
return;
eventHandled[event.type] = true;
}
</script>
<body onclick="myFunction(event); eventStates = new Array();">
<table onclick="myFunction(event);">
<tr>
<td>No Click</td>
<td><div onclick="myFunction(event);">Click</div></td>
</tr>
</table>
Clicking on the innermost <div> with "Click" calls myFunction. myFunction sets eventHandled["onclick"] to be true, and prevents bubbling up by halting execution of the onclick in the <table> and <body> tags. Finally at the <body> tag, the states are reset to ensure that the next onclick can be processed. Phew!
Stupid Internet Explorer.
(PS: I should look at getting some syntax highlighting...)
The Air of Change
Saturday November 8, 2008
As history unfolded three days ago as America watched its first African-American President be elected, so too the winds of change have swept over New Zealand as John Key, leader of the National Party, becomes our Prime Minister-elect. Gracious in defeat was Helen Clark, who highlighted the good nine years of Labour government, and announced her resignation as leader.
But I must say.
The changes don't stop there. We are watching the face of New Zealand politics change like never before, as New Zealand First fail to meet the 5% party vote threshold, and both Winston Peters and Ron Mark fail to win their electorate seats, sealing the fate of the party as it no longer has any seats in Parliament.
I can say only one thing.

Remember, Remember, the Fifth of November
Wednesday November 5, 2008
As the poem goes, the city of Wellington celebrated Guy Fawkes Day with a fantastic display of pyrotechnics streaming from the harbour.

But for some, these fireworks meant more than watching a myriad of chemicals combust in the sky. These fireworked heralded a change. A change that attracted the interest of the entire globe as we followed the US Presidential Race during the later hours of the afternoon, until its pinnacle as Senator Barack Obama claims the 44th Presidency of the United States of America, defeating rival John McCain, 338 electoral college votes to 156. It is certainly a phenomenal landmark in the history books as America gets set to crown its first African-American President.
But of course, my project team and I were busy discussing important matters at our team meeting.

¬.¬