Comment spam 3

Oliver Brown
— This upcoming video may not be available to view yet.

I did a bit of comment moderation for Oliver today, since he had a few obvious spam ones. Firstly I didn’t know I could actually moderate comments, but there you go… Secondly, why do people try to submit such obvious spam, I mean it didn’t even try to get around the spam filter! Plus its not even remotely tempting to click on them, so what the author aimed to get out of it I just don’t know! Anyway, three cheers for the WordPress spam detector! :D

Mohamed cartoons

Oliver Brown
— This upcoming video may not be available to view yet.

This will be a somewhat controversial post.

The violent reaction to the cartoons depicting Mohamed continues to escalate. The form and severity of this reaction is wrong for several reasons.

Firstly, Islam forbids the persecution of non-believers. That is people who just disagree with the teachings of Islam should not be punished or treated any less than a Muslim. Unlike the invasion of Iraq for instance, nobody (Muslim or otherwise) was actually hurt by the cartoons. They simply didn’t believe that drawing them was wrong. This represents a difference in beliefs and the cartoonists should not be punished (according to Islamic beliefs).

Secondly, Islam strongly upholds the sanctity of life. Killing an innocent person is said to be like killing the entire human race. The argument here is who is considered innocent? Well it isn’t really relevent since killing someone could only be condoned if that individual disregards others’ right to life. Essentially only murderers may be executed. Calls for the death of the cartoonists are fundamentally non-Islamic.

Happy Birthday to Me

Oliver Brown
— This upcoming video may not be available to view yet.

The Great Me is 22 :D

Er, that’s about it really…

Nerd test

Oliver Brown
— This upcoming video may not be available to view yet.

Apparently I’m 37% nerd. Probably about right. :) Thanks to Rylon for the link.

The end of Hitchhikers

Oliver Brown
— This upcoming video may not be available to view yet.

Just to let people know, the ending to Hitchhiker’s Guide to the Galaxy Quintessential Phase is actually pretty good. The ending is far more “together” than the end of the fifth book, Mostly Harmless since it includes both Zaphod Beeblebrox and Fenchurch. Any fans who haven’t heard it yet, should go out and buy it.

Sirius Cybernetics Corporation now make pizza

Oliver Brown
— This upcoming video may not be available to view yet.

I had a frozen pizza today, Goodfellas Delicia. And much to my surprise their slogan is the same as the Sirius Cybernetics Corporation (from Hitchhiker’s Guide to the Galaxy).

AJAXy Scriptaculous goodness

Oliver Brown
— This upcoming video may not be available to view yet.

Scriptaculous is a Javascript library used for doing AJAX stuff and certain visual effects.

It’s very well written, has excellent cross browser support and best of all there are cool functions in Ruby on Rails for using it. One of the coolest features is drag and drop. I’ve already implemented it in Galaxia Ruby for adding ships to fleets :)

Saddam Hussein to sue George Bush and Tony Blair

Oliver Brown
— This upcoming video may not be available to view yet.

In an interesting twist, Saddam Hussein is trying to sue George Bush and Tony Blair for a range of offences related to the invasion of Iraq.

Some of the points seem valid, some are rather silly. To read more detail, check out the Washington Post.

Tree structures in Ruby on Rails

Oliver Brown
— This upcoming video may not be available to view yet.

This is becoming a trend - another built-in feature of Rails that will seriously help Galaxia development.

You can use acts_as_tree in a model to make it, well, act as a tree.

What this means is you add an extra field to the database called parent_id that tracks object’s parents. Rails automatically manages this for you and adds extra methods for dealing with trees (things for accessing parent, ancestors, children etc.). Just like the post on type, this is something I was already doing with Galaxia but managing myself.

Using “type” in Ruby on Rails

Oliver Brown
— This upcoming video may not be available to view yet.

By default Rails applies special meaning to certain fields in a database table. One of these fields is “type”.

The type fields is used by Rails to create a “single table inheritance model”. This sounds fairly complicated and is best explained with an example:

Imagine a forum system. A forum will have threads and replies. Threads and replies are different and have different functionality, but certainly share a lot of characteristics. So you might create a class message with two sub classes: replies and threads. In Rails you can store all these in one messages table with a type field set to either reply" or thread. When you load a message it will actually create either a reply or thread object (in stead of a message object). When you create a new object it stores it in the messages table with the correct type.

This is ideal for Galaxia. In fact it’s the model I used all along - I just had to write the functionality myself.