Sunday, July 13, 2008

我家乡名字的来源细说。

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

“柔佛”二字,译自阿拉伯文“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....