Wednesday, December 31, 2008

The end of year 2008! 2008年结束了!

2008 is a year full of sorrows. A lot of people are suffering from the Economic Tsunami caused by the losing credibility of the financial system in the U.S due to the sub-prime crisis. The negative effect of this man made disaster is likely to continue in the coming few years. Fortunately many countries are showing positive attitude to work among all of them together to overcome this problem as soon as possible. I hope the level of confidence will restore next year, which is year 2009. I wish everyone a good year of 2009!

2008年,对于人类,尤其中国人来说,是蛮多灾多难的。最重要的世界大事莫过于起源于美国次贷危机的金融海啸了!至今各国的对金融海啸的反应都非常的积极,我觉得主要是信心崩塌的问题。相信当每个人的信心渐渐恢复了之后,全球将重新迅速迈入了又一个欣欣向荣的阶段。最重要的是各国都能把这次的事件当作反面教材,牢牢记得,如此错误千万莫重犯!最后,期待经济能于2009年复苏!人人皆能分得糖果!

Tuesday, December 23, 2008

Production

Finally my WBI adapter for Kenan (a finance system built by Accenture) has gone for PRODUCTION last week. I thought after that everything will be fine. However...

I hit the Tuxedo connection error again. The murderer is the Tuxedo client library again! This time i migrated the jar version that i edited and put to the one at production server. It did not work! I was panicked!

Luckily i deployed the system earlier than the agreed time and i discovered the problem earlier. I still had the whole night trying to fix the problem. I went back and worked from home until 1 something in the morning. Finally i got the solution which is i have to set TUXEDO relevant environment variables at either my startup script or my user's profile (.profile). (It's AIX machine)

I went to bed after that. 4am in the morning i was awakened by a call from maxis staff to stand by for testing before production. What frustrated me most is a lot of tables and database objects are not granted with enough privileges. This problem has been troubling me till the morning.

Also, a lot of late requirements came out only after the users found out some data integrity issue. That even worsened the problem.

The fight continued until 5 something in the late afternoon next day. The client decided to switch to a backup plan. Thus the production was announced failed.

Wednesday, November 26, 2008

The Jar Manifest

Today i learned something about the Manifest file inside JAR file.

I found out that path for the Class-Path property starts from the path where the jar is located.

For example, if you place your JAR file at C:/myApp/service/myJar.jar, and you want to add a library (C:/myApp/lib/A.jar) to your manifest file, you will NOT be able to achieve that! Remember this!

The root path for the Class-Path property in the manifest.mf file starts with the path where the jar file installed.

In this case, if you want to put your classes into manifest.mf, you have to move the C:/myApp/lib/ to C:/myApp/service/lib

Correct me if i am wrong.

Thursday, November 20, 2008

Hectic weeks

I had a tricky problem with the Wepshere Business Integration(WBI) Adaptor. There was a error message saying that the jar file in my customized adaptor (tuxedo.jar) failed to load a 'so' file. It uses loadFile method from java.lang.System and somehow that particular file could not be found. I double checked the LIB_PATH(AIX machine) and java.lib.property and they are correct.

In the end i decompiled the particular class from the tuxedo.jar, modified the source code by using load method in java.lang.System instead of loadFile method. The load method will require us to specify the absolute file path. It works!!!

Saturday, November 1, 2008

IBM Websphere Business Integrator Adapter

My recent work is much on maintaining an adapter called Kenan Adapter deployed on an IBM product called IBM Websphere Business Integrator(WBI). This product basically picks up XML message in the queue and processes the particular messages. I was struggling on getting the web services call to work. I tried a few methods but the web services call just did not work. My project manager who has a very solid technical background could not provide a solution too. In the end he concluded that an RMI program cannot just call another RMI. The WBI framework itself is RMI based. Hence he helped me to build a standalone Java application that listens to the queue all the time, picks up messages then calls the web services. Last Friday i tested one round. The web service call was successful!

Sunday, October 12, 2008

Should i change job again?

Recently i was sent to a Telco company to service them. I will have to be based at there for a long time. I was very shocked on the first day that i need to take over a colleague's task that is in testing phase and he is going to fly off 3 days later! I did not expect something like this could happen. It should be well arranged in such a big corporation. They could not just get some one new in and expected the him to fix problems asap! A proper hand over must be done and the process should be given a proper timeline but not to make it like cooking instant noodle! The project could fail due to something like this! If i need work have a few late nights i do not mind but the quality will not be guaranteed! That is for sure, that's happening to everyone especially when a project has to be completed in hurry. Normally the project would end up being delayed due to lots and lots of bugs! How can you give birth to a baby in 9 months???

What most frustrated me was, last Friday 4 somthing the client's manager showed some problesm to me and expected me to fix it! I told him directly that i did not really have the idea of what he was trying to explain to me of the problem! Well, that is ok. I can liase with my colleague back in The Philipines. But, this manager kept calling and asking the status. I was frustrated. My sickness nearly came back again! He made me very tension. He should have trusted me more! If things continue this way i would consider to leave this big corporation!

