How to Install ruby mysql on Mac OS X 10.6 (Snow Leopard)

Do a quick google search for “ruby mysql mac” and you’ll find the first result:

How to install the MySQL/Ruby gem on Mac OS X Leopard

This article really helped me when I was using Mac OS X 10.5 and wanted to connect to MySQL with ruby. I just got a Macbook Pro with Mac OS X 10.6 (snow leopard) pre-installed and the method this article taught us no longer works. Do a simple test in irb and ruby will give you an error like:

>>'localhost', 'user', 'pass', 'db')
ArgumentError: wrong number of arguments (4 for 0)
     from (irb):4:in `initialize'
     from (irb):4:in `new'
     from (irb):4

Continue reading How to Install ruby mysql on Mac OS X 10.6 (Snow Leopard)

Gravity E71 – Using GPS

The other day I wrote a blog post “Gravity unable to use GPS on E71?” complaining Gravity not being able to use E71’s GPS module. But now I know how to enable Gravity to use GPS on E71 so that we can check-in on foursquare and geo-tag our tweets.

Actually the problem is rather simple – just install the FP2 version! But before that I wasted a lot of time trying to figure out how to let Gravity use GPS.

Although it lacks documentation, Gravity is updated very frequently. Each time a new version is realeased by the author @janole, two different versions are available. For example, he just released the 6375 alpha, and sent two links on twitter:, We all know that E71 is feature pack 1, but for Gravity, you must choose the FP2 version!

During install process, you’ll notice that on the data access alert screen, there’s a new item of GPS data – that means it will access your GPS module (great!). FP2 version runs without any problem. After installing this version, you should be able to find a new row “Places nearby” in foursquare account and after clicking it you will find a list of venues and select one to check-in. For twitter, you’ll also be able to use the up arrow key to switch GPS on/off when writing tweets.

By the way, don’t forget to turn on the geotagging feature in your twitter account settings (go to, it’s not in Gravity).

Happy checking-in and geotagging!

Symbian is expensive

Twitter just bought tweetie and made it free. But even before that, tweetie for iPhone cost just $2.99.

Gravity is a twitter client for Symbian s60 devices, but it costs $9.95. Still most users think that it’s unbelievable to build such a great (user experience) app on such a platform (dev difficulties), so it’s worth the money.

So Symbian devices may be cheaper than iPhone, but symbian lacks apps. Developing apps for symbian is more expensive, so apps are more expensive for users.

If It’s possible, I’d like to try out development process on both kinds of platforms and see the differences of dev environments.

Gravity unable to use GPS on E71?

I don’t know. I have been trying to send a geo-tagged tweet for 3 days but still no luck. But some users told me that they could.

Gravity has no manuals except some very basic entries. So I had to google for answers, search twitter for the tweets about this topic, and shout on twitter asking for help. The closest one I got is an article published days ago: How to geotag tweets using gravity on an E71. But when I try to copy GPS to clipboard as the article says, it’s of no use, no matter how long I wait.

Some other people say that there’s an option “Use GPS” under “Tools” menu, but I didn’t see it.

I just sent an email to the address provided on the Gravity product info page, and hope there will be an official answer. Will update this post if there’s any news.

Update – no official answer but I finally found out how. Check out my new blog post – “Gravity E71 – Using GPS“.

It’s Hard to Persevere in a long-term Plan

One month ago, I became interested in Django and made studying Python well a goal for myself.

Yes I know there are other ways to study a language. For example, learn Python by practicing with Django. But I want to be a bit familiar with Python before coding Django websites. So I decided to implement the algorithms in the famous book “Introduction to Algorithms“. The even greater benefit for me, I thought, was that I could get more familiar with algorithms.

It’s a great plan for me, one without great determination. Some friends said it’s hard when I told them. Now the fact turns out to be I really can’t go on with it. At least it must be paused, if not terminated.

I just got a new job. Although I really love it, I’m overwhelmed by the amount of new tools and knowledge I must learn. The good news is that I will learn Python for this job. The bad is that I’m afraid I can’t learn Python through implementing the famous algorithms. I must learn fast through practicing in real productions work.

So to learn Python is easy. But the road I chose to this goal is hard. Maybe it’ll return great profits – reading the book helped me a lot in the interview for this great job.

Will I resume the process when time is not so expensive as now? I wish.

Use in TwitterFox to Shorten URL

OK, tinyurl is short enough. But is even shorter.

Many tools use tinyurl to shorten URLs, because it was the origin of this wonderful idea. TwitterFox is such an example.

I prefer TwitterFox to twhirl because as a Firefox add-on, the url can be inserted into the tweet with a single click (Besides, word “twhirl” is hard to remember :) ). But why didn’t it provide an option of URL shortener to use?

We can modify its source to achieve this, though. Open the file chrome/TwitterFox.jar!/content/twitternotifier.js and find the line where TINYURL_CREATE_API is defined. Change the constant value to “”, which is the API of

There are countless URL shorteners around the web. Just choose your favorite.