Diary of a geek

November 2007
Mon Tue Wed Thu Fri Sat Sun
     
   

Andrew Pollock

Categories

Other people's blogs

Subscribe

RSS feed

Contact me

JavaScript required


Thursday, 29 November 2007

On the 2007 Australian Federal election result

Well it's not like anyone couldn't see it coming.

I'm pretty happy with the result. It had to happen. If only Howard had stepped aside a year or more ago, maybe the outcome would have been very different for the Liberal party.

I do feel sorry for Howard though. It's not as if he's been doing a dreadful job for the 11 years he's been in office. He's done a lot of good. I don't think being thrown out on your ear completely is quite the way to end ones 25 year political career. I guess he really pissed off his constituency...

The main reasons I didn't vote Liberal again this time were pretty similar to last time: Iraq and the environment. Oh, and I thought the previous election campaign tactics were a bit dirty with all the FUD about interest rates. At least that backfired appropriately.

I must say that I've been quite surprised by various Liberal party happenings around this election. I'm surprised Malcolm Turnbull got a swing towards him in his electorate. I'm surprised that Costello didn't become the default Opposition Leader, and that he didn't even want the job. I'm surprised Turnbull was a front-runner for the job (and I'm pleased he didn't get it). I don't consider some filthy rich business man who's only just entered politics via a safe Liberal seat to be good alternative Prime Minister material. I can't say I'm a huge fan of Brendan Nelson either. Maybe the Liberal party's going to spend some time in the wilderness whilst in Opposition, the way the Labor did for so long?

I'm pleased that my immediate concerns about the Labor party being back in power haven't materialised, namely the selection of the cabinet. I've always hated the factional nature of the Labor party, and how the best person for the job wasn't necessarily selected. I'm glad Rudd hasn't continued that tradition. I'm glad Peter Garrett retained the environment portfolio. I'm also very pleased that Rudd's getting stuck into some of the things that are very popular with the people but the previous Government was quite controversial over, namely signing Kyoto, apologising to the Aborigines about the Stolen Generation and withdrawing troops from Iraq.

Interesting times ahead. I'm particularly interested to see how the US deals with any troop withdrawal. My personal opinion on that whole mess is that we shouldn't have been there in the first place, but we're morally obligated to see things through.