I am looking forward to further my Master study and focus on research & development field. I believe that is something i want. Wish me good luck!

Sunday, October 5, 2008

别开生面的婚宴



上个星期六晚,我见证了一场别出心裁的婚宴。

婚宴以自由餐形式来进行。老一辈可能认为这怎么行吧?因为自由餐于人有点寒酸的感觉,不好看。可是,那场自由餐婚宴盛会并不难看,反而简单又隆重。场面布置得非常典雅高贵,令客人有如处身在热带丛林内用餐。那种感觉非常的和谐,可能就是“天人合一”的境界吧?呵呵。

婚宴特别之处在于,有一个小小的婚礼见证仪式。新郎及新娘站在会场中心处,说了好多令人感动的话。由于新娘是辅导员,所以说得一口非常标准之华语,表达能力更不用多说。新郎则看得出不善发言。这我很早救知了,只因我与新郎共事了一段日子,所以对其个性我还蛮了解。新娘的同事也一个接一个上台发言,个个也是说话高手,在场的宾客获益不浅啊,呵呵。

新郎新娘还请来了一支乐队为宾客们献唱,他们的素质都很好,大家吃饭时也不会闷,有悦耳的歌声陪伴。

食物方面当然及不上普通婚宴酒席的菜式。可是我很满意,因为我吃得刚刚好,不会有太胀的感觉。我对普通婚宴酒席的铺张与浪费早就不认同了,所以自由餐正和我意。

有机会跟新郎说说几句,他说,“你就参考参考吧!”。呵呵。

特别感谢新郎这次邀请我去他的这场婚宴,我得以大开眼界。我认为,这场婚宴偏重于西式。这很好,值得鼓励,我们该不时融合中西的优点,来创造出新文化,为我们的原有文化锦上添花,增添活力。

Friday, September 19, 2008

Back to old tech? Oh no...

So today, i met with Lim KY. He is a project manager. He is currently handling a bank system project team. I am not sure what system is that but i was told it is already a phase 2 project. I may take part in the UAT session of phase 2, and phase 3 too.

After bidding farewell to him, i asked one of the team members what technology they use. Unfortunately they are using those obsolete technologies such as Java 1.4, EJB2, Struts 1.2 and so on. Oh no, not even using Object Relational Framework or Dependency Injection Framework. I need to dig deeper in those areas. I want to try out JBoss Seam, more Spring, EJB3, more Hibernate and so on. I need to sharpen those. Now my dream will likely break. I know it is normal for a client like bank to use those technology they are comfortable with because they are proved to be stable. So i can not blame. I am wondering if i shall talk to my manager to avoid working on something i do not like.

I do not know how long will the phase 3 last. I just know that working in this project will not offer me a chance to travel to oversea. That is what i am looking forward to: to communicate with oversea colleagus or clients, i want to improve on that part. Furthermore now i am going to use the obsolete technologies. It is a double blow to me. I do not want to waste my time doing things i do not like. I want to achive my goal as soon as possible before i get married. As you guys out there know, normally man will lose lots of freedom after getting married. Sorry, i should say this phenomenon is common in Asia.

Wish me good luck.

Great conversation with friends

I had a gathering with my university mates at 1U on 17 September 2008, which is a holiday in Selangor. We had a great conversation.

We talked about religions. One of my friend, who is a Methodist, said his Christian fellow will get angry every time he questions on the logic of certain Christian teachings. For example, if there are only heaven and hell for human to go to after death, then the number of being in hell is surely greater than the number of being in heaven as the rule to the heaven is so strict. Then the power of devil who governs the hell is surely greater than 'god' who governs the heaven. That is only one of many relevant topics that we discussed. Of course we did not only talk about Christian, but other religions as well.

We concluded that religion is a system. A system will surely have logical flaws. Of course we do not know if there is something that is beyond the logical flaw but for certain if based on the current knowledge we have, nothing can really explain the logical flaw of every religion or every system. It is a universal law.

Sunday, September 14, 2008

Happy mid-autumn festival 中秋节快乐!

The mid-autumn festival is one of the 4 major festivals of the Chinese. You may refer to the complete description of this festival here

The other 3 important festivals are the Chinese New Year(Spring Festival), the Qing Ming Festival (means Clear & Bright) and the Duan Wu Festival.

Luckily this year it falls on Sunday. Therefore i managed to reunite with my family members on this day. Reunion on the full moon day means everything to Chinese family.

It is quite unfortunate that it was raining in the night so i could not see the beautiful moonlight. Anyway i had seen it the day before. The scene was weird. Clouds were gathering around the full moon and the moonlight penetrated through the thick clouds. You could see rainbow ring surrounding the full moon. Fascinating!

Happy mid-autumn festival to you guys out there! Hope you guys will complete your whatever things out there as full moon means complete!

Monday, September 8, 2008

New Employee Orientation

