Friday, September 28, 2007

Software Design

It is some kind of difficult actually... 

You need to know 'how', 'when', 'where', 'which' and 'why' the design pattern should be uses.

And, you also need to understanding and leverage the development and requirement.

Whether the software capable to be uses? ease-to-use?

People can be very easy to channellege your design and your software from a very general point of view.

However, you have hounsands or even a million concerns on one decision.  You need to balance every concerns.  The interesting point is ... different people has different priority on each concern.  That's means you will never get everyone completely satisfy on the software design.

From a more abstract understanding on this situration.  You can not difficutl to understanding and found that... Software Design just a very typical case as like as every think in our life.  Is that means our life just part of software design? ops... 

Monday, September 24, 2007

BeStock Application Scope

Objective

Writing the scope of the bestock application.

User Requirement

1. Allows to watch the current stock profile
2. Allows to define my target stock profile
3. Main screen for watching the current stock profile
4. Allows to set HK stock and U.S. stock code

XML Master Exam preparation (week 5)

The last week, I tried to read the XSLT and XPATH W3C specifications. However, it's really difficult to read.

I think it's really difficult and not appropriated to ask study to learn something from the abstract concept like meta structure.

I was trying to find any ease-to-read reference book to study this part.

Sunday, September 23, 2007

XML Master Exam preparation (week 3 - week4)

These 2 weeks i focus on the study of the XML Schema.

According to the XML Master Basic Related Specifications section in the XML Master Basic Examination web site. There has 3 XML Schema related specifications that cover in the basic exam.

* http://www.w3.org/TR/xmlschema-0/
* http://www.w3.org/TR/xmlschema-1/
* http://www.w3.org/TR/xmlschema-2/

I spent my time mainly on the 1st one, i.e., http://www.w3.org/TR/xmlschema-0/ and the Day 6 and Day 7 of Sams Teach Yourself XML in 21 Days

And, this is my update of my worksheet on the XML Schema section.

Tuesday, September 18, 2007

工作人

工作其實真是需要很多的技術。特別是對待身邊的工作人。

遇到的一些甚麼人最討厭呢? 那些面對老細會變成悍將模樣,但老細不在便耍到你暈的人又如何? 

Sunday, September 09, 2007

XML Master Exam preparation (week 1 - week 2)

I started the XML Master Exam preparation over 2 weeks. This is the scope of the XML Master (Basic) Exam preparation.

The official XML Master Basic Examination Guide

I'm reading two resources for the Section 2 - Creating XML Documents and Section 3 - DTD.

1. The W3C XML,DTD specification , and

2. Sams Teach Yourself XML in 21 Days


After read these materials, this is the scope and reference materials recovered relation.

Sunday, August 26, 2007

Screen capture in Intel Mac OS X 10.4






Command + Shit + 3

Capture the full screen

Command + Shit + 4
Capture the part of screen

Command + Shit + 4 + Space
Capture any one of windows

Using SQLite with Java on Intel Mac OS X


Step 1:
Click here to Download the SQLite Mac OS X 10.4 JNI wrapper (thanks Tim Anderson)

Step 2:
Extract the sqlite_jni.macosx.zip file; and copy these 2 files into the /Library/Java/Extensions folder
- libsqlite_jni.jnilib
- sqlite.jar

Step 3:
compile the test.java file that come with the zip file
> javac test.java

Step 4:
run it with "java test", you will found these exception message

Unable to load sqlite: java.lang.UnsatisfiedLinkError: /Library/Java/Extensions/libsqlite_jni.jnilib:
Exception in thread "main" java.lang.UnsatisfiedLinkError: version
at SQLite.Database.version(Native Method)
at test.main(test.java:72)

Friday, August 10, 2007

Fix the chinese encoding problem in the AppFuse generated application

Using the AppFuse on Mac OSX, you will find the default generation of an application couldn't display the Traditional Chinese / Simplified Chinese as normal like this.

Monday, June 25, 2007

ITIL 3.0

I'm trying to understand what is the ITIL 3.0 covered. According to the ITIL official web site. There has 5 core

