Posted by: moorglade | March 26, 2009

Installing James

A while ago I implemented an application that performs an email merge, sending customised content to subscribers. All well and good, until I get reports that one particular person is not receiving the notifications.

Much testing followed, her record was analysed and test emails sent. Everything appeared to be working. The email server logs were subjected to more scrutiny than the private life of the latest celebrity. No errors were found.

I filed the bug in the ‘to follow up’ category and promptly forgot about it. Lo, when next the email merge sent, she once again missed out. The bug seemed unreproducible except in live conditions, when sending to greater than 3000 subscribers. Unable to set up conditions to examine it without harassing our subscriber base with unwanted emails, I once again shelved the problem. And there it remained until a chance conversation with a colleague gave me a brain wave – something I had never even considered. Read More…

Posted by: moorglade | March 25, 2009

onBeforeUnload

The onUload event handler has been around since JavaScript 1.0. The unload event fires when the user exits a document. It falls down though, in that it cannot cancel itself.

In web page design, this is great. The casual user browsing the web should be in complete control. In the world of DHTML, Ajax and web applications though, it becomes much more desirable. (Purists may still argue that providing a reliable ‘undo’ function is better than a cancel – but this throws up a whole heap of other questions.)

Gmail capturing a window unload event

Gmail capturing a window unload event

IE has supported an non-standards compliant handler, onBeforeUnload for a while. What I just realised today, is that Firefox now supports this too. It should have been obvious – on inspection, Gmail uses just this mechanism. (Again, purists may ask why not simply send off an AJAX save request on the unload and let the user know their message is saved in drafts, where they can delete it if they want. I’ll let them!).

Certainly not something to use everyday – but I can think of a couple of apps I will retrofit to give the user a nicer experience.

Posted by: moorglade | March 22, 2009

What I did on my holidays: Rarotonga 1

Other than a very brief two hour layover at 2am in Tahiti, when I first moved to New Zealand, neither my wife or I had ever been to a Pacific Island. Living in such close proximity in New Zealand, we reasoned it would be the perfect honeymoon destination. Our original plan was to Island hop a bit, visit maybe three Island groups, Tahiti, the Cook Islands, and Samoa. After some investigation though, it proved very difficult to get from one Island to another, short of flying back to Auckland. Also, our last holiday to England and Europe had proved very frenetic, not staying in one place longer than three days, and we wanted this break to be somewhat more languid.

So, we settled on just visiting the Cook Islands, and having a longer holiday in one location. After our float plane ride back from the Sounds, we traded up to a newly refitted Boeing 777, and settled down in business class. For such a short trip, there was really no need, but hey, it’s your honeymoon, you might as well splash out! Also, being a short trip it wasn’t insanely expensive. So, we got to indulge in fully lie flat beds in Air New Zealand’s new Business Premier class. As with the float plane, you wouldn’t do it every trip, but it was certainly a nicer experience than the normal economy class.

Rarotonga from the air

Rarotonga from the air

Four hours after leaving Auckland, we were circling over Rarotonga. The airport takes up a long strip along the North West coast, and as we approached from the South we could really appreciate the topography of the Island. Formed from multiple volcanic eruptions, Rarotonga is the youngest of the islands that make up the Cooks. The highly fertile soil of the central regions is covered in dense bush as it rises up to the multiple peaks that make up the ‘cloud mountains’ of the interior. Towards the coast the highlands flatten to a large coastal plane that encircles the 30km diameter, out to a rich lagoon, and further out a barrier reef.

The view out our window during one of the tropical storms

The view out our window during one of the tropical storms

We were staying in Muri, a small settlement almost exactly opposite the airport on the South West coast. The lagoon here is a marine reserve, and the four small Motu, or islands, provide a picturesque backdrop to the turquoise and indigo of the water.

The Pacific Resort Rarotonga was a lovely place to stay. Our bungalow was hidden away in lush tropical gardens, but still only 100m from the rich amber hues of the beach. A stream full of fish, fresh water crays and eels, flowed between the two, crossed by several bridges. A restaurant on the beach afforded breathtaking views of the sunsets, while a second restaurant bordered the stream, allowing the ravenous fish to be fed directly from your plate.