Well, i joined IBM Malaysia eventually. The first few weeks were just quite bored. I am not given any assignment. Today i attended the New Employee Orientation. I learned something here!

I realized the power of 'innovation'!

We were put in different groups. The trainer was asking us to play a game. Each of the group member has to touch 4 balls in sequence. He demonstrated the normal way we did it and asked us to improve the process.

The game was so interesting. Initially we achieved a 5 seconds record. He was not satisfied and in the end we managed to finish the task within 1 second!

That's the power of 'innovation' , 'think'

Wow....

Friday, July 18, 2008

Job is not our life!

Came across an article talking about there are more and more people not to prioritize job in their life. I like this excerpt:

In other words, I know firsthand how futile utter devotion to a job can be in the long run. I still want to do well in my job. I still want to be on the cutting edge of things. But I don’t want to work 16 hours a day to maintain that edge. It’s just not worth it. Or maybe it’s kind of worth it, but it wouldn’t win out in a head-to-head competition with my kid, my husband, my elderly father, and the rest of the hoodlums that make up my extended family.

It explains what i want to explain all this while.

Sunday, July 13, 2008

This is 21st century

Had a chat with friend. Were talking about investment. I complaint that buying a house basically means being put in prison for whole life because you owe to bank for 20-30 years!!! You are going to lose your freedom. Anyway, why should we think of getting a house as an investment? Yes it may have been the best way for the previous generation for investment but it may not seem to be as important as it was now! Nowadays we have plenty of ways to invest our money. For e.g. trust fund. In old time people did not buy trust fund! Well I am talking about people in Malaysia. Nowadays there are plenty of trust funds for us to choose. One advantage of buying trust fund is you are always guaranteed the liquidity! You will not enjoy the same level of liquidity if you are buying a house as you need time to get someone who is willing to offer the price that you are expecting to buy your house. Else it is going to be a burden to you because every month you have to allocate certain percentage of your income to bank!

我家乡名字的来源细说。

真惭愧,在网上读到了这篇介绍文,方知家乡名字的来龙去脉。在此贴上:

“柔佛”二字,译自阿拉伯文“Jauhar”,意即“宝石”,在英文则是“珠宝”,早期被喻为“大地的尽头”,后来才定名为“柔佛”(Johor),与英文的珠宝“Jewel”谐音。柔佛州人口多达256万,共有8个县:新山、笨珍、峇都巴辖、麻坡、昔加末、居銮、丰盛港及哥打丁宜,其中新山是柔佛州的首都。柔佛是马来西亚9个由苏丹统治的州属之一,掌管州内事务者为州务大臣。虽然新山是我国主要先进都市之一,但柔佛州超过30%的土地仍是纯大自然地区,上千种植物、动物和昆虫是吸引外国的卖点之一,4个国家公园、7个休闲森林以及越来越长的受保护海岸线,3面环海的柔佛州,因此不论是喜欢上山或下海的游客,都能尽兴。

“昔加末”(Segamat)的名字源自马来文“segar”和“amat”,意即“非常新鲜”或“非常清爽”,若要追溯其典故和源头,则要从16世纪柔佛苏丹时期说起。有民间传说指“昔加末”之名乃当时的统治者苏丹阿末,亦即第一任苏丹所取。1511年,苏丹阿末与随从在一河边休息时,极度干渴的苏丹命令随从从清澈见底的河中取水饮用后,即刻感到神清气爽,舒解了长途跋涉导致的全身酸痛,于是说了一句:“Segar amat(非常清爽)!”一旁的宰相敦德博也有同感,因此就将该地区命名为“Segamat”。隶属森美兰州管辖的昔加末受英国殖民地政府统治,一直道1901年才成为柔佛州管辖地区,并成为8大县之一,也是州内主要的农业原产品区,面积达2千851.26平方公里,人口共17万8千620,是个历史悠久的小镇,古迹保留得相当完整。

这个位于柔佛州北部的小镇处处是园丘,橡胶园、油棕园及果园几乎成为当地的经济命脉,其中以果王榴连为最,单是榴连园面积就达1万1千公顷,不但盛产,而且所种植出来的榴连,品种和素质皆属上等,镇上还有一个名为“榴连广场”的地方!昔加末出产的其他水果包括龙眼、柚子、冷刹及红毛丹等,若在年中或年终的果季到访昔加末,口福不浅!爆米花论坛昔加末只是一个很小很小的小镇,但却不失为一个值得一游的地方。这个只有一条大街的小镇五脏俱全,购物中心、旅店、高尔夫球度假村、农业旅游及手工艺品中心一样都不少!

昔加末县分为南北两地,小小昔加末是县内最主要的城市,也是主要的经济集中的地,县内人口虽以马来民族居多,但主要的经济地却以华人为主,较著名和特别的旅游景点包括拉美士的天然温泉、双溪大港的断桥、苏丹的度假别墅、榴连广场、农业旅游景点和原住民居住的双溪班当(Sungai Bantang)休闲森林。