- ITIL Service Strategy

- ITIL Service Design

- ITIL Service Transition

- ITIL Service Operation

- ITIL Continual Service Improvement

Sunday, May 13, 2007

Interesting visitor statistic

It's very exciting for me that the visitor of this blog can be around the world like this. Enjoy it!

Fix AppFuse generated application that couldn't connect HSQLDB database

Step 1: Enable the hibernate show sql features. This for tracing which SQL have problem to execute. If the 1st one has problem, we can going on.

Step 2: Since, the original AppFuse 1.9.x is not well prepare for the HSQLDB. We need to prepare the table creation script for the HSQLDB. i.e., hsql-create.sql, in the metadata folder of the project generated by the AppFuse.


Step 3: Using command "ant db-prepare" or click it the "db-prepare" to execute it in the Ant view of the Eclipse.


Step 4: Using command "ant compile" or click the "compile" in the Ant view of Eclipse.

Step 5: Using command "and deploy-war" or click the "deploy-war" in the Ant view of Eclipse.

Saturday, May 12, 2007

java.net.BindException: Address already in use:8080

After several times to reload the deployed application in tomcat on Mac OSX. I found the tomcat fail to start with this exception messages.

2007/5/12 下午 01:17:44 org.apache.coyote.http11.Http11BaseProtocol start
嚴重的: Error starting endpoint
java.net.BindException: Address already in use:8080
at org.apache.tomcat.util.net.PoolTcpEndpoint.initEndpoint(PoolTcpEndpoint.java:297)
at org.apache.tomcat.util.net.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java:312)
at org.apache.coyote.http11.Http11BaseProtocol.start(Http11BaseProtocol.java:150)
at org.apache.coyote.http11.Http11Protocol.start(Http11Protocol.java:75)
at org.apache.catalina.connector.Connector.start(Connector.java:1089)
at org.apache.catalina.core.StandardService.start(StandardService.java:459)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2007/5/12 下午 01:17:44 org.apache.catalina.startup.Catalina start
嚴重的: Catalina.start:
LifecycleException: service.getName(): "Catalina"; Protocol handler start failed: java.net.BindException: Address already in use:8080
at org.apache.catalina.connector.Connector.start(Connector.java:1096)
at org.apache.catalina.core.StandardService.start(StandardService.java:459)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
2007/5/12 下午 01:17:44 org.apache.catalina.startup.Catalina start

It's obviously that there has another process occupied the port 8080 or 8009. I uses the command, "lsof -i | grep LISTEN" to check the PID of the process that using the port.

imachome:/usr/local/apache-tomcat-5.5.20/logs chanapps$ lsof -i | grep LISTEN
java 298 chanapps 11u IPv6 0x2e2e3a0 0t0 TCP *:http-alt (LISTEN)
java 298
chanapps 18u IPv6 0x2e2ec50 0t0 TCP *:8009 (LISTEN)

And then, kill the process with "kill -9 298" command. Now, the tomcat recover!

Tuesday, May 08, 2007

Eclipse plugins for HSQLDB

When I trying to compare and select between HSQLDB and Apache Derby as the database for my mini application.

I found the Apache Derby has an interesting Eclipse Plugins can help to start and stop the Derby easily.

It caused me going to check any similiar plugins for HSQLDB. Finally, i found a project in source forge web site. I'm exciting and start to try it. However, it disappointed me that the plugins seems couldn't be uses directly extract to the eclipse plugins directory.

I had to agree that i like HSQLDB much more than Derby (just feeling). So, I try to fix it and have this workable version even the official project site is not active since 2004.

This plugin is good and easy enough for development.

You can add nature of HSQLDB in your project by right click on the project and select "HSQLDB > Add Database Engine nature"


And then, start / stop the HSQLDB for your project by right click on the project like this.


If you are interesed about it, just following these procedures to install it in your Eclipse.

1. download it from here

2. cd to ECLIPSE_HOME/plugins/