Visiting in February, the heat was not as oppressive as I had been expecting it to be. When it did become too much, the sea was only moments away, and was a pleasant alternative to the artificial air conditioning to cool off. Being tropical, the frequent storms were impressive. Out of a clear sky you would hear thunder rolling across the island, followed by the sky darkening, darkening, until the first large rain drops arrived. For ten minutes the rain would be torrential, then as suddenly as it arrived, it would be gone. Another ten minutes, and the ground would be dry again, as if the rain had never been.

Muri beach

Muri beach

Posted by: moorglade | March 22, 2009

The Queens Revels

The Queen's Revels orchestra

The Queen's Revels orchestra

The Queen’s Revels (or, an Elizabethan dance party) was held last night in Mt Victoria. Along the same lines as, and organised by the same people as the Feast of Fools, this was a great night of Renaissance music and dance.

Being based two or three hundred years later than the medieval Feast, the music was more readily recognisable, and a number were pieces that any classical orchestra would recognise. The orchestra of period instruments were amazing, as were the madrigals sung by quartets and quintets of the St Mary of the Angel’s choir.

A travelling minstrel?

A travelling minstrel?

Posted by: moorglade | March 8, 2009

Kepler lives again


Image credit: NASA/Jack Pfaller

2009 is being celebrated for being 400 years since Galileo demonstrated his telescope, and discovered the four largest moons of Jupiter. The turn of the century was a huge time in the scientific world quite apart from Galileo Galilei. While Europe, especially Italy was struggling to break out from the grip of the inquisition, the ’scientific method’ was starting to take off, especially in England with the birth of the Royal Society. By ’scientific method’ I am referring to what any high school science student would recognise now, but was revolutionary back then – the postulation of a hypothesis, and experimentation to prove or disprove it. Since Aristotelian times, the ‘natural philosophy’ was just that – a branch of philosophy. Philosophers would argue a hypothesis based on its merits in a naturally ordered universe. Actually experimenting was anathema.

In 1600, Johannes Kepler met Tycho Brahe. Working for Brahe at his new observatory, Kepler used physical observations to progress his mathematical models, and to underpin his laws of planetary motion. His work was itself one of the foundations of Newton’s theories of gravitation. As well as an astronomer and mathematician, Kepler also progressed the study of optics, and his Keplerian refracting telescope directly builds on Galileo’s own design.

As such an important foundation to our current body of scientific and especially astronomical knowledge, it is great to see that NASA’s new planet finding telescope has been named after him. Equipped with a 95-megapixel array of charge-coupled devices (as used in everyday digital cameras), it has the largest camera ever launched into space. Kepler will orbit the sun in an earth-trailing orbit, looking out towards Cygnus, watching for periodic dimming of stars that would indicate a planet passing in front. It is our best hope so far of finding earth-like planets outside the Solar system.

Posted by: moorglade | March 7, 2009

What I did on my holidays: a floatplane ride

The first part of our honeymoon involved getting back from our wedding venue in the Marlborough Sounds, to Wellington to catch an international flight.

The Marlborough Sounds are ’sounds’ in their true meaning. Unlike the Milford Sounds further south which are actually fjords created by glaciers carving through the landscape, or the Sound (of northern European usage) which would more properly be termed a Strait, the Marlborough Sounds were originally hills and river valleys, which through rising sea levels and subsidence have been drowned and covered by the sea, forming the characteristic long arms and small coves.

The ‘normal’ way between Wellington and the Sounds, and more generally between the North and South Islands, is on an ‘Interisland’ ferry. Two companies run regular passenger services on five different boats, a journey that takes around three hours – roughly evenly one third each in Wellington harbour, crossing the Straits, and through the Sounds. The journey itself is picturesque and a great tourist attraction – but it gets a bit boring when it is almost like a commuter route. Additionally, the venue for our wedding is half an hour from Picton by water taxi, making the round trip from the Cove to home the better part of six hours.

To make the start of our honeymoon special, we decided to do it slightly differently. We chartered a float plane to pick us up from the Bay of Many Coves and do a scenic flight over the Sounds on our way home. The one disappointment is that due to air and sea traffic in Wellington, the plane could not land in the harbour – instead, they fly to the Porirua inlet, half an hours drive north of Wellington.

