Sunday, March 30, 2008

Prevent _IG_FetchContent from caching data

_IG_FetchContent is a Java Script function provided by Google for facilitating iGoogle's Gadget development. Its function is simply to fetch data from a HTTP location.
_IG_FetchContent('', function (responseText) {
// do something

However, the HTTP request is NOT directly send from client to web server of that location like most AJAX calls. Google itself cache the content too. Which cause problems for Gadgets which need dynamic data.

To prevent Google from caching the data, the third parameter which is refreshInterval has to be specified.
_IG_FetchContent('', function (responseText) {
// do something
,{ refreshInterval: 1 });
The '1' means that the content at this location is cached for one second. Which is a reasonable amount of time.

Wednesday, March 12, 2008

My New Toy: X360 Controller for Windows

It is my summer! And I am spending my free time playing Need for Speed Prostreet, learning some new programming skills, and prepare myself for the internship program at IBM Solution Delivery, Thailand which will start at 17th this month.

When I played Need for Speed Prostreet for the first time, I found that Microsoft Wireless Keyboard was not responsive enough for playing this kind of game.

So, I decided to buy a new toy :)

I bought it from Pantip, Thailand's biggest computer store [and software vendors' nightmare :P], at the price of 1500 THB which seems to be too expensive for a game controller. I bought the wired version because some people in the forum said that the wired version is more responsive than the wireless ones. The wireless version also costs around 1900 THB.

The design is exactly the same as XBOX360 version. It has two analog sticks, one D-pad and four buttons. Despite the fact that I am a SONY fanboy. I have to say that this design is great!

There are more things to note about the controller's package design. First, there was a green stick wrapped around the end of the USB cord to warn the users to install hardware driver before plug the controller into USB port. It is really a great package design technique which can prevent technical problems for most users.

Second, it has a part in its cord that is loosely connected. So when people walk over the cord and accidentally trapped by it. The cord is consequently taken apart. So, the damage is not done to the game console, or the USB port of the computer.

My brother seems happy playing with it too. Here is photo of my brother playing Need for Speed :)