I think I need a new irony meter

•December 14, 2009 • Leave a Comment

Quoth everybody’s favourite Attorney-General, Michael Atkinson:

“This is a question of a small number of very zealous gamers trying to impose their will on society. And I think harm society. It’s the public interest versus the small vested interest.”

(H/T: The Escapist.)


•October 23, 2009 • Leave a Comment

This could be bad.

While it is noteworthy that Hamilton claims his primary focus to be climate change, it should not be forgotten that he has long been a proponent of “protecting teh kittehs!” by censoring the internets. (In fact, the Howard Government’s initial trials were instigated as a direct result of a paper co-authored by Hamilton. He got the facts wrong about the internet then, and he’s still spouting the same nonsense 6 years later.)

Worst Age-Verification System. EVER.

•October 22, 2009 • Leave a Comment

As part of my new life as an intrepid reporter for R18+ Games Australia, I check every few days on the classifications website for any new developments. As anyone who has checked the site would know, it employs the age-old CYA policy of age-checking before allowing access to the latest classification decisions. All well and good — I’m a good decade over 18, so “OK” is the obvious answer.

But what happens when you click “Cancel”? Are we redirected to the Disney channel?
Continue reading ‘Worst Age-Verification System. EVER.’

Subversion and Vim

•September 18, 2009 • Leave a Comment

After finally getting sick of receiving

svn: system('vim svn-commit.tmp') returned 256

every time I tried to commit without using the -m option, I found some good advice:

cd ~/.vim
mv doc/rails.txt plugin/rails.vim ~/.Trash

Since I still like my Rails plugin, the option in the comments of using

SVN_EDITOR="vim --noplugin"

finally fixed the problem without killing my Vim setup. Just add/change that line and run source ~/.profile.

Bad iTunes. No!

•September 16, 2009 • Leave a Comment

Don’t get me wrong, iTunes is a great piece of software. But does Apple really have to change the user interface with every fucking release? I quite liked the view I had before — two columns at top (Artist and Album) and the list of songs pared down by the selection from one or each of these.

I disabled the Genre column, since my music doesn’t classify easily. But why the hell should I have to use

defaults write com.apple.iTunes show-genre-when-browsing -bool FALSE

to disable something so obvious? This to me seemed like the sort of thing that should be able to be changed either via the preferences pane, or, even better, by right clicking on the heading bar. Give me a list of options and a little tick.

While we’re at it, why should I have to use

defaults write com.apple.iTunes show-store-arrow-links -bool FALSE

to disable the store links?

Thirdly, why the fuck would I need a store link to a song I already have?

Yet in spite of its faults, I quite liked iTunes 8. So what does Apple do? Changes the user interface. Again.

I’d started using Songbird on my PC as my main media library, since

  1. I hate the way Media Player organises my media (seriously, Disc 1 and Disc 2 as separate entries?)
  2. I hate the way iTunes tries to install every last piece of Apple software, especially since I don’t even own an iPod

The only thing I’d really like to see is the ability to rip CDs in Songbird. Other than that, it is, to me, the best media player around.

So thank you, Apple, for convincing me to switch to Songbird on my Mac as well now.

Update: I notice that CD Ripping is included in the Roadmap for the Kanye release, scheduled for October. Given that the Jackson 5 release is a month overdue, I’m not expecting it on time, but hopefully by the end of the year it will be available. Songbird FTW!

Update Update: Ooh, transcoding, too.

RedCloth and WordPress

•August 28, 2009 • Leave a Comment

I’ve been a bit lax posting anything substantive programming-wise; I think it’s largely because I have found myself reiterating the same code over and over at work, so there hasn’t been anything new to contribute (at least nothing that hadn’t already been contributed by programmers far superior than I). I thought this might be worth sharing, however. It’s a little script I put together today to generate an HTML file from a textile input. Nothing groundbreaking, I know, but I find it useful for blog posts, and here’s why.

  • I don’t like writing in HTML. It’s cumbersome.
  • I’m not really a big fan of the visual editors, since I find myself wanting to alter the HTML output anyway. (I think it offends my programmer’s sensibilities.)
  • I really like using textile for markup.
  • Writing programs is fun, and makes you a better programmer.

I found myself consistently writing the articles in TextMate or Vim using textile formatting, then manually converting the output to HTML, etc. I figured my output would be improved with some minor automation and so, with the joy that is Ruby, I set it up. All my posts are stored in a single directory (Articles) with a subdirectory for each website to which they get posted (e.g. intouchwiththeobvious.wordpress.com), each of which then has an ‘out’ directory for the HTML. The textile source goes in, and the following script in the base directory:

#!/usr/bin/env ruby

require 'rubygems'
require 'redcloth'

unless ARGV.empty?
  # Set up the files for conversion
  input_file = ARGV[0]
  directory = File.dirname(input_file)
  # FIXME: Retaining extension on filename
  filename  = File.basename(input_file).gsub(/(.*)\.#{File.extname(input_file)}$/,'\1')
  output_file = "#{directory}/out/#{filename}.html"
  File.open(input_file, "r+") do |input|
    File.open(output_file, "w+") do |output|
      # TODO: Unescape HTML codes?
      output << RedCloth.new(input.read).to_html
  # Fail gracefully if no input file is specified
  puts "You need to specify an input file"

Then I just call ./prepare.rb intouchwiththeobvious.wordpress.com/this-article.textile and voilà! HTML output to /intouchwiththeobvious.wordpress.com/out/this-article.textile.html. Copy and paste to the HTML editor in WordPress and it’s ready for any final customisation, or just posting.

I’m still tweaking it to remove the original extension from the filename (I wrote this script in less time than it took to write this article) and I was thinking of adding --[no]-escape as a command line option for whether RedCloth or WordPress should handle HTML escape codes. This can be achieved by changing the RedCloth call to

output << RedCloth.new(input.read).gsub(/\&\#8217\;/, "'").gsub(/\&\#822(0|1)\;/, '"')

and so on for the remaining escapees. Hell, I haven’t really looked at the RedCloth documentation much — there may be a way to do it already.

Now, before I get a dozen (I wish!) comments telling me how there’s already a way to do this with [insert plugin/editor of choice here], let me state this clearly: this is about writing code. If there’s a simple job to do, sometimes it’s more fun to create a custom solution than to search for an existing one. I’m enjoying (and getting better at) command-line Ruby and scripting, and I’ve got something that does exactly what I want it to, no more, no less!

Oh, and you’ll need to chmod +x prepare.rb to make it command-line executable, but you knew that already. 🙂

Support the Marriage Equality Amendment Bill 2009

•August 28, 2009 • Leave a Comment

Australian Marriage Equality is calling for support for the Marriage Equality Amendment Bill 2009, which would alter the wording of the Marriage Act 1969 to allow unions between same-sex couples.  The inquiry has recently been flooded by anti-gay submissions by the Religious Right. Do your bit to redress the issue. My submission is below the fold, and may be used in whole or in part by anyone wishing to support the amendment.

The submissions close today so you need to get in quick!

(Hat tip: John Wilkins.)

Continue reading ‘Support the Marriage Equality Amendment Bill 2009’