View from floatplane

The weather was again amazing, completely calm with thin wisps of cloud hanging in the valleys, slowly being burnt off by the sun like snow drifts melting into the water below. We banked out of the bay into the main arm of the Queen Charlotte sounds, before climbing up over Portage and down into Kenepuru Sound. Flying in a light plane is so different to a commercial liner, and we never climbed higher than the peaks of the surrounding hills. The many bays and coves take on a dreamlike aspect as you pass slowly overhead, the ripples and waves in the water merge into one seamless mirror as you gain height, until they themselves crack into splinters, the reflected sun refracted into thousands of sparkling shards where different currents meet.

View from floatplane

The azure water of the deep sounds slowly bled into the lighter colours of the Cook Strait as we headed out towards Mana Island and started to descend into Porirua harbour. The flight is certainly not the way to travel to the Sounds on every trip, but as a once off I found it amazing, yet again seeing this piece of paradise on our doorstep in a new light, yet again falling in love with the hills and valleys, the streams running down to the sea, this beautiful picturesque country which is our home.

Posted by: moorglade | February 25, 2009

WCC predetermines submissions, again!

What is it about our local council that makes them need to appear so out of touch with their constituents?

Recently, there has been a large stoush in the chambers, with several councilors calling on Cr Andy Foster to resign over his refusal to accept the Cobham Park location for the new indoor stadium. “If he cannot accept the collective responsibility of his council, he should resign immediately,” says Cr Morrison – although maybe Morrison needs to read the rule book and realise that collective responsibility is governmental convention, and does not apply at local body level.

After a meeting between the parties, the Mayor’s office released a media release to ‘Seize opportunity on ICSC’. In essence, there will be more analysis done on the options that was missed out of the fast tracked process. However, the very last sentence is shocking: “I’m hopeful this will resolve Cr Foster’s issues once-and-for-all and allow the ICSC to be built at Cobham as soon as possible.”

This comes after a long run of statements from the Mayor, including the infamous (paraphrased, as I can’t find a link to the source) ‘we will build a second mount vic tunnel no matter what the submissions say’. And indeed we have seen a supreme reluctance to accept the results of public submissions. 80% of respondents to the Ngauranga to Airport study said they did not want a Basin reserve flyover, yet it has been passed through Council. Now, they’ve done it again.

The results of the ‘Restoring the golden mile‘ submission were released today, showing that 74% of submitters opposed having buses in the mall. So what does our council do – they look for reasons to ignore the results.

Our take on the figures at this stage is this is more a pedestrian’s view of the world.”

Full disclosure – Unlike in the N2A submissions, I was one of the 20% who were very much in support of the proposal. However, that does not make it better that they are now planning on ignoring the majority that has spoken. I am fast losing all confidence in our city council.

Posted by: moorglade | February 24, 2009

Normal transmission resumes

I apologise for dropping off the blogosphere for three weeks. Significant events have been happening in my life.

I had a lovely post explaining my forthcoming absence all worked out. It was entitled The last post, and it juxtaposed that piece of music and its traditional usage with the ending of one stage of my life and the beginning of another. It then went off and explored the use of harmonics in bugle calls (bugles of course can only play one note, and the harmonies built off that), and paralleled that with the harmonious joining of two lives. All quite cloying and sappy really. But I completely ran out of time to type and post it before having to leave for my wedding. Probably just as well!

More recently, I decided not to post anything immediately upon my return to support the protest against S92A. I’m sure everyone reading this has heard everything there is to be heard about that, so don’t worry, you won’t get it from me again.

What will you get from me? Well, as soon as I get my thoughts in order, and find the pesky camera cables that I’ve lost, I’ll be putting up some thoughts and photos from our time in the Cook Islands, and from the wedding itself in the Marlborough Sounds.

Posted by: moorglade | February 2, 2009

Musical Monday: Ballet

I’m afraid I don’t know who this piece is by, or really much about it other than the name – Ballet.