火车站
位于车站路的昔加末火车站,是当地历史悠久的古迹之一,也可说是昔加末之旅的起点。火车站对面便是巴士站。在几年前的一场火灾后,火车站也进行了几次的装修。在新巴士站还没落成前,巴士站是与火车站毗邻的建筑,知道新地落成,也就有我们今天的巴士站了。虽然距离变远了,但是设施比以往都好很多。

榴槤
昔加末市区也紧随发展列车的轨道,尤以巫罗加什路最明显,其中一个最重要及最特别的旅游景点,大概要数榴槤广场,一个果王和各种水果的贸易中心,一直是热带水果迷的必到之处,在水果季节,这里的游客和人潮更为壮观。事实上,昔加末的榴槤身价是被当地人的宣传方式越抬越高,人人慕名而来,证实昔加末榴槤是否真的“榴”名八方!

美食
小镇小食别有一番独特风味,阿芝路小贩中心的辣椒烧鱼、对望昔加末河的哈山路的肉骨茶以及昔加末峇鲁花园的印度传统小食“纸煎饼”(paper tosai),都是不可错过的美食

断桥
断桥,一个听起来让人感觉沧海桑田、痕迹斑驳、几许惆怅、淡淡哀愁滋味在心头的词。这座位于巫罗加什的断桥,一直静静地守着这个淳朴小镇,长年的沉默,挥之不去的荒凉,像是无声的控诉,控诉战争的无情、残酷与惨痛,徒留悲痛在人间!伫立在河的另一端静看断桥,心头总会不自禁地涌起难言的情绪。其实,昔加末共有2座断桥,另一座断桥坐落于距离昔加末市区约28公里的双溪大港,亦即柔佛边界,“吊”在河上的断桥,看似未完的工程。

温泉
距离拉美士约10公里处,有一个天然温泉,经过人工美化后,就成为著名的旅游景点,也是附近居民和游客的休闲松懈身心之地,既享受泡澡的悠闲,又具疗效功能,绝对是个值得一游的地方!

休闲
森林距离彼咯(Bekok)市区8公里处的双溪班登休闲森林,是除金山之外另一个备受游客喜爱的瀑布区,参天古木,奇石怪岩,不论是为享受大自然的呵护或全家出游野餐共享天伦乐,一样尽兴。距离昔加末南部约4公里的飞行俱乐部,为考取私人机师执照者提供飞行训练,想尝试飞行的滋味或对飞行情有独钟者,不妨尝试一下操作小型飞机的体验!

购物中心 Billion、Derang Emas、顶好及拉美士购物中心

酒店/旅馆 彩虹酒店(Hotel Sri Pelangi)、昔加末度假酒店(Villa Hotel Segamat)、和平旅馆(Hotel Harmony)、文化旅馆(Mandarin Hotel)、The Pine Classic Inn

高尔夫球度假村
巴也朗高尔夫球俱乐部(Paya Lang Golf Club)及昔加末高尔夫球俱乐部(Segamat Country Club)警察局、消防局、医院、移民厅、邮政局、关税局、马电讯、公共交通站

Sunday, June 22, 2008

About Hibernate Save and Delete parent children again

I want to add new child object into children collections and remove 'selected' existing child object from the same children collections.

  1. First, i get the collection from 'attached' parent. For e.g Set children = parent.getChildren()
  2. Add the new Child object. Of course please save the Child object first. children.add(newChild).
  3. Remove the 'selected' existing Child object. children.remove(removedChild)
  4. Finally, save the Parent object.

It is kind of fundamental. However sometimes we may get confused due to whatever reasons.

Finally, i quit 终于辞职了

16th July 2008 will be my last day in XXX.

This time is real. I have spent my 4 years here. Now, it is time to go.

Being the first company in my life, i will not forget the memories with it.

Memory in Kulai, Melaka, Singapore...

In fact, since XXX left, i have already lost my mood to work. I became more quiet. I am not interested in having frequent interaction with new colleagues anymore.

It was back in year 2006. Basically, after that, i think i had wasted my time, until today.

I tried to look for the answer by having an 'escape' to Cambodia alone. Over there, i kept thinking and thinking. What actually lies ahead?

I think, i found the answer from famous ancient Chinese DAO Philosopher - Zhuang Zi (庄子)

He said:

Do not be afraid of anything you want to do when you are young, do not regret the things you have done when you are old.

年轻时、不要怕。年老时、不要悔。

Wednesday, June 18, 2008

OpenOffice mail merge problems

I need to merge document B to document A(master document) using OpenOffice SDK.

My font in document B is 'Arial' and there are 3 paragrahs in it.

After merging, the font of the last paragrah somehow changed to 'Times New Roman'!

Another problem is, document A is formatted with numbering, document B is supposed to be inserted at the first line of the numbering. However, the 2nd paragraph from document B ends up a new number within the numbering format! To be more specific, document B's content should be positioned at number 5.1, but right now document B's content has been splited into 2: 5.1 which is the 1st paragraph from document B and 5.2 which is the 2nd paragraph from document B. My intention is to put all paragraphs from document B into 5.1!

