Skip to main content


Showing posts from May, 2009

Ubuntu 9.04 and NVIDIA Driver

I have been using Ubuntu for quite a while and I loved it for it's simplicity. I downloaded and installed 9.04 in my machine last night and to my surprise I no longer get the nice pop-up prompting me to install proprietary NVIDIA driver for my NVIDIA 8800 GTS graphics card.

The "nv" driver worked fine but it doesn't allow me to enable desktop effects. Also, I really want the full hardware acceleration so I can do some OpenGL programming. After search around the ubuntu package repository, I found several versions of the old familiar nvidia-glx. So I installed the latest one with:
sudo apt-get install nvidia-glx-180Another surprise was that it no longer updates the xorg.conf file for me so I ended up running nvidia-xconfig myself by:
sudo nvidia-xconfigThis overrides the xorg.conf file to make sure X server loads the proprietary "nvidia" rather than open source "nv" driver. I wonder what the Ubuntu team was thinking, this definitely felt like a step ba…

East Coast Trip

I met a former colleague who was born in Hawkes bay and had some random chat about work and holidays. This was when I realised that even though I’ve been living in New Zealand for 12 years, I’ve never travel to the east coast of north island before. Therefore, when my wife said she felt like to go for a holiday I immediately suggested that we should travel to the east.Day 1 Napier is quite far away from Auckland (420 km, ~6 hours drive according to Google Map), so we’ve decided to stop by few other cities alone the way. Our first stop was Rotorua, which is famous for its geothermal sites and hot pools. After checked into our hotel, we were wondering around the street trying to find a place for dinner. Eventually, I pulled out my iPhone, browsed to, found a highly rated bar Pig & Whistle and found it using iPhone GPS and Google Map. I just can’t imagine how to live without iPhone and Internet these days. After dinner, we visited the Polynesian Spa, which is quite fam…

Referencing Local Variables in jQuery Callback Functions

One day I was working on a CRUD application, which contains a lot of form fields and controls. Each of them requires a mouse over event handler to display a tooltip message. After lots of copy’n’pasting, I decided to refactor the repetitive event registration code out and put them into a loop. To test out my idea, I developed a very simple page with just three <div>s:<div id="div1">Click me</div> <div id="div2">Click me</div> <div id="div3">Click me</div>and a list of messages indexed by the <div>s’ ID:var messages = new Object(); messages['div0'] = 'hello'; messages['div1'] = 'bonjour'; messages['div2'] = 'ciao';When someone click on one of the <div>’s region, I would like to show a popup an dialog and display the message associated with it’s ID. Since my goal was to eliminate repetitive lines of code, I put the event registration code in a loop:for(va…