Submission to the EPA’s call for comment on Shark Cull

Hey folks

The EPA are asking for public comment on the shark cull / drum line policy. Submissions are open until the 20th of February; based on the comments they will decide whether or not to conduct an environmental impact assessment. Head over there and put in a submission. It’ll take five minutes and a public environmental impact assessment could go a long way to ending this policy.

Below is my submission. Please don’t just copy & paste it – doing so diminishes its impact. However, feel free to use it as a source of inspiration and ideas for your submission :-)

The species of shark targeted by the drum line deployment are subject to federal protection as vulnerable species. Actions against that protection are inconsistent with existing environmental policies and should be subject to public review.

There has been enormous public concern about the drum line deployment, popularly described as (and in practical effect) a shark cull. Many thousands of people attended protests around the state, notably the large protests on two occasions at Cottesloe Beach. Significant discussion of the policy has occurred in regional, national and international press, with potential ramifications for tourism. This level of public concern justifies a public review period.

The shark cull is being conducted both in the Perth metropolitan region and in the South West. It is of state wide significance.

Insufficient evidence exists that:
a) the deployment of drum lines and the killing of sharks will reduce attacks upon humans
b) that the drum lines will not attract by-catch (including such endangered species as the Grey Nurse shark, or sharks of target species under 3m in length)
c) that personnel inspecting caught sharks are sufficiently trained to identify species and make a correct decision to release or kill under the policy

The long term impact on targeted species of the killing of individuals over 3m in length is complex to understand and the ramifications have not been considered in detail. There has been no opportunity for scientific inquiry and debate. Substantial, expert examination of the proposal is required to ensure these impacts can be managed.

Large individuals may be carrying pups and entering shallow waters to give birth. The low reproductive rate of these species necessitates review of the policy by the EPA to ensure long-term damage to the viability of these species does not occur.

Sharks are apex predators and are vital to healthy fisheries. The sustainability of Western Australian fisheries is a strategic issue. The EPA must assess the impact of the deployment of drum lines on these key species in order to ensure that a major industry remains viable.

Posted in Uncategorized | Leave a comment

Divest from mandatory detention

In case anyone wants to follow suit, I’ve just written this letter to UniSuper. Perhaps we can all write to our super funds (making some variation is a good idea) – and compare notes afterwards? If enough people write in funds are bound to notice, particularly industry funds like UniSuper.


I’m keen to make sure that I’m not financially benefiting from (invested in) the mandatory detention or offshore detention of asylum seekers.

Could you please let me know which of your investment options are invested in Transfield or Serco, so that I can ensure I’ve chosen options which are divested from them?

I would like to urge a general policy from UniSuper of divestment in companies who choose to participate in mandatory detention and Australian Government actions in violation of international law. Does such a policy already exist?

Thanks for any help


Posted in Uncategorized | 2 Comments

A shoutout for Vagrant + NFS

Newish vagrant (1.4+) has built in NFS share support. You can share filesystems between the host and the VM using NFS. If you’re like me, and running on VMware Fusion, this is a huge win, because you get to dodge the terrible performance and massive bugginess of vmhgfs. In particular, this issue where files are truncated was driving me spare.

The documentation for the feature is here. Go forth and use it, but one word of warning – on a mac it starts a bunch of RPC services (NFSd, mountd, …) which listen on all interfaces, not just the bridge with the VMs. So you might want to firewall those off.

Posted in Uncategorized | Leave a comment

Counting the West Australian Senate Election

