February 08, 2010
I discovered earlier today that through my trial ipv6 access I am using mostly ipv6 to access Google services. This made me wonder: just how much of my home network's communication with the outside world is through ipv6 compared with ipv4?
I don't have any results yet, but this is how I'm measuring it using Debian Linux.
Network traffic in the Linux kernel is managed through the tool iptables. Conveniently there are completely separate tables for ipv4 and ipv6 so I don't have to do anything to separate those. There are several chains which packets traverse depending on where they came from, where they're going and whether or not they're being routed on behalf another computer.
The chains of interest are INPUT, FORWARD and OUTPUT on the default table. INPUT receives all packets destined for this particular computer, FORWARD receives all packets which are being ferried on behalf of other computers (in my case, sharing Internet access with NAT) and OUTPUT receives all packets being sent from this particular computer, not on behalf of anyone else. By default all of these will simply allow the packets to pass unmolested.
What I've done is create four custom chains: ipv4_input_ppp0, ipv4_forward_in, ipv4_forward_out and ipv4_output_ppp0. They don't actually do anything, which permits the packets to continue onward, but iptables will keep track of how much traffic travels through each rule, both as a number of packets and in bytes.
Here is some output from "iptables -x -n -v -L" with these chains set up:
Chain INPUT (policy ACCEPT 617 packets, 92499 bytes)
pkts bytes target prot opt in out source destination
41 5511 ipv4_input_ppp0 all -- ppp0 * 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT 46173 packets, 28090499 bytes)
pkts bytes target prot opt in out source destination
21742 10919366 ipv4_forward_out all -- * ppp0 0.0.0.0/0 0.0.0.0/0
24431 17171133 ipv4_forward_in all -- * eth0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 487 packets, 113453 bytes)
pkts bytes target prot opt in out source destination
61 4783 ipv4_output_ppp0 all -- * ppp0 0.0.0.0/0 0.0.0.0/0
The rules are set up to use iptables' built in filtering capability. The ipv4_input_ppp0 rule will only collect packets which have an "in" interface of "ppp0". This means that packets from me sshing to my router from my LAN will not be counted. ipv4_output_ppp0 is handled the same way.
Similarly the destination interface is used to differentiate between incoming and outgoing traffic which is being forwarded by my router doing its router job, leading to counts in ipv4_forward_in and ipv4_forward_out.
This means we have direct byte counts which we can pull out of iptables and add together to get total incoming and outgoing ipv4 traffic. To make the information easier to process the counts can be zeroed at any time by running "iptables -Z".
The ipv6 setup is exactly the same except you use the tool ip6tables instead.
Here's my configuration for datalogging. I use the following in my firewall script which is run on boot to set up the chains and rules:
iptables -F
iptables -X
iptables -N ipv4_input_ppp0
iptables -N ipv4_forward_in
iptables -N ipv4_forward_out
iptables -N ipv4_output_ppp0
iptables -A INPUT -i ppp0 -j ipv4_input_ppp0
iptables -A FORWARD -o ppp0 -j ipv4_forward_out
iptables -A FORWARD -o eth0 -j ipv4_forward_in
iptables -A OUTPUT -o ppp0 -j ipv4_output_ppp0
iptables -Z
ip6tables -F
ip6tables -X
ip6tables -N ipv6_input_ppp0
ip6tables -N ipv6_forward_out
ip6tables -N ipv6_forward_in
ip6tables -N ipv6_output_ppp0
ip6tables -A INPUT -i ppp0 -j ipv6_input_ppp0
ip6tables -A FORWARD -o eth0 -j ipv6_forward_in
ip6tables -A FORWARD -o ppp0 -j ipv6_forward_out
ip6tables -A OUTPUT -o ppp0 -j ipv6_output_ppp0
ip6tables -Z
Then I run this script every day at midnight from root's crontab:
#!/bin/bash
ipv4_input_ppp0=`iptables -x -n -v -L | grep 'ipv4_input_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv4_forward_in=`iptables -x -n -v -L | grep 'ipv4_forward_in' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv4_forward_out=`iptables -x -n -v -L | grep 'ipv4_forward_out' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv4_output_ppp0=`iptables -x -n -v -L | grep 'ipv4_output_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
iptables -Z
ipv6_input_ppp0=`ip6tables -x -n -v -L | grep 'ipv6_input_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv6_forward_in=`ip6tables -x -n -v -L | grep 'ipv6_forward_in' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv6_forward_out=`ip6tables -x -n -v -L | grep 'ipv6_forward_out' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ipv6_output_ppp0=`ip6tables -x -n -v -L | grep 'ipv6_output_ppp0' | grep all | sed -e "s/\s\+/\t/g" | cut -f 3`
ip6tables -Z
ipv4_in=`echo "$ipv4_input_ppp0 + $ipv4_forward_in" | bc`
ipv4_out=`echo "$ipv4_forward_out + $ipv4_output_ppp0" | bc`
ipv6_in=`echo "$ipv6_input_ppp0 + $ipv6_forward_in" | bc`
ipv6_out=`echo "$ipv6_forward_out + $ipv6_output_ppp0" | bc`
echo "$ipv4_in $ipv4_out $ipv6_in $ipv6_out" >> /var/log/traffic/ip
February 08, 2010 06:29 AM
February 05, 2010
Welcome back! Last episode, our heroes had suddenly found themselves with rapid-onset heart attacks and Pocky, and had gone past a giant crab. Well I’m pleased to say we got back to the hotel just fine. After chilling in the hotel room and blogging for a bit, we went for dinner.
Next morning: woke up, did the cursory internetting for a few hours, then we went for a walk. Our path today: the Path of Philosophy, a trail going for a couple of km’s that goes past ever more shrines and temples and gardens, following a stream. It was really enjoyable (AAAAA++++ would walk the path again).
After checking out what looked like the final shrine on the path, we headed west, past the university, to the Kyoto Imperial Palace Gardens. Who needs a palace so huge? Some school kids had the right idea (or perhaps it was their teachers): run around the thing. The whole place is 1.3km by 800m.
Southward, about another k, and we got to the final attraction: the International Manga Museum. Photos were not permitted for most of the place, but if you could imagine a three-floor building with lots of manga (a collection of over 40,000 volumes) stacked on the walls, an exhibition of western comics for girls and women, a display of wood carvings, a reading room for kids, and lots of people sitting around just reading manga, then you’ve got the idea.
Finally, we were walking in the vague direction of the subway, when we came upon a garage-like sale at a shrine. It was “garage-like” in that it had the feel of a garage sale, and yet was clearly well-organised and with some interesting goods. My eyes happened upon a golden fully-mechanical pocket-watch, with no internal cover over the clockwork so that you can see the whole thing in action. Had. To. Have. Got the lady down to ¥8000–coincidentally, the amount of money I had on me. This is why I need to go to an ATM again so soon.
After all the excitement we headed back to the hotel, and promptly ran out of internet (because when they say 24 hours, they mean 24 hours!) but I bought some more. I’m not here to be so cheap as to make life totally inconvenient.
February 05, 2010 11:50 PM
February 04, 2010
A few hours ago my friend Josh posted an excellent blog post of what we’ve been up to in Japan (http://joshdeprez.com/?p=416). It strikes me that there’s a lot missing. This post will attempt to fill in the gaps. It will skip through the things Josh explains.
One disclaimer – I make no representations about the factual accuracy of this post. It may or may not have some relation to real events.
So, here we go.
~ Gold Coast. Plane. 9 hours. Kansai International Airport. Money Hole. 3rd floor (of 5). Takoyaki sans-tako. ~
Anyway, around about now we had a chance to use our iPhones. Josh’s, as expected, worked perfectly. Mine did almost the opposite. It also worked perfectly. This is despite me being assured several days ago that prepaid Vodafone customers could not get roaming in Japan, and that in any case I would need to be on the $49 cap.
Sadly, we had dire need of my prepaid data, because we didn’t know where our hotel was or how to get there. So I loaded up Google maps, but then Josh found it on a map anyway.
~ Fun whole wall train fare schedule. “Stuff that, let’s get the day pass”. ~
We then caught the JR train to Osaka. I’ve heard a lot about how trains in Japan are almost always on time, but somehow we managed to attract the one delayed one -_-.
We sat around for a bit less that 10 minutes waiting for some unexpected passing trains or something, and then spent the rest of the trip being profusely apologised to by the effusive Japan train voice.
~ 800m walk with semi-miraculous string of green lights. Yay internets. ~
At this point a comment must be made about the difficulty of talking in Japanese when you know some but not enough. It’s annoyingly hard to ask for things in Japanese rather than pointy language or English. Why? Because you have to read the menu / map / etc first. And that’s in Kanji + English. I often don’t understand the first one. They often don’t understand the 2nd. We revert to pointing, which is really unfortunate.
Anyway, we caught a couple more trains in the morning and then walked from Tennoji to Den-den street after some harrowing encounters with 3 different maps, my broken sense of direction, uncrossable streets, lack of signs and even street names (they use numbers or something), and a rather angry looking vending machine.
Eventually we got to Den-den street, although somehow we’d ended up at the north end. That would be the wrong end, meaning that in order to walk through the street we’d have to go backwards. So instead of doing that, we accosted a vending machine and headed into the closest electronics store. There we wandered around looking for cheap computer parts, but were only able to find cheap cameras. I bought a Nikon D3000, and despite the salesman’s attempts to warn me about the warranty and power supply not working in Australia it turned out to have an international warranty and a battery recharger that will work perfectly well in Australia with a standard cable.
We then wandered off towards Minami, got lost again after somehow crossing a river without noticing, discussed various transport options, and chose the slow (but day-pass useable) loop train back to the station 800m from our hotel.
We then flipped out and teleported to Kyoto. Enough about trains.
Kyoto is very pretty, but it makes you wish it was Spring. In Spring it would undoubtedly be beautiful. In Spring we would not be able to afford our 5 star hotel, or even get a reservation. I guess these things balance out.
~ Guided check-in, random convenience store, dinner, night-time wander around expansive hotel, sleep, missed winter celebration. Morning~
So there’s this walk in the Lonely Planet guidebook, which our hotel is pretty much at the end of. We started walking backwards down it, and visited some deserted temples. Around then my new camera ran out of batteries, which I had forgotten to recharge.

The last photo.
そのあとで we found our way to a large temple in which there was a Buddhist monk reciting a story/lesson (or something) about some people who wanted to change themselves – it was pretty interesting, but also fairly hard to follow because it was in Japanese and seemed to be jumping around a bit.
After that we abandoned the walk and headed up through the forest on Higashiyama towards the temple I particularly wanted to see – Kiyomizudera, a huge set of temples perched on the side of the hill. We came in from the back.
Here we met our first actual crowd (and close to our first actual people, the last temple excepted). Since we came in from the back we started at the top. That’s where the greatest concentration of shrines can be found. There are two rocks about 10 meters apart – the nicely misspelt sign informed us that walking between them with your eyes closed would predict your future love life. I went first and made it with a bit of help from the gaps in the pavement. Josh went 2nd and got somewhat lost, but made it with a bit of help.

No eyes allowed
Kiyomizudera had a very nice atmosphere – the crowds were fine, but there was a genuine feeling of, if not reverence, then casual respect for the shrines.

A pretty street.
~ Way too much cream, walking, Gion, walking, city, walking, walking, subway, hotel, books, sleep, walking, dinner, blogging, logging ~

Some random pavement. Not sure why.
More philosophy next time. Also by then I may know how to use my camera (I’ve had heaps of help from Twitter, thanks for that!).
February 04, 2010 01:22 PM
Welcome to the show! Tonight, I start on a series looking at the travels through Japan of myself and Alex.
A while ago somebody had the idea of going to Japan. Hrm well actually the thought has crossed the minds of many. But since there’s no time like the present, we booked some fantastically cheap flights and leapt across ocean and landmass alike in an Airbus A330 from the Gold Coast to Osaka. Here are some airport/plane snaps.
The landing at Kansai International was smooth. It’s a big airport, situated in the bay, conveniently connected to Osaka by rail and road. First order of business after the nine hours in a pressurised tin can speeding faster than your mum: money, tourist maps, and dinner. I ordered some okonomiyaki and Alex some takoyaki (though I should mention in order not to imply he’s quit vegetarianism, he did pick out the octopus and I helped myself).
Then we hunted down the train station. In order to ride a train you need a ticket, and we ended up laying down ¥4000 (~$50) each for two-day Kansai JR passes. The train left the airport, and roared up the side of the bay to the Osaka loop line, where it eventually took us to Osaka station. The hotel was about 1km north, so although getting the subway was possible, we walked instead. Checked in, checked out the room, checked the email. Behold, our first encounter with the INAX, a Japanese smart toilet.
The INAX features two water squirters for cleaning ones rear and, for ladies, front matter after use, as well as a seat and lid that can be dropped and will still close softly. But where’s the flusher? Turns out it was not on the main control panel.
Second bathroom innovation: the shower. There are two knobs, like a regular shower. However, instead of the cop-out approach of having one for hot and one for cold and letting the monkey figure out the right combination, this shower has one knob for temperature and another for flow rate. Also, the temperature knob has a locking button that can optionally prevent the knob proceeding beyond 40 degrees, presumably in the event of children.
We hit the sack and awoke some hours later in Osaka. It struck me as being vaguely reminiscent of Melbourne, though the train system is probably the least similar (in that the JR trains actually work. A rant for another time, perhaps.) After breakfast at the bakery café in the hotel, which had a rather satisfying set menu, we checked out and left our bags with reception.
We can get pretty gadget-nerdy at times, and it turns out Osaka has one of the bigger streets for obtaining well-priced electronics, an area known as Den-Den Town. We walked south back to Osaka station, and caught the loop around to Tennoji, where we walked past a few temples and shrines and vending machines on the way.
Despite all the stores we could have gone into, we pretty much spent most of it in Sofmap. Alex got a Nikon, I got some green goo. Win! But there was much more win at this store.
They had a pretty neat section on the fourth floor for keyboards and mixing desks and other audio production gear, and I was quite tempted. I also looked around for anything that could go in my ExpressCard/34 slot, and for SSDs. Alas, they had not a large enough SSD, nor could I find anything else. But what really tempted me was the out-of-production Mac equipment: they were still selling 12″ Powerbook G4s (I can’t begin to describe how much I wanted one back in the day), and even a couple of beige G3 Macs, as well as some of the old accessories.
Bah! I really couldn’t indulge—for you see, in the process of moving out recently, I had vowed to get rid of useless belongings in order to make space for things I really wanted, and I already have enough nostalgia-pacifying computers. Really.
We had lunch at Mickey D’s. Currently they have an “American” theme to their promotion (lol). I got a Texas Burger meal, and this would have to be almost the unhealthiest burger McDonald’s could devise: imagine, if you will, a bun between two slices of meat. Hehe, almost. The Texas has one meat patty larger than the surrounding bun, some cheese, mustard, and bacon. It’s basically a meatwich. (It was pretty delicious.)
Then walked around a bit more before calling it quits. The other objective was to get to Kyoto, where the real fun would start. So the next moves went: train to Osaka station, walked to hotel, got bags, walked back to station, train to Shin-Osaka, limited rapid train to Kyoto, fumbled about in Kyoto station looking for the tourist information centre, obtained a map of Kyoto, and then caught the subway to Higashiyama. Though perhaps we should have waited for the next stop, as once again, we ended up walking 1km to the hotel.
The Westin Miyako Kyoto is quite large, each floor a maze of long corridors and passages. It took about five left turns to get to the room, and we continued exploring the expansive hotel later in search of internet. Before that, we went for dinner. I had some yakisoba, and Alex had a mixed-vegetable okonomiyaki this time. The dinner was semi-ceremoniously dumped upon the heated metal surface in front of us, and we shifted bits and pieces onto the small places with chopsticks.
The final order of business for the day turned out to be the obtaining of foods for breakfast. There’s a convenience store that goes by the name Lawson. It has a nice selection of baked goods and plenty of instant ramen options. Best was yet to come: after purchasing ¥3300 of things, we were told to pull five cards out of a box. As it happens, three of the five cards were for the clerk to go fetch: as a prize!
And so began more walking. Last night there was a festival marking the end of winter, but we were quite pooped by the end of yesterday that we slept instead. Oh well. But it looks like there was some party, because some of the decorations were still up.
All the shrines, temples and so on were great. But for a challenge, we went up the mountain.
And then back down for a bit.
And then at the end of all that mountaineering, was the shrine and temple to end all shrines and temples: Jishu shrine and the Kiyomizu temple—a UNESCO world-heritage site, with utterly amazing buildings and endless entertainment. Lots to do with love. For instance, there are a pair of stones separated by about 10 metres. If you can walk from one to the other without using sight, it is said you will have more luck with love.
After all the fun at the temple, we had some “lunch” in the form of condensed heart attack wrapped in a pancake: the Japanese crépe. This one has a slice of cheesecake together with some blueberry sauce and stuffed with whipped cream. I washed it down with some Fire from the vending machine (served hot. Just the thing I needed on a very brisk day.
This was followed by more walking, back into town. We passed another awesomely-named store called Raak. I obtained a pack of the national food: Pocky. And some sushi on the side.
February 04, 2010 10:03 AM
January 29, 2010
Being my fist LCA this was my fist open day, I was wanting to go the the last one but spent most of my time rebuilding a server for TUCS. It was like a Salamanca market for geeks, and most of the wares were free (since this was a open source community). I found a few neat thinks like the racing car that ran only on batteries. And picked up my geek prayer book. After the open day I walked down to the museum, besides being a museum there were a few hands on activities that made things fun as you walked through. The day ended with a bunch of us in the common room eating pizza and working on our individual projects, a good end to the week in NZ.


January 29, 2010 09:47 PM
The lack of sleep is starting to take hold, too many late nights staying up late and socilising in the awsome uni common room. We had the penguin dinner where more socialising happened, my one complaint was food alcohol. I didn't care much for the preformers either, it was a big dissapointment since the rest of the week went so well.
Pictures below, chip stand "free chips!", epic beer and the uni common room.



January 29, 2010 09:14 PM
January 22, 2010

I’m in California again for work! It is raining heaps and I’m really enjoying it. Half of Secret Lab’s clients are now in the Bay Area. PhD is coming along slowly (but smoothly!)
Gadget wise: So, I’m using a Nexus One now. Review to come (uncharacteristically I plan to review the thing!)
In short: win.
January 22, 2010 05:29 AM
January 21, 2010
Ok, today’s recommendations are “The Elephant in the Room: Microsoft and Free Software” and “Tux on the Moon: FOSS hardware and software in space”. Both were interesting talks, especially the second one. A sort like competition to send a rocket into space (WhiteLabelSpace), but you should check out the progress of the Lunar Numbat!
For dinner I ordered Venison on a Stone, as you can see from the pics below the meat turned up raw. Thats ok, I can cook it on the hot rock they gave me as well!! Fancy that.


(ps if you don’t get the joke from the first pic please go here..) 404 Meal not found..
January 21, 2010 09:17 AM
A good day, the two talks that I enjoyed today were “Flying Rockets with Free Hardware & Free Software” and “The World’s Worst Inventions”, video will be released later if you want look at them. After the conference I headed back to my apartment and started more hardware soldering and programming. It is at this stage I have to thank everyone who cooked the meal, it was awesome and allowed us to continue with our hack fest. By the time we had all packed up it was just after 12am, this made the next day hard to get up but meah. I learnt enough to be able to continue with my next project, I should at leased have a stab at it as I now have all the hardware to put a test rig together and publicised it enough so there is almost no backing out.


January 21, 2010 08:51 AM
January 20, 2010
I’d just like to briefly observe something that I guess is fairly obvious about the nature of writing things to be read by other people.
Conveying experiences perfectly is impossible.
You’ll agree this is pretty obvious. However, I think I’ll go further than this – giving anything more than a hint of an experience was like is a fantastically difficult task.
The problem is that the main way in which authors build images in the mind of the reader is by calling on the reader’s experience and imagination, two things which by their very nature vary wildly from person to person. This means that writing a book that nearly everyone can enjoy is a virtual impossibility (and yet some incredibly talented and lucky authors manage it).
Even writing a message for a specific person requires you to know precisely how that person thinks, under what conditions it will be read, and how the person will be feeling when they read it.
Such is the hazard of communication.
I’m sure that this has all been said before. This is just my own attempt at explaining an experience of it.
January 20, 2010 05:50 AM
January 19, 2010
Nothing speial happens today, I spent most of the time in the systrem administators mini confrance. There were a few good talks but most of them I wouldn’t have added to the program. I suppose I was expecting a more in depth talk about the dos and donts of system administration. It was a long day, towards the end I nearly fell asleap on the job. So I went back to the hotel and fell asleep, after collecting food from a supermarket like place. I purchased some “drinks” when I was there and a while later was about to open one, and found the lid would not screw off. Just my luck I purchased a drink without a bottle opener!! Where did my multitool go? Ohh that’s right I left in Hobart. Well the main confrance starts tommorow, I hope I can find some good talks to goto.
Images, bacon wrapped in a pancake smothered in maple syrup with lemon juice in the side.
RepRap machine (free rapid prototyping machine)


January 19, 2010 09:57 AM
January 18, 2010
I have spent most of the time attending the Arduino crowd today, the opening keynote while entertaining at the start it finished with a technical glitch that put a downer on the rest of it (Welcome to Wellington). Anyway the rest of the day seem to pan out really well, if you like to tune in check out the program and stream it live!!
Anyway I have lots of Arduino gear now, ready to do my bidding!! Well once I get time to program and problem solve everything. :/
Loving NZ I think getting lost alone has lead me on long walks and interesting places, I will have to come back to some of them just to take a few pics, before signing off I must point out the bus system down here (see pic) it’s like trams but no lines.. SO AWSOME..


January 18, 2010 09:45 PM
January 17, 2010
I'm taking what scant morning time I have away from the conference today to let you know what I'm doing during it, isn't that nice? Naturally, I've written this at 6:30AM, which is like 4:30AM Sydney Time: a fact that my body hasn't kept from me. Still, I need to be up early, if only for today... So. Here begins the brain dump:
I landed in Wellington on Friday -- as a miniconf organiser, I was fortunate enough to get picked up at the airport, and get the sights of the area shown to me. This includes Wellington's idea of an aircraft control tower (slotted between two houses on a residential block -- no photo, going too fast :(), a wind meter, which kindly blocks the road in sufficiently-strong winds, and most importantly the conference centre in which LCA will be held. I checked in to UStay (the budget accommodation booked by the conference), and got a room on the 11th floor. This wouldn't necessarily be an issue to me, save for the fact that the elevator goes up to 10 only: the remaining floor is scaled by way of a fire escape that isn't terribly well-marked. The room is pretty comfortable (really good for NZ$21 per night), and the common room is big, with plenty of couches, allowing delegates to socialise.
This is my first time staying at conference accommodation (I've been to two LCA's before), which has revealed an entirely new side of the conference: all the delegates staying here share a single common room, and there are plenty of new friends to be made just by popping over to another of the many groups that form there.
The common room, luckily, provides more than enough entertainment here, since the weather's been pretty awful since I got here -- strong wind and plenty of rain have accompanied 15-degree weather (which I am hoping will lift tomorrow). Flights for some have had to be diverted to Auckland, so it's dubious as to whether some people will even make the start of the conference. This is apparently unusual for Wellington (despite its reputation as the windy city).
Well, it's probably time I considered popping downstairs, and getting ready to go: I've got a miniconf to run today -- wish me luck!
January 17, 2010 05:43 PM
How hard is it to wake up at 7am in NZ? Well that’s 5am in AUS, and I was up at 4am to catch a flight.
Well that was impossible!! At 9am finaly crawled out of bed and grabbed some food at the corner shop on the way to the confrance center. Turned up at 9:30 and found a very organised crew, each room has a webcam like setup. So if you want to tune in, some of the presentations will be streamed live to the interwebs. Think I’m getting use to this funny money, it looks so strange in the till, like aus notes but realy faded.. Once again I found my in the world, up the back in the dark. But this time in front of a audio desk, kinda a change from the lighting desk I’m use to. Meah I still get to play around with sliders to keep me intertained. Weather in Welington is a bit fail at the moment seems to be drissiling alot, so as a result I’m getting realy good use out of my new rain coat (and loving it) doesn’t seem to take to long to dry, shake and da da!! Anyway day 1 in NZ not to shabby..


January 17, 2010 08:34 AM
January 16, 2010
I had a lazy start to the day waiting for the right time to start my journy to the airport. After running around trying to find my apple headset I have come to the conclusion that I have left it on my desk at work (bugger no the end of the world though).
The flight from Hobart to Melboure was delayed so I was pushing it to get to the next gate. If I calculated in baggage time I could have had a quick coffee in hindsight.
International flight to NZ (Welington) was good, don’t care much for sitting in the same spot for hours on end by I got over that until my lappy battery went flat. Small sacrifice to make for some intertainment. I was assigned a block of three seats to myself but was sourunded by young children, they were quite behaved for most parts, it was the acent and decent was the worse with them screaming out with ear pearsing aggony.
Had a look around the place meet up with a few folk going to the same confrance as me, found somewhere to eat and now I’m pretty much had it. I think this calls for a early night.



January 16, 2010 08:05 AM
I'm sitting on a couch in the UStay common room in Wellington: the first bunch of LCA2010 delegates are showing up. Very much looking forward to registration tomorrow, and the week that follows it.
That's all for now. More substantial updates once things actually happen!
January 16, 2010 02:14 AM
January 13, 2010
Update 21/01/2010: added Zombieland!
Another post of no substance! Why 2009 was an above-average year for movies, in no particular order:
- District 9
- Watchmen
- Coraline
- Up
- Star Trek
- Moon
- Inglourious Basterds
- Avatar
- Zombieland
January 13, 2010 03:11 AM
January 12, 2010
<goodJess> one of the band members is missing
<goodJess> i swear i had nothing to do with it
<arctanx> uh oh, hopefully they don't have unhealthy fans
<MrJosh> they'd totally overheat
<arctanx> ...
<DrBucket> [You hear Matt swearing at his computer in the distance...]
January 12, 2010 10:52 AM
December 29, 2009
The majority of work I do, as a programmer who wears a shirt and tie, involves databases. And I try to keep things nice and simple when working with databases. What I mean by simple is, extra tables in a database is fine, even triple the “minimum number” (whatever that is), if they all mostly follow some pattern. Constructing a database schema is then a simple application of the rules devised when designing the pattern, and means there’s not much to think about or have go wrong. With a judicious choice of pattern, ORM tools like Hibernate or other things like .NET Entity Framework can start working for you rather than against you. It’s even possible to write code to check over the schema and ensure that the pattern is being followed, and then write code to write code to do all the data access (yes, write code to write code…)
My boss, on the other hand, has a slightly different idea of simplicity. Namely, in his view, simplicity = minimise number of tables, and rely on stored procedures for everything. The arguments I want to win with him are not really what I want to blog about today.
Today I’d like to describe how I implemented strongly-typed lists of objects (think List<SomeType> in C# / list<AClass> in C++) adhering to my boss’s vision of minimising table count, using only three tables and a pile of T-SQL and custom constraints, instead of the “more complex” system of lots of join tables and foreign key constraints. I do not particularly recommend this mode of implementation. For a start, it has made use of .NET Entity Framework, shall we say, “interesting.”
So consider directly representing classes, such as a Product class, each with a table in the schema, such as tProduct. Suppose the Product class has properties with the types List<Extras> and List<Retailers>, representing the extras one can buy with a product, and the retailers retailing a product. (Suppose we also model Extras and Retailers with tExtra and tRetailer, respectively.)
If we were implementing this with regular old join tables, there would be no columns in tProduct to represent the lists, rather, there would be some table tProductExtras, pointing at both tProduct and tExtra with FK constraints (call the columns ProductID and ExtraID), and a tProductRetailers, pointing at both tProduct and tRetailer in a similar fashion.
But now my boss comes along and says, “Oh, that’s too many tables. Your join tables really have the same structure, two columns of type INT, so they could easily be merged.” And he’s right on the second point, but with one caveat. If we had one join table for the whole database, call it tJoin, that simply had e.g. ParentID and ItemID, we cannot use foreign key constraints on either of them, since ParentID points to any of the tables that represent objects possessing a List of something, and ItemID points to any of the tables representing objects being part of a List. Which means there’s no database-level way of enforcing data integrity in tJoin, right? Lists are now so untyped it’s not funny.
Well, there is a way. (My sincere apologies.) Enter tList and tClass. For simplicity, let tClass just be a table with a two columns, ID as usual, and Name, and containing with names of classes, each one with a table in the database. So going back to the example above, tClass has (1, “Product”), (2, “Extra”), and (3, “Retailer”).
Now define tList as follows: give it an ID column, and a column which is a FK to tClass, call it ClassID. The ClassID is going to give us the type of object being contained in the list—the “T” in “List<T>”, as it were. tJoin is now going to have the columns ListID (FK to tList), and ItemID. (It needs to have something else if the List is going to be a proper list and specify the order in which items appear, but if this bugs you, just imagine we have an Order column in tJoin that specifies what order things appear in the list.)
CREATE TABLE dbo.tClass (
ID int IDENTITY(0,1) NOT NULL,
Name varchar(50) NOT NULL,
CONSTRAINT PK_tClass PRIMARY KEY CLUSTERED
(ID ASC))
CREATE TABLE dbo.tList (
ID int IDENTITY(0,1) NOT NULL,
ClassID int NOT NULL,
CONSTRAINT PK_tList PRIMARY KEY CLUSTERED
(ID ASC))
GO
ALTER TABLE dbo.tList WITH CHECK ADD CONSTRAINT [FK_tList_tClass] FOREIGN KEY(ClassID)
REFERENCES dbo.tClass (ID)
GO
CREATE TABLE dbo.tJoin (
ListID int NOT NULL,
ItemID int NOT NULL,
)
GO
ALTER TABLE dbo.tJoin WITH CHECK ADD CONSTRAINT [FK_tJoin_tList] FOREIGN KEY(ListID)
REFERENCES dbo.tList (ID)
GO
Now go back to tProduct. It is now going to have two FK columns to tList, call them ExtrasListID and RetailersListID. These will adequately model the Product having attributes of type List<Anything>. But really we also want to be sure that the tProduct columns point to the right kind of lists, i.e. that ExtrasListID refers to a tList referring to tClass with name ‘Extra’, and similarly for RetailersListID. Here comes the first custom constraint.
In SQL Server, one cannot have arbitrary code in a constraint—not even a SELECT. Only fairly simple things are allowed, such as =, >, IN, and BETWEEN. How is it possible, then, to enforce this kind of policy? It turns out that scalar user-defined functions (UDFs) are allowed. So we create a UDF like so, to perform a SELECT for us:
CREATE FUNCTION [dbo].[fListIsOfType]
(
@ListID int,
@ClassName varchar(50)
)
RETURNS int
AS
BEGIN
DECLARE @Result int
SELECT @Result = COUNT(*) FROM tList INNER JOIN tClass ON tList.ClassID = tClass.ID
WHERE tList.ID = @ListID AND tClass.Name = @ClassName
RETURN @Result
END
Now we have the pleasure of creating a custom checked constraint on each list column like so:
ALTER TABLE [dbo].[tProduct] WITH CHECK ADD CONSTRAINT [CK_tProduct_Extras] CHECK (([dbo].[fListIsOfType]([ExtrasListID],'Extra')>(0)))
GO
ALTER TABLE [dbo].[tProduct] CHECK CONSTRAINT [CK_tProduct_Extras]
GO
ALTER TABLE [dbo].[tProduct] WITH CHECK ADD CONSTRAINT [CK_tProduct_Retailers] CHECK (([dbo].[fListIsOfType]([RetailersListID],'Retailer')>(0)))
GO
ALTER TABLE [dbo].[tProduct] CHECK CONSTRAINT [CK_tProduct_Retailers]
GO
Great. Now we can be pretty sure that ExtrasListID is a List<Extra>, and not a List<SomethingElse>. We could stop here and rely on stored procedures to do the rest of the work—ensuring items are of the correct type when adding to lists and so on—but that’s no fun. Especially when *ahem* somebody invariably ignores the stored procedures and puts crap data in there manually.
The other side of tJoin requires constraining. This is a bit harder. Here’s how I did it. First, I wrote another scalar UDF like so:
CREATE FUNCTION [dbo].[fItemBelongs]
(
@ItemID int,
@ListID int
)
RETURNS int
AS
BEGIN
DECLARE @Result int
DECLARE @ClassName varchar(50)
SELECT @ClassName = tClass.Name FROM tList INNER JOIN tClass ON tList.ClassID = tClass.ID WHERE tList.ID = @ListID
SELECT @Result = CASE
WHEN @ClassName = 'Extra' THEN (SELECT COUNT(*) FROM tExtra WHERE ID = @ItemID)
WHEN @ClassName = 'Retailer' THEN (SELECT COUNT(*) FROM tRetailer WHERE ID = @ItemID)
ELSE 0
END
RETURN @Result
END
Now I didn’t finish adding cases to the CASE expression, because I have a lot of tables. It’s boring.
The reason we can’t just write one metaquery, instead of a whole heap inside something like CASE, that finds the right table to do the lookup in is…because UDFs can’t execute arbitrary SQL. I’d love to just write
-- ...
DECLARE @sql nvarchar(max), @params nvarchar(max)
DECLARE @count int
SET @sql = 'SELECT @count = COUNT(*) FROM t' + @ClassName + ' WHERE ID = @ItemID'
SET @params = '@count int OUTPUT, @ItemID int'
EXEC sp_executesql @sql, @params, @count OUTPUT, @ItemID
RETURN @count
-- ..
and put that into a UDF, but due to the limitations we can’t (and fair enough, if we could execute stuff like that in a UDF, forget about query optimisation).
I stopped adding cases, but I used the function as the basis for something else. I wrote a stored procedure that updates the fItemBelongs function as follows.
CREATE PROCEDURE [dbo].[sUpdateItemBelongsTest]
AS
BEGIN
SET NOCOUNT ON;
DECLARE @sql nvarchar(max)
SET @sql = 'ALTER FUNCTION fItemBelongs
(
@ItemID int,
@ListID int
)
RETURNS int
AS
BEGIN
DECLARE @Result int
DECLARE @ClassName varchar(50)
SELECT @ClassName = tClass.Name FROM tList INNER JOIN tClass ON tList.ClassID = tClass.ID WHERE tList.ID = @ListID
SELECT @Result = CASE
' +
REPLACE((SELECT ' WHEN @ClassName = ''' + ClassName + ''' THEN (SELECT COUNT(*) FROM t' + ClassName + ' WHERE ID = @ItemID)
' FROM tClass FOR XML PATH('')), '
', '') +
' ELSE 0
END
RETURN @Result
END'
PRINT @sql
EXEC sp_executesql @sql
END
“What the hell is that about?” I hear you ask. Well. It builds the ALTER FUNCTION statement using rows out of the tClass table, prints the statement just to show me what is being executed, then executes it. To build the massive CASE, it concatenates a pile of strings of the form “WHEN ClassName = ‘Blah’ (SELECT COUNT(*) FROM tBlah WHERE ID = @ItemID”, using the “FOR XML PATH(”)” concatenation trick on the tClass table.
Now using the function is as easy as
ALTER TABLE [dbo].[tJoin] WITH CHECK ADD CONSTRAINT [CK_tJoin_ItemsBelong] CHECK (([dbo].[fItemBelongs]([ItemID],[ListID])>(0)))
GO
ALTER TABLE [dbo].[tJoin] CHECK CONSTRAINT [CK_tJoin_ItemsBelong]
GO
and to ensure you always have a current fItemBelongs, consider adding the stored procedure to a trigger on changes to tClass.
Finally, I wanted to ensure that tClass only referred to things that have tables—specifically, tables with a proper ID column of the right type and so on. To do this, I wrote another UDF.
CREATE FUNCTION [dbo].[fClassHasTable]
(
@ClassName varchar(50)
)
RETURNS int
AS
BEGIN
DECLARE @Result int
SELECT @Result = COUNT(*) FROM sys.tables T
INNER JOIN sys.columns C ON T.object_id = C.object_id
WHERE T.name = 't' + @ClassName
AND C.name = 'ID'
AND C.user_type_id = 56 -- 56 = int, YMMV.
AND C.is_nullable = 0
AND C.is_identity = 1
RETURN @Result
END
And using it in another constraint was pretty straightforward.
December 29, 2009 05:24 AM
December 23, 2009
Currently the protest against Senator Conroy's Internet filter is happening in a vacuum. This vacuum is occupied by thousands upon thousands of outraged Internet-savvy computer users. Unfortunately these people constitute only a small percentage of the overall voting population of Australia, and not all of them are prepared to vote based only on an Internet filtering policy. Where I live, the newspaper does not even cover the Internet filtering as a news item.
It has been shown clearly that appealing directly to the politicians responsible for the poor policy is not effective. We need to engage more with the general public, not only to raise awareness, but to make them realise how the filter could potentially affect them and show how futile it ultimately will be.
Enough Twitter. More Facebook? More real life, person-to-person interaction about this issue. "Hey, did you hear about that Internet filter? Dumb idea, huh? Hah, no, it won't help block child pornography..." You get the idea.
Protestors have succumbed to another problem -- factual inaccuracy. Nothing kills you faster in politics. In this article which Stephen Conroy wrote for Crikey he correctly blasts inaccurate reporting.
Keep up, people, we're no longer facing a heuristic filter which will cause massive slowdowns. Yes, the blacklist filter has only been trialed against 8 Mbit/s instead of 100 Mbit/s fibre, but pattern matching against 10000 URLs is not a large technological hurdle. ISPs can and will do that quickly in order to retain their competitive low-latency advantage.
It took them a couple of days, but nocleanfeed.com have updated their information page to reflect the most recent announcements, so that should be a good source of information. Furthermore, to encourage my own less technical friends to understand the issue I have developed my own more concise guide, The Australian Internet Filter And You, which I hope to use convince people that this filter is a bad idea. Please let me know if there are any factual errors in it; I would like to keep it up-to-date for as long as is required for this debate.
Go forth and spread the word amongst the people who wouldn't normally care! Goodness knows the media isn't doing it for us.
December 23, 2009 12:20 PM
December 18, 2009
It’s the silly season already, and that means Xmas. Or is it Exmas?

Illuminated road sign: "EXMAS PAGEANT"
And exmas means presents, right?
I’m kinda hopeless at the presents thing. I can get caught spending hours trying to find the right present for somebody, and completely forget to get a present for somebody supposedly more important!
That’s the story, anyhow. I believe all sorts of things that aren’t true—it’s called history. (And history doesn’t exist in the present, as it were.)
This is why, this year, my close friends are each getting something that is small and markedly similar to what all the others are getting.
But the silly season, or exmas, or [insert your favourite name here] or what have you has another meaning for UTas graduands-cum-graduates. Graduation! It happens between exams and exmas. In the case of me and some of my friends, it was Graduation 2.0 (Honours) and it happened earlier this week.
A hearty congratulations are in order to all my uni mates, you did well. Congratulations! It is a little strange to be in a social circle full of people who do so well. Uni really did turn out to be a completely different game to high school and college.
This leaves the rest of this blog post for some self-admirational studies into this strange metallic drink coaster medal I received on stage at graduation. Additionally, because I couldn’t find any description or image on the entire Internet of what the actual medal looks like, only the rules for obtaining one.

It's a me
The University Medal from the University of Tasmania is a circular medal presented in a fuzzy-lined medal box. It is 60mm in diameter and approximately 3.5mm thick, and made of what looks like bronze. Here is a top-down shot comparing it to a 50 cent piece.

UTas Medal (left) and an Australian 50c coin
The front of the medal proudly displays the beautiful UTAS coat-of-arms. The motto reads INGENIIS PATVIT CAMPVS. I don’t pretend to know Latin, but it sounds cool. (You can look it up yourself, lazy!)
The back of the medal has the engraved text, and is otherwise flat.

"University Medal / awarded to / JOSHUA THOMAS DEPREZ / Faculty of Science, / Engineering & Technology / for academic excellence / 2009"
It’s got a nice weight to it. I don’t have any scales handy to tell you precisely how much it weighs. It doesn’t have a pin for pushing into one’s chest, nor a ribbon for hanging around one’s neck. (Thankfully, UTas is neither the military nor the olympics.)
As for the presentation of the medal, it differed only slightly to your regular First Class Honours conferral of a testamur in that they made me wait until all the other BSc(Hons) grads had walked the walk, and then made the Dean say all this:

Ceremony script cards, read by the Dean: "Chancellor, I present to you Joshua Thomas Deprez whom you have admitted to the degree of Bachelor of Science with First Class Honours. Mr Deprez has been awarded a University Medal, the highest academic award made to an undergraduate student. I ask you, Sir, to present the University Medal to Joshua Thomas Deprez." Seriously.
So now for a few words about the testamur. I can report that neither the class of Honours mark, nor the field of study, nor the fact a medal was conferred appear upon my testamur at all. It simply reads Bachelor of Science with Honours (and the usual—you know, university, name, etc).
But a few things did strike me. First was that, unlike last year, they did not hand me the testamur during the ceremony—the new procedure is to collect a worthless roll of paper on the red carpet, and proceed to collect the real deal afterwards and only after presenting some ID. (Though they did hand me the real medal during the ceremony. Huh. Perhaps I should test the veracity of the Chancellor next time I’m up there?)
The testamur now sports a holographic seal and an impression of the coat of arms on the left of the page, as opposed to the old-fashioned seal. The paper also looks a lighter shade. My BComp-BSc testamur has the old-style seal, so I now have one sample of each.

Framed BSc(Hons) testamur (left) and BComp-BSc testamur
Incidentally, I have left the paying of the rather expensive framing in both years to my dear grandparents Joyce and Joe.
Some final remarks about the graduation: the weather was stupidly hot but the Federation concert hall at a pleasing temperature, the finger-food and orange juice afterwards was good, the gown hire was the same price as last time, the speech by the DSc recipient was quite interesting and there were an awful lot of PhDs graduating at the ceremony.
Oh, and there was this guy who hunted me down, only to turn somewhat disappointed to hear I was probably not doing a Computing PhD next year. Sorry, Julian.

Left: Dr Julian Dermoudy, Head of the School of Computing and Information Systems, and myself
Of course, what’s it all for anyway?
Getting this pack of paper in the mail is probably the biggest reason for doing Honours.

Offer for an APA, from left: Cover letter, information sheet & offer acceptance form, application for admission to candidature, a notification of some rule changes, a banking details form, and finally the conditions of the award.
They even filled some of it in for me. How nice!
December 18, 2009 12:02 PM
Once again, I've left this site for faaaaar too long without letting you all know what I've been up to of late (oops). Needless to say, a fair bit has happened in the past few weeks, and it's probably worth telling you all about this.
Honours, Semester 1 (during semester 2)
Uni study's been going quite swimmingly of late: both my units of study went pretty well (insofar as I got HDs in them); thesis on the other hand, has only really just started to take off. My research is into the computer vision task fo object detection (for example, finding faces in images), in particular, I'm working on improving the scheme built into the Intel OpenCV Library (Haar Classifier Cascades, if you're at all interested) by having them consider colour.
One of the deficiencies I've discovered during my research is lack of sufficient real-world colour face datasets to perform detection upon: whilst I need in the order of 2000 faces (1000 to train upon, 1000 to test upon), the largest useful academic set is an order of magnitude smaller. For this reason I'm developing my own set. My current intention is to assemble the data set entirely from Creative Commons-licensed data (e.g. from Flickr and Wikipedia) and to release the resultant set under CC licenses too. I expect I'll give a lightning talk at LCA on this, I'll also dump a blog post here somewhere about what sort of data I'd like donated.
Summer of Google
One thing that's looking like it will derail my Honours work slightly happened not too long ago. I applied for a Software Engineering Internship at Google Sydney back in July, and didn't hear much about it. In late October, however, I very suddenly got contacted about it, and interviewed for the position, and quite happily, I was offered a job. This, amongst other things, involved dropping (almost*) everything for the summer, and moving to Sydney within two weeks, which I guess I've done somewhat successfully.
So I'm now working at Google until sometime during the first two weeks of semester (!). My current project involves working on [redacted], to make [redacted] do [redacted]; in related news, the new Sydney offices are pretty damn cool, the food is excellent, and the work is fun. I'm really looking forward to the rest of my time here.
*I guess the most important thing to mention here is that I'm still spending my week-and-a-bit in Wellington for Linux.conf.au 2010, and that I'll still be running the Open Programming Languages Miniconf there. I can hardly wait!
December 18, 2009 12:04 AM
December 17, 2009
If you follow me on Twitter then you probably know that I’ve recently started an independent games studio called Abstract Artificer – its first game, called Spiri, has been released and is available on the iPhone App Store for your equivalent of US$1.
Spiri is a fun little game, but next I’m thinking of making something bigger next, maybe with a somewhat related concept but with a lot more of the things that people want from an iPhone game – social aspects, short term goals, and lots of marketing -_-. Also looking at making some non-game apps that people have suggested or requested from me.
For more on my game Spiri and Abstract Artificer, see AbstractArtificer.com.
December 17, 2009 04:49 AM
I’m Alex Berry, and I’m going to put stuff on this site. Stuff. No, really. What else did you expect?
Some specific things I’m thinking of putting up or posting about:
- Blog posts/news/followups to Twitter
- Random ideas
- iPhone games (See AbstractArtificer.com)
- Karaoke/original music
- Comics/artwork
- Photography
- Computer Science/Competitive Programming
- Starcraft II
- Japanese/Korean Stuff
- Randomness
- Anything else that seems interesting
That’s the plan. Let’s see how it goes!
December 17, 2009 03:07 AM
December 09, 2009
Twitter has hated me for the last few days. I was getting consistent errors about exceeding my API rate limit when I haven't even been running any clients. Just in case I changed my password and now I'm getting inconsistent errors telling me that my account has been locked from excessive bad logins. Again, not running any clients.
Either I've recently become a Twitter celebrity without becoming aware of it and somebody somewhere is trying to crack my account, or Twitter hates me. Yeah, I'm going with the hate option. Never assume malice where stupidity will suffice.
So what's my response to all this? Shall I jump up and down and complain that the (free) Twitter service is not working and that I desperately need my constant intravenous flow of tweets to operate? It doesn't sound particularly elegant. Shall I make a declaration that Twitter fails in general and ragequit and try to delete my account? Tempting, but not incredibly rational or practical.
Instead, ironically, I've announced on Facebook that I won't be reading Twitter for a while. And that gives me a little bit of leeway to experiment. For Twitter has become a reasonably large time sink.
When you first deal with Twitter it's easy to fall into a naïve mindset that to prevent your list of tweets being full of crud you don't care about you just have to be careful who you follow. Unfortunately the reality is that perfectly nice and normal people, such as my friends and me, when given an environment like Twitter will fill it with all kinds of garbage. Alongside all the useful stuff you actually care about hearing from your friends. The signal to noise ratio is just bad because community expectations for usefulness of tweet content are not high.
The concept of flirting with the idea of not using Twitter for a while seems a little strange given that we all got along perfectly fine without it. All the same, it forms an inlet and an outlet in your brain which were nowhere near as active before -- an inlet for "I wonder what's been happening in my friends' lives lately" and an outlet for "heh, I just found/thought this thing which is kind of cool/annoying/I feel like sharing".
Previously those outlets had less opportunity to be exercised but they were invigorated by Twitter. When you stop using the service the outlets remain for a while. When I first started having difficulty with my API rate limiting my first desire was to post about it on Twitter. It gets into your BRAIN.
In hindsight I think those outlets were doing just fine before. I shouldn't have to think about what my friends -- or at least those connected to the Internet all day -- are doing at every hour, and I certainly shouldn't be sharing my random thoughts at a rate of several per day. Because they just ain't that good. If there's one thing the Internet is good at, it's showing you just how unoriginal you truly are.
Heck, I haven't even been reading Twitter properly lately. There's just too much crud. I'd never get anything done if I was notified every time a new tweet comes in, and it's something like a chore to read through the backlog a couple of times a day. It's not that the tweets aren't relevant to me or even that they aren't interesting -- they just aren't relevant or interesting enough. We have to draw a line, folks.
So is the correct response to not read Twitter at all? Beats me, but the Twitter website's failure to let me log in seems as good a reason as any to find out. I could go and play with identi.ca but I'd probably end up in a similar problem one day.
I just don't like micro-blogging in principle. I like using big words when they mean precisely what I want to express. The amount of time it takes me to fit what I want to say into 140 characters is significant, as is the amount of semantic intent I have to lose in the process.
Yet Twitter is fun. But it's not, lately. And now it's not working for me. So it can bugger off for a while.
Did I mention I like email? I like getting email from real people. Also phone calls. Just not at 4:20AM like the most recent phone call I got, please.
December 09, 2009 12:13 PM
December 04, 2009
This is my OZCHI 2009 presentation (of my short paper), The Pile of Least Effort. It’s slides only I’m afraid, as the talk wasn’t recorded (to my knowledge!)
If you want a PDF or PPT of this presentation, click the “full screen” button in the embedded player, then choose what you want from the “actions” menu.
December 04, 2009 02:44 AM
November 19, 2009
After some experimenting I've managed to get a semi-permanent 115kb/s SLIP connection between my main Debian server and a 486 running BSD. By semi-permanent, I mean as soon as there's a power cycle I'm going to have to run out with a laptop with DHCP server, a crossover cable and some patience to make it work again.
Here's a bit of odd behaviour from the BSD machine shown from /var/log/messages:
Nov 20 03:08:33 cogline slattach[644]: SIGHUP on /dev/ttyd0 (sl-1); exiting
This occurs when I run slattach -s 115200 /dev/ttyd0 with nothing attached to the port, or when the other computer is connected and has been running slattach for "a while" (a minute or two?). Debian slattach has no difficulty running with the serial port in any condition, and if it's started reasonably soon before the BSD slattach, everything is fine.
Unfortunately this kind of problem makes it difficult to set up computers that will automatically negotiate a SLIP connection when they first turn on. I configured the BSD system to run slattach and the required ifconfig command on boot and it never works.
Normally SIGHUP is used to indicate that the carrier has dropped and a redial is necessary. The BSD slattach code reveals that the above message is simply what the SIGHUP handler does when no redial command is set, presumably before the interface has finished initialising because the "unit" is still "sl-1" instead of "sl0". I'm using a null modem cable so it makes sense that the carrier will go down when nothing is attached, but that doesn't explain the failure when both are running for a while.
Curious. Stay tuned, I might learn something.
November 19, 2009 05:11 AM
This is a post about pen and paper roleplaying games. Turn back now if you’re not interested.
I have often struggled over the years to create a different flavour to my campaign experience. I freely admit that most of my games have thematic tones of evil and conquest, where I could quite easily exploit themes of corruption, intrigue, mystery, horror and so on. Somehow I always seem to return to my generic fantasy roots, wherein evil is trying to take over by spewing forth an army from the deep dark depths of hell or its fantasy setting equivalent. Even in my most original campaign plots, there has been an army of some description bent on invading where the players are currently located.
So too do my players get stuck in their own mindsets. I largely attribute it to the fact that, in GURPS, you are invincible. While many options for evisceration are available to players and enemies alike, somehow all my opponents end up as unrecognisable piles of meat on the floor. Most of my players, myself included, began on this system. There is a mindset at my table that the player characters can overcome, which is inspiring in books and movies, but usually leads to rampantly stupid acts of heroism that get people killed in roleplaying games.
When running a game of 4th Edition Dungeons and Dragons, I do like to appreciate that my players occasionally feel overwhelmed. I like them in the final few encounters of an adventure to discuss the possibility of high tailing it and have ‘maybe those villagers can defend from what’s left of the hobgoblins anyway’ conversations.That is of course before they inevitably fell a few foes and everything seems alright again. I’ve fallen into the trap of making things too easy and become a sucker for the good ending. I’d like to kill a player character, but the long surviving GURPS characters haven’t given me the taste for blood I needed in my early DMing days to help me become the cold heartless bastard at the head of the table that I should be.
Similarly, I can’t get my table sessions to have the right feel to them. I’m not talking about game content, but rather what happens in the course of playing the game. I’d like to start calling my players by their character names when their initiative comes up, but I just can’t. I always slip back into player names which I’m sure facilitates the table talk and meta-gaming that floods our sessions. Not that I mind it all terribly, we all have fun in the end - it’s just something that I’d appreciate.
I guess to conclude I should declare that “COOL STORY BRO” is not an appropriate comment or response to this article. I am aware that this post is entirely contentless, but these things have been swirling in my head for some time now. It’s good to put them down, and I hope I can’t find this article one day and reflect on how my campaigns have improved.
November 19, 2009 02:57 AM
November 18, 2009
Let’s get dirty. Peel back a few layers of the human onion called Josh and see what’s under there…might maybe even post this on the blog, hah! Do I have the balls? I guess Paris wanted more blogging from maclab, well here’s my contribution!
I’ve claimed a few times that I had once attempted suicide. Pretty heavy stuff, hey? Well, it’s felt like an easy thing to say when I was trying to guilt someone—and depressed.
There’s nothing much else on this weird planet that is as serious as suicide. If you ever come so close as to think about doing it, don’t do it! If for nobody else, at least stay alive for me. I don’t care how fat, ugly, stupid, useless or just plain numb you feel, you will make my world a more awful place by actually doing it! The thought certainly has crossed my mind a few times. That’s a state of (non-)being I’d rather never have again.
I didn’t ever make up being depressed at all. Even now, once in a while, the world seems just a bit too colourless and I’m reminded again of the numb dullness of being depressed. I also thought about suicide a few times, some very grave moments they were. But the attempt part of the story was a fabrication and how I used it was in retrospect a pretty despicable way of trying to influence somebody. What really happened was I never followed through, my thoughts were confined to my head. There’d be a lot more people who’d know about it if I did follow through.
The impact of abusing a delicate matter like this to gerrymander somebody else in this way was awful. Thanks to cognitive congruence, the act of saying I had tried suicide probably prolonged the sadness longer. The person I was trying to manipulate almost certainly saw through it and I lost a lot of respect from then-friends.
I’m glad I never did try to kill myself. Looking back at the last three years I’d say it’s been a wild ride. Recently things have been pretty stressful, having been flat-chat with Honours, but now that’s over my life is picking up again, dramatically. This coming year is going to be lots of fun, and I’m making sure of it!
Let’s get dirty. Peel back a few layers of the human onion called Josh and see what’s under there…might maybe even post this on the blog, hah! Do I have the balls? I guess Paris wanted more blogging from maclab, well here’s my contribution!
I’ve claimed a few times that I had once attempted suicide. Pretty heavy stuff, hey? Well, it’s felt like an easy thing to say when I was trying to guilt someone—and depressed.
There’s nothing much else on this weird planet that is as serious as suicide. If you ever come so close as to think about doing it, don’t do it! If for nobody else, at least stay alive for me. I don’t care how fat, ugly, stupid, useless or just plain numb you feel, you will make my world a more awful place by actually doing it! The thought certainly has crossed my mind a few times. That’s a state of (non-)being I’d rather never have again, but not so much as to end the journey prematurely.
I didn’t ever make up being depressed at all. Even now, once in a while, the world seems just a bit too colourless and I’m reminded again of the numb dullness of being depressed. I also thought about suicide a few times, some very grave moments they were. But the attempt part of the story was a fabrication and how I used it was in retrospect a pretty despicable way of trying to influence somebody. What really happened was I never followed through, my thoughts stayed confined to my head. There’d be a lot more people who’d know about it if I did follow through. To think of all the collective effort they’d have to put in to deal with such a selfish tragedy!
Right now though I’m just feeling a bit bad about how I tried to exploit the concept. The impact of abusing a delicate matter such as this, in order to gerrymander somebody else’s feelings has been awful. Thanks to cognitive congruence, the act of saying I had tried suicide probably prolonged the sadness longer. The person I was trying to manipulate almost certainly saw through it and I lost a lot of respect from then-friends—let’s not forget any health implications, loss of motivation to get my drivers license or a proper job, the unwillingness to do ACM programming competition training, and the utterly failsome sequence of pseudoromantic almost-relationships that were just so frustrating.
Looking back, I’m sure glad I never did try to kill myself. Looking back at the last three and a half years, it’s been a wild ride. A pivotal moment was when I rediscovered sobriety. These days, things have been quite stressful, having been flat-chat with Honours all year and not long ago with some mild romantic disappointment. Even last week I was in the same hypersensitive, pessimistic and cynical frame of mind that led to all the suffering last time. But now that the uni stress is all done and dusted for this year, life is picking up again, dramatically. This coming summer break, and 2010, are going to be lots of fun. Energetic and healthy Josh is finally energetic and healthy!
Who’s up for some tree-climbing or watching some anime?
November 18, 2009 11:39 AM
November 11, 2009
Our book is announced! Rejoice!
More (preliminary, and temporary) info at Wiley.
Oh, and we have a United States phone number now (mostly for voicemail and SMS): +1 (510) 854-6522
Most excellent!
November 11, 2009 11:08 PM
November 10, 2009
My ISP has been doing a lot of work in the IPv6 department recently and amongst all their IPv6 offerings they have just started a trial for ADSL customers to run a dual IPv4/IPv6 PPP connection. They also run a broker to provide an IPv6 tunnel over IPv4, but this native solution is much neater.
Here's how I've set it up on my home Debian server so that it will provide IPv6 addresses to my home network:
- Add
+ipv6 to /etc/ppp/peers/dsl-provider
- I had to change the username in dsl-provider and in /etc/ppp/chap-secrets to use a different hostname, as this is how Internode knows you want to connect to the IPv6 trial server.
- Start the DSL connection with "pon dsl-provider", resulting in a connection ppp0 which has both an IPv4 internet address, and a local fe80:: IPv6 address
- Ensure eth0 has a local IPv6 address too, using ifconfig. I was messing about and lost it, and got it back by resetting with
ifdown eth0; ifup eth0
- Now to get a real IPv6 prefix you need an IPv6 DHCP client. At Internode's suggestion I installed the WIDE client (package wide-dhcpv6-client in Debian). The given working configuration for a PPP connection ppp0 and local ethernet connection eth0 is placed in /etc/wide-dhcpv6/dhcp6c.conf as follows:
interface ppp0 {
send ia-pd 0;
script "/etc/wide-dhcpv6/dhcp6c-script";
};
id-assoc pd {
prefix-interface eth0 {
sla-id 0;
sla-len 4;
};
};
- When you install the WIDE DHCPv6 client it starts automatically, with an non-useful config. Restart it with
invoke-rc.d wide-dhcpv6-client restart. Hopefully now an "ifconfig" will show that you have successfully attached a 2001:: prefix address to your eth0 interface.
- Add a default route -- this doesn't happen automatically. Run the command:
route --inet6 add default dev ppp0
This will add a default route through the gateway on your PPP connection.
- At this point there is working IPv6 connectivity on the local machine. It can be tested with "ping6 ipv6.google.com":
# ping6 ipv6.google.com
PING ipv6.google.com(tx-in-x68.1e100.net) 56 data bytes
64 bytes from tx-in-x68.1e100.net: icmp_seq=1 ttl=56 time=171 ms
64 bytes from tx-in-x68.1e100.net: icmp_seq=2 ttl=56 time=172 ms
- To set up advertising of addresses and routing I referred to Martin Krafft's excellent IPv6 with Debian documentation. In summary, the configuration I had to do was to set /proc/sys/net/ipv6/conf/all/forwarding to 1, which can be made permanent by setting it in /etc/sysctl.conf, and to set up radvd.
- radvd (which is also the name of the package) will provide IPv6 addresses from the allocated /64 prefix to hosts on the local network. Install the package. I set my /etc/radvd.conf to the following, which uses the prefix I was allocated, as found from ifconfig:
interface eth0
{
AdvSendAdvert on;
AdvLinkMTU 1280;
prefix 2001:44b8:7c90:be0::/64
{
AdvOnLink on;
AdvAutonomous on;
};
};
- Now other machines with IPv6 support which are connected via the eth0 interface should be allocated an address and will be able to access the IPv6 Internet too.
I have a fun ISP who gives me toys to play with. :)
November 10, 2009 12:59 PM
November 09, 2009
In español my nickname is L T GRAY. CINO. AHHHHH. AKAKAKAKAK.
I am T-Bone, the disco spider.
November 09, 2009 07:20 AM
I _AM_ dangerous.
Thanks to Chris for the find!
November 09, 2009 07:14 AM
November 08, 2009
Just to give a little justification as to why blog posts have been so lacking lately, here is most of Secret Lab’s, and my, recent (and future) travel schedule!
- June 2009 – July 2009: Attending Apple’s WWDC in San Francisco, CA, meetings in Los Angeles, CA (6 weeks)
- August 2009 – September 2009: Meetings and business in Mountain View, CA (2 weeks)
- September 2009: Speaking at the AUC /dev/world/2009 Conference in Canberra (3 days)
- October 2009: Impromptu trip to Melbourne to visit the United States Consulate for Non-Immigrant Processing (2 days)
- October 2009: Working on-site with client in Mountain View, CA (1 week)
- October 2009: Attending Unity’s Unite 2009 Conference in San Francisco, CA (1 week)
- October 2009 – November 2009: Working on-site with client in Mountain View, CA (4 weeks)
- November 2009: Presenting at OZCHI 2009 in Melbourne (1 week)
- December 2009: Presenting at the AUC CreateWorld 2009 Conference in Brisbane (3 days)
- December 2009: Running the 3-day intensive AUC Unity Workshop in Sydney (3 days)
- December 2009: (Tentative) Running 3-day iPhone Workshop in Melbourne (3 days)
Phew.
November 08, 2009 08:49 PM
November 05, 2009
Sitting in front of my computer in Sydney Hotel paid by CSIRO.
Yes im at the ICTC Conference, brain is too active to go to sleep, foreign bed is hard, at least they have my pillow preference right this time.
WHAT AM I TALKING ABOUT, im still in front of a computer typing a blog entry at 23:30 in Sydney.
I need some changes, straighten some priorities out there somewhere. My life seems to orientated around sitting, and sitting in front of a computer screen never less.
I cant even stay still to start learning and program some iPhone apps that I would like to make, keep twitching and moving about reach for reinforcements (Epic quantities of sugar) and find the day’s rolling by with nothing really substantial achieved.
The only thing that makes this all tolerable is Apple Technologies, even if the iPhone is not CSIRO approved.. (lol)
So can anyone provide some direction? I’m floating in some sort of cyber space here? Not really knowing what I will be doing from day to day.. I think I need to get out more. Ohh, soo need to go on a bush walk somewhere, fresh air, exercise, Tas bush land. Or a few days on the ski slopes, but I think I have missed that for this year.
I think I will end my thesis here and find something else to do, umm sleep?
November 05, 2009 12:09 PM
November 01, 2009
Just a friendly prod to interstate friends (and apologies to those of you picking who are otherwise uninterested):
I'll be in Sydney from Wednesday evening for the AUC XGrid Workshop; I'll be heading to Melbourne on Friday evening for the weekend. If you want to meet up at any time whilst I'm there, you can contact me through the usual channels.
November 01, 2009 10:06 AM
October 30, 2009
I have a hypothesis regarding the comparison of the ability of punning folk.
Amongst those who pun actively, everybody is able to produce bad puns to a similar level of ability. It becomes instinctive enough to search for puns that you can come up with poor (often self-referential) puns virtually on demand.
This means that if you are to compare two people by how bad their puns are, the only observable criterion is the point of equilibrium each person chooses between high frequency of jokes and having any friends. The people who seem to not say the bad puns are just restraining themselves more effectively.
Truly good puns do require some level of skill in my opinion. Unfortunately I don't think of them very often.
October 30, 2009 10:52 AM
October 24, 2009
Yesterday I gave an extended talk describing many of the topics from my honours thesis, and promised to put the slides up here. Well this post is to fulfill that.
Here is an “article-ified” version of my slides. You will notice that I didn’t quite use the LaTeX beamer package all that thrustingly, so there are repeated headings etc. Nevertheless the content is all there.
End-of-year Honours presentation
October 24, 2009 12:03 AM
October 19, 2009
And this time we mean it!
Our CFP was extended by a month, and now you only have this week to get
your presentation proposals in for the LCA2010 Open Programming Languages Miniconf!
Our call for presentations closes on Friday 23 October 2009, so if
you're planning on attending LCA2010 in Wellington in January, and have something to say about doing development with Open Source programming languages, libraries or frameworks, we'd love to hear from you!
We're looking primarly for standard-length talks (20-25 minutes including questions), but we'll also consider double-length talks on suitably compelling topics (that's 40-45 minutes including questions).
Our CFP is available from http://blogs.tucs.org.au/oplm/cfp/ -- if you've already read it, you can submit your proposal at http://blogs.tucs.org.au/oplm/cfp/submit/
ABOUT THE MINICONF
The Linux.conf.au Open Programming Languages Miniconf is a single-day mini-conference about application development with Open Source programming languages. Featuring talks on a wide range of topics and programming languages, this miniconf aims to bring together open source developers with presentations that share techniques, best practices and values amongst programmers of all open programming languages. OPLM2010 will be held at Linux.conf.au 2010, in Wellington, New Zealand on January 18.
OPLM2010 is being organised by Christopher Neugebauer and Jacinta Richardson with help from the broader community. You can contact the OPLM2010 organising team at oplm2010@googlegroups.com or visit the website at http://blogs.tucs.org.au/oplm
October 19, 2009 08:30 AM
October 12, 2009
I don’t know what the Cadbury’s marketing department is on. But I want some.
October 12, 2009 02:44 AM
What are you doing for Chinchilli day?
October 12, 2009 02:40 AM
October 10, 2009

Registrations for Linux.conf.au 2010, being held in Wellington, New Zealand this January opened earlier this week -- I'm registered (a bit of a no-brainer, given that I'm running a miniconf this year). Have you registered yet?
Not sure if I mentioned it here, but thanks to the kind generosity of the LCA2010 team, the Open Programming Languages Miniconf has been able to extend its call for presentations by a month. This means that you can now submit your presentations up until October 23 (which is a Friday) -- I look forward to seeing another deluge of presentations in a couple of weeks-ish!
October 10, 2009 10:00 PM
October 07, 2009
<TheRealMrPink> hmm
<TheRealMrPink> I'm not entirely sure I know how to manually shave any more
<McJones> avoid the eyes
October 07, 2009 11:35 AM
October 06, 2009
OZCHI! Mountain View! Awesome!
Again, it’s been quite some time since my last post! A few interesting things have been happening:
- A paper I wrote got accepted into OZCHI! This pleases me greatly! So I’ll be heading there in November.
- Pending our upcoming E-3 Visa issuance, the Secret Lab team will be heading to Mountain View, California to work for a month in two weeks. That should be great fun!
- The AUC /dev/world/2009 conference went very well! #fingUTAS (also known as the University of Tasmania) gave a great bunch of presentations, and hosted a fun Quiz Night and Lightning Talks. All the presentations were great! My two presentations went very well, and will be available for download in the near future!
- The most recent TUCS Tech Talks, starring pjf were a huge success! Paul is an amazing speaker, and we got an amazing crowd!
More updates soon.
October 06, 2009 05:46 AM
October 05, 2009
October 03, 2009
AUC /dev/world/2009, the Apple University Consortium's annual student (and university staff) developer conference was held this week in Canberra. DevWorld goes for two days, and consisted (this year) of about 90 enthusiastic Apple developers learning about popular Mac technologies.
This year, as well as being my first DevWorld conference, I was a presenter: I presented a talk about the OS X scripting bridges, with a particular focus on the Python--Objective-C bridge, PyObjC. I rushed through the first half of my talk, and instead of taking ~45 minutes like I'd estimated, I took 30, which means I probably rushed through the back end of the talk as well (though it felt as though I was going pretty slowly!). I was not the only student presenter at this conference, indeed around two thirds of presenters were students at one of the AUC member universities.
As well as my presentation, I was the official photography crew for the conference (with a broken camera for half the conference, too, I might add), wrote a substantial amount of the (ridiculously hard) quiz night, and organised their lunchtime lightning talks, which in my opinion was one of the greater successes of the conference -- more than half of the 11 talks were presented by people who had not presented at the conference, and the representatives from Apple Australia were suitably impressed by the quality of the talks.
Coming from an Open Source person's standpoint, I'm very impressed with the level of developer community that the AUC are able to extract from University students. There is clearly a high level of enthusiasm amongst student Mac and iPhone developers for their chosen platform, which is something that Apple should justifiably be proud of. I am convinced, however, that this enthusiasm is not solely limited to Apple Development, and almost certainly exists for Open Source platforms as well. It is our job as Open Source people to foster this enthusiasm for Free developer platforms and Open Source technology in general amongst the student population.
Our existing conferences do not do enough to encourage students to participate in presentating at them. I will single out LCA in this case, as it is our community's most visible local conference -- what I am pointing out also applies to others. Though there has been a concerted increase in student-related events at LCA (beginning with the Google student event in 2008 and the TUCS UpDNS in 2009), and this certainly establishes ties within the student community, more needs to be done to extend these ties into the broader community.
An appropriate place to start here would be the establishment of a regular student miniconf as of 2011. Student developers make up a significant minority of delegates to LCA, but are seriously underrepresented in both main programme presentations and miniconf presentations. Referencing her experiences on the PyCon papers committee, Anna Martelli Ravenscroft lists 6 reasons why women do not talk enough at conferences, but they apply equally well to student developers at well -- fear of inexperience in comparison with other delegates or presenters, fear of presenting a topic that may be irrelevant to other delegates and fear of presenting in general are all listed as common reasons why people do not present enough. Providing an allocated track for student developers would almost completely eliminates the first two listed issues, and will make significant inroads into the third by providing a supportive environment for students to present at the conference. Linuxchix has been a notable precedent and success story in this field, by providing a supportive environment for female delegates at LCA, there has been a noticable increase in attendance by female delegates since the Linuxchix miniconf was started (the proportion of which I am not sure); and from what I can tell, the standard of presentations is very high.
Student developers are currently an untapped resource for LCA and the Open Source conference community in general, but one that we must strive to harness whilst the opportunity still presents itself. The AUC have demonstrated that a student-driven developer conference is not only a feasible model, but one that can be highly informative, well-delivered, and highly successful. For as long as we are not encouraging enthusiasm amongst our own young developers this way, we are presenting further opportunities for Apple and others to fill the void, and at the moment, the void is great.
I close with a quote from Simon Phipps' keynote from LCA2009. In reference to his presenting from a Mac laptop, Simon observed that
The greatest enemy to freedom is a happy slave.
I argue that an even greater enemy to freedom is someone who is happily being educated into slavery. For as long as our non-free competition are encouraging student development in this way, this is the circumstance that we in the Australian Open Source community are faced with. I commend the AUC for their fantastic work on producing an excellent conference, and it is something that we in the Open Source community should be striving to replicate, and not striving to extinguish.
October 03, 2009 01:33 AM
September 29, 2009
Today I found myself needing to draw both a sine wave and a triangle wave accurately for a diagram in Inkscape. It turns out that all the required functionality is included, but you have to do a little work yourself. Here are my findings...
The tool is called Function Plotter and can be found under Effects | Render | Function Plotter...
Sine Wave
The sinusoid is easy to do.

- Draw a rectangle with the rectangle tool, select it, then open the Function Plotter.
- Check the "Multiply x-range by 2*pi" box so the end x-value represents how many periods you want.
- Adjust the y values of the top and bottom of your rectangle---if your sine wave has a peak value of 1 and you want it to take up the whole box, use +/- 1 here.
- Make sure that "use polar coordinates" is unchecked.
- Choose enough sample points to get a good looking sine wave. It evaluates your function at various points and makes an interpolating path. In this case I got a reasonable looking sine-wave with only 8 samples.
- Put "sin(x)" into the Function area and click Apply.
Your rectangle will turn into a sine wave, like this:
Triangle Wave
You can't make a triangle wave directly, but it can be built up from simpler functions.

- Draw a rectangle which will contain the triangle wave.
- Set the end x-value to the total number of peaks you want.
- Set the bottom y-value to 0.0 and the top y-value to 1.0.
- Choose a large-ish number of samples. You'll probably want at least 25 per peak. This is necessary to get tight corners on your triangle wave because Inkscape tries to smooth out lines between your points.
- Make sure that both the "multiply by 2*pi" and "use polar coordinates" options are unchecked.
- Put "-2*fabs(fmod(x,1)-0.5)+1" into the Function area and click Apply.
Your rectangle will become a triangle wave like this one:
Conclusion
Inkscape's function plotter is very powerful for drawing paths conforming to shapes which you can define mathematically. The "Functions" tab in the Function Plotter gives a list of the available functions. Have a play with it.
September 29, 2009 03:11 AM
September 27, 2009
So I bought a new mobile phone. The few months I spent without one have been excellent. For the first time since I first got a phone back in 2004 my electronic communications have been entirely on my terms. It is satisfying to know that you can go about your business doing exactly what you want, knowing that your email inbox and IRC logs are happily collecting everybody's calls for your attention for you to peruse in your own time.
As nice as independence from pestering is, I'm fully aware that phones are useful things so I'm back on the bandwagon. I wrote some time ago (while my old phone was still working) about why I didn't want an Apple iPhone, back when they were the revolutionary new toy and the cool widget to get. The same reasons hold true today---it's expensive, the contracts expect fairly extensive use, the phone comes locked and needs jailbreaking to do interesting things, you can only install applications from their sanctioned App Store, you can only run one app at a time, and there's the pervading sense that for things to work smoothly you ought to be using other Apple products too.
I bought a Nokia E63. It is the new baby brother to the E71, coming in a thicker plastic case instead of metal and lacking a GPS. I bought it for $AU320 delivered from eBay and it's working a treat.

Clearly it has a fairly small screen for modern so-called "smartphones", and with all those buttons it doesn't have a touch screen. If you're thinking that this makes it not very useful for web browsing, you'd be right.
I like it anyway, because these are the reasons I chose this model:
- QWERTY keyboard! Hell yes! It was only a matter of time before I had an aneurysm from trying to write SMSes with a numeric keypad. The physical keys feel nice and have a nice response too.
- Great battery life
- Easy to buy it not locked to any phone company
- Installs apps from anywhere by URL, and runs several at the same time
- It's very happy to talk to my IMAPS mail server
- Lots of free software available for Symbian S60, its operating system
- Reasonable price
- Favourable reviews on the 'net
- Played with one belonging to a friend, who also thought it was pretty good
Things like playing MP3s, web browsing, taking pictures on the built-in camera or using GPS software are not features that interest me in a phone. It's a good thing too, because this phone is not exceptional for any of those.
The thing I'm happy about here is that I actually took the time to evaluate my own values and needs before buying one of these fancy new phones. I highly recommend doing that.
If you want to you can contact me by phone or SMS again. I still reserve the right to ignore it for indeterminate periods of time if I feel like it though.
September 27, 2009 12:47 PM
September 23, 2009
Yesterday was the South-Pacific region event for the annual ACM ICPC. You can read more about it in general at http://cm.baylor.edu/welcome.icpc and our regional at http://sppcontest.org/.
Every year, among the IBM-branded schwag that the members of competing teams receive for their five hours of keyboard-mashing, swearing, headdesking and facepalming, is a t-shirt. Shirts are also given to the organisers and are generally a different colour. This is an attempt to chronicle the various colours of competitor shirt given out over recent years.
2004 and before: I only have a vague recollection of what colours one of these shirts was. Back in 2005, prior to driving up to Launceston (because that’s where the site was) we stopped at Matt Armsby’s place (since he was a competitor back then) to grab some last-minute things. While rummaging around we stumbled across one of his old shirts, which from memory was an odd light blue with yellow writing combination. Ask him about it sometime.
2005: My first ACM shirt, still in one piece. The main body is a nice navy blue, though mine has faded noticeably, with grey sleeves. There is an OK photo of Matt accepting a certificate in 2006 wearing the 2005 shirt at the site history page. (I’m also there but the shirt isn’t as visible.) My actual shirt is hanging on the line right now so I won’t bother putting up another photo of it here.
2006: This shirt marked the start of the trend towards lighter combinations. A black-sleeved, yet mottled light-grey middle shirt. It makes me feel soft and slightly depressed.

ACM-SPPC Shirt 2006
2007: This shirt completed the colour-transition and had a white torso with dark navy blue sleeves. Oddly, this is the only ACM shirt of mine that has developed a small hole, the others are still perfectly intact.

ACM-SPPC Shirt 2007
2008: Once on a theme, it is difficult sometimes to get off it. The 2008 contestant shirt was the same as the 2007 shirt but with bright, cheery red for the sleeves and collar.

ACM-SPPC Shirt 2008
2009: It is perhaps a measure of the feebleness of the economy in these troubling times that this year’s shirt is completely white, except for the print. This shirt marks the end of the transition to lighter styles, the only remaining step being to remove the print. I shan’t post a photo, suffice it to say that the shirt really is indeed just a pure white t-shirt with the print as above, as it were.
So about this year’s problem set.
The nice thing about the contest is that it is over, so I and others can now blog about it. Imagine how less rich your life would be if you couldn’t read how we solved the problems right now and instead had to wait for it! Chris beat me to it, but that’s ok because we were on the same team. My contribution was the solution to problems B and E. My team placed 3rd on the day and by Chris’s reckoning, that looks to be stable for rejudging.
Problem B: Four submissions, 297th minute (that’s 3 minutes before the close of the competition). What was this odd problem? Why did it have a bug that was only found at the last moment? What circumstances lead to this supposedly easy problem being an excercise in facepalming, headdesking, swearing, groaning and, very ultimately, succeeding?
It reads as a pretty easy input munging problem. Given some date (in a fairly easy-to-parse format) for a chess tournament and a list of participant’s names, birthdays and scores on the day, bucketise them into year groups and print the person with the highest score in each group. Oh, don’t forget the leap-year thing where people born on 29 Feb are considered a year older on 1 Mar in non-leap-years.
So it didn’t take too long to get working code. Ah sorry, “working.” But it wasn’t until afterwards that we knew the early code wasn’t working.
What happened was this: I am cursed. I always get a problem that has not been totally specifed/is a bit ambiguous and also has the dodgy judging data that has to be fixed during the comp. This has happened consistently during practices and competitions and I knew it was going to happen again and it did. :’(
When the cheif judge realises there is a testing data issue, it holds everybody from Perth to Dunedin up while they scramble to fix the issue and test it and get it out and rejudge. But before everybody is told about the issue, it is possible to tell when the annual fudgeup has occurred by looking at the leaderboard, and it was the case that we inferred from the complete lack of successful submissions to problem B that there was an issue. This was confirmed later on in an official announcement.
So thinking that I had stumbled into whatever pothole everybody else in the leaderboard had seemingly stumbled into, we put debugging the submission on hold while we worked on other things. This wasn’t too bad an approach: for instance it let me solve E, and the others solved a few other problems in that time.
Then things took another turn: they fixed the data and other teams started being more successful with their submissions to B. Mine wasn’t rejudged as successful. Hmmm.
So we politely let Simon hack away until the last five minutes of the comp on his (unfortunately TLE) solution to problem H (it only needed to be a bit faster) and in the meantime I came up with every possible fix to my code I could think of. There were two. The idea was to submit a lot in the last five minutes of the comp—what could we possibly lose by firing off as many submissions to B as possible at this point, just to be more likely to be rejudged correct later on? It was already close to 300 minutes penalty for the submission if it was correct anyway.
It so happened that the second fix I came up with—a modified calculation that should have been identical in every way to the last one—fixed it and we got B from Wrong Answer to Accepted in the 297th minute. Yes! I broke the curse!
I’m planning on seeing a specialist about the nerve damage.
Problem E: Rewards for Maths indeed.
Given real integer coefficients of an
-degree polynomial, determine whether or not all the
(complex) factors (and hence complex roots) are distinct.
We had a look at this at first, threw our hands up in the air and said “Meh! It’s maths!” Just looking at the leaderboard, most of everybody must have done the same. “But hang on,” said Simon (these aren’t really his words), “all we need is some reliable root-finding method and then we can factorise it using synthetic division to get a polynomial of degree
, and then go back and do the same to the smaller one until we have found all the roots.” I would expect a few teams to have realised this as well.
A bit of background: myself and Simon are maths honours students this year. Last year I did a unit numeric methods with the head of Maths as lecturer. I think Simon had done it too. Either way, it was obvious at that point one way to solve it, even if in a numeric approximation fashion rather than in a whole-integer programming fashion. The trick was to have a fairly reliable root-finding method for roots in the complex plane. Bisection method won’t help in the complex plane. Newton’s method is famous for not converging. Who you gonna call?
I pulled out Laguerre’s method, and bashed it out in under 15 minutes, only to be held up being a boneheaded mistake in the loop that checked for distinct roots. I fixed it. It worked. It was an easy win. And it gave us one more problem that everybody else in the top 20 at that point hadn’t even tried to solve.
There was another technique we had available which is slightly more reliable for polynomials over the reals, and it goes like this: A matrix and its eigenvalues both satisfy the matrix’s characteristic polynomial. Turning it around, it is possible to build a matrix such that the characteristic polynomial is the polynomial we are trying to find roots for, and then using eigenvalue-finding methods like QR decomposition on the matrix to get the solutions.
Comparing the code in Numeric Recipes in C++ between their Laguerre’s method implementation and their eigenvalue-finding approach, the eigenvalue-solution code is roughly 3 times longer. Good stuff.
September 23, 2009 10:51 AM
September 21, 2009
WHY IS HE CLIMBING THE MOUNTAIN? That Mountain. That Mountain.
Challenge the rock.
September 21, 2009 11:44 PM