Wednesday, 28 September 2011

Neutrino Racing


That is all.

Thursday, 15 July 2010

No software patents in NZ

Today the NZ government that they are not going to change the law to allow software patents in NZ [1], [2].

This is a GOOD THING, and rather a surprising development in this time of creeping increase in draconian IP laws.

That is all.

Thursday, 17 June 2010

Extended Warranty

3 metre extension cords with extended warranty. Guaranteed for up to 6 metres.

Thursday, 13 May 2010

The Gervais Principle

Here's an absolutely fascinating and insightful article about the psychology of company structures and lifecycles and the different roles people play within them, using the TV show The Office as an example:

The Gervais Principle, or The Office according to The Office

(This is from last year, but I didn't see it then, and it just got reposted on Hacker News. Long but worth reading all of it.)

It's quite dark and slightly cynical, but it's also pretty much spot on. Suddenly the business world makes sense.

Wednesday, 5 May 2010

ColorLogs log colorizing script - my version

Finally got round to publishing my log colorizing script 'ColorLogs'.

It's available here on GitHub: http://github.com/memorius/colorlogs

This is a perl script intended to have command output piped through it to a terminal, and allows easy creation of new highlighting configurations using simple text matches, globs or regular expressions. See the readme for instructions - very simple to use.

My version started as a fork of v1.1 from here, but I've made numerous improvements since then. It's become an essential tool for me when running ant, maven and various other programs in the terminal.

Please feel free to use it, modify it, etc. You can also send me your custom highlighting config files - I'll be happy to put them in my repository for others to use.

Tuesday, 4 May 2010

Color survey

Awesome and fascinating results of XKCD's color survey.

How nice to be able to spend your time on stuff like that...

I'm gonna print the poster, RGB monitor color spaces be damned!

Monday, 29 March 2010

Meta-patents

This isn't new, but I had to share it.

Someone (Halliburton apparently) has tried to patent the process of patent trolling.

If granted, this would allow you to sue everyone who ever sues (or licenses or alleges infringement or obtains out-of-court settlement or cross-licenses etc etc) anyone in relation to any patent, for infringing your patent on the process of suing (or licensing, settling etc) in relation to a patent.

Beautiful. Twisted, but beautiful.

Monday, 22 March 2010

Night Unicycling - Makara Peak, North Face

Having bought some Ay-Up LED lights (which are absolutely awesome) in December for an outing at Unicon (which I never actually went on), lately I've been getting into night unicycling - so far mostly on Mount Victoria.

Last night I finally got back up to Makara Peak - somehow I've not been since December - for what became a 3-hour ride, half of which was in darkness.

This was also the first Makara Peak outing for my new KH24 mountain unicycle, which is the only thing I've wanted to ride offroad since I got it in December. I've been riding it on Mount Victoria and having a great time on the steep tracks there.

The KH24 really likes Makara Peak. With its long 165mm cranks and huge 3-inch-wide tyre, it's much better suited to the steep rocky parts than the 29" uni, especially with the trails in their current eroded, rocky condition. At least, it's better suited now that my balance and skill is up to it and I don't have to rely on the big 29er wheel to smooth out the bumps.



KH24 at top of Sally Alley track

Eventually, in darkness, I reached the summit, after stopping to chat to two surprised evening mountain bikers. The climb was a bit of an ordeal - my leg muscles are apparently a bit out of condition since I haven't done any multi-hour rides lately, just shorter intense ones on Mt Vic. I had to walk much of Aratihi, though the lower tracks were ok.

The summit was in cloud and very windy, so I didn't linger but headed over to the new North Face downhill track, which is now open for careful riding, and has recently been conquered by mountain bike.

I'm not going to say too much about whether it's a good idea to ride a new, unfamiliar, unpolished, rough-edged track by unicycle, alone in the dark, when somewhat tired... suffice to say that I survived.

So, what's it like? What can I say? North Face is awesome! This is already my new favourite track in the park for unicycling (previously I would have said Sally Alley/Missing Link, then Aratihi downhill). Never boring, but still good for a bit of speed. The right mix of interesting steep bits, twistiness, sudden humps and grade reversals.


KH24 resting on North Face, lights of Karori in background


KH24 and a treacherous bump on North Face, cloudily illuminated by Ay-Up lights

Some of the many steep switchbacks defeated me, but I'm still fairly rubbish at unicycling even the easy ones (even those on Lazy Fern), so that says more about my riding than the track design. They will provide a good challenge for some time I think!

After North Face I was tired enough to take the easy option, so headed up then down the 4wd track, then down Lazy Fern. Unfortunately I then got an agonising cramp in a thigh muscle, leading to an abrupt dismount, and leaving me helplessly cursing on the ground for a while until it relaxed and I could bend my leg again. Ouch! Maybe I overdid it slightly. I had to walk down from there - it felt like it might cramp again, and the results could be spectacular if descending a switchback at the time!

Fun ride. A lot of muscles are going to hurt in a day or so, but I will definitely be keen to ride North Face again soon. Just for a laugh, I might try it in daylight.

Tuesday, 16 March 2010

Immortality

Things that worry me about immortality, #485:
Do I get to keep my lifetime gym membership?

Monday, 1 March 2010

Spring: setting static fields

This is pretty obscure, but I just found this nice trick with Spring framework, for injection of values into static fields: I've been looking for a way to do this for AGES.

What that article doesn't mention, and the key benefit in my project, is that when you use @AutoWired, you can have the Spring-invoked initialization method marked as private, to avoid polluting your public API.

Spring config:
<beans xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">

    <!-- Scan for @Autowired annotations -->
    <context:annotation-config>

    <!-- The instance to be injected into the static field on StaticHub -->
    <bean class="internal.stuff.MyInterfaceImpl" name="myPrecious">

    <!-- The class which will have its static field set via @Autowired -->
    <bean class="very.public.api.StaticHub" name="dummyInstanceOfStaticHub">
</beans>

Java class with static field:
package very.public.api;

import org.springframework.beans.factory.annotation.Autowired;

public final class StaticHub {
    private static MyInterface theStaticInstance;

    /**
     * Note this initialization method is private! No nasty public setInstance method.
     */
    @Autowired(required = true)
    private StaticHub(MyInterface instance) {
        theStaticInstance = instance;
    }

    /**
     * My public API, making the Spring-created instance of MyInterface statically accessible
     */
    public static MyInterface getInstance() {
        return theStaticInstance;
    }
}

This is a big improvement over my previous unsatisfactory solution, which was to use org.springframework.beans.factory.config.MethodInvokingFactoryBean with a public method on StaticHub like this:
<bean name="staticHubInitializer" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="staticMethod" value="very.public.api.StaticHub.setInstance"/>
        <property name="arguments">
            <list>
                <ref bean="myPrecious"/>
            </list>
       </property>
    </bean>

    public static void setInstance(MyInterface instance) {
        theStaticInstance = instance;
    }
...which is not very pretty.

You can also use @Qualifier to disambiguate if you have multiple beans in your Spring container which implement MyInterface:
import org.springframework.beans.factory.annotation.Qualifier;
...
    private StaticHub(@Qualifier("myPrecious") MyInterface instance) {
        theStaticInstance = instance;
    }

Before you use this, consider carefully whether static fields are actually a good idea - in general this kind of pattern is something Spring is designed to help you avoid!

In my project there are good reasons for it, but it needs thought - things get complicated quickly in environments with multiple classloaders, or with multiple Spring containers inside the same classloader; it also makes it harder to use newfangled clustering technologies which let you scale to multiple JVMs.

Friday, 26 February 2010

Comedy autocorrect suggestion of the day

Eclipse's built-in spelling checker recommends I replace "hashcode" with "hitchhike":
/**
 * Generate a hitchhike for this event
 *
 * @return a hitchhike considering only the event's topic and properties
 */
@Override
    public final int hashCode() {
    ...

Thursday, 25 February 2010

Homeopathic horror

I've been a bit quiet lately. There's been a lot going on in my life, including moving to a new flat and selling my old one. Not much time lately for blogging, nor for Makara Peak trips, though on the plus side I'm now living right next to Mount Victoria, so I've been mountain unicycling there about once a week.

Today's horror story, from the UK: Stop funding homeopathy, say British MPs.

The horror is that currently, homeopathy IS paid for by the NHS. Homeopathy is a 'treatment' which is trivially demonstrable to be complete bunk, 'medicines' with no active ingredients whatsoever. Even homeopathic 'hospitals' have been paid for. To the tune of maybe £4m per year, and £20m 'hospital' refurbishments.

At least they are coming to their senses now. I'm quite glad I'm not a UK taxpayer.

Monday, 21 December 2009

Makara Peak shuttle day by unicycle

Makara Peak had a shuttle day on Wednesday 16th, to which I took my 29er unicycle - finally got round to posting about it.

4WD lifts to the summit allow you to do as many downhill runs as you have time and energy for. Due to a slow puncture which I wasted a lot of time messing with, the warmth of the day, the exhaustingness of mountain unicycling, and my general beginnerness, I had time and energy for only two. (Some of the fearless speedy downhill mountain bikers did dozens.)

First I tried out some of the tracks on the back of the hill - Zac's track, Varley's, and down through the woods via Wahine (at least, I think it was Wahine) to Karori Park.

Zac's was a bit narrow and slippy-sandy for me at the moment, and hard work in the heat - no shade - but should be increasingly fun as I get better.


Zac's Track


View towards Makara Cemetery and the wind farm

Varley's endless switchbacks were a bit overgrown with long grass, resulting in an interesting dismount into a spiky tree (barberry probably) as the slowly deflating tyre, the grass-hidden side of the track and my steering conspired to send me flying off the downhill side, scraping up my upper arm nicely. I was glad of the elbow pads. I actually managed quite a few of the switchbacks though - starting to get the hang of them.

Wahine was pretty steep through the woods, but an interesting change from the trails on Makara Peak itself. Lots of dismounts. Fortunately today was dry - I think this could be too slippery for one wheel when wet.

Once at the bottom I headed to the nearby bike shop to get my second spare inner tube of the day (long story) as a precaution against the worsening slow puncture. Then at Karori Park I refilled my nearly-empty 3-litre camelbak (that's a lot of water for just a few kilometres), rested a while and ate sandwiches.

Recovered, I decided to ride up Koru before going for a second shuttle run - after chatting to some folks by the BBQ at the bottom.

This time down Aratihi (by far my favourite downhill at the moment) and Missing Link (rode the whole rocky downhill part this time, but still walking the uphill). Then after surprising an upward-bound 4WD, I had another go at Ridgeline Extension. Getting better, I can do the woodland parts well enough, but still defeated by some bare rocky bits - when I'm not dodging hurtling downhill bikers!

Finally down Lazy Fern (favourite finish), then I had to struggle up to St Alban's Avenue where I'd left the car near the shuttle pickup.

See the gallery for more pictures, and captions.

Send in the clowns

This has to be my laugh of the week.

This is due mainly to the presence of the phrase "preoperative medically trained clowns".

Friday, 18 December 2009

Someone breaks a leg while unicycling on Mount Vic!

Snapped femur. Ouch. Can't believe he actually has video of it happening!

Muni Leg Break from Boffy Da Unicyclist on Vimeo.

I've yet to do worse than a sprained ankle - hopefully there are no broken bones in my future.

Sunday, 6 December 2009

Unicycling Makara Peak - summit

I've been on a few more weekend unicycling trips to Makara Peak since the ankle incident, now kitted out with ankle braces, and this week with some elbow pads as well following some scrapes and bruises last week. Ankle is mostly recovered now despite continued weekend abuse.

Last Sunday and yesterday I managed to reach the summit, via the very rocky Missing Link, and the long uphill Aratihi track.

The uphill rocky parts of Missing Link are still a bit much for me, though I can manage most of the downhill.

Though mostly not very steep, Aratihi is quite a long climb, and it's still well beyond my current endurance to ride the whole of it without stopping. Yesterday though I managed to ride intermittently for maybe 2/3 of it, and tried to keep walking up during the recovery periods in between, rather than stopping completely.

After a quick rest at the cloudy and windy summit, I came back down Aratihi and found it to be just right for my current skill level - an interesting and fast downhill route, but not too tricky even when I'm really tired from the uphill. (Last week I tried to go down Ridgeline instead, and had to walk it - much too hard at the moment.) Then back along Missing Link; the downhill first half is fun, but the climb back out of the valley is the disadvantage to this route: had to walk it. Then down the 4WD track and Lazy Fern - still a favourite. By the time I reached Lazy Fern my back was aching and I was glad to reach the bottom!

I took the camera along this time - there are only a few pictures because mostly I just kept riding / falling!


Here is the gallery with the rest, and captions.

The park will have been very busy today with the Makara Peak Rally, so I'm guessing it will be pretty torn up next weekend (as if I needed any more obstacles). Next year I hope to be good enough to enter the rally on a unicycle - would be an interesting challenge. At the moment though I would just be a semi-stationary obstacle in the way of the mountain bikers!

In a week or so there is a shuttle day (4WD lifts to the summit, so you can repeatedly ride the downhills) - I'm taking the day off work to go along if the weather is decent.

Tuesday, 1 December 2009

Unicon XV schedule and race routes

The schedule has been posted for Wellington's upcoming Unicycle World Championships & Convention. Less than a month to go.

Also the details of most of the race routes, which are right on my doorstep.

The 10km race (pdf) is on the flat, all along the waterfront round some favourite places from my rides to work, and my first ventures out and about after I learned to ride: Queens Wharf, Frank Kitts Park, Te Papa, round the Overseas Terminal, then back to the start - 3 laps.

The 44km marathon road race (pdf) is around Scorching Bay, Shelly Bay, up the hill to the prison, over the hill to Scorching Bay again - 4 laps, with a fair bit of up and down.

The trials competition will be right behind where I work, at Odlins Plaza.

The muni crosscountry course is all over Mount Victoria, looks really steep. Here's the map:
Full size original is here. Uphill and downhill tracks still to come.

It includes some of the tracks I've been riding up recently, but some that are steeper - and 3 laps! On my 29er, at my current strength and fitness I wouldn't finish even one lap without a few rest stops.

These events should be impressive to watch.

Sunday, 22 November 2009

Terrorists sneak up on Homeland Security

Nice work.

I wonder if they came after him as he walked away? That would be particularly amusing.

Update: apparently the front of the shirt says "Not A", and apparently he survived the attack.

Offset your Bad Code footprint today

Twisting the much-abused concept of "offsetting" carbon dioxide emissions (your "carbon footprint") by buying "carbon credits", now you can "offset" your footprint of badly-written software by buying Bad Code Offsets.

Donations go to the widely-used open source projects jQuery, PostgreSQL, and the Apache Software Foundation.

Nice idea, but that last one is enough to trigger my rant mode:

Perhaps this will help Apache Commons to actually finish and maintain a project for once!

Apache may have, according to their home page, "a desire to create high quality software that leads the way in its field", and be "celebrating a decade of open source leadership", but the part I have experience with - the Commons java libraries - are, despite being very widely used, hardly a shining beacon of what open source can achieve in terms of Good Code!

Over the last few years I have spent a lot of time with several of these, using them in a large java project in my day job. This has proven a very time-consuming and frustrating experience. Without exception, I have found them to be incomplete, buggy and poorly written, and often essentially orphaned, with no releases in several years despite numerous reported critical bugs. I have had to build custom versions of four of them to fix basic failures - typically things that have already been reported with submitted patches, and often things severe enough to break my production installations. Fixes contributed back to the projects generally just sit in the issue tracker, unreleased! Why even bother contributing?

Bad open source code which is free, I can tolerate, if it admits its limitations and its completely unsupported status. After all, I can (and do) fix it myself, given the permissive license.

Bad open source code which makes a lot of noise about community, claims to strive for high quality and to lead its field, provides an issue tracker and release plan, yet doesn't release contributed critical bugfixes even after several years - this I have much less tolerance for.

More than most projects, I blame the Apache Foundation and its process for this. As Paul Graham points out, process (especially ease of releasing, and hence frequency) has a lot to do with software quality and currency. Apache places a big emphasis on their community consensus process, committees, the process of gaining project committer status etc, so they should be blamed when that process fails dismally and still hasn't released known, already-implemented fixes after several years.

via Coding Horror