3. extract the hsqldb eclipse plugins.zip contents in the directory. The "hsqldb.ui" and "hsqldb.core" directories should be extracted into the ECLIPSE_HOME/plugins/ direcotry, like this:

ECLIPSE_HOME/plugins/hsqldb.ui/
ECLIPSE_HOME/plugins/hsqldb.core/

And then, the next time you start Eclipse, everything should work.

Thursday, April 26, 2007

Configure the HSQLDB server to store data in datafile

After you started the HSQLDB in server mode, it stores the data in memory by default. You have necessary to amend the properties file to change the hsqldb.default_table_type value to use cached as below.

With reference to my previous article, the property file name should be, "My-db.properties".

hsqldb.default_table_type=cached

Wednesday, April 25, 2007

又一個心理問題!

第一題: 若果你的老闆覺得你的表現很好,他叫你進房說想奬勵你,然後給你兩個選擇

A. 跟他猜兩拳,勝了可以加3000元人工。若輸了要減1000元人工

B. 直接加1000元人工


第二題:若果你犯左交通規則,給交通警捉到,要罰你,但給你兩個選擇

A. 直接罰500元

B. 跟他猜兩拳,勝了可以不用罰款,即時走人。若輸了要罰1000元



睇答案... 來呢度啦喂

Start HSQLDB server in my eclipse project folder

After successfully created my first application with AppFuse on MacOSX, I'm wonder how to make it work work with HSQLDB.

I found this wiki reference is really good as it simple but detail enough for the setup. I put this command in a file with the following contents; and then name it as "startHSQLDB.sh".

java -cp ~/dev/hsqldb/lib/hsqldb.jar org.hsqldb.Server -database.0 ./My-db -dbname.0 MyDB

Then, I change it's execution mode to 755 with following command.

> chmod 755 startHSQLDB.sh

Now, i can start it anytime when i need to have the development.

Sunday, April 22, 2007

Setup environment variable for the AppFuse on MacOSX

Edit the ".bash_login" file and add these environment variables before use start to use 'ant new' with Appfuse.

export CATALINA_HOME=/usr/local/apache-tomcat-5.5.20
export ANT_HOME=/Developer/Java/Ant

And then, copy the "junit.jar" file from the "lib/junit3.8.1/" folder inside the AppFuse directory to the ANT home "lib" folder.

And then, you can start to new a project with the "ant new" command. Just enter 3-4 simple information. Your application is created.

Using AppFuse in Mac OSX

Software development, Java programming ... etc. are keeping evolution and growth. Inside there, it has many compartively dummy and repeadly works. Why it is comparively dummy? It is simple under a condition, that is "You have experince to use it".

I always thinks how to avoid this kinid of works. Now, i'm trying a framework + tool, Appfuse 1.9.4. It seems can help to start a java web-based application in a short time. This is some of my experince of using it on Mac OSX.

Sunday, April 15, 2007

Hibernate No CurrentSessionContext configured!

Exceptionn message : "Hibernate No CurrentSessionContext configured!"

This message happened because didn't well configure the "hibernate.cfg.xml" file when using the "getCurrentSession()" function of the Hibernate session factory

Need the following property define in the hibernate.cfg.xml :

thread

Friday, March 02, 2007

好財政 “獅” (07-08 年度)

糖糖 派完糖,你滿意嗎?感覺上好似係放粒方糖落你果大碗苦茶,仲話要分開粒方糖幾小塊,每隔幾個月先放落去苦茶到,會甜得持久些... 到底係咪真係有甜味真係得佢知囉。 或者真係會甜到唔知講咩好...

假如你係沒甚麼扣稅額可用來扣稅,而只係受惠邊際稅階及邊際稅率回復至 2002-03 年度的水平人,用個計數機計下,便會大概見到薪俸稅有甚麼不同了。



Tuesday, February 27, 2007

好運動量

如何得知運動量是否達標﹖ 可以根據你的年齡計算出運動的時候理想的心跳速度。






Sunday, February 25, 2007

又一個心理問題!... 既答案...

問題係呢度呀喂 ...

第一題

答A : 無分

答B:得一個叻


第二題

答A : 得一個叻

