Wordpress for iPhone (and iPod Touch)

July 23rd, 2008

Typing on my iPod Touch at the moment. I think this app is gonna rock.

iTunes 7.7 and AppStore

July 11th, 2008

When I was reading Rafif’s tweets earlier today, I found out that iTunes 7.7 is available through Software Update. Expecting AppStore to be available through this iTunes update, I downloaded and installed the new iTunes.

iTunes 7.7

I have only browsed through the AppStore to look at applications that I might be interested in, and of course, I downloaded a few free ones.

iTunes AppStore

Currently I am waiting for the iPod Software Update 2.0 to be available through iTunes. According to MacRumors [1], iPhone 2.0 Firmware is already available through a specific link. Please note that it is not for iPod Touch!

So without anything better to do at the moment, I am doing some “window shopping” on iTunes:

Facebook (Cost: Free)

Not overly excited with this one, since their mobile interface is pretty decent. I wanted to see what they are offering that beats the mobile interface.

Facebook on iTunes AppStore

Remote (Cost: Free)

I think Remote extended the ability of Apple Remote (which I have never really used). You can control iTunes or Apple TV, see the album artwork on Remote, and amazingly - it can be done over the Wi-Fi network!

Remote on iTunes AppStore

Twitterrific (Cost: Free/$12.99)

The good people at Iconfactory offers two different versions of Twitterrific on AppStore. If you don’t know what’s Twitterrific, you don’t know what’s Twitter. Twitter is a micro-blogging social network. The free version of Twitterrific is free, that comes with advertisements; while the Premium version that has no advertisement costs $12.99.

Twitterrific on iTunes AppStore

Things (Cost: $12.99)

A task manager for your iPhone, or iPod Touch. I need this, I keep forgetting things.

Things on iTunes AppStore

Super Monkey Ball (Cost: $12.99)

If you followed Jobs’ keynote during WWDC, you might have seen this demo, and wet your pants (I did! I even got the game on Wii). Control the little monkeys using the accelerometer (if you don’t know what’s this, you don’t know iPhone/iPod Touch at all) through 5 worlds and 110 stages! Powerful use of the accelerometer!

Super Monkey Ball on iTunes AppStore

Enigmo (Cost: $12.99)

This game was one of the demo during Jobs’ WWDC keynote. Your task is to direct the water droplets to where they are supposed to be.

Enigmo on iTunes AppStore

Bomberman Touch “The Legend of Mystic Bomb” (Cost: $9.99)

The last time I played Bomberman was, many many years ago. This version of Bomberman on iPhone/iPod Touch makes me want to quickly find out how they implement the gameplay, with the features of the handheld devices.

Bomberman on iTunes AppStore

So, about time to spend more money, don’t forget the 2.0 Firmware update for iPod Touch will cost you!

ref:

  1. iPhone 2.0 Firmware (5A347) Available Early

Installing Gnome Do

June 26th, 2008

I have been using Quicksilver on my MacBook for a couple of months now, kinda used to it now since I can launch applications and do most of the daily tasks without having to point-and-click too much.

What if you want something similar that runs on your Linux system? Ladies and gentlemen, say hello to Gnome Do.

gnome-do.png

To install it, add the following PPA repositories into your sources list:

deb http://ppa.launchpad.net/do-core/ubuntu hardy main
deb-src http://ppa.launchpad.net/do-core/ubuntu hardy main

Reload Synaptic, then search for Gnome-Do. If you are a CLI guy, do this:

sudo apt-get update
sudo apt-get install gnome-do

When installed, you can Gnome-Do from Applications > Accessories > Gnome Do.

The default hotkey is <Super>-Space, you can easily edit this from Gnome-Do’s Preferences. There’s also easy access to all the official/third-party plugins from the Preferences dialog.

gnome-do-prefs.png

A few plugins that I find useful:

  • Files and Folders: indexes files in your specified directories.
  • Flickr: upload photos to Flickr
  • GNOME Dictionary: add ‘define’ function to Do
  • GNOME Screenshot: take screenshots of whole screen or current window, with delay
  • Twitter: tweet from Do!

Ruby on Rails: Polymorphic Association

June 19th, 2008

While working on our industrial project today, we stumbled across this situation where we need a base class (Document) that are able to refer to different type of documents (ie. Report, Screen, etc).

We found two ways of dealing with this situation, one of which is by using Single Table Inheritance (STI); and the other one we are fond of, is called Polymorphic Association.

According to [1], Single Table Inheritance is:

… an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes

We decided to go with Polymorphic Association, because we wanted different classes for different subtypes of documents. We wanted to avoid having a really large single table to store everything, and using STI might leave us with many empty fields in a row.

A little explanation of Polymorphic Association, based on my understanding. Polymorphic Association uses two fields in the base class as the foreign keys, to refer to different subclasses. It stores the ID of the subclass, and the type (model).

This is the relationship we hope to achieve:

Inheritance

I have created models for the above classes:

script/generate model Document
script/generate model Report
script/generate model Screen
script/generate model Process

We start by declaring the interface, and associate them:

We declare the interface in models/document.rb:

class Document < ActiveRecord::Base
  belongs_to :content, :polymorphic => true
end

Then, we associate the subclasses with the interface.

In models/process.rb:

class Process < ActiveRecord::Base
  has_one :document, :as => :content
end

In models/report.rb:

class Report < ActiveRecord::Base
  has_one :document, :as => :content
end

In models/screen.rb:

class Screen < ActiveRecord::Base
  has_one :document, :as => :content
end

Now, in Document’s migration file, create the table:

create_table :documents do |t|
  t.string :title
  t.string :author
  t.references :content, :polymorphic => true
  t.timestamps
end

In the rest of the migration files (create_report, create_screen, create_process), fill in the appropriate columns for your table, and finally run the migration.

rake db:migrate

What you will see in your database table (documents) is that Rails created two fields, namely content_id and content_type in your table. Those are the fields used to reference the subclasses.

So far, this method is able to accomplish what we had in mind.

If anyone out there have a better solution to this problem, drop me a comment. Cheers.

ref:

  1. P of EAA: Single Table Inheritance

Firefox 3: Help Set A World Record

June 18th, 2008
Download Day

Firefox 3 is scheduled to be released in about an hour.

The guys at SpreadFirefox wanted to set a world record for the most software downloaded in 24 hours, so pledge yourself and help make it happen!

Firefox 3 has more than 15,000 improvements, and its much faster than the previous version, plus it does not have the memory problems previous versions had.