Wednesday, May 28, 2008

End of this Blog

Since my office blocks this blog site, I've moved to a new one. Please go to my new blog @ dhydrated.wordpress.com

Friday, November 9, 2007

Google Talk on Nokia e61i

My wife recently got Nokia e61i for her b'day. And the first thing I want to test is the Wi-Fi capability of the phone. I wanted my wife be able to chat with me thru Google Talk whenever I'm away from home.






So, I started to log on the net and surf 'http://talk.google.com'.



Then, I clicked on 'Launch Google Talk Gadget', which I could have a Google Talk on a browser with no installation required.


Then, it prompted me to sign-in and I'd signed-in.

It asking me whether it is ok to leave the secured page and I pressed 'Yes'.


Unfortunately, the nokia e61i standard browser don't has the flash player to support 'Google Talk Gadget'.


Then, I'd came across a piece of software called 'fring' where if installed on a smartphone, it could be an interface to several IMs on the Net. Google Talk is one of 'em.


Once, installed, I ran it. It required for me to log in only once for the first time. And walla! My wife able to chat with me thru Gtalk on her phone. Cool!


Currently, fring does not support Yahoo messenger. So, for now my wife has to resort to ebuddy mobile using the browser to chat via Yahoo.

Monday, October 15, 2007

Hari Raya 2007

On the first day reporting back to office after Hari Raya holidays, first natural things to do is to upload Hari Raya photos. This time around, Hari Raya brings a different meaning to me and my wifey. This is our first time celebrating Raya with our Adam since he was born a month after raya last year. Preparations before Raya were mostly about Adam. By first week of Puasa, his Opah, had already sow his first Baju Melayu. I haven't seen Baju Melayu that small before. Since it was the first time his Opah sewing a 10 month old Baju Melayu, there were some trials and errors. Eventually, she managed to complete it and it is d' most adorable piece of clothing I ever seen.

I guess, it is natural, once you have a child and wife, their priorities come before you. There was nothing I've planned to get for myself for this Hari Raya. Then of course, wifey keep hustling me to get a new Baju Melayu to match with Adam. Honestly, I'm glad that I'm over with all those branded clothing and stuffs. Thinking back, when I used to get all those expensive shoes, shirts and etc., from my mom before I was married, it was all a waste of my family money. Not that I don't appreciate what my family had done for me but I jez wish I had the same mentality then, like I am now. But again, parent will do all sorts of thing to make their children happy. Jez like me doing it to Adam. It must be a natural cycle.

I wish to apologize to all who know me personally, whether I've hurt anyone feelings either face2face or online. Selamat Menyambut Hari Raya Aidilfitri to all the muslims.

Hari Raya Aidilfitri 2007

Wednesday, October 10, 2007

SQL INSERT statement with 'Reserved Word' Column Name

I wonder, who was the genius who created a table column, named 'AND'. In any software development, it is fundamental not to use reserved words besides their documented usage. Today my colleague asked me how to create SQL INSERT statement for a column consists of reserved word 'AND'. I have to make some trials and errors kinda research since I had never came across a table as ridiculous as this.

Although, it'll never work, I've to tried below INSERT statement anyway.
INSERT INTO mytable (id, and) VALUES (1, 'TEST');
By running above INSERT statement, you will received below error message.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and) VALUES (1,'TEST')' at line 1
Some references I got from the Internet, they said it could be solved just by enclosing the column name with quotes ('and'). I've tried and it doesn't work.
Then I've came across MySQL Online Reference, where it stated there are three ways or syntax you could use to refer to a column, which are as below:
  1. <column_name>
  2. <table_name>.<column_name>
  3. <database_name>.<table_name>.<column_name>
So to solve my friend's problem, we can jez easily rephrase our insert statement as below:
INSERT INTO mytable (id, mytable.and) VALUES (1, 'TEST');
So by appending the table name prior to the column name (separated by dot '.'), we have turned this statement into a valid INSERT statement. Walla.

How to Rerender 'Mandatory' InputText with A4J

I was working on A4J (Ajax for JSF) for a week now. Just when I'm about to like A4J (Ajax for JSF), I hit a dead end with a bug. Initially, when I started writing this article, it was intended as a Bug report. But while I was preparing the snapshots, kachiingg..!!, my email received a notification from JBoss forum. Anxiously, I clicked on the URL in the mail, after several minutes of waiting (yes, JBoss, you guys need to do something with your website performance), I've received a solution from 'SergeySmirnov'. Russian I presumed. So from Bug report, this article turned to a solution. That's a miracle of the Internet. OK, back to my problem.

Supposely, A4J makes it simple for a developer to apply Ajax capabilities on their current JSF applications. And I admit, it is. After a week trying on A4J, I've been able to make cool Ajax call between my client page and server.

Here is the problem. I have a simple form, where I display a name in two format. One with an <h:inputtext> tag and another one in the <h:outputtext> tag.



Very simple. Below is the code for each object on the page.


Input field code.


Text output code.


Reset button code.

As a conventional JSF way, I'd put 'immediate' attribute equals to 'true' for my <a4j:commandbutton>, in order to by pass the validation since the <h:inputtext> 'required' attribute is 'true'. The thing is, when I clicked on 'Reset' it only 'rerenders' the text output. Input field value, remains. Hmm. That's not right. It should clears off both, input and output objects.


Thanks to 'SergeySmirnov' from JBoss.com forum, he gaves a solution. Instead of using 'immediate' attribute to 'true', I should use <a4j:region> to surround my reset code like below.


As you can guess by now, it works. My reset buttons clears off both objects. By surrounding my reset button with <a4j:region>, it will only submit this particular region as an Ajax request and omits the others.


Yeah... A4J rules!

Tuesday, October 9, 2007

US$100 'OLPC' Laptop


You may wonder what is OLPC. It stands for "One Laptop Per Child". To me it's the most noble project I've came across. The mission is to provide the children from all over the world, especially poverty countries, with this laptop which is also known as 'XO' laptop. The price is US$100. Now they have a program called "Get 1 Give 1", where you could purchase this laptop for US$400, and another laptop will be giveaway as a charity. For more info, go to www.laptop.org

On personal note, I jez wish they'd put in Java in to the laptop. I'm not saying Python is not good. But being a Java developer, I just think with Java, this laptop could has more killer applications and games.

Below is a video on the 'XO laptop'.

Monday, October 1, 2007

Attack of the Allergy

Never thought one day I could had an allergy attack. Never had any history of allergy before and now, I had one. Maybe it's just a message from above, for skipping 'Terawih' this year. After one jab on my behind and 2 jabs on my arm, hopefully the allergy will go away. Sick of going back and forth to the clinic and hospital. My first 2 visits to the clinic, was a waste of time. The doctor probably gave me some generic (cheap) drugs for my allergy. Don't even bother to look at my body. Some doctor just do it for the money I guess. But my visit to the hospital was totally the opposite. The doctor really showed her interest to treat me. She probably shots every drugs she could possibly give to me. Hopefully, the allergy stays away this time.
Doctor sending me for a stress test, which she said, could be one of the contributor for this allergy attack. I'm not that stress till I could get this sick. At least I think so. Well, I'm not that fit to be running on the treadmill during this fasting month. Maybe after raya, I'll think about it.