<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5625548515922693160</id><updated>2012-02-05T09:56:52.415+08:00</updated><category term='Redmine'/><category term='Struts2'/><category term='MySQL'/><category term='SpringMVC'/><category term='Annotations'/><category term='心情'/><category term='Music'/><category term='Hibernate'/><category term='Maven2'/><category term='Java'/><category term='OpenSource'/><category term='MAC'/><category term='SpringSecurity'/><category term='JQuery'/><category term='Xdoclet2'/><category term='Tomcat'/><category term='Spring3'/><category term='Git'/><category term='JMX'/><category term='Maven'/><category term='tiles'/><category term='OGNL'/><category term='Eclipse'/><category term='SPRING2'/><category term='JPA2'/><category term='SSL'/><category term='Ubuntu'/><category term='Spring'/><category term='Maven3'/><category term='Android'/><category term='Apache2'/><category term='碎碎唸'/><title type='text'>起風前的相遇</title><subtitle type='html'>Mac, Music and Programming</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default?start-index=101&amp;max-results=100'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>132</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2753384430759343338</id><published>2012-02-01T16:32:00.001+08:00</published><updated>2012-02-01T16:34:20.139+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Install Sun/Oracle JDK in Ubuntu 11.10</title><summary type='text'>
在Oracle買下Sun之後，Ubuntu上要安裝sun/oracle的JDK是愈來愈不容易...
還是做個筆記囉


安裝Sun JDK6

sudo add-apt-repository ppa:flexiondotorg/java 
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin sun-java6-fonts



安裝Oracle JDK7
這部份主要是參考Intalling Java 7 on Ubuntu Natty (11.04)


請至Oracle http://www.oracle.com/technetwork/java/javase/downloads/index.html Download最新的檔案，要注意配合作業系統。下列的例子以x64為主。
解壓縮後移到/</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2753384430759343338/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2753384430759343338' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2753384430759343338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2753384430759343338'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2012/02/install-sunoracle-jdk-in-ubuntu-1110.html' title='Install Sun/Oracle JDK in Ubuntu 11.10'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4472588728796703227</id><published>2012-01-31T16:55:00.001+08:00</published><updated>2012-01-31T17:18:08.057+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache2'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Git over Apache2 http server in Ubuntu 11.10</title><summary type='text'>由於手邊的MBP年事已高（五歲多囉），而且RAM最大僅能加到3G，開了IDE與Browser後已經沒什麼多餘的能力來支撐一個VM了。所以把另一台NB裝上Ubuntu 11.10，並將常用的服務裝上去，順便做些更新的筆記。先前也曾經有個安裝筆記GIT + Apache2 on Ubuntu 8.10 (1)，但現在的Ubuntu安裝又更簡單些；主要是因為現在提供了git-http-backend，設定上可以更簡化了。
 

安裝apache 與 git
sudo apt-get install apache2 git

後期的Ubuntu 已將git-core更名為git，但是用git-core也沒問題啦。
建立相關人員帳號密碼，-c代表要建新檔，-m代表密碼要加密
sudo htpasswd -cm /etc/apache2/passwd $username
第二位成員起就不需要加-c，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4472588728796703227/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4472588728796703227' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4472588728796703227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4472588728796703227'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2012/01/git-over-apache2-http-server-in-ubuntu.html' title='Git over Apache2 http server in Ubuntu 11.10'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7007563541382427357</id><published>2012-01-02T12:39:00.001+08:00</published><updated>2012-01-02T12:39:57.405+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Plugin : DataTables (6)</title><summary type='text'>前接jQuery Plugin : DataTables (5)
再來就是DataTables比較費工的地方。大部份遇到的案子，Table/Grid裡除了顯示，通常還要可以加上checkbox, radio, button, link等操作，以提供多個選取刪除，單選編輯等功能。這也是我覺得使用了DataTables，程式碼實際不會少多少，開發效率提昇待議的部份，但也可能是我能力的問題，若有大德能指引明燈，小弟會非常感激。
以下以在table裡加上checkbok與button的操作為例，DataTables裡要多加Column就必需在aoColumns裡以mDataProp標示，由於資料並非自JSON Object裡取得，所以就必需設定為null.而要顯示自訂的資料，就必需提供"fnRender"這個callback method，其中僅有一個參數oObj，oObj其中的aData</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7007563541382427357/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7007563541382427357' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7007563541382427357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7007563541382427357'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2012/01/jquery-plugin-datatables-6.html' title='jQuery Plugin : DataTables (6)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-vc88K-ezxCg/TwE0svOvyjI/AAAAAAAACco/YAKIvvGp-Y8/s72-c/datatables6.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4882117935235824911</id><published>2011-12-28T15:23:00.001+08:00</published><updated>2011-12-28T15:23:12.270+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Plugin : DataTables (5)</title><summary type='text'>前接jQuery Plugin : DataTables (4)
這裡開始的思路跟我早期的想法不一樣，主要原因是在DataTables call ajax 的時刻。對我先前的BaseCRUD模式而言，在init時就會自DB取得第一頁的資料以供顯示。如果透過DataTables來處理，就代表不需要在init階段處理這部份。但無論如何，Search Form的存在還是必要的，DataTables第一次找回來的資料也必需符合Form初始化的選項；也就代表DataTables要能加入目前現有Form的欄位做為參數。
第一步還是先要訂個Form吧，並將submit改掉，改用button呼叫javascript。因為DataTables的聯絡對象是用“sAjaxSource“指定的，所以Form的action就沒有作用了。

	&lt;form id="myform"&gt;
	&lt;table&gt;
		&lt;tr&gt;&lt;</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4882117935235824911/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4882117935235824911' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4882117935235824911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4882117935235824911'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/12/jquery-plugin-datatables-5.html' title='jQuery Plugin : DataTables (5)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5331356203032186929</id><published>2011-12-28T14:11:00.001+08:00</published><updated>2011-12-28T14:11:40.249+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Plugin : DataTables (4)</title><summary type='text'>前接jQuery Plugin : DataTables (3)
如果要讓DataTables完全聽命於Server端，無論大小時都要問過Server時，就要加入“bServerSide“來告訴DataTables。只要設定“bServerSide“為true之後，無論是換頁、排序、搜尋，DataTables一定會與sAjaxSource聯絡來取得正確的結果。Server與Client之間的溝通當然必需先講好各自要用的參數，請先參考Server-side processing，下列僅說明必要的部份
Sent to Server Side:

sEcho : Client端在每次呼叫sAjaxSource時會產生一個特定的sEcho做為驗証碼，Server端必需在JSON中回傳相同的值做為認證
iDisplayStart ： 目前顯示的是第幾筆資料
iDisplayLength ： </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5331356203032186929/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5331356203032186929' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5331356203032186929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5331356203032186929'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/12/jquery-plugin-datatables-4.html' title='jQuery Plugin : DataTables (4)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4674900945818811752</id><published>2011-12-28T12:45:00.001+08:00</published><updated>2011-12-28T12:47:54.113+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Plugin : DataTables (3)</title><summary type='text'>前接jQuery Plugin : DataTables (2)
經過前面的測試，雖然可以改變資料來源為動態而非固定值，但馬上遇到回傳格式的問題。看看先前回傳的資料
{"aaData":[
	["A123","Adam","0910"],
	["B123","Bob","0819"],
	["C123","Child","0739"]
]}
這不就代表我Server端輸出時還要考慮property的順序？
 