答B:無分

分析:
有兩個叻既,恭喜晒啦,你夠疆、勇於爭取利潤,又懂得止蝕。 股場大嬴家咪係你囉。

一個叻既呢,一係就勇到唔識止蝕,一係就驚驚情情。 不過都應該揾到既,不用怕,記得請飲茶。

無既呢... 其實高息存款都有四厘架喎... 不如諗諗都好喎...

Wednesday, February 21, 2007

一個好心理... 測試 !

答案在本頁最底部(這個測驗跟之前1-10 的測驗問題不一樣... )

1. 寫下一個異性的名字

2. 紅、黑、藍、綠、黃最喜歡什顏色?

3. 你的首寫字母?

4. 你的生日?

5. 黑與白,你比較喜歡那個顏色?

6. 一個同性的名字

7. 你喜歡的數字?

8. 你喜歡雪梨還是布裏斯本?

9. 你比較喜歡湖還是海 ?

10. 寫下一個願望(具現實性的 )


做的時候,應該蓋住下邊(不要撒謊)

...下面有答案...



















答 案
1. 你與這個人完全愛戀中

2. 如果你選:
紅色 —— 你是機敏的並且你的生活充滿了愛。
黑色 —— 你是保守、好鬥的。
綠色—— 你的靈魂是放鬆的。
藍色 —— 你是自然的並樂於接吻及收到愛人的影響。
黃色 ——你是一個幸福的人,能夠給與不幸的人很多好的建議。

3. 如果你的首寫字母是:
A-K: 你擁有很多愛,熱衷於友情;
L-R 你試圖盡最大努力享受你的生活。你的感情生活不久將得到大發展;
S-Z 你樂於幫助別人,你未來的感情生活非常不錯。

4. 如果你生於:
1月 -3月: 你今年將會過得很順遂,並且你會與一個意想不到的人墜入愛河
4 月 -6 月: 你將有一段很強的愛情關係並將持續很長時間,記憶將永遠;
7 月 -9 月: 你將有很棒的一年,可能會經歷生命大的變化(好方面);
10-12月: 你的感情生活不太順利,但最終你能找到心心相印的伴侶。

5.如果你選擇: 黑色: 你的生命將出現新的方向,將有好的事情發生,你也十分樂於改變 白色:你有一個朋友完全的信賴於你並為你做了些事情,但你可能認識不到。

6. 這個人是你最好的朋友。

7. 這是你生命裏最好朋友的個數。

8.如果你選:
雪梨:你喜歡冒險。
布裏斯本:你是一個鬆弛懶散的人。

9. 如果你選:
湖: 你忠誠于你的朋友和愛人。 是個有保留的人
海: 你是一個自然的人,招人喜歡。

10. 把這個測試在一個小時之內
發給 5 個人,你的願望將實現。
發給 10 個人,你的願望將在你下一個生日前實現。

Saturday, February 17, 2007

新春大吉! 新年快樂!


祝大家豬年,萬事勝意,心想事成! 恭喜發財!

Click 圖便可以放煙花了! Enjoy it!













Saturday, February 10, 2007

一個好廣告!

某某賣樓廣告...

四季如春...港窄水嗅...四面環樓
人人食快餐... 可以發胖 , 而持久
係一個 做死人 既谷氣地...

買啦... 買啦...

Friday, February 09, 2007

一個好口號!

煲軚曾角逐連任用「我會做好呢份工!」做競選口號

如果換轉其他行業或者其他人,應該會咁講:
地盤佬: 「我會鑽好呢個窿!」
氣功師: 「我會發好呢次功!」
八達通公司: 「我會整好八達通!」
天文台: 「我會測好呢個風!」
整容醫生: 「我會隆好呢個胸!」
鐘錶師: 「我會整好呢個鐘!」
廚師: 「我會爆好呢碟蔥!」
麻將腳: 「我會碰好呢隻東!」
X X 公司的專業員工:「我會五點九就鬆…」

果然係一個好口號!

XML Master Cert Group

Google Groups
XML Master Certification
Visit this group