After few days of searching, i discovered that it is actually a bug in OpenOffice!
  1. http://qa.openoffice.org/issues/show_bug.cgi?id=60475


  2. http://www.oooforum.org/forum/viewtopic.phtml?t=60268&highlight=insertdocumentfromurl+format

My solution:


  1. To solve the numbering problem, document B must always have an extra paragraph break after the last paragraph! (If you are using OpenOffice, click View from menu and choose to show "Nonprinting Characters")


  2. To solve the style problem, i adjust the styles in document A again after the merging is done.















Thursday, June 12, 2008

Differences between response.sendRedirect & response.forward methods

Came across one good explanation below, share with you guys out there:

Forwarding the Request and Re-Directing URL are two totally different animal. Your server gets the request from the browser..job of server is to send back the response. How how that response is generated is totally up to your server..you can process that request in one servlet or can process the same request using multiple sevlet...To process request using multiple servlet, you need to pass the request to another servlet...and ofcouse we do not want to loose the parameters/data set into the request otherwise that request does not make sense anymore.....This is all request forwarding!...Request forwarding is done during one HTTP request-response cycle..Once you return the response, you are done!

Now, In the response, you can tell your browser to do URL redirect to any other URL..this is HTTP header thing and browser will interprete the HTTP header and will send brand new request...

Wednesday, June 4, 2008

Delete procedure of One to One relationship in Hibernate

I found out that Cascading does not work for 1-to1 relationship. We have to cater for it specifically.

The story is, i mapped 2 entities with each of them having a "many-to-one" relationship to represent a 1-to-1 relationship. I did not use the "1-to-1" mapping because it caused some problems which i now can not remember anymore.

Let's call the 2 entities as "parent" and "friend". 1 parent has 1 friend.

Now, I want to just delete "parent" and hope that its children will get deleted automatically.


  1. Therefore i will do a "session.delete(parent)". However this will throw an exception saying that "parent" is referencing another entity "friend".

  2. So, I will now get the "friend" from "parent" first by doing "Friend friend = parent.getFriend()".

  3. Then, i do a "parent.setFriend(null)" and saved the parent by doing "session.save(parent)". The "parent-friend" 1-to-1 relationship is being removed now.

  4. Next i delete the friend by doing "session.delete(friend)".

  5. Lastly, i will do a "session.delete(parent)". The parent will now be removed together with its children!

funny funny problem

Today one problem arose. User complaint that one of the screen's query process takes too long time! I spent hours trying to figure out why. In the end found out that the Hibernate Dialect should be changed to MySQL instead of MSSQl one!

That is funny because my system is running on a MSSQL database! How can i just put MySQL dialect for Hibernate!

Well, it really speeds up the searching process.

Hell....

Thursday, May 29, 2008

Funny Unix Symbolic Link to Windows Server issue

I faced this while doing deployment of one system to a unix server.

There is a folder/directory which is the symbolic link to a folder hosts at a windows NT server.

It is meant for clustering. The idea is 2 servers put the files/documents at the same folder at one location.

So, everytime i build my source code and deploy the war file at the unix server, i will run a program which runs the data migration. During the process the program will make use of the "open office service" that resides behind the operating system to create document such as Word and put at that particular folder as mentioned above.

Nightmare came. System kept throwing errors. The error message said it has something to do with "wrong code blar..".

I thought it was due to my code. Then I spent days to investigate the problem and to examine my code. It was a wrong move, a waste of time because in the end i found out that it is actually the program failed to create new directory! Ok reason found. The funny thing is, i tried to create the directory using unix shell command manually but failed! I did a list files command and found out that there is no such folder! But why did Unix say the folder is there? Ain't it funny!

Later i discovered that the folder is actually hidden. However i still did not manage to remove the folder by using the "rm -f ." command. From the net i know that this command works all the time to remove hidden directory. Clearly it did not work out in my case. So how now?

Finally i recreated the directory that the Unix claimed exist at the Windows Server, which is the "parent" cluster machine that holds the folder. After that i removed the folder again from the Shell at the Unix server. Yahoo! This time everything is back to normal! My program ran successfully!

What a waste of time. Was in the wrong direction. The Open Office Service should throw a more "exact" or "meaningul" message.

Nevertheless, I still do not know WHY and HOW did this problem happen! I only know the solution so far!

Somthing about Set in Java

Well, if you read about the Java API, you will know that Set will only add object that does not exist in the Set itself. You must be aware of this especially when working with Hibernate! Here's my experience:

I was trying to add a few objects in a Set and set this Set. Then I found out from the database that there is always only ONE object added. I did a debug and found the size of the Set is always > 1 !!!

What happened? Here is my answer from torough checking:

