Sunday 18 May 2008

There's a reason to everything...

There's a reason to everything...seriously, I swear....there is, there is!!! : O

You see if a wise wise wise person tells me that "there's a reason for everything", I'll probably give them the "raise-up-eye-brow" look, half wondering about what they have just said. But many a times when I think back to the past, to actions leading up to an event, everything just CLICKS just like that. And you go 'ah hah', everything, every move, they suddenly all make so much sense.

The even more funny thing is you usually don't realise it until when you look back or reflect upon the event. All the prior unexpected actions leading up to the result suddenly fits perfectly into the picture.

Ok may be NOT EVERYTHING has a reason to it (I'm sure someone will bound to be able to think of some examples here). But I guess my main point is that I've always find it funny (in the interesting way) that when I look back on something, the sudden rush of realisation, how everything fits in together and that you are able to explain each step leading up to it. You know like the joy and sudden "clicks" you get when you solve a murder case (in TV or puzzle book or something). It's like 'wow' and you can't help to realise how life can just be so powerfully amazing! At least this is my thought anyway.

So just remember this when you are down / lost / wonder about something / questioning WHY WHY WHY:

"Things don't happen for no reason at all, there's a reason to everything"

You might say I'm too optimistic, but at least, this is what I believe in.
ps - I happened to find the above via a random web search (while trying to find appropriate images for my post). It's a very popular piglet's quote. It is very sweet indeed!!! (luv piglet!) And I think the above can be somewhat related to my post content...hehe : )

Text Images from: http://annieslittlefootprints.blogspot.com/2008/05/piglets-turn.html
Piglet Image from: http://www.poohfriends.com/piglet/modules.php?name=gallery2&g2_itemId=80

Friday 16 May 2008

Hibernate - The Basics (Part 1)

Have been working on a new project recently, finally get to really deal with the basics of Hibernate. Here are two basic things that I've learnt so far:
  1. The concept of "Persistent":
    My intention is to insert two new rows into a database table.
    Bean bean = new Bean("Hello");
    session.save(bean);

    bean.setName("Bye");
    session.save(bean);
    But this isn't going to work!!! With the first save action, it has already 'persisted' the bean. Hibernate remembers that you have already saved the bean, so with the second save action, it will think that you are trying to save the same bean and rather than something new that represents a new row.

    So in order to insert a second row into the table, I MUST create a new instance of Bean before I try calling the save action again.

  2. The concept of "Dirty" data:
    Let's say I have already persisted a bean. I then update the bean and try to get the same type of bean from the database.
    Bean bean = new Bean("Hello");
    session.save(bean);

    bean.setName("Hi"); // updated the bean with new value
    Bean retrievedBean = getBeanFromDB(bean.getName());
    You would've think the "get" method will only execute a SELECT query. But WRONG! Hibernate is smart enough to realise that the bean that it persisted is dirty (i.e. its data has been updated). In the "get" method, Hibernate goes "ah oh...need to retrieve some Bean objects from the table. I know some data is dirty, I must write it to the DB first, so I can return the latest data back to the user".

Friday 2 May 2008

歌曲分享: 可不可以

Another song I would like to share and to bring back your memory to (of course only if u are like me, one of those who grew up in the 90s in HK). Yes the days of the 四大天王 (The Four Heavenly Kings).

Today I would like to bring back the song 可不可以 by 劉德華 (Andy Lau). Recently this old classic has been flowing back to my mind every so often. haha Whenever this song is being played in my head, I can still see the the image of the 1990s 劉德華 singing this song in his "orange" jacket and singing the song to the audience with his very own "劉德華 style" (hah I wish I can find a picture of his orange jacket on the web, it should be the one he wore in the 1990 劲歌金曲 or in other HK awards ceremony).

Anyway, back to the song, this was probably one of my first favourite out of all the Andy Lau's songs. Lyrics is simple but sad and definitely very easy to remember (lol I can seriously verify this as I remembered I could sing most of this song off by heart back when I was still 7!!! haha).

I can't really say more about this song, it's just a lovely old classic in the HK pop history. Enjoy! : )
可不可以 - 劉德華
作曲:TONY TAM 作詞:簡寧 編曲:杜自持

黯然記起 那日黃昏
含著凝眼共妳分手
此時這刻 妳在何方
為何埋沒了柔情千縷

輾轉深秋 讓愛意再等候
只想妳又再與我再一起
儘管分開千里 仍然懷念妳
無奈冷風裡痛悲

如清風可告知 如天空可告知
懇請妳萬里送上我心事
曾寫的千句詩 萬個愛妳的字
交給妳可不可以
.......
To listen to just the song / view song lyrics:
http://www.imeem.com/iamtso/music/3LDraLBl/andy_lau_would_you_please/

The following is the ancient mv of this song (and back in the days when smoking was considered cool!!! 0_0 And you see a lot of Andy's style already visible back then in this video too!)