Not that I need to tell you how to vote

I’ve fielded many questions about how to vote for me in Sydney or the Secular Party in the senate. Here’s the low down.

I’ve fielded many questions about how to vote for me in Sydney or the Secular Party in the Senate.

Here’s the low down for:

Naturally, if you do not find the allocation of preferences on either ticket to your satisfaction, you should modify them to best represent your interests. belowtheline.org.au allows you to fully customise a preference allocation before polling day to make sure your vote counts the way you want it to. Numbering 84 boxes requires some stamina but technologists are certainly doing their democratic bit to help you out!


Authorised by John Goldbaum, 7 Rockwall Crescent, Potts Point NSW 2001.

Surveys: useful or yes definitely

Here’s a brilliantly constructed survey I was sent from FamilyVoice Australia. This was not going to be a highscore entry for me.

Here’s a brilliantly constructed survey I was sent from FamilyVoice Australia. Apparently you get 10 points for answering “Yes definitely”, 2 points for answering “definitely not”, 1 point for “no comment” and no points for not answering. From the very first question I could tell that this was not going to be a highscore entry for me.

A snippet from the survey
A snippet from the survey

Full PDF version

Why I stand before you

As some of you already know by now, I have nominated myself for the 2010 Australian Federal Election as a candidate for the Commonwealth Electoral Division of Sydney, endorsed by the Secular Party of Australia.


As some of you already know by now, I have nominated myself for the 2010 Australian Federal Election as a candidate for the Commonwealth Electoral Division of Sydney, endorsed by the Secular Party of Australia. It is both an honour and a privilege simply to be able to stand for such office. It is truly a remarkable thing to participate in a society that conducts its affairs in this manner.

Continue reading “Why I stand before you”

The Happy Toggler

So I’ve been writing a lot of boolean toggling code recently, and it’s been making me sad. Can’t we make it happier?

I’ve been writing a lot of UI code lately, and one of the bread-and-butter operations in UI code is toggling boolean state, usually in response to a button press. Now, what does toggling code look like?

Say I have an object that likes to transition solely between happy states every time a certain event occurs. Here’s how I might handle it:

 theObject.happy = !theObject.happy;

There. Simple huh? Something you probably learn how to do in an introductory programming course. It might be surprising to you, but someone asked a question on how to do this on Stack Overflow. The other alternative provided in the answer is the somewhat more cerebral:

theObject.happy ^= true;

Thanks Spock. Of course if your language doesn’t have an assigning XOR operator this option is ruled out. If you value clarity of code, or you simply don’t want less brainy maintainers pestering you about what your code is doing, you rule this option out as well.

So I’ve been writing a lot of code recently of the first form, and it’s been making me sad. There’s a strong feeling of non object oriented-ness about it. I mean, to toggle the state of an object I have to:

  1. ask it what its current state is;
  2. flip that state locally;
  3. and then tell the object to take on this new state.

Bleh! Why the hell should I care what state it currently is in? I just want to toggle it! Shouldn’t I just be able to ask the object to toggle it’s own state; perhaps of even multiple properties in a batch sequence?

Naturally, nobody wants to write a toggling method for every writable boolean property of their objects. So either there needs to be automatic support in the platform or some ability to provide a general toggling abstraction.

One such example of a crude toggling abstraction would be a Ruby module defined like the following.

module Toggler

  class ToggleHelper

    def initialize(target)
      @target = target
    end

    def method_missing(sym)
      @target.toggle(sym)
    end

    def toggle; end

  end

  def toggle(*sym)
    return ToggleHelper.new(self) if sym.empty?
    
    sym.each { |s| self.send("#{s}=", !self.send(s)) }
  end

end

Such a module could be mixed-in at the appropriate levels of an inheritance hierarchy, or maybe even at the root level if you’re game.

With the mix-in mixed-in, toggling code would be more concise and less repetitious:

the_object.toggle.happy
the_object.toggle(:happy)
the_object.toggle(:wanted, :happy, :virtuous)

Doesn’t a declarative syntax such as this feel much more happy?

Stories what I wrote when I was ten

A youthful and somewhat insensitive re-telling of a classic fairy tale.

I present to you a youthful and somewhat insensitive re-telling of a classic fairy tale.

Please note—The following story is not meant to imply that the residents of Chernobyl were:

  • tax evaders; or
  • incompetent home builders; or
  • mean spirited; or
  • comparable to swine; or
  • given to formulaic naming of their children.

Any resemblance to any person, living or dead, is purely (and tragically) coincidental.

The Three Little Taxpayers

by C. D. Owen. (Age 10)

Once upon a time, there were three little taxpayers and they lived in a Russian town called Chernobyl. Two lived in the outskirts of the town and they had made their homes of poor building material. One whose name was Yuri had made his house of straw. The other, whose name was Yori, had made his house of sticks and branches. Everyone in the town made fun of the them. The other taxpayer lived in the upper-crust of the city and he was very well-off. His name was Yari and he lived in a magnificent sky-scraper and he made fun of Yuri and Yari as well.

One day, the big bad tax-collector came along and his name was Yiri. He came to Yuri’s house and knocked on the woven door.

“Little tax-payer, little tax-payer, let me in!”
“Not by the vinyl of my skinny wallet!”
“Then I’ll have to demolish your house!”

So the big bad tax-collector went away and then came back with a bull-dozer. He then knocked over Yuri’s residence. He then went and on and came to Yori’s house of sticks.

“Little money bag, little money bag, let me in!”
“Not by the leatherette of my medium filled wallet!” came the reply.
“Then I’ll have to demolish your house!”

And again he went away and this time brought back a demolishing ball. He then knocked down Yori’s house. Then he continued along collecting debts. He then came to the sky-scraper belonging to Yari.

“Little dollar-sign, little dollar-sign, let me in!”
And Yari replied, “Not by the one hundred percent leather of my fat wallet!”

And so away went the big, bad tax-collector yet another time. He then came back with a demolishing squad but they couldn’t destroy the sky-scraper because they didn’t have a permit to destroy large buildings.

As you have probably known, the big bad tax-collector was very greedy and he just had to have Yari’s wallet. So the big bad tax collector went to the Chernobyl nuclear power plant and he shut off the reactor’s cooling systems and then the power plant blew up causing Yari’s building to glow and melt.

The next day the big bad tax-collector came back in his protective clothing and he searched the rubble for Yari’s wallet, which he never found but he was glad he gained his revenge.

The moral to this story is: pay your debts or you’ll be sorry!