Only the 1st object had been added to the Set. It is because the rest are actually "equal" to the first object so Set does not take them anymore! Bear in mind that each object differs from each other using their ID field. They do have their own ID yet when they are being added into the Set so they are rejected by the Set!

Thus, i have to save each object first before adding them into the Set. The reason is the ID will be generated by Hibernate for each object. The Set knows that they are NOT EQUAL right now then they will be added.

Busy and depressing week!

Since last week i have been working on a data migration project. I am supposed to get it done before the system went live last Friday. However due to the totally different table structure of the old database, the data migration unfortunately did not go smooth. Since then i have been working like hell to get the data correct till now.

What makes me most frustrated is i always need to take some moments to perform a few steps to test my correction! I have already done my best to simplify the steps!

This process has resulted me to only have a very little hours of sleeping time for a few days continuously!

I hope it can quickly goes live asap!

So now, back to Work!!! back to Work!!!!

Friday, May 16, 2008

Finally stock market crossed 1300 points!

After having fluctuated for several weeks, finally KLSE(Malaysia Stock Exchange Market) soared to over 1,300 !!! It is the highest record since the tragedy on 10th March 2008!

Despite the good news of KLSE, over the 4 counters i am holding, 3 of them actually dropped today including the prominent Public Bank! Well, the decline does not really matter to me because overall my portfolio still generates a book yield. I would like to express my gratitude to the Public Bank! It has been performing very very well since the day i bought its shares.

I think my mutual funds' price will rise further following by today's good performance of KLSE. Looks like i am going to do another time of switching in a few weeks time.

Good day!

Wednesday, May 14, 2008

Switched mutual fund to protect my profit!

After 22 months(almost 2 years) of buying Public Ittikal Fund, finally today i decided to switch to another fund to protect my profit.

The return rate of the fund is very impressive. It achieved a total return rate of around 39% which also means around 20% per year on average. Since the day i bought this fund i have been very confident of it as it has a handsome history. The statistics told me this fund is really worth to buy! Back then i really took a lot of time to actually study each funds and also compare each of them before i made my move.

Too bad i missed the golden moment last year. The fund raised so remarkably. At one time it even achieved an overall return rate of more than 40%! I damn regret now! I should have sold it off during that time! Well, one of my customer chose to sell his fund off last year. It so happened that he needed money during that time. Thus he managed to enjoy the 40%++ of return rate! Oh yes, he bought Public Ittikal too because i am the one who recommended this fund to him!

Luckily after the huge decline of the KLSE stock market due to the 'Political Tsunami' which took place on 8th of March 2008, Public Ittikal's price has been gradually restoring to the level which reflects its actual value.

The big drop of March really taught me a lesson. I decided not to be so greedy anymore. To me, 20% of return rate per year is considered a great achievement already. That's the standard practiced by Warren Buffet all this while!

After several days of serious thought, this noon i went to the nearest Public Mutual branch and did the switching. Anyway that was my first ever fund switching.

I switched the fund units to 2 different conservative profile funds.

Tuesday, May 13, 2008

Ali rustam had supper at Subaidah Cafe

Just now, I had my supper with my friend at one cafe called Subaidah. We spent there for around 2 hours more. When we were about to leave, we saw chief minister of the Melaka state, Ali Rustam came together with one of his friend. I think he just finished OT? Haha.

Anyway, as he showed up, a group of customers from the table next to us quickly dashed forward to shake hand with him. Wow! Do they really need to do that?

Monday, May 12, 2008

Apache POI

I have one web application, everytime i deploy i will need to load initial reference data again and again.

The amount of these data is huge!

I used to hardcode all these data in my Java file. I organised them properly using data structure such as String array and so on. In my Java file i have a few functions that actually perform the data loading job.

The problem is, It's time consuming and error prone to hardcode each and every data in the Java file.

Therefore, today i decided to put all the data in Spreadsheet program. It is easier to maintain data at Spreadsheet rather than in the Java file itself.

Then i used Apache POI library to read me those data from the Spreadsheet (Microsoft Excel).

Just one time try and it worked fine!

So simple! I was really delighted!

Wednesday, May 7, 2008

One day effort for unknown vm crach of Eclipse during Subclipse installation

WTF,

It took me one day to get the problem fixed. The solution is so simple!

I setup Eclipse at my new laptop. As usual, i also installed the Subclipse plugin. By right it should work properly. Well, when i tried to create a new remote source repository using Subclipse Perspective in Eclipse, Eclipse just quitted suddenly followed by a prompt saying that it is some kind of memory crash.

Also, there is an error log file generated each time Eclipse exited. However the message is so so not comprehensive.

Here's the message:


## An unexpected error has been detected by Java Runtime Environment:
## EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x3b397bfc,
pid=3824, id=5160
## Java VM: Java HotSpot(TM) Client VM (10.0-b22 mixed mode
windows-x86)
# Problematic frame:# C [libapr-1.dll+0x7bfc]
## If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.


With this only clue, i kept Googling for the whole day and still did not get the problem fixed! How frustated was i!