tl;dr – check out to see the full details of the WA senate election distribution – precisely how the count was processed by the AEC for both the initial count (#14votes) and the recount, and to see what happens if the “lost” votes are added back in, assuming they were counted right the first time. grab the code and run the distribution yourself, it’s over on github.

Western Australia went to the polls with the rest of the country on September 7 2013, but failed to clearly elect six senators. When the votes were tallied a crucial exclusion on a margin of 14 votes was the difference between the election of Scott Ludlam (Greens) and Wayne Dropulich (Sports Party), or Louise Pratt (ALP) and Zhenya Wang (Palmer). The ALP & Palmer won on this count, but no result was declared and a recount was conducted.

After the initial count, several people asked me how the Australian Electoral Commission (AEC) processed the distribution of preferences, and whether there was a way to verify it. To my surprise the AEC software which takes all above-the-line and below-the-line votes and runs a Single Transferable Vote (STV) distribution is closed source and not available for download. I was unable to find any publicly available software to run the count. This made it extremely difficult to verify the correctness of AEC’s results.

While the recount was going on I got to work on some software to process the distribution. This was greatly helped by a detailed run log from the AEC’s software I managed to obtain. This told me exactly how the AEC’s software ran the distribution, including totals of votes for each candidate at each count, and precisely when candidates were elected and excluded.

STV is really a family of voting systems – some details vary between jurisdictions. The information I could find on the AEC website on how to process the distribution was adequate only for educational purposes, and did not go into the fine details. This lead to much late night study of the Commonwealth Electoral Act. A bill of Parliament is a pretty awful means to document an algorithm, but everything needed is in Part XVIII.

The AEC publish all the data necessary to run a count on their Senate downloads page. It is simply a matter of taking the number of above-the-line (ticket) votes and counting these votes as that number of papers following the party’s ticket(s). They also publish the form of every below-the-line paper lodged. Add those papers into one collection and you have all the information necessary to run the distribution, and determine who the elected candidates are.

In two long nights of work, I was able to get this done – exactly reproducing the AEC’s results in my software. The code was pretty rough and ready, but I had functional tests which checked my results matched the AEC’s. Being afraid of rounding errors I made sure to stick with rational number representations of transfer values, and was slightly hopeful this might turn up a minor error in the AEC’s software. Disappointingly, but reassuringly, I found no fault at all in the AEC’s software.

The AEC published above-the-line vote counts as the recount progressed. This made me hopeful I’d be able to run a count myself once the recount was complete and know the result before the official distribution was run. Unfortunately they did not enter the changes to the below-the-line votes (ballots rescued from the informal pile) until the last day, and did not make the data available until a couple of hours after they ran the count and declared the result. Gratifyingly my software agreed with theirs, the election now tipping to Scott Ludlam and Wayne Dropulich, the same crucial exclusion now going 12 votes the other way.

Of course, the AEC lost 1370 votes which were not included in the recount. The preferences of those votes as interpreted during the first count were published by the AEC, making it simple to add them back into the recount. This swings the crucial exclusion back to a margin of 1 vote, electing Louise Pratt and Zhenya Wang. It’s impossible to know if these votes would have stood as they did if scrutinised again, and votes may also have come back from lost informal votes.

The full senate vote distribution for these three scenarios can be viewed in detail. You can flick through the counts one-by-one, or the summary page for each scenario will link you to the count in which any given candidate was elected or excluded.

My software outputs JSON data describing the distribution process, and the user interface is an angularjs application which presents that JSON data. If anyone is interested in analysis or visualisation of the full distribution (as opposed to a simplified distribution only including above-the-line votes) the JSON files are linked for download. I would love to see some great animations appear from this data!

If you want to check out the code behind this, it’s over on github. I have named the project dividebatur (Latin for ‘distribution’) and it is open source under the Apache license. If you’re interested in the STV algorithm itself, it’s implemented in these 700 lines of Python code (hopefully quite readable).

I learnt a bunch of surprising things implementing the distribution. A bundle of “x” papers distributed at a given transfer value translates into a “x” times the transfer value votes, rounded down. This means that occasionally votes will be “lost” to rounding. What I didn’t realise is that those votes can also come back – if those papers are distributed in an exclusion, they may break by next preference in a way that avoids the rounding issue. Subtle details like this (and split group voting tickets, exclusion tie resolution, …) were tricky to get right!

In conclusion, we’ve now got some software which lets us as voters verify that the rather complex senate distribution is correct, and study hypothetical scenarios if we want to. It is easy to determine what would happen if a party changed their ticket vote in a particular way, or consider what would happen if a state-that-shall-not-be-named stuffed up their senate election. I hope you find it useful, and please send me feedback and/or patches! @angrygoat on twitter or

Disclosure: I’m a member of The Greens (WA). I don’t believe anything in this post is partisan, and I am speaking for myself. My software is open source and can be verified at your leisure :-)