The music I have is arranged for four guitars, and is, as you’d expect, a ballet. I’ve ‘rocked up’ the rhythm slightly, rearranging it for flute, recorder, and two guitars. I couldn’t really figure out how to end it, I was trying to bring it to a climax that didn’t really exist in the music, hence the somewhat ostentatious drumming. I’m still not too happy with the ending, but it’ll do for now. (I should mention that the drum track is all MIDI programmed – much as I’d love to be able to play it live, there’s no way I’d be able to handle the syncopation that I put into the high-hat).

I’ve also been playing around with the video editing software that I finally bought. I’ve also invested in a new digital camcorder, which records in wide-screen. The video editing software maintains the aspect ratio of video in the ‘main track’, but for some reason completely skews video that’s in overlay tracks, converting it to 3:4 ratio. It then stretches it taller than the main track – I can’t figure out how to specify that the main track should be size of the final render, and everything else cropped to that. Very annoying. I was also playing around with transparent backgrounds, but it appears my skin tone is almost the same as the wall behind me, so to make that fully transparent also made me transparent. Now I’ll have to invest in a proper green screen!!

Ballet

Posted by: moorglade | January 28, 2009

Cycles, economic and by-

The last fortnight has seen several petrol price increases, just at the time when all the gas guzzling SUVs and people movers that have been sitting in their garages for the last year were starting to find their ways on to the streets again. All those people that thought last years record prices were a temporary blip need to take note, and start to prepare for much worse to come. Oil will become far too scarce a resource to waste powering a vehicle to move one person. And this has got to be a good thing for the environment, as less car use means less polluting emissions.

So it has been interesting to watch a number of developments over the same period of time, developments both political and scientific.

First, our own city council appears to be more dysfunctional than ever, with an amazing article in the Wellingtonian last week.

Confusion reigns over the Basin Reserve flyover. Some city councillors believe it will definitely be built, others think it is yet to be voted on, and a public opposition group is gathering strength to fight it.

“It is council policy that we support the flyover,” says Cr Andy Foster, while Deputy Mayor Ian McKinnon says ‘…I don’t think we voted on the flyover.”

Meanwhile, in the States, (or at least two of them), legislators are trying to make up for the poor planning of their cities’ cycle ways. Every cyclist knows that annoyance of having to stop for a red light or a stop sign. Yes, we are officially vehicles, and must obey the road code, but the energy needs to restart after stopping are huge compared to those of maintaining speed. This is fine for cars, in which you simply put your foot down and the car accelerates, but on a bike you are supplying the motive power. Another problem that I personally experience, is that a lot of traffic lights are sensor activated. They register the weight of a car waiting, and change to allow that car to proceed. I (and my bike) weigh at a tenth of even the lightest car – not enough to trip the sensor. So I either wait (sometimes minutes) for a car to pull up, or go against the traffic light. Traffic planners have their parts to play in this, but where they fail, maybe a change to the law will help.

These are the questions raised by newly-proposed legislation in Oregon [and existing legislation in Idaho]. The statute, proposed by the Bicycle Transportation Alliance, would allow cyclists to treat stop signs as yield signs [give way in NZ terms!], requiring them to yield to traffic with the right of way, but otherwise allowing cyclists to roll through stop signs if they have the right of way…
[and in Idaho]
…A person operating a bicycle or human-powered vehicle approaching a steady red traffic control light shall stop before entering the intersection and shall yield to all other traffic. Once the person has yielded, he may proceed through the steady red light with caution.

I mostly cycle to work before 7am, there is very little traffic around. I have clear visiblity in all directions approaching most intersections, it would be really lovely if I didn’t have to come to a full and complete stop at every stop sign.

Lastly, frogblog has an article about a laser projector bikelane. I agree with the comments that lights and reflectors would be a good idea too!, but it is astounding the number of cars which do not realise how wide a bike is. Any and all visual reminders are welcomed.

With the fantastic weather over summer, the bike lockup in my building is chocker every day. Hopefully, the number of people choosing this great means of transport can only increase, and our city planners get finally understand our needs – and that when 79% of people say they don’t want something, they should not build it anyway!

…Ms Prendergast said a new Mt Victoria tunnel should be a high priority, regardless of what submitters to the study say.

« Newer Posts - Older Posts »

Categories