Besides trying out the solutions found online, I also tried to tackle the problem by doing a few times of trial and error, which is actually install-uninstall this kind of stuff.

We really got to be patient enough when dealing with this kind of problem.

Yet, the problems stayed. All the tries did not bring positive outcome.

Office hour ended. Today i did nothing but just configuring stupid Subversion on Eclipse. Boss, please don't get mad.

I started over the puzzle solving game again at home after coming back from dinner.

With calm mind, and of course enough of rest, i found the answer within an hour!

I came across this article online:

http://subclipse.tigris.org/faq.html#win32-crash

Here's the excerpt:


As soon as I do something with Subclipse on Windows, Eclipse just
crashes. Why does this happen?


This is a fairly recent problem that is caused by a DLL incompatibility. Subversion uses a library called APR or the Apache Portable Runtime. This library has a component called APR-ICONV which is used for translating characters in path and file names to/from UTF8 and the local character set. The release of Apache 2.2 brought with it new releases of APR and APR-ICONV and these are not binary compatible with previous releases.


Subclipse ships with the Apache 2.0 version of these libraries. This crash
occurs if you install an application that installs the Apache 2.2 version of
these libraries AND ALSO sets the APR_ICONV_PATH environment variable to a path that contains the Apache 2.2 version of the APR-ICONV .so objects.


The fix is actually simple. Change the name of the environment variable to APR_ICONV1_PATH. The Apache 2.2 library will look for this environment variable name first, and only fallback to the older name if it is not found. You can safely have an APR_ICONV_PATH environment variable pointing to the Apache 2.0 version of these libraries and the APR_ICONV1_PATH environment variable pointing to the Apache 2.2 version. Subversion 1.5 has resolved this problem by discontinuing the use of APR-ICONV. Instead, Subversion will use translation routines that are provided by the Windows operating system.


So, i uninstalled the Subversion Server built against Apache 2.2 and replaced it with the one built against Apache 2.0.

Eclipse looks fine now.

Finally!

Thursday, April 17, 2008

2008澳门游记

感谢公司给予的机会,让我体验了在澳门旅游的乐趣。

虽然旅程只有短短数天,不足以更深入的体会澳门,但由于乃自由活动,是以也不虚此行。

由于地点靠近,有些同事选择第二天往香港去了。他们一大早就赶往渡轮码头以乘搭第一班船,我觉得旅行需让身心放松才能达到目的,所以不随他们了。

之后与另一位同事穿梭于澳门的大街小巷间,体验大众的生活形态,满意非常。那种感觉是非常随意、非常悠闲的。

尤其是他们的大众食物让我感到兴趣万分,虽然多数看看就知道都不合我胃口,但很高兴能打开眼界。

Thursday, April 3, 2008

Hibernate Tips - delete existing item from children

Scenario as below:

I am at a screen now from a web application.

There is a swap-select box on the screen. I select 5 items and click Save button.

Next, the system creates 1 parent object and saves 5 items (selected from screen's swap-select box) as children(a Set) into their parent.

I leave the screen.

Upon next visit to the same screen again, i am trying to remove 2 among the 5 selected items. After that i click Save button.

How should i handle this?

What i need to do is:

1) Get the original Set from the parent object. (Let's name it 'children')

2) At the same time, create new Set(let's name it 'removedChildren'), add those objects that are meant to be removed. (In this case this new Set will have 2 objects)

3) Using removeAll method from Set, put the 'removedChildren' Set in it (children.removeAll(removedChildren))

4) Set the 'children' Set back to the parent. (parent.setChildren(children))

5) Save the parent. (saveOrUpdate(parent))

How to get the last 2 decimal digits using JAVA?

Example:

To get 0.99
from
double abcd =123456789012345.99;

Solution:
double a = 12345678901234.99*100;
String f = Long.toString(((long) a)%100);

Wednesday, March 5, 2008

Very, very much blood shed in KLSE

Over the past few days, KLSE index dropped drastically. A few billions of RM just gone like that. It's like a dagger ripping my heart! Nobody like us (small investors) have ever expected this. Especially right now the general election is approaching!

The profit earned from both stock counters and funds last year soon turned into ashes.

So far, over the 3 stocks i am holding, 2 of them achieve a growth of 46.06% & 46.45% respectively. I have been holding these 2 stocks for 3 years already. It means on average, they have brought >14% profit each year. Well, the other one, which is the only one, causes me losses anyway! It's approaching one year and so far it causes loss at -17.37% ! Well, everything stated here is not the physical one as i have not yet sold the counters off!

Wednesday, January 2, 2008

Development frustration

In this new project, i was using Service Facade design pattern to implement Spring + Hibernate.

I wonder why Hibernate Session is always being closed after the program leaves the DAO level.

I am frustrated when trying to manipulate model/models retrieved from DAO by accessing its/their child/children. It always tells me "Session is closed!"

That's really much different than the way i used to do.