所以當然要試著讓DataTables可以動態的指定每個column要顯示的property.這就必需在兩邊都有改動。Server端回傳的格式要改，像是下列這樣
{"aaData":[
	{"id":"A123","name":"Adam","phone":"0910"},
	{"id":"B123","name":"Bob","phone":"0819"},
	{"id":"</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4674900945818811752/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4674900945818811752' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4674900945818811752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4674900945818811752'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/12/jquery-plugin-datatables-3.html' title='jQuery Plugin : DataTables (3)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8053976328975919928</id><published>2011-12-28T11:46:00.001+08:00</published><updated>2011-12-28T11:46:02.570+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Plugin : DataTables (2)</title><summary type='text'>在我開發過的系統，沒有一個可以接受一次把所有資料撈出來後在Client上做分頁的。所以Server端的回應模式一定要能被處理。
先理解DataTables做法的重點。

要自Server端取得資料，必需要有一個參數“sAjaxSource“指定資料的來源，資料來源可以是文字檔或是PHP，ASP，Servlet等程式的URL
Server端回傳資料的格式，可以是JSON或XML，但以JSON為佳；回傳資料的property名稱要為aaData。
DataTables會將回傳的資料更新table中&lt;tbody&gt;&lt;/tbody&gt;的部份。
自Server端取得資料的時機是在呼叫$("#tableId").dataTable();後，所以一開始的&lt;tbody&gt;&lt;/tbody&gt;內不需要有資料。

以純文字檔做為Server回傳資料的來源做個示範。先將下列文字存為檔案serverdata.txt{"</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8053976328975919928/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8053976328975919928' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8053976328975919928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8053976328975919928'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/12/jquery-plugin-datatables-2.html' title='jQuery Plugin : DataTables (2)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/-quhL1sB9TYY/TvqQA14F5cI/AAAAAAAACcg/Kl6m22yZ5go/s72-c/DataTables02.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-1776481408877129349</id><published>2011-12-28T09:36:00.001+08:00</published><updated>2011-12-28T09:46:24.057+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Plugin : DataTables (1)</title><summary type='text'> 
去年曾經有幸，短時間加入了X稅局的案子，大部份使用的技術都還算熟悉，像是SpringMVC, JPA, Maven這些東西，比較少接觸的大概是像jquery的眾多plugin，DataTables是其中之一。由於我自已是有習慣的分頁查詢處理模式，在當下我並沒有很喜愛這個Plugin，因為在各方面比較之下，我覺得我常用的模式要寫的程式碼並不會比較多，而且對於我BaseCRUD的操作模式有所影響。所以在prototyping 時我是將我常用的模式硬加在DataTables之上。不過沒幾個星期我就脫離案子，後續也沒再深入瞭解。
不過前段時間又有些新想法，記起了這個jQuery Plugin，稍為試了下順便做些筆記。以下的東西可能會有錯誤的部份...
DataTables的網站請參考：DataTables
最基本的例子，針對目前Html中現有的table加工，讓table</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/1776481408877129349/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=1776481408877129349' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1776481408877129349'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1776481408877129349'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/12/jquery-plugin-datatables-1.html' title='jQuery Plugin : DataTables (1)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-iKtJ1zfNC8c/TvpyZZY0zXI/AAAAAAAACcY/1lBOQlDU_xo/s72-c/datatable01.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7996563941723268954</id><published>2011-09-28T15:00:00.001+08:00</published><updated>2011-09-28T15:00:07.409+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>好用的Java Date Library -- Joda Time</title><summary type='text'>Java裡提供的Calendar 與 Date在實用上實在有許多不方便的地方，這點我想有異議的人應該不多，所以大部份的開發團隊都會有一些DateUtils來補足常用的日期操作。
例如像是int getCurrentMonth(Calendar date); #Java Calendar的月份是從0開始....boolean isBetween(Date begin, Date end);boolean isBefore(Date source, Date target);Calendar addDay(Calendar source, int days); ＃日期計算String format(SimpleDateFormat sdf); #轉換日期格式
總歸一下大約是有下列幾種的需求

基本資訊的取得，例如年，月，日，星期幾等資訊
格式轉換，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7996563941723268954/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7996563941723268954' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7996563941723268954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7996563941723268954'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/09/java-date-library-joda-time.html' title='好用的Java Date Library -- Joda Time'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-922411498941185980</id><published>2011-07-26T14:31:00.001+08:00</published><updated>2011-07-26T14:31:53.319+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Struts2'/><title type='text'>Struts2 處理404錯誤的方法</title><summary type='text'>一個Member問起這個問題，我覺得很不錯。
Error Code 404 這個問題說大不大，不過是使用者敲錯了URL，又不是Error Code 500代表我們的系統出現錯誤，何況使用者要敲什麼，我們哪管得著？我想這也沒錯啦，如果我在Google Map敲個'我家'，然後還希望它給我什麼好看的是不是有點超過？（也許會出現全家便利商店?）
在Struts2中，一般要解決的404URL大約是兩類，一類是struts2 的.action，另一類就是一般的resource，像jpg、js等
第一類Action的方式很容易，在struts.xml中設定一個default的package，然後用個default-action-ref就可以解決

	&lt;package name="default" extends="struts-default"&gt;
		&lt;default-action-ref name</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/922411498941185980/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=922411498941185980' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/922411498941185980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/922411498941185980'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/07/struts2-404.html' title='Struts2 處理404錯誤的方法'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2326276864424498338</id><published>2011-05-31T22:43:00.001+08:00</published><updated>2011-05-31T22:43:58.348+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>A500 首發</title><summary type='text'>用blogger-droid寫blog大概就只能寫出plurk的內容吧Published with Blogger-droid v1.6.9</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2326276864424498338/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2326276864424498338' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2326276864424498338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2326276864424498338'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/05/a500.html' title='A500 首發'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6125834604613288443</id><published>2011-04-27T17:57:00.002+08:00</published><updated>2011-04-27T17:59:45.842+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven3'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Maven Android Plugin</title><summary type='text'> 
主要是參考 sonatype的reference - Android Application Development with Maven
1. Maven android sdk deployerAndroid SDK的安裝就不在這篇記錄了，直接跳到maven android sdk deployer安裝，先連到https://github.com/mosabua/maven-android-sdk-deployer/，按下Download後自行解壓縮。

 
進入解壓縮後的目錄執行 mvn install正常的話可以看到類似下列的結果

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6125834604613288443/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6125834604613288443' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6125834604613288443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6125834604613288443'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/04/maven-android-plugin.html' title='Maven Android Plugin'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_HqfGenkdwXM/TbfokjFnAgI/AAAAAAAABdI/yz8lDjCzOLU/s72-c/github-deployer.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6497527289646908155</id><published>2011-04-27T12:14:00.001+08:00</published><updated>2011-04-27T12:14:13.642+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OGNL'/><title type='text'>OGNL note</title><summary type='text'>Basic Syntax:用“.“取得property，例如：user.name =&gt; user.getName();最後加上“()“則代表呼叫method，例如：user.name.toString()陣列的使用則是以"[]"來操作， users[0]利用'@'來指定特定的Class、Method及Property，例：呼叫static method @my.package.Utils@staticMethod(args)取得static property @my.package.Utils@myproperty在OGNL的概念裡，所有變數都是global variable，但有一個特定的變數做為root要取得變數以'#'來標示，如：#currentUser,若是僅見到currentUser,代表是呼叫root.getCurrentUser()以取得root的currentUser
</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6497527289646908155/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6497527289646908155' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6497527289646908155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6497527289646908155'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/04/ognl-note.html' title='OGNL note'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4326731519369493817</id><published>2011-03-21T02:58:00.001+08:00</published><updated>2011-03-21T02:58:08.776+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringSecurity'/><title type='text'>Spring Security (3) Basic Configuration fo &lt;authentication-provider&gt;</title><summary type='text'>&lt;authentication-manager&gt;共本上提供了兩種Authentication Provider，一個是authentication-provider，另一個是ldap-authentication-provider
預設的authentication-provide就是採用DaoAuthenticationProvider，有三種基本的帳號密碼檢核與提供人員資料方式

user-service：建立一個in-memory的UserDetailService，帳密可以自properties file載入或在xml以&lt;user&gt;建立
jdbc-user-service：Spring Security提供了SQL Schema，所以相關的帳密可以自DB載入，只要給jdbc-user-service一個DataSource就可以使用，或是現有欄位定稱與Spring </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4326731519369493817/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4326731519369493817' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4326731519369493817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4326731519369493817'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/03/spring-security-3-basic-configuration.html' title='Spring Security (3) Basic Configuration fo &amp;lt;authentication-provider&amp;gt;'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-825348870011382370</id><published>2011-03-20T21:46:00.002+08:00</published><updated>2011-03-21T03:01:00.713+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringSecurity'/><title type='text'>Spring Security (2) Basic Configuration of &lt;http&gt;</title><summary type='text'>看過先前的說明應該會有些困惑，我們應該先稍為拆解一下&lt;http&gt;&lt;http auto-config='true'&gt; 代表了三個預設定設定

&lt;form-login&gt;
&lt;http-basic&gt;
&lt;logout&gt; 

&lt;form-login&gt;代表要使用基本的Form-based authentication，但由於沒有指定登入的頁面，所以SpringSecurity會直接採用內建的Servlet產生登入的頁面，如果只是展示一下系統，當然沒問題，但真實在使用的系統應該沒辦法接受，所以直接加上&lt;form-login login-page="/your_login.jsp" /&gt;這樣的設定就可以改用目前系統使用的登入頁面，但由於其他設定都沒動，所以form的欄位及action url仍有一定的要求，action仍必需是“/j_spring_security_check“，account</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/825348870011382370/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=825348870011382370' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/825348870011382370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/825348870011382370'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/03/spring-security-2-basic-configuration.html' title='Spring Security (2) Basic Configuration of &amp;lt;http&amp;gt;'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5680333670977791058</id><published>2011-03-18T15:31:00.001+08:00</published><updated>2011-03-18T15:31:45.216+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringSecurity'/><title type='text'>Spring Security (1) Basic Configuration</title><summary type='text'>一個對外的系統通常有權限設定，主要的需求通常就是兩個

判斷目前的操作人員是誰
人員是否可以進行這個操作 

Spring Security提供了一個快速而有彈性的方法可以處理上述兩個需求，當然，有彈性通常也代表較多的設定與較複雜的設計....
我們先假設一個基本的網頁系統權限需求，除index.jsp外，其他的頁面存取都必需要是登入後才能看到，但/admin.jsp則必需是具有admin角色的人員才能看到。
web.xml
第一步當然是載入Spring的設定檔....

&lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;classpath*:applicationContext.xml&lt;/param-value&gt;
&lt;/context-param&gt;
&lt;listener&gt;
</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5680333670977791058/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5680333670977791058' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5680333670977791058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5680333670977791058'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/03/spring-security-1-basic-configuration.html' title='Spring Security (1) Basic Configuration'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_HqfGenkdwXM/TYMKXvvkk_I/AAAAAAAAA-I/bix_wkGdz78/s72-c/login.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6689986082091489392</id><published>2011-03-17T16:11:00.001+08:00</published><updated>2011-03-17T16:11:57.983+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven3'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Maven 同時使用Emma 與Surefire會執行兩次Unit test的解決方式</title><summary type='text'>emma-maven-plugin的開發人員認為，被instrumented過的test class不等同於原來的test class，可能會造成原來test不會通過，但在emma處理後而可以通過，或是反過來的情形發生。所以在pom中如果同時加上emma-maven-plugin與maven-surefire-plugin，就會跑兩次的unit test。
如果可以接受被emma instrumented過的test class可以代表原來的test class，那解決的方式就還蠻容易的，簡單說， 就是讓surefire執行被instrumented過的test class，但是要求emma在test或site之類的phase不做事。設定如下
&lt;!-- 要求Emma Plugin 在 process-classes 時執行instrument, 
	但在test 與site時都略過執行-</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6689986082091489392/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6689986082091489392' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6689986082091489392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6689986082091489392'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/03/maven-emma-surefireunit-test.html' title='Maven 同時使用Emma 與Surefire會執行兩次Unit test的解決方式'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3981365115010364317</id><published>2011-03-14T13:19:00.001+08:00</published><updated>2011-03-14T13:19:47.039+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>偶有所感</title><summary type='text'>方才看了 綿羊的譯心譯意 的新博文“大師出手，高下立見“，見到下面這段文字
“I am not bound to win, but I am bound to be true. I am not bound to succeed but I am bound to live up to what light I have. I must stand with anybody that stands right, stand with him while he is right and part with him when he goes wrong.“
我覺得失敗也要敗得有格調，但我現在配合的人似乎不在意格調的問題....突然有點感慨我現在做的工作，又要找下一步了嗎？
 </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3981365115010364317/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3981365115010364317' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3981365115010364317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3981365115010364317'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/03/blog-post_14.html' title='偶有所感'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7172764255296557499</id><published>2011-03-07T10:28:00.001+08:00</published><updated>2011-03-07T10:28:37.401+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>全型 ＜－＞半型</title><summary type='text'>嗯，非常無聊，寫了還是記錄一下
字串裡的全型字元與半型字元轉換

public abstract class StringUtils {
	/**
	 * 全型轉半型
	 * @param source
	 * @return
	 */
	public static String convertToHalfWidth(final String source) {
		if (null == source) {
			return null;
		}
		
		char[] charArray = source.toCharArray();
		for (int i = 0; i &lt; charArray.length; i++) {
			int ic = (int) charArray[i];
			
			if (ic &gt;= 65281 &amp;&amp; ic &lt;= 65374) {
				</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7172764255296557499/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7172764255296557499' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7172764255296557499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7172764255296557499'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/03/blog-post.html' title='全型 ＜－＞半型'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4435705812594521945</id><published>2011-02-25T15:17:00.001+08:00</published><updated>2011-02-25T15:17:14.755+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JMX'/><title type='text'>Manage Logger Level via JMX</title><summary type='text'>常用的Log library不外乎logback跟log4j，logback自備了JMX控制的功能，只要在logback.xml中加入

&lt;configuration&gt; 
	&lt;jmxConfigurator /&gt;
&lt;/configuration&gt;


lo4j沒有，但只要簡單地寫個小小Util就可以達成


@ManagedResource(objectName = "log4j:name=Lo4jLoggerManager", description = "log4j logger level manager")
public class Lo4jLoggerManager {
	@ManagedOperation
	@ManagedOperationParameters({@ManagedOperationParameter(name="loggerName", </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4435705812594521945/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4435705812594521945' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4435705812594521945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4435705812594521945'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/02/manage-logger-level-via-jmx.html' title='Manage Logger Level via JMX'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8146332305708224345</id><published>2011-02-25T11:33:00.002+08:00</published><updated>2011-02-25T11:36:01.758+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='SPRING2'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='JMX'/><title type='text'>Startup MX4J HttpAdaptor with Spring</title><summary type='text'>我用JMX用的並不多，多半而言就是拿來控制Logger 的Level，最多加個清Cache，其餘就沒什麼特別在意的。控制的介面用jconsole多半還過得去，部份案子還是會使用mx4j的HttpAdaptor來建立Web的操作介面，只是在使用上，要自動帶起HttpAdaptor還是有些困擾。
先看看MX4J 的HttpAdaptor，

public void start() throws IOException {
    final Logger logger = getLogger();
    if (server != null) {
         serverSocket = createServerSocket();
         .....
    } else {
        if (logger.isEnabledFor(Logger.INFO)) </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8146332305708224345/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8146332305708224345' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8146332305708224345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8146332305708224345'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/02/startup-mx4j-httpadaptor-with-spring.html' title='Startup MX4J HttpAdaptor with Spring'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6591583316568909865</id><published>2011-02-05T19:13:00.001+08:00</published><updated>2011-02-05T19:13:46.561+08:00</updated><title type='text'>Struts2 上 i18n的小技巧</title><summary type='text'>最近被問到的小問題網頁程式上我們經常需要產生一些表單上的選項，而選項內容也需要參考到i18n的properties裡的設定，例如要顯示“是：否“兩個選項，最糟的寫法可以是&lt;select&gt; &lt;option value="true"&gt;&lt;s:text name="msg.true" /&gt;&lt;/option&gt; &lt;option value="false"&gt;&lt;s:text name="msg.false" /&gt;&lt;/option&gt;&lt;/select&gt;要簡單一點，就用ognl產生一個map或listmap 的做法&lt;s:select list="#{'true':getText('msg.true'),'false':getText('msg.false')}"&gt;&lt;/s:select&gt;list 的做法&lt;s:select list="{'true','false'}" listValue="%{getText(</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6591583316568909865/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6591583316568909865' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6591583316568909865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6591583316568909865'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/02/struts2-i18n.html' title='Struts2 上 i18n的小技巧'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7845364748749179203</id><published>2011-01-21T15:40:00.001+08:00</published><updated>2011-01-21T15:40:57.393+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>第五個季節</title><summary type='text'>"你知道我最喜歡哪個季節嗎？"，妳一如往常無厘頭地問起問題；我手邊正翻著雜誌，有一搭沒一搭地回應反問：“哪一個？““第五個季節啊！“，妳瞪大眼睛，一副不可思議地表情看著我。
“第五個季節？哪是什麼樣的季節？“，我趕緊放下雜誌回應，我瞭解如果我再一副漫不經心的回應，妳雖然不會像對其他人一樣往我胸口捶，但蹭一下腳擰一下腿恐怕是免不了的。“我還沒有想清楚耶，你也幫我想一想吧。“，妳低頭又想了一下，“對了，那你幫我的第五個季節寫首詩吧？“，“呿，那是什麼我都不知道，還寫什麼詩？有機會再聯絡。“，我又開始翻起我的雜誌，“等妳想清楚了，我再考慮。“，沒多久我腳上就多了兩個瘀青
“那妳知道我最喜歡哪個季節嗎？“，我只好反問妳轉移你的注意力，開始揉著我剛剛得到的兩個瘀青。妳轉頭想了想，“誰在乎啊？“，踢了下我椅子又轉身去鬧別人了。
當時我們都不知道，這是我們一起渡過的最後一個季節。</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7845364748749179203/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7845364748749179203' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7845364748749179203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7845364748749179203'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/01/blog-post.html' title='第五個季節'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-9214311812657065505</id><published>2011-01-19T16:53:00.001+08:00</published><updated>2011-01-19T16:53:13.835+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>Web Application Security</title><summary type='text'>Web Application Security要做的通常不過就是確認目前使用者是誰，能不能做目前要做的動作，就算提到到SSO、OpenID這些東西，也不過是在確認使用者上多些手續而已。
近來面談的人，跟兩三年前不同，多半對Spring都有些瞭解，但再深入問些應用卻又讓我有點失望，Sercurity就是很常讓我不滿意的地方。有些人還停留在Submit button的enable or disable，這種情形就比較糟糕，有些完全沒有意識到這樣做會有問題的地方，所以開個Firebug，將disabled拿掉，這些人才覺得這是個問題...再有些人認為用method="GET" or "POST"就能阻止這些問題，但要送一個http post request又有何難?
有些人會很快回覆說利用Filter控制，我個人也認為基本上沒有問題，但我不認為全部都在Filter裡處理完是個好方法，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/9214311812657065505/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=9214311812657065505' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/9214311812657065505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/9214311812657065505'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/01/web-application-security.html' title='Web Application Security'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8393674750675111727</id><published>2011-01-19T12:29:00.001+08:00</published><updated>2011-01-19T12:29:41.725+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>jquerywtp : jQuery Editor Plugin for Eclipse</title><summary type='text'>在Eclipse寫JavaScript比較麻煩的的是缺少API提示的工具，當然用其他IDE像是Spket也不算太差，但總是麻煩了些。
透過Goolge找到了jquerywtp這個Eclipse Plugin，雖然沒辦法配合最新的jQuery版本，但也總算提供了一個較佳的解決方式，必要時也可以修改libraries裡的js檔以符合個人需求。
jquerywtp是透過修改wtp裡的jar檔來達成，與其他一般的Eclipse Plugin不同，流程如下：
先至sourceforge download 最新的jar檔我本身的Eclipse 是JEE 版3.6.1，可用最新的檔案連結在下：jqueryWTP0.40foEn.jar
下載完成後 透過command line或直接連擊jqueryWTP0.40foEn.jar會帶出下列conosle
選取$Eclipse_Home/plugins的</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8393674750675111727/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8393674750675111727' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8393674750675111727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8393674750675111727'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/01/jquerywtp-jquery-editor-plugin-for.html' title='jquerywtp : jQuery Editor Plugin for Eclipse'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_HqfGenkdwXM/TTZor6golkI/AAAAAAAAAOk/1GUdXuEoDvg/s72-c/FileChooserDemo.png?imgmax=800' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8352058290078194079</id><published>2011-01-18T17:40:00.001+08:00</published><updated>2011-01-18T18:12:56.812+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>git ignore</title><summary type='text'>
(1)以＃起始的該行資料會被當做註解
(2)使用Glog PatternGlog patterns 相近於常見的Regular Expressions, 但是較為簡單，由於git在ignore裡使用的是glob patterns，所以還是需要稍為瞭解一下。 

？：代表任意的一個字元
＊：代表任意數目的字元
{!ab}：必需不合於此pattern
{ab,bb,cx}：代表合於ab,bb,cx之一種pattern即可
[abc]：代表合於a,b,c中任一字元即可
[^abc]：代表必需不合於a,b,c中任一字元


(3)若要指出目錄請以"/"表示

 
下列是我常用的.gitignore內容
#Mac OSX Finder
.DS_Store
#Maven Build Folder : Target
target/
#Temp Folder
tmp/
#Log Folder or </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8352058290078194079/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8352058290078194079' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8352058290078194079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8352058290078194079'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/01/git-ignore.html' title='git ignore'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8619930185232833204</id><published>2011-01-03T17:33:00.001+08:00</published><updated>2011-01-03T17:39:49.206+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Redmine'/><title type='text'>Subverion and Redmine Integration</title><summary type='text'>Redmine與SCM結合有2個明顯的優點
1.列出目前SCM Repository資料，以subversion來說，subversion並未如github提供一個友善的介面，透過browser雖然可以看到檔案名稱及內容，但其他資訊如由誰commit或是附加的commet都必需使用其他軟體才能看到，Redmine與SCM Repository結合後就比較方便取得這些資訊。
2.將issue與commit結合，只要在commit message裡加上keyword+#+issueId，就可以在Redmine裡取透過issueId看到相關commit的程式，也可以反向透過commit message找到對應的issue；這個對於承接舊案的人員實在相當方便，因為常常在trace source code時比較容易瞭解前因後果。
Redmine add SCM Repository
(1)</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8619930185232833204/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8619930185232833204' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8619930185232833204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8619930185232833204'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2011/01/subverion-and-redmine-integration.html' title='Subverion and Redmine Integration'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_HqfGenkdwXM/TSGX-WojmoI/AAAAAAAAAN4/8d4c7-b1KQw/s72-c/vm_001.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3912120034903323493</id><published>2010-12-27T10:23:00.001+08:00</published><updated>2010-12-27T10:23:55.033+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='MAC'/><title type='text'>MySQL 5.5 on Mac OSX</title><summary type='text'>送修的Mac回來，原來的硬碟有些問題，只好重裝系統。
剛好Oracle剛發佈新版的MySQL，就順便換裝看看，沒想到一直無法正常起動。
查了下說明，原來要手動改/usr/local/mysql/support-files/mysql.server
把
basedir=datadir=
改為
basedir=/usr/local/mysqldatadir=/usr/local/mysql/data
即可</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3912120034903323493/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3912120034903323493' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3912120034903323493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3912120034903323493'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/12/mysql-55-on-mac-osx.html' title='MySQL 5.5 on Mac OSX'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-183804119872926597</id><published>2010-12-14T23:09:00.001+08:00</published><updated>2010-12-14T23:10:48.282+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>MarsEdit Test</title><summary type='text'>MarsEdit Test
</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/183804119872926597/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=183804119872926597' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/183804119872926597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/183804119872926597'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/12/marsedit-test.html' title='MarsEdit Test'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_HqfGenkdwXM/TQeI6J73f_I/AAAAAAAAANA/5leBuR_rWWE/s72-c/excel12.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2259055774778614490</id><published>2010-12-14T18:49:00.001+08:00</published><updated>2010-12-14T22:54:36.170+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='Redmine'/><title type='text'>Redmine Mylyn Connector</title><summary type='text'>個人覺得，工程師在工作時，所有要處理的事最好都能在IDE裡完成，這樣比較不易被其他事情中斷，因為每次的Switch一定是要花些成本的。工作的分派也是，今天有什麼Task要處理或是Bug要修，如果可以在IDE裡取得，完成後也在IDE裡回報，這應該是比較理想的。Redmine Mylyn Connector 就提供Eclipse 這樣的 Plugin，讓我們將Redmine當做Mylyn的repository，方便我們回報各種工作情況。
要將Redmine與Eclipse兩方連結，必需在兩方都加點東西，Redmine要加個vendor plugin，而Eclipse 也要加plugin。
1. Redmine方面：執行下列statement
cd /usr/share/redminesudo ruby script/plugin install git://</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2259055774778614490/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2259055774778614490' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2259055774778614490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2259055774778614490'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/12/redmine-mylyn-connector.html' title='Redmine Mylyn Connector'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_HqfGenkdwXM/TQdLjnrNOQI/AAAAAAAAALc/KFVRN9-23M4/s72-c/Ubuntu64__Running_2-thumb.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-815608144893632805</id><published>2010-12-14T16:16:00.001+08:00</published><updated>2010-12-14T16:21:02.009+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Redmine'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Redmine on Ubuntu 10.10</title><summary type='text'>個人覺得，每間軟體公司應該都要有一個Issue Tracking System，有了Issue Tracking System，專案才方便進行Planning、Development及Evaluation的流程管理。當然也有人覺得，用Microsoft Project或Excel等工具也就夠了，這點我也沒什麼特別的意見，但也許考慮嘗試使用一下Open Source的Issue Tracking System後，可以發現這類工具的助益遠大於你一開始的想像。以往我個人認為比較好用的Issue tracking system大概只有JIRA，其他如Trac、Mantis或Bugzilla之類的，通常是公司或專案已經在使用，就跟著用就是。雖然我也不是對JIRA有什麼特別的喜好，因為我再怎麼用也不過就是基本的工作指派或是問題回報；不過JIRA額外提供了設定專案不同階段（version）</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/815608144893632805/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=815608144893632805' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/815608144893632805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/815608144893632805'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/12/redmine-on-ubuntu-1010.html' title='Redmine on Ubuntu 10.10'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6495471582945668573</id><published>2010-12-03T15:01:00.001+08:00</published><updated>2010-12-03T15:02:37.112+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven3'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Maven3 and Site Plugin</title><summary type='text'>Maven3 的 maven-site-plugin已將關於reporting的邏輯移除，所以如果用原先給maven2用的pom.xml，雖然可以執行，但除了用Doxia的report可以跑出結果來，其餘的report都不會產生。要跑出先前的report就必需修改下pom.xml，Maven的report主要有分兩類，一是Project Information、另一則是Project Report，Information就是專案成員名單、使用的library、Issue Tracking等相關資訊，而Report則是其他外掛的Changelog、Unit test Surefire、CodeCoverage Emma等report，maven2的是將其分為兩部份控制，information是內建的，只要敲個mvn site就一定有，其他的report就必需在&lt;reporting /&gt;</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6495471582945668573/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6495471582945668573' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6495471582945668573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6495471582945668573'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/12/maven3-and-site-plugin.html' title='Maven3 and Site Plugin'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4150881054620674027</id><published>2010-11-29T17:01:00.001+08:00</published><updated>2010-11-29T17:01:49.190+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸</title><summary type='text'>個人覺得，工作可以是一種信仰、一種宗教，而一間公司可能同時存在有多種信仰；信仰間是會有衝突的，有些信仰無法容下其他的信仰而有衝突，發生衝突時也難免會因較為激進的派系而交火；在人數極多時，我想這無可避免。但如果一間人數極少而每個人竟都有不同的信仰，這個組合應該是一件蠢事。這蠢事居然就在我眼前。蠢！</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4150881054620674027/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4150881054620674027' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4150881054620674027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4150881054620674027'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/11/blog-post.html' title='碎碎唸'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-214608598852963370</id><published>2010-11-10T17:28:00.001+08:00</published><updated>2010-11-10T17:38:47.898+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tiles'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringMVC'/><title type='text'>Spring MVC (2) -- Tiles</title><summary type='text'>Tiles是一個分割網頁的Library，提供了一個除了使用&lt;jsp:include&gt;之外的JSP組合工具；透過xml設定檔，將重覆不需變動的頁面分割後定為Template，讓開發人員專注在各個模組中不同的頁面並使其具有組合性。通常一個頁面基本的格局大概如下圖



這次的Demo就以table來分割而不以div方式來制定，簡單的html如下 &lt;html&gt;
&lt;head&gt;
&lt;meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /&gt;
&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table&gt;
 &lt;tr&gt;
  &lt;td colspan="2"&gt;Header&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td&gt;Menu&lt;/td&gt;&lt;td&gt;Body&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
  &lt;td </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/214608598852963370/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=214608598852963370' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/214608598852963370'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/214608598852963370'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/11/spring-mvc-2-tiles.html' title='Spring MVC (2) -- Tiles'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_HqfGenkdwXM/TNplv2d-hEI/AAAAAAAAALI/F_kCijoEmi8/s72-c/Screen_shot_2010-11-09_at___4-thumb.43.22.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5407887437518214315</id><published>2010-11-09T15:13:00.001+08:00</published><updated>2010-11-09T16:03:54.817+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='SpringMVC'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><title type='text'>Spring MVC (1)</title><summary type='text'>因為專案需要，但是專案沒有wiki的系統（說來Redmine真的不錯用！），就稍為利用這裡記錄關於SpringMVC想說明的部份(1)library要開始一個SpringMVC很容易，第一請先建立一個web project，要利用mvn eclipse:eclipse或直接在ide裡開都ok，pom.xml裡的dependency只需要  &lt;dependencies&gt;
  &lt;dependency&gt;
   &lt;groupid&gt;org.springframework&lt;/groupid&gt;
   &lt;artifactid&gt;spring-webmvc&lt;/artifactid&gt;
   &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
   &lt;groupid&gt;javax.servlet&lt;/groupid&gt;
   &lt;</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5407887437518214315/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5407887437518214315' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5407887437518214315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5407887437518214315'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/11/spring-mvc-1_08.html' title='Spring MVC (1)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_HqfGenkdwXM/TNj0Y30z6kI/AAAAAAAAALA/pF-rWBnpDRU/s72-c/Screen_shot_2010-11-09_at___9-thumb.01.1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4482047924366838856</id><published>2010-10-18T12:04:00.000+08:00</published><updated>2010-10-18T12:06:08.317+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Maven2 : Release Plugin</title><summary type='text'>在專案的後期，要進入大量測試的階段，或是要完成測試要打包完整檔案給客戶時，通常都會在source code上加上一個tag，例如XXX-RC1，XXXX-RELEASE，以方便追踪各項問題，當然透過其他SCM提供的GUI Tools或是Commadn line來執行這種上tag的工作是沒有任何疑慮的，只不過Maven也提供了一個Plugin讓我們可以在沒在錯誤下完成一個Build時一併進行上Tag及其他release的工作，如修改pom.xml的version。Maven Release Plugin請參考http://maven.apache.org/plugins/maven-release-plugin/index.html 基本上只要在pom.xml的plugin中加上 &lt;plugin&gt;
    &lt;groupid&gt;org.apache.maven.plugins&lt;/groupid</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4482047924366838856/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4482047924366838856' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4482047924366838856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4482047924366838856'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/10/maven2-release-plugin.html' title='Maven2 : Release Plugin'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7499375423760651995</id><published>2010-10-18T10:54:00.001+08:00</published><updated>2010-10-18T11:04:02.770+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Maven2 : SCM</title><summary type='text'>通常在Nightly Build的環節，我比較喜歡Clean Build，也就是從Checkout、Compile、Test、Deploy都是一個動作完成的Compile、Test、Deploy都可以靠Maven或Ant完成，但是自VCS中checkout source code就要看plugin的支援程度了。即便是plugin支援度不夠，只要該種VCS有提供command line的模式，我想就能利用shell或script的方式來達到完整的Clean Build。 例如：git clone [url] ＃checkout source code from VCScd [project]mvn site -Pprod當然利用Maven提供的SCM來處理也是不錯，除了checkin, checkout之外也可以利用scm plugin來列出changelog或add、remove檔案，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7499375423760651995/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7499375423760651995' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7499375423760651995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7499375423760651995'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/10/maven2-scm.html' title='Maven2 : SCM'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6039151006224576351</id><published>2010-10-13T16:45:00.001+08:00</published><updated>2010-10-13T16:51:48.093+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Maven2 : Portable Configuration</title><summary type='text'>最近Support中x信托個金的WebATM案子，非常訝異，SCM checkout出來的source code不能compile，四個環境上跑的是哪個版本也不能確定，環境上的configuration也都不能完全確定哪個是正確的，再來改版時的patch是一個個class複製到deployment目錄下，XML或Properties也都是手動一個個修改....拜託，什麼年代了！？能用程式做的就不要手動，寫個maven或ant的設定有這麼麻煩嗎？時間要花在更有義意的事情上，減少手動的工作，也減少人為的錯誤，多出來的時間回去陪家人不是更好些嗎....XML及Properties的變動不外乎兩種方式解決(1)Merge : 在範本檔案以${變數名}做為標記，然後再為不同環境寫不同的設定檔，為每個變數定出符合該環境的值，在Build的時候將範本與變數檔進行Merge，產生該環境專用的檔案，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6039151006224576351/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6039151006224576351' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6039151006224576351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6039151006224576351'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/10/maven2-portable-configuration.html' title='Maven2 : Portable Configuration'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_HqfGenkdwXM/TLVxpUDpMVI/AAAAAAAAAKw/WhT5KKIWWBQ/s72-c/Finder-thumb.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5737522529271921703</id><published>2010-09-09T18:33:00.001+08:00</published><updated>2010-09-10T09:16:31.937+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Improve SimpleDateFormat performance</title><summary type='text'>很久之前，承接了一個寫了一半的案子，自專案開始可以測試起就有一個問題，日期時間資料輸出會偶爾有幾筆顯示為很怪的日期，例如是1977/XX/XX,2032/XX/XX，但是怎麼寫Unit Test就是找不出怎麼發生的，當時年紀小，不知道SimpleDateFormat並非Thread Safe，當時在專案最後被逼得花了五天的時間，就是在找這個問題怎麼能重現，最後突然看到Java Doc裡的說明，真的差點流下淚來.....但是知道SimpleDateFormat不是ThreadSafe後又有另一個問題，要產生一個SimpleDateFormat物件是頗花Resource的，因為裡面包了一個Calendar物件，最初以為使用Clone可以減少消耗Resource，但最後想到，雖然不是Tread Safe，那就讓一個Thread只有一個SimpleDateFormat Instance就好...</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5737522529271921703/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5737522529271921703' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5737522529271921703'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5737522529271921703'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/09/improve-simpledateformat-performance.html' title='Improve SimpleDateFormat performance'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5645457490917828836</id><published>2010-08-25T01:08:00.001+08:00</published><updated>2010-08-25T01:08:04.706+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Form + blockUI</title><summary type='text'>基本的crud操作，個人是相當喜歡在Search時使用jQuery Form來做ajax submit，將結果指到一個div中顯示，這樣的優點是不是再寫任何程式來保留使用者查詢的條件，因為它根本沒被更新過，特別是一些select/option這類還要去比對的部份就不用再費心。至於Create、Update這類的就不用麻煩到用ajax submit，但是必需要考慮到duplicate submit的問題，以往會利用些小方法，像是為每一次要輸入的from建一個id，發現目前這id與之前最後一次收到的id相同時，就取消這次的操作，或是直接disable掉可以操作的button，但利用blockUI可以同時達到告知使用者已經在處理中及防止duplicate submit的效果。下面是簡單的範例筆記&lt;html&gt;
	&lt;head&gt;
		&lt;title&gt;Form&lt;/title&gt;
		&lt;script src</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5645457490917828836/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5645457490917828836' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5645457490917828836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5645457490917828836'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/08/jquery-form-blockui.html' title='jQuery Form + blockUI'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4183416839953585425</id><published>2010-08-23T00:31:00.001+08:00</published><updated>2010-08-23T00:31:43.238+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>jQuery Validation (2)</title><summary type='text'>jQuery Validate還有些設定與使用方式可以利用  Debug mode: 在options中，加入debug:true後，即便是所有validation都沒有錯誤也不會行submit，真的是讓人debug用  &lt;script language="JavaScript"&gt;
$().ready(function() {
	$("#myForm").validate({
		debug : true	
	});
});
&lt;/script&gt;
  submitHandler:預設的submitHandler是在所有validation都通過後直接執行form.submit(),修改default submitHandler可以做兩件事，一是檢查基本validation難以檢查的資料，二是可以改用ajax或其他方式執行submit，而submit之後也可以利用blockui等其他</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4183416839953585425/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4183416839953585425' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4183416839953585425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4183416839953585425'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/08/jquery-validation-2.html' title='jQuery Validation (2)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4172188237512915560</id><published>2010-08-22T16:38:00.001+08:00</published><updated>2010-08-22T22:17:48.718+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JQuery'/><title type='text'>JQuery validation (1)</title><summary type='text'>
Web上的Form Validation實在有相當多種，而各種Web Framework也都各自提供了Validation的基本功能，改用不同的Framework也通常代表要新學一種Validation的機制。再以一個Form看來，雖說看起來可以重覆使用，但實際上同一個Form物件或Model在查尋、新增、修改時所需要的Validation條件通常都不盡相同，為此還需要客製不同的Action設定以供分辨，所以個人覺得比較好的方式是利用JavaScript的solution來處理，一則是易懂，一則是容易通用。

JQuery validation 就是一個非常方便的工具，雖說JQuery官方的JQuery UI也有Formular可以使用，但由於接觸JQuery validation較早，而且也沒有特別的問題，也就一直延用下來。JQuery validation的官網是：http://</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4172188237512915560/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4172188237512915560' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4172188237512915560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4172188237512915560'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/08/jquery-validation-1.html' title='JQuery validation (1)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6674715068720956354</id><published>2010-07-15T14:11:00.001+08:00</published><updated>2010-07-15T14:17:52.830+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Step by Step : Github with EGit</title><summary type='text'>(1)Create Github Repository輸入你要的Project Name即可，在這用的是gitdemo


















Create repository成功後，github會提供repository存取的uri，你可以使用ssh或http，也可以給他人readonly的uri，接下來的操作我選擇使用ssh的uri進行clone與push


















(2) Import git repository and create eclipse project要使用import的方式才能選到Git Repository相關的操作，為什麼用new project的方式就不行，這...





























選Project from Git





















直接按下Clone</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6674715068720956354/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6674715068720956354' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6674715068720956354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6674715068720956354'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/07/step-by-step-github-with-egit.html' title='Step by Step : Github with EGit'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_HqfGenkdwXM/TD6mPiA7aWI/AAAAAAAAAHk/ZMtqUXCDeU8/s72-c/Create_a_New_Repository_-_GitHub-thumb.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5098876080092090871</id><published>2010-07-13T23:43:00.001+08:00</published><updated>2010-07-13T23:43:16.028+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MAC'/><title type='text'>iATKOS!!</title><summary type='text'>由於愈來愈難忍受Eclipse在不同OS有不同的hotkey，所以考量了是將所有OS統一換成Ubuntu或OSX，雖然以前就知道有iATKOS這個在PC上裝Mac OSX的方式，但總是有點半信半疑。。。在前天趁著案子都算到一段落，就抱著姑且一試的想法裝裝看吧，如果裝不起來，那可能就會將MBP裝回Ubuntu工作下去。沒想到安裝過程居然意外地順利，一點問題都沒有.... 真糟糕，Ubuntu 離我愈來愈遠了...後來想想，也可能是我硬體真的算是舊了點，所以支援度較高吧。無論如何，跑得飛快的OSX（相較我那近4年的MBP）還是讓我有著莫名的狂喜。</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5098876080092090871/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5098876080092090871' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5098876080092090871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5098876080092090871'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/07/iatkos.html' title='iATKOS!!'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_HqfGenkdwXM/TDyJiwI426I/AAAAAAAAAHU/JZ5l8OGHtqI/s72-c/About_This_Mac-thumb.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6835573238486164986</id><published>2010-07-12T13:28:00.001+08:00</published><updated>2010-07-12T13:28:52.780+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>If all you have is a hammer, everything looks like a nail</title><summary type='text'>最近這兩個月頗忙，因為要換工作的關係，手上的東西要快點結掉，其中一個案子，在12個工作天左右，寫了大約近8千行的程式，雖然先前對主要流程所訂的lifecycle算是很符合這個案子需要，所在大方向上並沒有什麼問題，但在部份小地方的設計就稍嫌趕了一點。很多東西就是當下想到個大概就動手了，所以有不少程式再回頭看時就覺得有些不當。只是可能沒什麼機會改了.....對於標題，另外有個想法 You may have a hammer, but not everything is a nail.</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6835573238486164986/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6835573238486164986' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6835573238486164986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6835573238486164986'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/07/if-all-you-have-is-hammer-everything.html' title='If all you have is a hammer, everything looks like a nail'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6491842325619987779</id><published>2010-04-23T18:57:00.000+08:00</published><updated>2010-04-23T19:15:41.160+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA2'/><title type='text'>JPA2--Transaction Management</title><summary type='text'>Transaction Type：(1) Resource-local Transaction：Persistence Unit使用native JDBC driver。(2) JTA Transaction：僅能在JEE Server中使用，可以管理distributed XA Transaction。CMEM一定使用JTA Transaction，而在JEE Container 中的AMEM則可在兩者中擇一使用，不在JEE Container 中的AMEM僅能使用Resource-local Transaction。Transaction 與 Persistence Context間的關係:Synchronization: Persistence Context與Transaction註冊，當Transaction committed 時會通知該Persistence Context</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6491842325619987779/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6491842325619987779' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6491842325619987779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6491842325619987779'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/jpa2-transaction-management.html' title='JPA2--Transaction Management'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4006214368456679646</id><published>2010-04-21T19:15:00.000+08:00</published><updated>2010-04-21T19:17:25.383+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA2'/><title type='text'>JPA2--Entity Manager (1)</title><summary type='text'>Entity Manager 藉由Persistence Context來控制被管理的Entity Instances，而每個Persistence Context必定由一個Persistence Unit來限制該Context可以管理的Entity Classes種類。Entity Manager 可以分為兩類Container-Managed Entity ManagerApplication-Managed Entity ManagerContainer-Managed Entity Manager(以下簡稱CMEM)就如同字意上所代表的，是由JEE Container所管理的Entity Manager，主要是以@PersistenceContext標識在你的程式中，Container會在執行期間自動注入對應的instance。CMEM還可以再區分兩類：</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4006214368456679646/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4006214368456679646' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4006214368456679646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4006214368456679646'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/jpa2-entity-manager-1.html' title='JPA2--Entity Manager (1)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2759041152605376971</id><published>2010-04-13T12:44:00.001+08:00</published><updated>2010-04-14T08:04:15.332+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JPA2'/><title type='text'>JPA(2)--Relationship</title><summary type='text'>
跟原先Hibernate設定一樣，想清楚Directionality、Cardinality及Ordinality
只要能分辦@OneToOne@OneToMany@ManyToOne@ManyToMany差在哪就好.....
區別Owning side及Inverse SideOwning Side：記錄Relationship那一方，記有@JoinColumnInverse Side：未記有@JoinColumn，在Bidirectional relationship時需加上mappedBy=XXX
基本上@ManyToOne的幾乎都是Owning Side@OneToMany的幾乎都是Inverse Side@ManyToMany較為特別，因為在Bidirectional情況下，雙方都可能是Owning Side，但仍需決定哪一方為Owning Side，也就是在Inverse </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2759041152605376971/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2759041152605376971' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2759041152605376971'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2759041152605376971'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/jpa2-relationship.html' title='JPA(2)--Relationship'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3333511834920411959</id><published>2010-04-12T18:07:00.000+08:00</published><updated>2010-04-13T07:58:56.130+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA2'/><title type='text'>JPA2(1)--Basic Annotation</title><summary type='text'>
@Entity當Class被標識為@Entity，代表這個Class可以被persist至DB，而該Class中的Field除特別以@Transient標記外皆預定會被儲存。
@Id每個Entity都需要ID做為識別的基準，產生ID的方式由@GeneratedValue來決定@GeneratedValuestrategy =&gt; GenerationType:AUTO, TABLE, SEQUENCE, IDENTITYGenerationType.AUTO 雖然方便，但建議僅供開發或Prototyping使用GenerationType.TABLE 再利用@TableGenerator來指定記錄key的Table相關資料GenerationType.SEQUENCE 部份DB支援Sequence, 利用DB的Sequence功能，也可以使用@SequenceGenerator來指定</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3333511834920411959/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3333511834920411959' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3333511834920411959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3333511834920411959'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/jpa21-basic-annotation_12.html' title='JPA2(1)--Basic Annotation'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5483015021188236378</id><published>2010-04-12T12:17:00.001+08:00</published><updated>2010-04-12T12:17:47.376+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='Struts2'/><title type='text'>StrutsSpringTestCase</title><summary type='text'>  Struts2的Unit Test說容易也是真的不麻煩，但如果希望測試得仔細些又要頗費力氣，還好在2.1.8時將一直沒有Commit到release repository的StrutsSpringTestCase放了出來，使Unit Test又更加方便。 下列寫個簡單例子：   

public class FirstActionTest extends StrutsSpringTestCase{
	 public void testAction() throws Exception {  
		  ActionProxy actionProxy  = this.getActionProxy ( "first!index.action");  
		  Assert.assertNotNull(actionProxy);  
		  FirstAction action = (</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5483015021188236378/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5483015021188236378' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5483015021188236378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5483015021188236378'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/strutsspringtestcase.html' title='StrutsSpringTestCase'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7317267281673514672</id><published>2010-04-12T11:46:00.001+08:00</published><updated>2010-04-12T11:48:51.322+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='JPA2'/><title type='text'>Spring3與JPA2 （1）</title><summary type='text'>
ORM的選擇很多，雖然JEE訂出了一個規格JPA，但之前並不喜歡使用，主要是因為相較其他原生的library像Hibernate, Eclipse Link等，JPA在實際開發上並不如其他Library來得方便，沒有像Hibernate的Criteria這類API就令我很感冒，所以在ORM的Demo裡一直沒有把JPA納入，多半使用的都還是Hibernate。

直到JPA2規格訂完，Hibernate也出了Stable的版本，想想也該納入看一看了。Hibernate與JPA所訂的EntityManager差異還不小，從中轉換還是要看一下JPA2的Spec，但我發現花較多時間的是在Spring的Configuration，要設定的部份較原來的純Hibernate要多出不少，而且有些我看了還是有些疑惑，看來單單有關Configuration就要寫上幾篇筆記了。

下列是基本的Spring </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7317267281673514672/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7317267281673514672' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7317267281673514672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7317267281673514672'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/spring3jpa2-1.html' title='Spring3與JPA2 （1）'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3685842575867490842</id><published>2010-04-08T19:00:00.001+08:00</published><updated>2010-04-08T23:58:03.854+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>m2eclipse與Jetty 7</title><summary type='text'>
Jetty是一個小巧又能高度客製化的Servlet Container，在很多場合可能會比Tomcat要來得方便，但是在配合Eclipse開發時有點缺憾，就是Jetty配合可用的Server Adapter更新不快，Jetty7至今仍未有一個方便的Server Adapter可以像使用Tomcat一樣快速Deploy，不過利用m2eclipse也可以減少利用Jetty7開發時的不便。第一步：當然是要會裝m2eclipse....第二步：修改pom.xml，加入maven-jetty-plugin
&lt;plugin&gt;
 &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
 &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
 &lt;version&gt;7.0.2.v20100331&lt;/version&gt;
 &lt;configuration&gt;
 &lt;</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3685842575867490842/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3685842575867490842' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3685842575867490842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3685842575867490842'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/m2eclipsejetty-7.html' title='m2eclipse與Jetty 7'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_HqfGenkdwXM/S723MXh_A4I/AAAAAAAAAGE/J6mQp-yi3Jg/s72-c/Jetty_Run1-thumb.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7255068307140763184</id><published>2010-04-08T12:19:00.001+08:00</published><updated>2010-04-08T12:24:52.663+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>套用Maven2在Eclipse上的Dynamic Web Project</title><summary type='text'>這問題在最近一個月被問了三次，雖然沒什麼價值，想想還是寫出來好了。不少朋友用Eclipse開了個Dynamic Web Project後再想加入Maven2作為Build Tool，但是由於兩者間的目錄結構不同而頗為困擾，這種情形下我比較建議修改pom.xml以符合現行Project的結構。&lt;build&gt;
    &lt;sourcedirectory&gt;${basedir}/src&lt;/sourcedirectory&gt;  
    &lt;outputdirectory&gt;${basedir}/build/classes&lt;/outputdirectory&gt;  
    &lt;resources&gt;  
     &lt;resource&gt;  
     &lt;directory&gt;${basedir}/src&lt;/directory&gt;  
      &lt;includes&gt;  
       &lt;include&gt;*.xml&lt;/</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7255068307140763184/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7255068307140763184' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7255068307140763184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7255068307140763184'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/04/maven2eclipsedynamic-web-project.html' title='套用Maven2在Eclipse上的Dynamic Web Project'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-842238335622238683</id><published>2010-03-24T15:43:00.000+08:00</published><updated>2010-03-24T17:58:08.819+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Branch named master</title><summary type='text'>git init --no branch created.touch READMEgit add README -- still no branch created.git commit -m 'first commit' -- create a new branch named 'master', you have no choose....git remote add origin git@github.com:AccountName/reponame.git --you can change 'origin' to any word you likegit push origin master -- If you don't like 'master', you have to use 'git checkout -b' and 'git branch -d master' to </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/842238335622238683/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=842238335622238683' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/842238335622238683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/842238335622238683'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/03/branch-named-master.html' title='Branch named master'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-1197251876344264412</id><published>2010-03-24T09:48:00.000+08:00</published><updated>2010-03-24T15:41:55.536+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Blogo 測試</title><summary type='text'>私以為Git File Lifecycle 是這樣的</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/1197251876344264412/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=1197251876344264412' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1197251876344264412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1197251876344264412'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/03/blogo.html' title='Blogo 測試'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_HqfGenkdwXM/S6nCP01UFVI/AAAAAAAAAF4/7MY79QbXWFI/s72-c/Slide2-thumb.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5145045013311321766</id><published>2010-02-23T16:11:00.000+08:00</published><updated>2010-02-23T16:18:54.953+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>State Pattern</title><summary type='text'>
State Pattern這個入門的Design Pattern，我想大多數人都不陌生，只是我工作這麼久，幾乎沒有看別人使用過，多半都是用if {} else {}, switch case來處理，這是我比較不能理解的情形。
一個程式有多種State，而且需要依目前不同State做出不同的反應，幾乎是每個系統一定會有的，
像電信業的使用者多半有prepaid, postpaid, unsubscribe，np等多種State；
還有所謂的Task，可能有Init, Scheduled, Triggered, Success, Fail等State，我看到的程式幾乎都是將State開放交給在外部程式利用setter來改變。
這樣也不是說不好，如果控制得當，系統當然也不會有什麼大問題，但是在每次系統要做事之前，一定要經過一大堆的State判斷，可能是if else，也可能是switch，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5145045013311321766/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5145045013311321766' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5145045013311321766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5145045013311321766'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/02/state-pattern.html' title='State Pattern'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3606370993085660886</id><published>2010-02-12T23:57:00.000+08:00</published><updated>2010-02-13T00:00:24.984+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Annotations'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Guice  Injector and Spring AnnotationConfigApplicationContext</title><summary type='text'>目前Dependency Injection Framework比較活躍的除了Spring外就是Google的Guice了，Guice以Annotation為主，不需要複雜的設定檔，很容易就能上手，而且所需要的Library很小，對於一些比較小的系統，不希望使用太多Library的開發者而言（例如Android)，Guice提供了一個較Spring有利的DI Framework。

Spring在使用Annotation上有些舊包袱，但在JSR-299,JSR-330後也逐漸為大家接受，但是在3.0之前，仍需要一個XML設定檔，相較Guice完全不用的情形下是有些許的不便（當然2.5自己加工一下也是可以達成不用讀取XML而直接使用Annotaion）。

Spring3.0多了個AnnotationConfigApplicationContext，可以讓我們完全不用讀取任何XML</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3606370993085660886/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3606370993085660886' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3606370993085660886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3606370993085660886'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/02/guice-injector-and-spring.html' title='Guice  Injector and Spring AnnotationConfigApplicationContext'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2475750905937596223</id><published>2010-01-27T18:13:00.000+08:00</published><updated>2010-01-27T18:13:34.758+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Annotations'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Annotation: Inherited</title><summary type='text'>java.lang.annotation中@Retention跟@Target都很容易瞭解，但＠Inherited就比較麻煩些，所以簡單列個例子來看＠Inherited的影響。
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Inherited
public @interface InheritedAnn {

}

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface NonInheritedAnn {

}
上列兩個Annotation僅差別在有無@Inherited。簡單看一下@Inherited對extends跟</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2475750905937596223/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2475750905937596223' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2475750905937596223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2475750905937596223'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/01/java-annotation-inherited.html' title='Java Annotation: Inherited'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3256196639850833434</id><published>2010-01-25T17:55:00.000+08:00</published><updated>2010-01-25T18:00:19.539+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>測量執行時間的小工具</title><summary type='text'>我想每個人程式寫久了都會有些小工具，例如StringUtils、DateTimeUtils等，這可能是整個Team所累積的，如果能分享下應該也不錯吧。

這裡提供個測量執行時間的小API，雖說AOP可以測量每個Method所花的時間，但比較耗時，而且偶爾也有AOP不方便的時候。我常用的是下面這種方法。
TrackingStack.enable();
TrackingStack.push("Execution");
TrackingStack.push("Step1");
//Does something
TrackingStack.pop("Step1");
  
TrackingStack.push("Step2");
//Does something
TrackingStack.pop("Step2");
TrackingStack.pop("Execution");
</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3256196639850833434/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3256196639850833434' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3256196639850833434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3256196639850833434'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/01/blog-post.html' title='測量執行時間的小工具'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7774774177200232480</id><published>2010-01-25T15:32:00.000+08:00</published><updated>2010-01-25T15:32:13.111+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>利用MDC簡化取得特定對象Log資料的方法</title><summary type='text'>這是半反省文。

以往要想取得某一使用者操作過程所產生的Log，由於我會將User放在ThreadLocal中，所以想到的做法就是在LogPattern中加入一個{},並每次自ThreadLocal中取出，例如下列這樣
logger.info("user{} does something.", ThreadLocalHolder.getUserName);
logger.info("user{} create role{}.", ThreadLocalHolder.getUserName, role);
這樣可以很方便的用grep取回這User相關的Log而濾掉非必要的Log.

但是log4j跟logback都有一個Class叫MDC(Mapped Diagnostic Context)，可以更簡單地達到這個功能。只要在取得User的那個Filter或是Intercepter，放入</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7774774177200232480/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7774774177200232480' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7774774177200232480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7774774177200232480'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2010/01/mdclog.html' title='利用MDC簡化取得特定對象Log資料的方法'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5615096199085155831</id><published>2009-12-25T15:54:00.000+08:00</published><updated>2009-12-25T15:57:18.679+08:00</updated><title type='text'>Callback just like?</title><summary type='text'>這篇想寫有段時間了,因為前兩週有個工作多年的同行在問,callback是什麼....但一直沒寫的原因是不想畫圖,不想寫sample code...

Callback是什麼?看起來很容易啊,就"叫回去"咩...似乎"回去叫"比較符合文法,這是簡單基本的東西,連Design Pattern都不屑列進去,但是只寫Java的人可能比較不能想像,因為Java沒有function pointer,所以比較不容易舉例,反而是寫過C(++),JavaScript的人比較容易理解.
簡單說, Callback就是將function當做參數傳給被呼叫的程式, 只碰Java的應該就頭大了,將function(method)當參數?!
先談談程式運作的模式吧,用別人的Library寫系統有幾種方式,

一是事必躬親,站在旁邊看著別人做完一步,再決定下一步要做什麼

二是先告訴對方我是誰,能做什麼事,</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5615096199085155831/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5615096199085155831' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5615096199085155831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5615096199085155831'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/12/callback-just-like.html' title='Callback just like?'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7321223698318091725</id><published>2009-12-04T15:20:00.000+08:00</published><updated>2009-12-04T15:20:57.504+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>病貓</title><summary type='text'>有人跟我抱怨為什麼用Eclipse ＋ m2eclipse deploy web project到tomcat時，老是㑹將servlet-api-XXX.jar跟jsp-api-XXX.jar丢到WEB-INF/lib下，結果tomcat就變成起不來的病貓,可是經我個人反覆測試，pom.xml中的dependency只要有加&lt;scope&gt;provided&lt;/scope&gt;，一定不㑹被丟到WEB-INF/lib。遇到這種見鬼的事情，第一件要做的事當然是...拿乖乖去拜你的電腦（誤 
有幾個選擇可以解決
(1)自己砍掉WEB-INF/lib中的servlet-api.jar jsp-api.jar，缺點是每次你有改變dependency時就要再做一次。
(2)將serlvet-api跟jsp-api的dependency的設定移到profile中，然後在project-&gt;Java build </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7321223698318091725/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7321223698318091725' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7321223698318091725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7321223698318091725'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/12/blog-post.html' title='病貓'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7512919279189646876</id><published>2009-11-20T11:26:00.000+08:00</published><updated>2009-11-20T11:26:50.052+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache2'/><title type='text'>Apache2 mod_ssl : SSLPassPhraseDialog</title><summary type='text'>最近都在處理platform的事，好像很久沒coding...

SSL的private key可以用來保護，但在一般server上為了方便，常㑹使用去除Pass Phrase的key，否則每次啟動都要輸入Pass Phrase，對我這種不太重視資安的人是比較麻煩些。

這次遇到的問題是Apache2 SSL module用的private key一定要用Pass Phrase，平時沒在用的功能，只好推說要回去確認，再回家拜請Google大神，不過答案在Apache2的mod_ssl文件中就很淸楚了


改一下mod_ssl.conf，只要把原來

SSLPassPhraseDialog builtin
改成
SSLPassPhraseDialog exec:/ect/apache2/key.sh #位置，檔名隨你高興

key.sh只要這様寫
#!/bin/bash
echo '</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7512919279189646876/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7512919279189646876' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7512919279189646876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7512919279189646876'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/11/apache2-modssl-sslpassphrasedialog.html' title='Apache2 mod_ssl : SSLPassPhraseDialog'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4134366349424970814</id><published>2009-11-11T10:13:00.000+08:00</published><updated>2009-11-11T10:33:34.075+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>How many open files on unix like server?</title><summary type='text'>有人遇到開啟檔案超過上限的問題，就隨手列了下來，這應該只是一篇噗文就能解決的。。。

1.簡易計算法
unixlike$ lsof | wc -l
5124
2.正式確認法
unixlike$ cat /proc/sys/fs/file-nr
6144 0 125039
-------------
(1) (2) (3)
(1)The number of allocated file handles
(2)The number of allocated but unused file handles
(3)The maximum number of file handles
要修改可開啟的檔案數量上限，請修改/proc/sys/fs/file-max,這動作做完要重開就是了。開啟檔案超過上限這個問題通常只在server上會遇到，大部份處理platform的人應該都知道，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4134366349424970814/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4134366349424970814' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4134366349424970814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4134366349424970814'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/11/how-many-open-files-on-unix-like-server.html' title='How many open files on unix like server?'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3121623922599675038</id><published>2009-10-27T17:47:00.000+08:00</published><updated>2009-10-27T17:47:56.393+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>emma-maven-plugin always executes test cases twice</title><summary type='text'>這是碎碎唸如果同時要出Emma Code Coverage跟Surefire Test report的話，一定要跑2次 Unit Test，聽起來很合理，但其實根本就不用。只要在Surefire執行前先將test classes做instrument，這様測出來的就是具有coverage的unit test.
&lt;plugin&gt;
 &lt;groupId&gt;org.sonatype.maven.plugin&lt;/groupId&gt;
 &lt;artifactId&gt;emma-maven-plugin&lt;/artifactId&gt;
 &lt;version&gt;1.1&lt;/version&gt;
 &lt;inherited&gt;true&lt;/inherited&gt;
 &lt;executions&gt;
  &lt;execution&gt;
   &lt;id&gt;instrument&lt;/id&gt;
   &lt;phase&gt;process-classes&lt;/phase&gt;
   &lt;</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3121623922599675038/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3121623922599675038' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3121623922599675038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3121623922599675038'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/10/emma-maven-plugin-always-executes-test.html' title='emma-maven-plugin always executes test cases twice'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-994808532857543959</id><published>2009-10-20T09:38:00.000+08:00</published><updated>2009-10-20T10:27:26.058+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Spring'/><category scheme='http://www.blogger.com/atom/ns#' term='Hibernate'/><title type='text'>hibernate3-maven-plugin直接使用Spring AnnotationSessionFactoryBean</title><summary type='text'>新公司有自己的一套Framework，並自行開發一套code gen的工具，稍為喚起了我曽經用過Hibernate Tools的記憶，一方面是因為用了JDK5的Generic後，要寫的Code變少，另一方面也是因為如果有修改，code gen出來的東西比較不易配合更動，所以也沒有納入我常用的工具之一。不過既然想起了Hibernate tools，那就再用用看有沒有什麼改變，或許會有驚喜吧。不過似乎沒有…特別是不能直接用Spring Configuration Xml中已經訂好的設定，一定要另訂hibernate.cfg.xml，這就又讓我難過了一下，再發現居然連hibernate3-maven-plugin也無法直接使用Spring 裡訂好的AnnotationSessionFactoryBean或LocalSessionFactoryBean，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/994808532857543959/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=994808532857543959' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/994808532857543959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/994808532857543959'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/10/hibernate3-maven-pluginspring.html' title='hibernate3-maven-plugin直接使用Spring AnnotationSessionFactoryBean'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8337203744924219386</id><published>2009-10-14T13:44:00.000+08:00</published><updated>2009-10-14T13:44:28.752+08:00</updated><title type='text'>載入特定目錄下的jar做為CLASSPATH</title><summary type='text'>一種是用FIND
#!/bin/sh

CLASSPATH=`find lib -name *.jar|xargs|sed "s/ /:/g"`
CLASSPATH=".:$CLASSPATH"
echo $CLASSPATH

另一種就是自己組囉…
#!/bin/sh

CLASSPATH=.
for file in lib/*;
do CLASSPATH=${CLASSPATH}:$file;
done
echo $CLASSPATH
</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8337203744924219386/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8337203744924219386' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8337203744924219386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8337203744924219386'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/10/jarclasspath.html' title='載入特定目錄下的jar做為CLASSPATH'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4228085932886587788</id><published>2009-09-18T15:01:00.000+08:00</published><updated>2009-09-18T15:20:05.209+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸（8）</title><summary type='text'>一直來就想做件事，租個虛擬主機，掛個Apache + Subversion，這樣我在外頭也可以改改自High的demo，回家後也不用開MBP來sync程式到我的Desktop，但一方面是不確定是否能正常運作，一方面也不想多這筆開銷（在家用ADSL自己架？我可不想天天擔心家裡電器走火…），所以一直沒有付諸實行，但最近因為玩Ruby的關係，接觸到了GIT，發現有免錢的github，真是一整個高興！Eclipse上的pluging “egit”雖然有點不成材，但用git protocol來接github倒沒出什麼事，只可惜了我的iPhone 3GS，JB後裝的git 跟subversion 就沒什麼用了…</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4228085932886587788/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4228085932886587788' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4228085932886587788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4228085932886587788'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/09/8.html' title='碎碎唸（8）'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-832357560660023178</id><published>2009-09-16T10:45:00.000+08:00</published><updated>2009-09-17T16:54:04.447+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Nexus : Maven Repository Server</title><summary type='text'>Nexus，一個Maven Repository Server，在區網內如果架設一個Nexus來提供開發人員使用，可以有效減少對外網路頻寬的浪費，也提供一個可以管理團隊自行開發library的機制，之前較多使用的是Apache Archiva，但是Archiva較為複雜，相較之下Nexus則無論在安裝上跟管理上都較為容易。  以下是我在Ubuntu 8.10 與 Tomcat 6.0.18下安裝的方式 Download nexus-webapp-XXX.warNexus的下載頁面在 http://nexus.sonatype.org/downloads/ ，雖然Nexus也有自帶jetty的版本，但我還是打算使用webapp來安裝，所以下載的是nexus-webapp-XXX.war。

Deploy nexus-webapp-XXX.war將war改名為nexus.war後直接丟到${</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/832357560660023178/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=832357560660023178' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/832357560660023178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/832357560660023178'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/09/nexus-maven-repository-server.html' title='Nexus : Maven Repository Server'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-1124203034056151269</id><published>2009-09-04T14:57:00.000+08:00</published><updated>2009-09-04T15:13:26.405+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu &amp; git-daemon</title><summary type='text'>既然git是distributed revision control system, 所以除了server外,每個開發人員也應該要有完整的git操作環境,但不是每個開發人員都需要有apache這種httpd server,還好git本身有提供git-daemon來讓開發人員交流手上的source clone,git-daemon很容易,指定base-path就好,但是如果希望開機時自動載入的話可以試試安裝下這個package:

sudo apt-get insall git-daemon-run

安裝好了之後改一下 /etc/sv/git-daemon/run, 將"--base-path=xxxx"指到你git repositories 的root path, 然後在每一個你要share出來的git repository中下一個指令建立magic file

touch </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/1124203034056151269/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=1124203034056151269' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1124203034056151269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1124203034056151269'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/09/ubuntu-git-daemon.html' title='Ubuntu &amp; git-daemon'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4635295183306557770</id><published>2009-09-02T15:04:00.002+08:00</published><updated>2009-09-02T23:53:15.555+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Maven2: Profile</title><summary type='text'>通常在一個專案中，執行的環境通常不㑹只有一個，大多數的情形是3個，真正上線的Production環境，上線前的測試Staging環境，還有就是開發人員自己開發時用的Personal環境，所以在Package時自然應該要有不同的Script來處理不同環境下的設定檔，不然用人工的話很容易發生開發人員將Personal的設定檔包入Production要用的deployment file。Server起不來就算了，就怕滙入了什麼不該滙的，或是砍了什麼不能砍的…

早期使用Ant時，properties跟xml不是用merge就是用replace的，Maven的做法也不例外，只是Ant要寫不少個ant task，但Maven不用，當然，過於思念或割捨不下Ant時，仍然可以透過Ant run在Maven中讓你與Ant相逢。

下面舉個小小的例子，使用profile來區分不同的環境下使用的同名設定檔。</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4635295183306557770/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4635295183306557770' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4635295183306557770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4635295183306557770'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/09/maven2-profile_4848.html' title='Maven2: Profile'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_HqfGenkdwXM/Sp4rv8LFYRI/AAAAAAAAADs/2QgExz-_NmQ/s72-c/profile_structure.tu4fAfcdsJOA.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-1681214579733661419</id><published>2009-09-02T10:54:00.000+08:00</published><updated>2009-09-02T15:00:19.817+08:00</updated><title type='text'>MacJournal Test</title><summary type='text'>Test for new tool - MacJournal....


    junit
    junit
    4.6
    jar
    compile

</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/1681214579733661419/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=1681214579733661419' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1681214579733661419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1681214579733661419'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/09/macjournal-test.html' title='MacJournal Test'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8093790402047919663</id><published>2009-08-12T17:49:00.004+08:00</published><updated>2009-08-12T18:21:52.347+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring3'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Spring3 Maven Repository</title><summary type='text'>Spring repositories
由於Spring3還是在測試階段，所以並沒有把library放到多數公開的repository上，所以要取用的話必需加些repository到maven裡

&lt;repositories&gt;
    &lt;repository&gt;
        &lt;id&gt;SpringSource Enterprise Bundle Repository - External Bundle Milestones&lt;/id&gt;
        &lt;url&gt;http://repository.springsource.com/maven/bundles/milestone&lt;/url&gt;
    &lt;/repository&gt;
    &lt;repository&gt;
        &lt;id&gt;SpringSource Enterprise Bundle Repository - </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8093790402047919663/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8093790402047919663' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8093790402047919663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8093790402047919663'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/08/spring3-maven-repository_4880.html' title='Spring3 Maven Repository'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4609767655977888183</id><published>2009-08-06T16:51:00.001+08:00</published><updated>2009-08-06T16:54:22.086+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>為什麼VCS要能透過HTTP存取對我很重要</title><summary type='text'>有朋友問著，Subversion用svn protocol，Git就用git protocol，設定起來不是比較容易嗎？
當然，在Intranet裡，通常你要怎麼用都沒問題，問題是當你離開辦公室後，或是特別的因素開發人員必需分隔兩地時，能不能透過HTTP來存取VCS就很重要了。
從公司內部來看，很少MIS會願意特別幫我在防火牆上去開svn, git要用的port，要不然也要經過相當麻煩的申請手續，除非我就是那個網路管理者。
從身在他地的人來看，如果是在自己家中還好，不會特別去關svn, git用到的port，但是如果是身在其他公司內會有網路使用限制的人，恐怕連pop3/smtp, ftp都不能連了，更不用提這些svn, git所用的port。
所以能透過最不容易被擋的HTTP存取VCS的重要性就在這囉。

</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4609767655977888183/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4609767655977888183' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4609767655977888183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4609767655977888183'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/08/vcshttp.html' title='為什麼VCS要能透過HTTP存取對我很重要'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5666714518222087037</id><published>2009-08-06T15:03:00.001+08:00</published><updated>2009-08-06T15:04:41.055+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache2'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Apache2 + SSL on Ubuntu 8.10</title><summary type='text'>主要是參照SSL on Ubuntu 8.10 Apache2(1)Open Apache SSL Module

sudo a2enmod ssl
(2)Create server's private key and certificate

cd /etc/apache2
sudo openssl genrsa -des3 -out server.key 1024
sudo openssl req -new -key server.key -out server.csr
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
這時會問些國家、公司之類的問題，照著回答就OK了，回答的資料會顥示在Browser的憑證清單裡
(3)Install the key and </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5666714518222087037/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5666714518222087037' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5666714518222087037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5666714518222087037'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/08/apache2-ssl-on-ubuntu-810.html' title='Apache2 + SSL on Ubuntu 8.10'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-1023565514556692824</id><published>2009-08-05T15:39:00.001+08:00</published><updated>2009-08-05T16:08:52.206+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><category scheme='http://www.blogger.com/atom/ns#' term='Apache2'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>GIT + Apache2 on Ubuntu 8.10 (1)</title><summary type='text'>前言
很早前就聽過GIT這個分散式的VCS，但是因為Subversion對我而言實在相當夠用，一直沒有想要更換的念頭，直到最近開始用了JRuby
才有了用用看的念頭，花了點時間確認GIT可以透過Apache走HTTP/HTTPS來checkin/checkout，而且Maven的SCM也支援GIT，
就開始了跟GIT奮戰的過程，我想至少花了4小時才確認這個GIT的Service是可用的。主要是因為不熟GIT的command，無法確認是否正
常。
安裝
(0)由於我已經有安裝了Apache2與Subversion，所以略過Apache2及DAV module的安裝，並且採用Subversion的帳號密碼檔
(1)安裝git-core curl

$&gt;sudo apt-get install git-core curl

這時執行

$&gt;git --version


應該會出現下到訊息，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/1023565514556692824/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=1023565514556692824' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1023565514556692824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/1023565514556692824'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/08/git-apache2-on-ubuntu-810-1.html' title='GIT + Apache2 on Ubuntu 8.10 (1)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6073811687390362442</id><published>2009-07-29T16:45:00.001+08:00</published><updated>2009-07-29T16:45:35.749+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>其實，我想知道你聽到的是什麼</title><summary type='text'>以下這對話經常出現在我高中下課後
我：香草霜淇淋一個
店員：先生，請問你要什麼口味
我：…
我真的很想知道，你們聽到的是什麼

</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6073811687390362442/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6073811687390362442' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6073811687390362442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6073811687390362442'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/blog-post_29.html' title='其實，我想知道你聽到的是什麼'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5124853789167140949</id><published>2009-07-24T16:26:00.000+08:00</published><updated>2009-07-24T16:52:25.231+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Tomcat'/><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>APR for Tomcat6 on Ubuntu 8.10</title><summary type='text'>常用Tomcat的朋友對下面的WARN Message應該不陌生

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/i386:/lib:/usr/lib:/usr/lib/jni

如果不理他其實也沒什麼影響，只是看久了也會難過，依以往用tomcat的經驗，就是download apr的source，再make install就好了，不過還是Google了一下，果然發現Ubuntu有自帶的package，還好沒做白工自己compile，然後就很開心的執行了下面的cmd

sudo apt-get </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5124853789167140949/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5124853789167140949' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5124853789167140949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5124853789167140949'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/apr-for-tomcat6-on-ubuntu-810.html' title='APR for Tomcat6 on Ubuntu 8.10'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5275996381732470601</id><published>2009-07-21T11:38:00.001+08:00</published><updated>2009-07-21T11:38:40.818+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><title type='text'>介於陰影與靈魂之間</title><summary type='text'>------------------------------------------------------------------------------
【聶魯達一百首情詩－17】 聶魯達著/陳黎‧張芬齡譯
我愛你，但不把你當成玫瑰，或黃寶石，
或大火射出的康乃馨之箭。
我愛你，像愛戀某些陰暗的事物，
秘密地，介於陰影與靈魂之間。
我愛你，把你當成永不開花
但自身隱含花的光芒的植物；
因為你的愛，某種具體的香味
自大地升起，暗自生活於我的體內。
我愛你，不知該如何愛，何時愛，打哪兒愛起。
我對你的愛直截了當，不複雜也不傲慢；
我如是愛你，因為除此之外我不知道
還有什麼方式：我不存在之處，你也不存在，
如此親密，你擱在我胸前的手便是我的手，
如此親密，我入睡時你也闔上雙眼。
--------------------------------------------------------</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5275996381732470601/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5275996381732470601' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5275996381732470601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5275996381732470601'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/blog-post_20.html' title='介於陰影與靈魂之間'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7544466277100271626</id><published>2009-07-21T07:56:00.001+08:00</published><updated>2009-07-21T07:56:40.521+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>logback： 將各個log file依日期存放在同一目錄</title><summary type='text'>偶爾會有這樣的需求，希望同一天的Log都在同一個目錄下，這時只要將TimeBasedRollingPolicy的FileNamePattern用
%d{yyyy/MM/dd/}/這類的Pattern就可以達成囉。

請見以下例子

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;configuration debug="true"&gt;
	&lt;appender name="SYSTEM" class="ch.qos.logback.core.rolling.RollingFileAppender"&gt;
		&lt;Prudent&gt;true&lt;/Prudent&gt;
		&lt;rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"&gt;
			&lt;FileNamePattern&gt;%d{yyyy/MM</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7544466277100271626/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7544466277100271626' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7544466277100271626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7544466277100271626'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/logback-log-file.html' title='logback： 將各個log file依日期存放在同一目錄'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8729197792780427637</id><published>2009-07-20T16:57:00.001+08:00</published><updated>2009-07-20T16:57:25.725+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>logback 二、三事</title><summary type='text'>
(1)要用Logback當然就一併用slf4j，Maven2的dependencies就加入：

&lt;dependency&gt;
	&lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
	&lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
	&lt;version&gt;0.9.16&lt;/version&gt;
	&lt;type&gt;jar&lt;/type&gt;
&lt;/dependency&gt;
&lt;!-- 用以取代commons-logging --&gt;
&lt;dependency&gt;
	&lt;groupId&gt;org.slf4j&lt;/groupId&gt;
	&lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
	&lt;version&gt;1.5.8&lt;/version&gt;
	&lt;type&gt;jar&lt;/type&gt;
&lt;/dependency&gt;
&lt;!-- 用以取代Log4j，若確定系統中都是透過</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8729197792780427637/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8729197792780427637' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8729197792780427637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8729197792780427637'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/logback.html' title='logback 二、三事'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2085164904556116686</id><published>2009-07-17T16:34:00.001+08:00</published><updated>2009-07-17T16:34:19.539+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>不要舉報我</title><summary type='text'>西斯版為什麼好笑？請見範例，現在還是看一遍笑一遍啊
－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－－
作者: ohyeahhh (古大熙) 看板: sex標題: [心得] 近來西斯版的文章
時間: Tue Jun 9 21:18:37 2009
現在我依最近西斯版回文較多的文章題目，來後以各板可能的推文來加以分析
如有不同意或不正確之處，還請各位板友不吝嗇指正


[討論] 如果強暴罪最重可求處死刑...

Joke →：笑點勒 幹你娘 我走錯板了嗎
Boy-Girl →：愛不是這樣的，怎麼會有人在沒有愛的情況下還可以發生這種事
法西斯 →：那些賤男人，最好通通都給老娘我去死一死
西斯板 →：改判肛刑，讓牠們知道被捅的滋味，五樓你說好嗎
→：五樓都跟士官長肛肛好了，他沒再怕
→：電梯向下


[認真]女生在床上的時候,該叫些什麼

Joke →：笑點勒 幹你娘 </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2085164904556116686/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2085164904556116686' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2085164904556116686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2085164904556116686'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/blog-post.html' title='不要舉報我'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-601777499543721037</id><published>2009-07-17T14:16:00.000+08:00</published><updated>2009-07-17T14:27:04.534+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸（7）</title><summary type='text'>以往下了班就是隨便買點東西，開了Windows桌機就等WOW的登入畫面（我的WOW是放在Windows的啟動....羞）。現在呢，下了班也是隨便買點東西，開了一台Ubuntu的桌機、一台Ubuntu的筆電跟一台Mac mini，然後就是LPIC跟Ruby交替看著，Mac mini就乖乖當著動物機跑。那這些有什麼好碎碎唸？
Ubuntu 9.04支援ext4，實在是頗快啊！而且常用到的Apache2, Tomcat6, Subversion 1.5.4，要設定的東西實在愈來愈少，東西做這麼好，我以後離不開怎麼辦，公司裡那台Red Hat Server實在想丟掉啊。
從開始用Ubuntu當Server，不再單純只當Coding的開發機，發現自己有很多的錯誤觀念，沒事自己在自己home folder建個java 目錄幹什麼，tomcat跟maven不用Ubuntu綁定的話就下載後丟到/opt</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/601777499543721037/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=601777499543721037' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/601777499543721037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/601777499543721037'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/7.html' title='碎碎唸（7）'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-3372152001669858397</id><published>2009-07-15T11:03:00.001+08:00</published><updated>2009-07-15T11:12:19.601+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Maven:Properties</title><summary type='text'>Maven:Properties

本篇是參考MavenPropertiesGuide整理的

Maven在POM中可以用的Properties大約可以分為下列幾種
（1）Build in Properties
	${basedir}:取得mvn執行時pom.xml的所在目錄
（2）Project Properties
	基本上pom.xml中所有的tag都是算在這類，只要加上project這個prefix即可。
	${project.name}:可以拿到&lt;name&gt;yourprojectname&lt;/name&gt;中的yourprojectname。
	${project.version}:可以拿到&lt;version&gt;buildversion&lt;/version&gt;中的buildversion。
	${project.build.directory}:可以拿到&lt;build&gt;&lt;directory&gt;</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/3372152001669858397/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=3372152001669858397' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3372152001669858397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/3372152001669858397'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/1.html' title='Maven:Properties'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-7249134288559516566</id><published>2009-07-13T17:26:00.000+08:00</published><updated>2009-07-13T17:33:13.883+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Maven: Create Eclipse Project</title><summary type='text'>用Maven建立Eclipse Project其實頗為容易，第一步用plugin: archetype建立Maven Project，第二步再用plugin: eclipse建立Eclipse要用的設定檔，再來用Eclipse import即可。1. run mvn archetype:generate

&gt;$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/7249134288559516566/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=7249134288559516566' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7249134288559516566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/7249134288559516566'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/maven-create-eclipse-project.html' title='Maven: Create Eclipse Project'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_HqfGenkdwXM/Slr1rqRvuBI/AAAAAAAAAC8/DC3XMdFOcrU/s72-c/2009071301.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5730303950769911641</id><published>2009-07-13T15:01:00.001+08:00</published><updated>2009-09-14T16:19:43.589+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Maven2'/><title type='text'>Maven: Basic Concepts（Lifecycle, Phase, Goal)</title><summary type='text'>Lifecycle / Phase / Goal
A build lifecycle is made up of phases.
lifecycle將各phase有順序性的串連起來，所以當你指定執行一個phase時，maven將會執行排在其之前的所有phases.

A phase is made up of goals.
一個Phase可以綁定多個Goals，但一般只有預設的一個Goal會被執行，所以要執行其他的Goal時，
必需明白指出所要執行Goal。一般來說是以plugin:goal來表示，例如compile:test-compile

說明下上面兩者的差別，例如test-compile這個phase，實際上是要執行compiler:testCompile，但是分別執行的結果如下
mvn test-compile    &gt;$ mvn test-compile
[INFO] </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5730303950769911641/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5730303950769911641' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5730303950769911641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5730303950769911641'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/maven-basic-conceptslifecycle-phase.html' title='Maven: Basic Concepts（Lifecycle, Phase, Goal)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6326360748439106555</id><published>2009-07-13T08:38:00.001+08:00</published><updated>2009-07-13T08:39:36.561+08:00</updated><title type='text'>ECTO3 TEST</title><summary type='text'>Just test for ecto.
continue edit


</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6326360748439106555/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6326360748439106555' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6326360748439106555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6326360748439106555'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/ecto3-test.html' title='ECTO3 TEST'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-8791639351364107114</id><published>2009-07-08T18:08:00.000+08:00</published><updated>2009-07-13T15:34:12.851+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Development Tools on Mac</title><summary type='text'>習慣用的IDE當然是Eclipse啦，換個IDE就差不多變成癈人了，想當初從JBuilder換到Eclipse也是痛苦了很長一段時間，並不是IDEA或Netbeans不好，但是實在是沒什麼時間再習慣另一個IDE，除非Eclipse不再開發了，要不應該會一直用下去吧。
用Eclipse當然要加些Plugin:
MyEclipse:早期我一定要用的是MyEclipse，不過實在愈來愈肥，而且更新速度愈來愈慢（跟Eclipse更速度來比），所以在Ganymede之後就沒再用了，單純用Eclipse JEE的版本倒也頗為愉快。
m2eclipse: http://m2eclipse.codehaus.org/，現在如果少了這個Plugin，我也算是個癈人了，Build、Test、Package都要靠Maven，在IDE裡可以快速執行Maven非這個Plugin不可。
Subversive: </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/8791639351364107114/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=8791639351364107114' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8791639351364107114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/8791639351364107114'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/07/development-tools-on-mac.html' title='Development Tools on Mac'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-645859636707295254</id><published>2009-06-26T16:56:00.001+08:00</published><updated>2009-06-26T17:18:11.966+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse 3.5 (Galileo) for Mac:Carbon or Cocoa?</title><summary type='text'>Eclipse 3.5 (Galileo)如期在6月24日上線了，根據列出來的Support Platform來看真是相當浩大...比較引起Mac用戶注意的，應該是這次產品線開始支援32/64 bit Cocoa，但是困惑的是，倒底要選Carbon或是Cocoa的版本呢?  非常無聊的我，兩個都下載來用看看(...10M光世代還不錯)，發現:   (1)兩個介面幾乎一樣，有差異的太少，比較明顯的是Cocoa用到SWT Sheet的部份，但真的是不多，另一個比較明顯的是Cocoa在元件間隔的使用上似乎比較有效率(忘了cut圖..)，不清楚的話，選"About Eclipse Platform"，比較兩者安裝模組按鈕上的差異，很明顯的發現，Carbon的版本，按鈕間隔出奇的大....這，算[無用]吧    (2)兩者需要的環境一樣，Carbon雖然是比較舊的API環境，但兩者所需的都是"</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/645859636707295254/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=645859636707295254' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/645859636707295254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/645859636707295254'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/eclipse-35-gelileo-for-maccarbon-or.html' title='Eclipse 3.5 (Galileo) for Mac:Carbon or Cocoa?'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2489185550994531966</id><published>2009-06-22T08:37:00.001+08:00</published><updated>2009-06-22T08:37:47.525+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸(6)</title><summary type='text'>離上一次登入WOW已經整整一個月了，雖然偶爾會連上Armory看看之前同團成員的資料，從成就裡還是可以瞭解些他們現在的情形，說不上是關心，也許只是淡淡的懷念吧，昨天發現有幾個人已經接近一個星期沒登入過，而奧杜亞成就也只停在威斯札，優格還沒倒，忽然有些難過....  玩WOW讓我現實世界中大部份的事物都停滯不前，唯獨體重緩慢增加，雖說現在的公司沒有健身房，家裡附近沒有合適的場所可以運動也是個因素，但我想我花了太多時間在WOW上面還是主因，從2007年3月到今年年初，大約增加了14、15公斤。年初的健檢的確讓我嚇一跳，77公斤對於一個身高只有168、169的人來說是太重了些...控制飲食是有些效果，減到68、69左右卻又停了下來，突然覺得目標60公斤是好遠好遠的距離...想找出問題還是需要些記錄吧，從App Store 下載了Health Cubby，準備開始仔細地記記，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2489185550994531966/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2489185550994531966' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2489185550994531966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2489185550994531966'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/6.html' title='碎碎唸(6)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2772760857781691154</id><published>2009-06-22T05:04:00.001+08:00</published><updated>2009-06-22T05:04:19.973+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><title type='text'>你總是藉黃昏隱沒</title><summary type='text'>------------------------------------------------------------------------------  【我們甚至失去了黃昏】 聶魯達著/李宗榮譯       我們甚至失去了黃昏的顏色。   當藍色的夜墜落在世界時，    沒人看見我們手牽著手。  從我的窗戶中我已經看見   在遙遠的山頂上落日的祭典。  有時候一片太陽   在我的雙掌間如硬幣燃燒。  在你熟知我的哀傷中   我憶及了你，靈魂肅歛。  彼時，你在哪裡呢?    那裡還有些什麼人?    說些什麼?    為什麼當我哀傷且感覺到你遠離時，    全部的愛會突如其然的來臨呢?  暮色中如常發生的，書本掉落了下來，   我的披肩像受傷的小狗踡躺在腳邊。  總是如此，朝暮色抹去雕像的方向   你總是藉黃昏隱沒。  ------------------------------</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2772760857781691154/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2772760857781691154' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2772760857781691154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2772760857781691154'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/blog-post_21.html' title='你總是藉黃昏隱沒'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2289323033872453422</id><published>2009-06-17T04:33:00.001+08:00</published><updated>2009-06-17T04:34:09.562+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><title type='text'>你不像任何人</title><summary type='text'>------------------------------------------------------------------------------  【每日妳與宇宙的光...】 聶魯達著/李宗榮譯     每日你與宇宙的光一起嬉戲。   靈巧的訪者，在花朵與水之間你翩然到訪。   你比我手中緊握的白色的頭顱，   更像每日我手中的成簇的果實。     你不像任何人，因為我愛你。   讓我把你灑在眾多花圈之中。   誰在南方群星裡，以煙的字母寫下你的名字？   喔，在你存在之前，讓我憶起你往日的樣子。     突然地，風在我緊閉的窗上怒嚎狂擊。   天空是一張網，塞滿了陰暗的魚。   全部的風在這裡逐一釋放。全部。   大雨脫去她的衣服。     眾鳥飛逝，逃離。   風，風。   我只能與男人的力量相互搏鬥。   暴風雨讓黑色的樹葉迴旋飄落，   讓昨夜停泊在天空的船隻逐一散落</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2289323033872453422/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2289323033872453422' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2289323033872453422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2289323033872453422'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/blog-post_16.html' title='你不像任何人'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-6878737746113200681</id><published>2009-06-17T03:21:00.001+08:00</published><updated>2009-06-17T04:09:40.272+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><title type='text'>Es tan corto el amor, y es tan largo el olvido.</title><summary type='text'>知道Pablo Neruda，最初是因為紅膠囊，封面的圖吸引了我拿起它，李宗榮譯的"二十首情詩與絕望的歌"；後來有很長一段時間，這本書擺在我書桌旁最容拿到的位置，裡面每一首詩，對我而言似乎都有著說不完的故事。  年紀大了後才明白，所有的故事都應該要有結局。  這本書逐漸被我放逐，停在Dissecting MFC 2nd Edition的旁邊，似乎不會再回來了。  而現在，我是用什麼樣的心情再拾起它?  Love may end soon, but memory won't.  我只是逃避，但未曾放下。  "愛情太短，而遺忘太長。"  </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/6878737746113200681/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=6878737746113200681' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6878737746113200681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/6878737746113200681'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/es-tan-corto-el-amor-y-es-tan-largo-el.html' title='Es tan corto el amor, y es tan largo el olvido.'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-978063147603060082</id><published>2009-06-13T01:57:00.000+08:00</published><updated>2009-06-13T01:59:54.497+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸(5)</title><summary type='text'>最近常常突然就進入放空狀態...慘。
不過也不是完全沒收獲，發現了幾首放空時聽了卻完全不會干擾到放空狀態的歌。

青山黛瑪 - そばにいるね


 

梁靜茹-可惜不是你


 

剛剛在PTT看到一篇評魔羯座的，其中有一句

"如果他愛你,你就什麼都不用做,因為他都會幫你做;如果他不愛你.你也什麼都不用做,因為做了也沒用"

我笑了起來

繼續放空....</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/978063147603060082/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=978063147603060082' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/978063147603060082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/978063147603060082'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/5.html' title='碎碎唸(5)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5673575690206799308</id><published>2009-06-12T08:30:00.000+08:00</published><updated>2009-06-12T08:42:06.229+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Eclipse'/><title type='text'>Eclipse 3.5 RC3 Released</title><summary type='text'>之前沒什麼注意，不知不覺Eclipse 3.5(Galileo)已經到了RC3的階段了，看Schedule預定是在2009/06/24要發正式版!依以往的慣例，到了RC3差不多就很接近正式版了，API應該不會再改，會再修的只有BUG了，無聊之餘也就看看有什麼新東西，沒想到有幾項新功能真的是要給他稱讚一下。
(1)There is a new toString() generator之前如果不掛個commons4e的Plugin那就用org.apache.commons.lang.builder.ToStringBuilder來override toString() method，缺點是前者要錢，後者則會破壞pure的dependency

按Alt+Shift+S，選取"Generate toString()"
 選取用來產生String的fields 輕鬆產生 toString() </summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5673575690206799308/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5673575690206799308' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5673575690206799308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5673575690206799308'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/eclipse-35-rc3-released.html' title='Eclipse 3.5 RC3 Released'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_HqfGenkdwXM/SjGjDjNzyTI/AAAAAAAAAA8/uAo33y7Nxh0/s72-c/01.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4152354156815768831</id><published>2009-06-11T05:50:00.001+08:00</published><updated>2009-06-11T05:51:57.476+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸(4)</title><summary type='text'>睡不著，拿起了村上春樹的"國境之南、太陽之西"複習，這本小說是我第一次接觸村上成為村上迷的開始。手上這本是1998年2月第16刷，也就是這本書大約在我身邊已經過了10年了，所以我記憶應該沒錯，是我在新化受預官訓時放假等車回家，頗為無聊時在書店翻起，在村上之前我所知道的日本作家，大概就是夏木漱石、大江健三郎、川端康成這些作家，對村上的印象頗淺；依我的習慣，通常不太熟的作家我都是先看略薄一點的著作，如果看完有興趣，就會將該作家的書全部掃完(這真的應該算病態吧...)。  那時挑這本書沒什麼原因，只是因為它比較薄，封面截錄的" '萬物都在那裡生長'，你說，'然而真正存活的只有沙漠本身' "，其實引不起我的興趣....從台南回台北的路程很長，時間充足到可以讀這本書2遍，下了車，我沒有先回家，而是先到重慶南路再掃了幾本村上的書。  村上小說的主角，通常都是相當普通的人，就像是週遭就能見到的，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4152354156815768831/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4152354156815768831' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4152354156815768831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4152354156815768831'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/4.html' title='碎碎唸(4)'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-4759021027540088258</id><published>2009-06-10T05:12:00.001+08:00</published><updated>2009-06-10T05:12:48.987+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><title type='text'>因為風的緣故</title><summary type='text'>------------------------------------------------------------------------------   【因為風的緣故】  洛夫   昨日我沿著河岸   漫步到    蘆葦彎腰喝水的地方    順便請煙囪    在天空為我寫一封長長的信    潦是潦草了些    而我的心意    則明亮亦如你窗前的燭光    稍有曖昧之處    勢所難免    因為風的緣故  此信你能否看懂並不重要   重要的是    你務必在雛菊尚未全部凋零之前    趕快發怒，或者發笑    趕快從箱子裡找出我那件薄衫子    趕快對鏡梳你那又黑又柔的嫵媚    然後以整生的愛    點燃一盞燈    我是火    隨時可能熄滅    因為風的緣故    ----------------------------------------------------</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/4759021027540088258/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=4759021027540088258' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4759021027540088258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/4759021027540088258'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/blog-post_8.html' title='因為風的緣故'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-2134583219038477752</id><published>2009-06-10T04:45:00.001+08:00</published><updated>2009-06-10T04:45:39.291+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Struts2'/><title type='text'>專案心得</title><summary type='text'>這個案子相對以前其他的案子，規模小上一截，所以很大膽地使用了Struts2到案子裡來，隨著開發逐漸看到當初在寫Demo沒想到的問題，而且將舊時常用的JavaScript Library從Prototype改成jQuery，大量使用Ajax來處理Data與Form Submition，而這些也改變了不少舊有Demo的Operation Pattern，中間也就累積了不少新筆記，等再空一些整理一下，有不少是蠻有趣的值得一看的東西，就數量來說的確是不少，應該可以當本小書了。  先舉個例來說，以往的分頁查詢(pagination search)模式在Action除了宣告一個domain object做為 search example來記錄使用者在Search Form輸入的條件，還會直接宣告一個int pageNo = 1；這樣每次在Search顯示Result時，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/2134583219038477752/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=2134583219038477752' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2134583219038477752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/2134583219038477752'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/blog-post_09.html' title='專案心得'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5948392633932934162</id><published>2009-06-08T04:44:00.001+08:00</published><updated>2009-06-08T04:53:23.082+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><title type='text'>眾荷喧嘩</title><summary type='text'>------------------------------------------------------------------------------  【眾荷喧嘩】  洛夫   眾荷喧嘩   而你是挨我最近    最靜，最最溫婉的一朵   要看，就看荷去吧   我就喜歡看你撐著一把碧油傘   從水中升起    我向池心    輕輕扔過去一拉石子    一隻水鳥    如火焰般掠過對岸的柳枝    再靠近一些    只要再靠我近一點    便可聽到    水珠在你掌心滴溜溜地轉    你的臉    便嘩然紅了起來   你是喧嘩的荷池中   一朵最最安靜的    夕陽    蟬鳴依舊    依舊如你獨立眾荷中時的寂寂   我走了，走了一半又停住   等你    等你輕聲喚我  ------------------------------------------------------</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5948392633932934162/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5948392633932934162' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5948392633932934162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5948392633932934162'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/blog-post.html' title='眾荷喧嘩'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625548515922693160.post-5425070316521330676</id><published>2009-06-08T04:33:00.001+08:00</published><updated>2009-06-08T04:57:25.343+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='心情'/><category scheme='http://www.blogger.com/atom/ns#' term='碎碎唸'/><title type='text'>碎碎唸(3)--說是心得太沉重</title><summary type='text'>又是碎碎唸?因為說是心得太沉重...  白石一文在台有翻譯出版的小說應該都看完了吧?一瞬之光、我心中尚未崩壞的部分、愛有多少、永遠在身邊、心中鑲著龍。白石一文的小說果然口味比較重，沒一本看完開心的...  不能分割的生與死，中間的日子要如何渡過?將每一刻都當做最後一刻來過，致力將其成為最閃耀的極致時光，生氣蓬勃地活著走向死亡，在其他生命的幸福裡認可自己的生命?孕育一個生命就是將他推向死亡，人無法選擇自己的出生與否，甚至也無法選擇自己的死亡方式，這樣的生命，如果只是受著看不見的命運與不斷浮現的慾望控制而活動，又怎麼能明確定出"自我"的存在與意義?也許"一瞬之光"跟"我心中尚未崩壞的部分"要合在一起看。  眼裡所見的，終究只是事實其中一部份；"所謂的理解，通常只不過是誤解的總合"。愛有多少這本書裡提到的四個故事，都在說明"肉眼不可見的確定性"，無論是岬與安西一開始的誤解，</summary><link rel='replies' type='application/atom+xml' href='http://mactruecolor.blogspot.com/feeds/5425070316521330676/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625548515922693160&amp;postID=5425070316521330676' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5425070316521330676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625548515922693160/posts/default/5425070316521330676'/><link rel='alternate' type='text/html' href='http://mactruecolor.blogspot.com/2009/06/3.html' title='碎碎唸(3)--說是心得太沉重'/><author><name>Elliot Chen</name><uri>https://profiles.google.com/110184967516973884440</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//lh4.googleusercontent.com/-JY6NpnqQflE/AAAAAAAAAAI/AAAAAAAAB2Q/tks4xxBWaqM/s512-c/photo.jpg'/></author><thr:total>0</thr:total></entry></feed>