Oh, and I'm extremely curious as to what's going to happen to the Canberra housing market. Apparently (I can't remember where I got this from, maybe some long-time Canberrans on Planet Linux Australia can confirm or deny this) when the Liberal Party first came to power 11 years ago, they gutted the public service, and Canberra house prices dropped dramatically. I'll be watching with interest to see if anything similar happens this time.

[21:18] [politics] [permalink]

Tuesday, 27 November 2007

Two years of Python

As last Wednesday was the second anniversary of me joining Google, I thought it an opportune time to reflect on how I've found learning Python.

It's no big secret that Google is a Python shop. I'd been meaning to learn it a for a while prior to joining Google, but never found enough reason to other than because it seemed to be the cool new language. If I had a task that required me to write a script, I could do it in Perl in 30 minutes, or spend a day trying to wrap my head around how to do it Python.

I think I'd known and been writing Perl in some form or other for about 9 years. I've hardly written any in the last two, which is a bit sad. I even bought Perl Best Practices shortly after moving over here, and haven't gotten around to reading it. The only Perl I write these days is for personal tasks to try and stop myself from going totally rusty.

Anyway, I thought I'd write down some of my observations of Python, from a "veteran" Perl programmer's perspective. Not that I consider myself to be a shit-hot Perl coder by any stretch of the imagination...

No punctuation

I really like the lack of punctuation. It makes the code look a lot cleaner. I go back to Perl and my eyes bleed after trying to dereference a reference to a scalar, or something like that. It's just ugly in Perl.

No curly braces/indentation for blocks

The indentation thing isn't so bad. If you're using vi, you really need something along the lines of

set shiftwidth=2
set smarttab
set autoindent
set expandtab

in your ~/.vimrc

What I do miss is being able to bounce on the % key to find the beginning and ending of a block. I've heard rumours of a way to configure vi to do something similar for Python code, but I haven't gotten around to finding out. There seems to a general opinion that if you're writing a block that is so big you can't find the beginning and end of it, you're probably doing something wrong.

String concatenation

It's always struck me as bizarre how the most obvious way to concatenate a string in Python is also one of the least efficient. In fact, there's whole studies been done into different methods of string concatenation and their efficiencies.

Prototyping is easy

Now I may just be ignorant of some Perl shell here, but the number of times I've written a quick Perl script in /tmp to do some proof-of-concept thing is immeasurable. The fact that you can just fire up a Python interpreter and try something quick and dirty to see if it's syntactically sane, or does what you expect is fantastic time saver. ipython makes it an even more pleasant an experience.

No CPAN

I was initially a bit disappointed that there wasn't something like CPAN for Python modules. In practice, using Debian, I haven't found this to be that big a problem though.

List joining is wacky

I still find it weird that you don't join a list by a method of the list, you do it by a method of the string you want to use to join the list together with, that is, I think it should be mylist.join(" ") when it's really " ".join(mylist). That's just always struck me as unintuitive.

urllib2 doesn't hold a candle to libwww-perl

I think even last time I checked with Python 2.5, it's impossible to make a HEAD request. The mind boggles.

No setuid support

I can't complain too much, I think I heard somewhere it's going away in Perl as well, but it was certainly very convenient to be able to write setuid Perl scripts. I miss that convenience in Python. Not that one has to write setuid scripts all that often.

Regular expression handling is painful

It's about on a par with Java. You just can't beat Perl's =~ operator.

"There's more than one way to do it" versus only one way to do it

Perl's always had the adage of there being more than one way to do things. I think that has been its downfall in terms of readability. Heck, I've written some monstrosities that I've looked back on in a month's time and wondered what on earth I was thinking at the time. I think it's far easier to write readable Python than it is to write readable Perl.

I think that's about everything. I never did any real object-oriented programming in Perl, and so I tend to take a procedural approach to things in Python as well. I haven't written any massive bodies of code in Python (although I did help maintain one for about 18 months).

I like Python. It's become my first choice for writing random scripts now. Now I look at Ruby like I used to look at Python when I knew Perl quite well. Ruby has some nice things (like Perlish regular expression handling), but it brings back all that punctuation noise again. I'm not in a huge rush to learn it, even though there's a lot of hype around Ruby on Rails. I think I'd rather investigate Django or Pylons

[22:16] [tech] [permalink]

Sunday, 25 November 2007

Thanksgiving below zero

We got home from our week in Arizona late last night. We decided to drive non-stop yesterday, and get home in a day, rather than split it over two days like we did getting there. It ended up taking around 15 hours (we had an unexpected delay at Lost Hills because we found a stray dog (we initially thought it to be injured to boot) and Sarah was trying to get hold of some local animal control people to do something about it), otherwise it'd have taken closer to 14 hours.

The drive to Phoenix was pretty uneventful. We took our time leaving Mountain View on Sunday (we had an early Thanksgiving dinner with all of our neighbours on Saturday night), and decided to call it a night at Cabazon. For about the same price that we stayed in a crappy motel last time we went this way, we stayed at the Morongo Casino, which was really nice. We were in a "Canyon View" room, and, well this is what the view looked like...

We arrived at Craig and Sarah's place at about 5pm on Monday afternoon. Their new place is really nice. It's huge, with a huge yard, and a nice view of the hills. I've found suburban Phoenix (well Peoria to be precise) to be the closest looking thing to what I consider "normal Australian suburbia" that I've seen so far in the US. Granted, Peoria's a bit upmarket (at least the part that Craig and Sarah live in).

So we spent a day and a half vegging out at Craig and Sarah's place, then on Wednesday afternoon, we headed off to Woods Canyon Lake, in the Sitgreaves National Forests. I rode most of the way with Craig in their new motor home, and then swapped to drive our car after we got close to our destination. It turns out that the headlights in RVs are universally crap, so it was better for the Prius to be out front lighting the way on the gravel road.

I'd always associated Arizona with cacti and sand, but as it turns out, the majority of the state is forest. We arrived at the campsite after nightfall, and set up shop. We met some of Craig and Sarah's friends that night, who were all very friendly towards us. It was ridiculously cold that night. We went to bed rather under-dressed for the temperature, and absolutely froze.

The next day (Thursday), we all drove from the campsite (Craig towed their Jeep behind the RV) to Woods Canyon Lake itself, and went fishing. Arizona fishing licences for non-Arizona residents were a bit on the expensive side, so Sarah and I just hung out on the rocks and chatted to people and took photos. The collective haul of trout from about 5 hours fishing was pretty impressive.

I'm not quite sure why, but Friday was the group Thanksgiving dinner. Everyone pitched in, and cooked up a storm. They deep-fried three turkeys (which came out very nice and looking much less like KFC than I expected), and we had way more food than we needed. We all ate outdoors at around 3:30pm, and it was about 33°F (0.55°C). The only downside of this (aside from it being bloody cold) was the leftovers went cold almost instantly, so going back for seconds was a bit of a disappointment. Everyone gravitated back to the fire pretty quickly afterwards. It got pretty cold that night. I think it was down around -4°C when we went to bed that night.

We left a bit before 8am the next morning, and the car thought it was -7°C outside. One of the other campers told Sarah his thermometer was reading something closer to -14°C. I'm not sure how cold it was when we were in New York in January, but I didn't think it was that cold.

It was a good week away. The mix of camping and not camping was about just right. Now it's back to work for two weeks before we head off to Australia.

Photos from the trip are here.

[22:55] [life/americania] [permalink]

Sunday, 18 November 2007

Road trip!

It's been a while, but we're off putting a few more miles on the car. I decided to take the entire week of Thanksgiving off, and we're heading to Phoenix to spend some time with our friends Craig and Sarah as I write. They've got an RV, so we're going to go somewhere with them and hang out in it with them.

The air quality around the I-5 was particularly dreadful today. I've no idea if it's smoke, dust, fog, smog, or some combination of all four, but it was really quite disgusting. You could barely make out mountains looming up through the haze, and the sun looked a funny colour. Then we got to LA, and the air quality was just as bad. It makes me appreciate living in the Bay Area. The air there has its off days, but it doesn't seem as bad as it looks down here.

[17:38] [life] [permalink]

Two years in the US

So as it turns out, two years ago today, was when I arrived in the US with the intent of staying here for a bit.

Aside from recent developments, it's been a good couple of years. We're both pretty settled, have made plenty of wonderful friends, and seen a bit (not as much as we'd like) of the country. Sarah would have liked to have had a better time with employment, but it's not like she's been sitting around at home climbing the walls in her unemployment, either.

We keep talking about "when we move back", but I'm personally in no huge rush. I also don't have any strong desire to do anything relating to putting down roots over here. Buying a place just feels extremely unfeasible, and we can't really stay forever on the visa type I'm on, and I can't really see myself ever qualifying for a H-1B.

[17:37] [life/americania] [permalink]

Monday, 12 November 2007

Trip to Boston (well Cambridge really)

The week before last I spent in Cambridge. I didn't really see a lot of the place (although we ventured out on the T to have dinner in Boston a few times).

I quite liked what I saw of the place though. I like any city with half-decent mass-transit. I think ever since I saw the MTR in Hong Kong I've really liked big subway systems. Ones that run so often you don't need to have a timetable.

What I saw of Boston felt like New York without quite the same size and pace, which made it feel slightly less intense. I'd go visit again.

[21:35] [life/americania] [permalink]

My First Ubuntu Developer Summit

I've been procrastinating writing about my Boston trip, for no particular reason.

A bunch of us went to the Boston Ubuntu Developer Summit (in Cambridge, actually) for work purposes. We currently derive from the Long Term Support releases, and Hardy Heron is going to be an LTS, so I wanted us to get more involved directly, particularly at this stage of the game, rather than after it's already a done thing.

Anyway, the reason I'm writing this in the "Debian" category is I found the whole thing to be totally awesome. Debian should do something similar.

Rather than being a conference, this was essentially a week of 1-2 hour small-group meetings to discuss various features for Hardy. I thought it worked pretty well. I'd never seen gobby used before, and it's basically a poor-man's Google Docs (although one could argue it handles real-time collaborative editing better).

They had VoIP up the wazoo. You could dial into a conference bridge to just listen in, or you could dial a different bridge to participate. Every room had a Polycom conference phone in it. That seemed to work pretty well.

I think the main reason I think Debian could take a leaf out of Ubuntu's book on this was it helps resolve potentially controversial technical decisions very quickly. Rather than having a two week protracted flame war on a mailing list, you can have a 30 minute rational debate in person and move on.

So I've no idea how this UDS stacked up to previous ones, but I was very impressed by the whole thing. I'm in total awe of Scott James Remnant and Colin Watson for not having burned out by now. Doing a release every 6 months, with all the associated stuff that goes around it (i.e. running a UDS) has got to take it out of you.

[21:30] [debian] [permalink]

Wednesday, 07 November 2007

"As keen as mustard"

Daniel observes that the simile "as keen as mustard" isn't grokked by Americans, and had some trouble explaining the etymology of it.

As far as I understand it, it derives from a brand of mustard, known as Keen's.

Keen's mustard

[08:07] [life/americania] [permalink]

Sunday, 04 November 2007

Making mutt deal with HTML mail better

[09:50] [tech] [permalink]

Solar power for Cloncurry

It's exciting to read that Cloncurry is going to get a solar power generation plant that sounds something similar to the honking great big one in Spain. All for only $7 million. Apparently the Spanish one cost €1,200 million, which by my calculations is something obscene like $1.8 billion. The Spanish one is going to produce 300 megawatts though, and the Cloncurry one is only producing something like 10.

I'm mildly concerned about the other Australian solar tower project that I've been watching with interest.

Their latest annual report doesn't offer a status update, and the last two news articles on their website aren't very promising. It'd be a shame to see this project only ever produce the wrong sort of hot air...

[09:44] [life] [permalink]

Saturday, 03 November 2007

That's just gross

[22:50] [politics] [permalink]

Thursday, 01 November 2007

sysnews for Gnome/KDE/X in general?

Dearest Lazyweb,

I wouldn't mind something that put in-your-face announcements on the desktops of our users. Something exactly like sysnews would be ideal.

If it were GNOME-centric, it'd pop up some sort of notification thingy down on the bottom, right-hand corner, on top of everything and require explicit dismissal, but in an ideal world, it'd be desktop environment agnostic.

Anything like that already out there, or do I have to put my coding pants on?

Love, and sloppy kisses

Andrew

Update

libnotify-bin has a very promising looking notify-send -t 0. That might address the GNOME and KDE users, but I'm not sure how say FVWM2 users would fare.

[22:36] [tech] [permalink]