Also, i could not manipulate Hibernate Transaction across different calls of services. I could not control when and where to commit or rollback just like what i usually do!

The Common Control also makes me scratching my head a lot! I am still in the process of getting familiar with it. I am now missing much on the traditional Struts + Javascript technique. Anyway, pros and cons always there.

Today bad news came, so, end of this month, have to complete everything! Yeah, another mission impossible!

One sicked, one blinded, one cursed

How can you expect the project to be completed?

Tuesday, January 1, 2008

喜迎元旦, Happy New Year!

2008元旦至。回顾2007年,悲多于喜,确是不堪回首。

1)事业-停滞不前、碰到瓶颈。
2)爱情-平平淡淡、冷战频频。
3)友情-三五知己、冷冷清清。
4)亲情-父亲仙逝、面具卸去。
5)钱财-基金不俗、股市丰收。
6)休闲-毕览好戏、柬蒲赛游。
7)健康-睡眠不足、病痛频仍。

为新的一年许下新的愿望。

1)事业-自行创业、转大机构壮大基金、遍寻良机。
2)爱情-加额时间、加倍关怀、增添元素、双游天下。
3)友情-广结善缘、慎选活动、慷慨解囊、笑口常开。
4)亲情-倍孝家慈熏陶家妹
5)钱财-善理基金股市续旺
6)休闲-毕阅好书、毕览好戏、毕听好乐、美国之旅?中国之旅?。
7)健康-睡眠充足大病必除定期运动避免破食
8)学业-升阳证书、会计课程、财经硕士、风水处成、乐理初读。

进行中:
1)大病必除

Looking back to year 2007, it is a kind of disastrous year for me...

My career remains stagnant. It seems like i can't grow further. I am afraid of this feeling. I had been looking for the reason and found out that my personality is the one that actually restricts myself a lot. Hence I wish could have a total change of environment so that i could start everything new! I resigned. However i was persuaded by my technical director to give myself a chance again at Melaka branch. Now, i am at Melaka branch. I don't feel happier. Even tough it is much more relax than the previous office. Most probably, is due to there are still people i know is here... i have been trying to turn myself another person. However, the tight deadline has once again put me into a bad situation. I ask myself, do i still want to continue this kind of tension life? Take over my dad's business? As a full time freelancer? Join any MNC in the Klang Valley area? I have a dream, that is to be sent to oversea for training. I believe if i weren't to join the current company last time, i would have already been going oversea either for mission or for training for a few times already. I expect the coming job suits my personality, which is patient and less-communicative. I hope my career will be more towards R&D.

On a full 'Yin' day, my dad had passed away. What could be worst than this? Sadly,during the course of seven '7' week, i did not dream of him at all. My sister dreamed of him during his first '7' week. He was in a wonderland, bringing us the whole family to play around. He was happy according to my sister, he in the end hid inside a leave. What does that mean? I hope the answer is positive. I really really hope dad is there. Whoever out there, can YOU give me the answer?
I couldn't forget the moment. My teardrops could not stop falling while i was cleaning his body. Everything is so stiff, and so cold, blood still in his mouth. Dad, i know you did not want to leave, yet the thing turned out this way. What could me, as a son, as a human, do? Sorry for not always being obedient to you, i actually do remember your advises. They are the treasures that you passed to me. They are priceless.

The funds i bought continue to generate good number of income for me. Of course, it shall not be counted as i did not actually sell them. The achievement i am proud of is, i have helped one of my customers to achieve a 30%++ growth in exactly one year time. When he sold the fund, i could feel his excitement! I was so happy for him too! Imagine, let's say one year ago you invested 10k, right now you will get 13k! Don't you get excited? In the coming years, i expect i will invest in more funds, i wish i will choose the right one every time! Same goes for stock market! I am holding a few, i plan to sell one of them which is less stable in the coming future. The rest of the stocks remain lucrative. Loving them...!

I started to lose my health since few years ago. I think that was due to insufficient rest. There are a few sicknesses keep haunting me. There are 3 major ones. I am now trying to get them cured one by one in the coming year. I could not afford to risk my health anymore. My mom and sister need me!

I was thinking about to join US Summer Camp in year 2008. Right now my dad has passed away, do i still need to persist my dream? In fact, i was in the progress of finding suitable camp to join! Now, bad events had passed, shall i be selfish to get away from my family for 3-6 months? They are worried i could not live well over there...

MBA in Finance, shall i continue to pursue this? I really hope to gain more financial knowledge by taking a master. However, one of my friends suggested me to take ACCA instead. How funny? I am considering this option anyway. MBA, the university that offers this course is quite near to the place i stay. However the price is expensive. I would rather take a foreign U one. The best is to go oversea to study! I think i will start looking for scholarship. Again, shall i just leave my mom and sis like that? i guess the answer is, no way! Perhaps i will consider taking a distant leaning MBA programme.

SCJP, oh my god. It's already 2008. I think my ticket is going to expire soon. I really got to move forward asap!