Posted in Uncategorized | 2 Comments

Experience using personas to provide site logins

I recently knocked up a site for internal use at an organisation. I didn’t want to spend a lot of time coming up with a user system – the app is based on Flask so I’d have had to find something to manage users, and then handle password resets, and it’s all just too awful to contemplate.

Having seen a bit about Mozilla’s “Persona” federated authentication (for some reason, confusingly sharing a name with their theme system for Firefox) on LWN I followed the quick setup, set up flask-browserid and a tiny bit of infrastructure to maintain a list of email addresses with access. It took a couple of hours to get going, and another hour to debug a mysterious IE bug – not bad.

The really impressive bit is how it’s worked for the people using the application. I’ve got over fifty people using it, of various levels of computer skill, and I’ve had almost no support burden. I circulated a small document showing people how to get started, but that’s it.

Although Personas is federated, almost everyone is using the fall-back mode where Mozilla certify the identity. In that mode Mozilla let the person set a password, send an email to the person, they click to confirm ownership of the email address, and then (impressively) the login continues the second they click the link.

That fallback mode, and the fact that the system works around email addresses – which people understand – rather then URIs – which people don’t – is no doubt why I’ve found it so successful.

Anyway, it’s worked well. I’d definitely recommend it over coming up with your own user management infrastructure.

Posted in Uncategorized | Leave a comment

2011 Australian Census Release 3

A long time since I’ve blogged over here!

Just a quick post to let people know I’ve made a torrent for the third release of the Australian census 2011. I’m seeding it for anyone that wants a copy. It’s a 4.6GB download, the contents are unchanged from the original ABS DVDs, except that they have been recompressed with XZ rather than Zip (~ 50% smaller than the original zip files.)

Grab the torrent file, and you’re off.

This blog is hosted with and they won’t let me create an inline magnet link (software as a service, grr!); but you can get a magnet link via this shortened URL:

… or paste this into your bittorrent client:

Share and enjoy :-)

The source of this data is the Australian Bureau of Statistics. The data is licensed under a Creative Commons Attribution 2.5 Australia licence. Once you’ve downloaded the file, there is more information on licensing and attribution in the “About DataPacks” folder.

Posted in Uncategorized | 26 Comments

Pecan and Blueberry muffins, vegan, gluten free

Adapted from this wonderful cartoon by First Dog on The Moon (unfortunately, broken image on the Crikey site).

Ingredients: 1/4 cup light olive oil, 1/2 cup maple syrup, 3/4 cup soy milk, 1/2 cup water, 2 cups Orgran gluten-free flour, 2 heaped tsp gluten-free baking powder, 1 tsp cinnamon, 1tsp nutmeg, 1tsp cloves, 1/2 cup chopped pecans, 1 cup blueberries

Mix the oil, maple syrup, water and milk together, fold in sifted flour, baking powder and spices. Stir in the pecans and blueberries. Spoon muffin mixture into pans (works well in those fancy-pants silicon muffin trays), bake at 180c for 20 minutes.

(The original recipe doesn’t call for any water, but I found the gluten-free flour is a bit stiffer and needs a bit of extra moisture so you can stir the blueberries and pecans in. And a tip for laziness – crush the pecans in a mortar and pestle rather than chopping them!)

Posted in Uncategorized | Leave a comment