<?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:blogger='http://schemas.google.com/blogger/2008' 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-8104116394214089859</id><updated>2024-10-24T19:49:29.147+08:00</updated><category term="Life"/><category term="Groovy"/><category term="Java"/><category term="Grails"/><category term="Mac"/><category term="Health"/><category term="OSX"/><category term="Arduino"/><category term="GGTS"/><category term="LED"/><category term="STS"/><category term="CSS"/><category term="JavaScript"/><category term="SwingBuilder"/><category term="Travel"/><category term="Andoid"/><category term="Food"/><category term="GIMP"/><category term="OpenOffice"/><category term="SQL Developer"/><category term="Scala"/><category term="Spring framework"/><category term="Web App"/><title type='text'>學著愛人、學著愛己</title><subtitle type='html'>真切感恩與惜福, 用愛與微笑待人。時時刻刻修正自己、別成為人生目標的障礙。</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>69</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-6567511483401505089</id><published>2015-05-02T16:18:00.003+08:00</published><updated>2016-09-24T19:50:02.358+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Spring framework"/><category scheme="http://www.blogger.com/atom/ns#" term="Web App"/><title type='text'>程式設計=廉價工作?</title><summary type="text">不知多久以來，一直存在的一種狀況：程式設計是廉價的工作。
會有這樣子的心情跟感受，有三：

有人說，程式設計是很無趣的 (&quot;好像&quot;不是很難、不是很有價值的工作)。
技術門檻越來越低，從業的人越來越多；而且做出來的軟體系統，品質並不高。(原因可能不只是&quot;人&quot;的部份而已)
經歷過，而且很長的一段時間被當做廉價勞工。

很多年前在網路上看到(而已經找不到)的一份(好像是M$做的)資料；指出，(不良的)系統調教的方向與範疇，70% 來自所做的應用系統，20% 需要檢視作業系統，而 10% 則可能看看主機硬體是否有調整或升級的必要。個人在這個行業多年的觀察，70% 之語應該指的是歐美的情形，但對照於國內來看，那算是太客氣了。

7、8 年前接觸到的 Java 應用系統，一個是自己主導的、一個是有參與的、一個是維運而沒有權力介入的，還有現在維運的系統；都看到了一個很平常的問題：系統慢、很吃記憶體..</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/6567511483401505089/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/6567511483401505089' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/6567511483401505089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/6567511483401505089'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2015/05/blog-post.html' title='程式設計=廉價工作?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-3322980910995689337</id><published>2014-09-07T10:30:00.003+08:00</published><updated>2014-09-07T16:11:36.131+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Life"/><title type='text'>另類、精彩的 ”one shop stop“ 活動</title><summary type="text">視野寬闊的機場、豪邁的烤肉、抗議的民團、坐在旁邊抓人的便衣(維安人員)、地景月免、精彩好聽的打擊樂表演、嗨翻的西班牙樂團＋雲端魔幻搖滾秀。 
帶孩子一次體驗(而且是第一次)，What an amazing night！


























</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/3322980910995689337/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/3322980910995689337' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3322980910995689337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3322980910995689337'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/09/one-shop-stop.html' title='另類、精彩的 ”one shop stop“ 活動'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidgdvNJr4JxAUU4ih8Anw3a0orSxqsWkW_-GQZT2iThU9sZRlSpSG7XwXgx_Uf2bkaUyKmw7mYvEnLw8CtHGE-ff_o-iY-2XNi0jeGgOv4Vld0KCqcHw9GIROLTVjweA9fVqMXkhE9ATwH/s72-c/fb01.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-7422532472260404121</id><published>2014-08-25T01:28:00.003+08:00</published><updated>2014-08-25T09:52:17.852+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Travel"/><title type='text'>遊江、照夕 、港平安</title><summary type="text">



</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/7422532472260404121/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/7422532472260404121' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7422532472260404121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7422532472260404121'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/08/blog-post_25.html' title='遊江、照夕 、港平安'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixd-DB8MIY4GDVoDvzKbGGFjyG1hNe06BaDlA2huNl0-iRQWqGPWr5t8uS7K9Tfm7IUPnnEqSXkHWwzDdTQX-qIiLabf3RQBVlgwMa7oTgV8be8-_Z9KM49pRs83cI6G7RjQ77507-3oK4/s72-c/DSCN6300.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-4607183215171201383</id><published>2014-08-23T22:08:00.001+08:00</published><updated>2014-08-23T22:08:52.041+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Travel"/><title type='text'>風輕、雲淡、山芙蓉</title><summary type="text">

</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/4607183215171201383/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/4607183215171201383' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/4607183215171201383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/4607183215171201383'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/08/blog-post_23.html' title='風輕、雲淡、山芙蓉'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqn6ZBecjy_PKqowdUFj1YC5YJDmdRC2s2DBztYSW0LOoBuYAnMCYZRdod-AjHvrNU6w6XJcrROKVuViS2Qt8LzLsErJrToZC10UcSRl3PnppmGZyTdbM1iHaEiOUo88IXD_nUpnvcM1W5/s72-c/DSCN6147.JPG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-2840922051398756202</id><published>2014-08-15T01:20:00.002+08:00</published><updated>2014-08-15T01:26:56.709+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="LED"/><title type='text'>Arduino - LED 7 段數字顯示器</title><summary type="text">LED 7 段數字顯示器數數控制。

材料
LED 共陰極7段顯示器&amp;nbsp; x 1
Resistor 330Ω&amp;nbsp; x7

製作
&amp;lt; 參考「Arduino互動設 計入門2」- p7-5 ~ p7-7 &amp;gt; 
port D0 (RX) 與上傳程式的USB共用之故， 我沒用上。






電路圖如下:






程式同上篇一樣使用 DDRx/PORTx 的技巧；如下:

const byte LED_SET = 0b11111110
const byte LEDs[10] = {
  0b11110110, // 0
  0b11000000, // 1
  0b01101110, // 2
  0b11101010, // 3
  0b11011000, // 4
  0b10111010, // 5
  0b10111110, // 6
  </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/2840922051398756202/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/2840922051398756202' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/2840922051398756202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/2840922051398756202'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/08/arduino-led-7.html' title='Arduino - LED 7 段數字顯示器'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg24Y6HBCC5Y1fRCURwYqu4HD3nIGCCBysC8lAlK6_tgztDu9eG_9y8OGuqK1jsNuA_D3cqwXRCT09sw-DETNNciJoXi4RXOFrjadoIMQRhdIFlc5TeMy53nZ0ZwwE4CZEwAWM7D29c8Is0/s72-c/LED-7.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-6587281663179063987</id><published>2014-08-12T03:49:00.002+08:00</published><updated>2014-08-12T03:59:59.575+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="LED"/><title type='text'>Arduino 第二課 - 跑馬燈</title><summary type="text">繼自學第一課: LED switch 用開關控制 LED (或者其他元件)後, 接著進入較複雜的(程式)控制: 跑馬燈。

材料
LED x3 (以上)
Resistor 330Ω x3 (搭配LED數量)

製作
&amp;lt; 參考「Arduino互動設 計入門2」- p4-19 ~ p4-21 &amp;gt; 
紅色線: 高電位/電源輸出
黑色線: 低電位/電源回流

分兩種接法: 左圖為源流(source current) 與 右圖潛流(sink current)





電路圖如下:




程式如下:

const byte LEDs[] = {4 ,7, 10};
const byte LEDs_SIZE = sizeof(LEDs);

const byte INIT_VALUE = LOW; // LOW/HIGH when using source-/sink-current </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/6587281663179063987/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/6587281663179063987' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/6587281663179063987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/6587281663179063987'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/08/arduino.html' title='Arduino 第二課 - 跑馬燈'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj51YD47m0dbSK0zhIfRxPWgFwMA5cQ6kLHBhTv-Rn4MBxekRrsSLYifB58okMzcEoGiWnZqhYwAhFLgkogRbDFQRvkR116WMl0hJnsQTL92FLF39D0CWUAsLXJF7jFWAwKZA4sylxbq2pT/s72-c/marguee_source-current.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-7802080964145884273</id><published>2014-08-10T10:39:00.001+08:00</published><updated>2014-08-12T03:28:14.284+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="LED"/><title type='text'>Arduino 第一課 - LED switch</title><summary type="text">去天瓏買書時, 老闆慫恿我買 Arduino 的書來看, [年紀這麼大了, 學還來得及嗎?] 我這樣子問, 他說:[玩玩嘛!]. 於是真得玩了起來.

會有這樣子的想法, 是多年前 Make: 正夯(現在已發行《Make》雜誌國際中文版), 印象所及是曾看一篇網頁說明了用紅外線指示筆+光碟機做出了一個雷射筆(槍), 不久後新聞報導了大陸的網購網站竟然開始賣這樣子危險的東西; 另外, 還有 GPS 尋寶遊戲的導航製作. 試想, 我自己是否依樣畫葫蘆呢?!

而 Arduino 對我所學非專科的人來說, 多半只是看看而已; 直到一年多前開始察覺已經出現很多網站刊出很多有趣的東西之後, 我才順著天瓏老闆的話, 試著玩玩, 看是否如同以前的中推會同事一般, 做出個藍芽搖控玩具呢?!

但自學的第一課是什麼呢? 買材料! 而買材料的第一步是找一間電子材料行隨意逛逛. 看了玲瑯滿目各式規格看不懂的</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/7802080964145884273/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/7802080964145884273' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7802080964145884273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7802080964145884273'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/08/arduino-led-switch.html' title='Arduino 第一課 - LED switch'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1Y-jiD2U2DjgFihMM2pXMLfL8Fjvz_d03nRPTRIBaBNgkCkGQeWG0cjJRBSSFLVFAdTiFso3uD-CLrLCFNv8RGcSJ1KOJqVpUII7DNnOHLvdQuNR3DesSTdUbIQ4foNxSP5z8WveLn5Wk/s72-c/light-up_pull-down.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-7395200057657229043</id><published>2014-04-19T13:54:00.000+08:00</published><updated>2014-04-19T14:10:33.809+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GGTS"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><category scheme="http://www.blogger.com/atom/ns#" term="STS"/><title type='text'>Upgrade subversion 第二彈</title><summary type="text">自從 upgrade 至 Mavericks 後, 大多不太敢將開發工具也一起 upgrade, 必竟編譯環境並非像這些軟件更新的這麼快。

以個人的工作平台為例:

Mavericks &amp;nbsp;+ &amp;nbsp;GGTS v3.5.0(Eclipse v3.8.2) &amp;nbsp;+ &amp;nbsp;Xcode v5.1 &amp;nbsp;+ &amp;nbsp;JDK 1.7.0_51

對於更新 JavaHL native lib 以整合 subversion eclipse plug-in v1.7.x，過去雖有經驗，但仍無法使用 Homebrew 順利安裝，發生的問題有二：

安裝 subversion v1.7.10 時, 無法取得 serf
安裝 subversion17 (v1.7.14) 時, 無法載入 zlib

不免要花上一些時間來解決。而這狀況有點像是綜合了前兩篇所提到的問題：

</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/7395200057657229043/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/7395200057657229043' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7395200057657229043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7395200057657229043'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/04/upgrade-subversion.html' title='Upgrade subversion 第二彈'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGv4VQyDFc8bfYyQyUG7hHJDgPoOOu_Pqjxnq2s-o6BCyjZ4OaQgfdMczcjH7TYAz25X-jhy-p9sTkKN8Y0Uo3EY7Rz8EWnrVzvFAHoMLicgjIxpJAn3WLfe4GdkkHJqZXVdBLpKuDWIr0/s72-c/javahl-2nd.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-1762775075845211380</id><published>2014-04-07T23:12:00.003+08:00</published><updated>2014-04-07T23:15:43.741+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Life"/><title type='text'>IPO</title><summary type="text">IT 領域中, input --&amp;gt; process --&amp;gt; output 是基本結構

社會層面上, &quot;法(條)&quot; 是 &quot;法治化&quot; 的結果;
就邏輯上而言, 法治化是 process , 法(條)是 output

那 input 是什麼呢?!

若從 IT 技術上來看, Garbage in 就會 garbage out

換句話說, 對於目前政經問題(服貿協議法治化／太陽花學運), 我們更該注意 input 到法治化過程中的內涵</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/1762775075845211380/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/1762775075845211380' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/1762775075845211380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/1762775075845211380'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/04/ipo.html' title='IPO'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-3529180046987508476</id><published>2014-01-23T10:32:00.003+08:00</published><updated>2014-01-23T13:01:35.639+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>BeanUtilsBean 的小小應用 2</title><summary type="text">在利用 BeanUtilsBean 的一點小技巧來解決部份 property 不做 copyProperties() 的需要之後。
如果處理 BigDecimal 的 property 賦值, 而其值為 null 時, 會出現...

Exception in thread &quot;main&quot; org.apache.commons.beanutils.ConversionException: No value specified

 at org.apache.commons.beanutils.converters.BigDecimalConverter.convert(BigDecimalConverter.java:...)...
解決問題前, 先從 BeanUtils 取得 BeanUtilsBean.getInstance() 來處理 copyProperties() 的 </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/3529180046987508476/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/3529180046987508476' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3529180046987508476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3529180046987508476'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/01/beanutilsbean-2.html' title='BeanUtilsBean 的小小應用 2'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-503432965451712756</id><published>2014-01-17T22:28:00.002+08:00</published><updated>2016-09-24T21:16:08.993+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>BeanUtilsBean 的小小應用</title><summary type="text">Apache Commons BeanUtils 發展有十多年, 累積了很多很棒的功能; 它在當時推動 JavaBean 風潮的時空背景下, 算是主要的推手之一。主要的精神在於讓 class 像 data type 一般, 借由 naming convention 慣例, 使用 attributes(或稱 properties) 的 setter／getter methods 來存取 information, 保有了物件導向理論中封裝特性的彈性與好處。雖說另有一派(人)不同意此一看法，但仍有其存在的必要。

最常見的是, 兩個物件有幾乎相仿的 setter/getter methods 情形下進行 copy；在很早的 COBOL、FoxBase ... 年代, 這些 language 在宣告上或語法上已有支援, 而 4GL 年代也有相同、類似的支援方式:
        LET </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/503432965451712756/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/503432965451712756' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/503432965451712756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/503432965451712756'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/01/beanutilsbean.html' title='BeanUtilsBean 的小小應用'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-7616683773724169314</id><published>2014-01-12T23:38:00.003+08:00</published><updated>2014-07-08T13:03:58.921+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GGTS"/><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><title type='text'>Grails Scaffolding</title><summary type="text">Grails 的 Scaffolding 功能自開天闢地以來就有了, 也是介紹入門時的介紹重點之一。

上篇 GORM custom id 另解 就是由 scaffolding plugin 產生出來後所進行的調整; 如果多數 controller 變更情形如同上篇, 那多半會考慮變更 template files, 在產生(generate-all)時就大致已調整完成, 而稍做修改即可。

變更修改前, 須先產生預設的 template files 在專案目錄 src/templates(/scaffolding) 下:
grails&amp;gt; install-templates

接著再以 editor 直修改它, 存檔後會在下次產生另一組 controller/views 時生效。

其實這小撇步早在多年前另一篇 GORM 物件於 update method 後立即顯示資料 也用過。</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/7616683773724169314/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/7616683773724169314' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7616683773724169314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7616683773724169314'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2014/01/grails-scaffolding.html' title='Grails Scaffolding'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg20AeXgAHGfKtqXmoKiIAtytDVsCOSfMjBXuLnnbBq_LK3zhwg-z8YptKC-uBpZaPdkrSKt-iu2Pg1cfJPSLcm2ty2tON3qmwiECOTPbULT9nawgrgDEZMUXOp0l4pAQXfcL8Mc-L7HmQu/s72-c/ggts-gt.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-1548906112113927476</id><published>2013-12-31T14:27:00.000+08:00</published><updated>2014-04-07T09:39:57.467+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><title type='text'>GORM custom id 另解</title><summary type="text">在前篇 使用 Grails 開發應用系統之感&amp;nbsp;提到 &quot;框&quot;不&quot;框&quot;住的問題, 其中提到不同版本 Grails 的 domain class 用到 transients 的技巧來避免使用&amp;nbsp;(Hibernate)&amp;nbsp;object id 做為資料庫的 PK。該算是自己一時失查 (此查非彼&quot;察&quot;) 呢? 還是才疏學淺?! 就在無意間瀏覧 Blog 時, 看到一篇 GORM custom id mapping&amp;nbsp;(作者: Ilya Sterin) 的技巧才算找到我的答案。

因此, 依樣畫葫蘆做了一個 domain class:
class Employee {
    String id
    String code // 員工編號
    String name // 員工姓名
 
    static constraints = {
        id</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/1548906112113927476/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/1548906112113927476' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/1548906112113927476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/1548906112113927476'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/12/gorm-custom-id.html' title='GORM custom id 另解'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-5004938706979589132</id><published>2013-12-30T13:05:00.000+08:00</published><updated>2013-12-31T17:54:54.727+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java實戰兩三事</title><summary type="text">多年前的 presentation:

</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/5004938706979589132/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/5004938706979589132' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/5004938706979589132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/5004938706979589132'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/12/java.html' title='Java實戰兩三事'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-57888963598048871</id><published>2013-12-30T00:19:00.000+08:00</published><updated>2013-12-30T09:23:47.824+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Grails"/><title type='text'>使用 Grails 開發應用系統之感</title><summary type="text">在 ihower 的一篇 FAQ&amp;nbsp;開頭中提到 [Rails 發明人... : Rails Is Not For Beginners], 不知這自問自答式的內容是否也同意了 Rails 發明人的說法?! 但, 卻又像傳教士般的引導閱者進入 RoR 的世界之中?!

而 lyhcode 的 [程式設計師小心別被框架給「框」住了...] 一篇也提到 [... 如果一位「資深」的 Java 程式設計師，在過去 3-5 年間在專案中應用這些技術，可是不深入瞭解這些框架解決了甚麼問題、用什麼方法實作、底層如何運作以及如何擴充或調校，就很難有真正屬於自己的 Know-how。...],&amp;nbsp;文中意在說明&quot;用過&quot;(而非&quot;適當運用&quot;)一些 framework 時存在的風險。

當個人近幾年發展的一些小案專使用 Grails 時, 也意識到了一點點以上的狀況: 需要溝通並傳達一些基礎與概念,</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/57888963598048871/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/57888963598048871' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/57888963598048871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/57888963598048871'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/12/grails.html' title='使用 Grails 開發應用系統之感'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-8488676557036033295</id><published>2013-10-31T14:55:00.002+08:00</published><updated>2016-09-24T21:26:08.653+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="OpenOffice"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL Developer"/><title type='text'>用 unoconv 轉出我的 .xlsx 資料</title><summary type="text">典型的應用程式開發多會處理資料庫(RDB)。
有很多情形是版本會依不同的開發環境不同而資料庫也有所不同，例如：

Dev. App sever --&amp;gt; Dev. DB server
UAT App server --&amp;gt; UAT DB server

對於 Dev. DB server 上的資料，無論是測試案例或設定資料會不斷、不斷的異動；或者像 UAT DB server 上的資料會從不同的測試 phase 往前或往後進、退版時而所有異動。

App 前後版本的異同有很多開發工具可用而能看出差異，但對於要觀察或審視因此而調整的差異資料，要如何比對出來呢？

這個問題對於精熟資料庫及工具的 DBA 來說，也許不是什麼大問題；要模擬前後不同的(資料庫中)測試案例或設定資料，無論是觀察或資料補遺，免不了要進行資料兩相比對，這種情形可能來說，但對於應用程開發人員來說會是不小的困擾。
</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/8488676557036033295/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/8488676557036033295' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/8488676557036033295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/8488676557036033295'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/10/unoconv-xlsx.html' title='用 unoconv 轉出我的 .xlsx 資料'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-3073292384511359686</id><published>2013-10-27T00:11:00.004+08:00</published><updated>2013-10-27T02:06:12.585+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><title type='text'>Upgrade 我的 Snow Leopard 到 Mavericks</title><summary type="text">使用 OSX 10.6 有一段時間了，對於 software development 來說開始有些不方便了；像是 XCode 工具的版本限制以及 OpenJDK 7 安裝問題等。自從 Apple 公司發表新款 iPhone 5S/C 與 iPad Air 同時，突然佛心來著，OSX 10.9 提供免費升級：


當然，對個人來說簡直提天掉下來的禮物，於是開始著手安裝。
(1) 程序上總是先求保險，得準備第 2 顆硬碟進行資料備份：


(2) 設定第 2 顆硬碟開機，測試並確認資料有抄寫：


(3) 無誤後再設回原開機磁碟，重開機後開始下載安裝：






安裝完畢後，便是檢查所有常用應用程式的相容問題；多數情形下使用系統更新作業或程式換版就可以解決了。不過，最麻煩的是得下載幾個重量級的更新，例如：XCode；而且原系統中的 JDK 6 會被移除，須自行下載與安裝 Java for </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/3073292384511359686/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/3073292384511359686' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3073292384511359686'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3073292384511359686'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/10/upgrade-snow-leopard-mavericks.html' title='Upgrade 我的 Snow Leopard 到 Mavericks'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhw0FajGtexRjZ8rwS6Nik5J6wE9PFWW3Ngm8L74-lurCgQR-kKbWxFM00WgeOdi90EAsYesFCLzQeOdJg-EJF1P2n_sFhF-VdqNVRq08qBDD6SdcgHXMOGvrH5tPzkNxmCJPA1JpFHgcrB/s72-c/freeuprade.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-2965027812151540726</id><published>2013-10-15T17:46:00.004+08:00</published><updated>2013-10-15T21:24:01.220+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><title type='text'>Multiple assignment in Groovy</title><summary type="text">在 Groovy 的說明資料中提到, 物件可以進行 multiple assignment。從其範例可看出 values 是 List 型別的: ...The syntax works for arrays as well as lists, as well as methods that return either of these...。

在&amp;nbsp;HA.KI blog 的範例&amp;nbsp;中最後一個也舉出了使用 regular expression 的技巧:
def money  = &#39;12 Euro&#39;
def regexp = /(\d+) (\w+)/
def (exp, amount, currency) = (money =~ regexp)[0]

assert &#39;12&#39; == amount
assert &#39;Euro&#39; == currency


不過, 對於 </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/2965027812151540726/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/2965027812151540726' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/2965027812151540726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/2965027812151540726'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/10/multiple-assignment-in-groovy.html' title='Multiple assignment in Groovy'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-3606899051828185342</id><published>2013-10-05T23:57:00.000+08:00</published><updated>2016-04-27T18:47:00.823+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><title type='text'>GVM 與 GroovyServ</title><summary type="text">執行 .groovy code 不外乎要設定 PATH 與 CLASSPATH，以找到 interpreter(groovy)、compiler(groovyc) 與相關的 library；它往往需要在啟動的 shell 或 user profile 來加以處理。但，以系統維運的角度來說，則需要&quot;安裝&quot;，以便整合至 environment 之中，維持系統固定、一致版本的 interpreter 與 compiler。以 ubuntu 系統為例:
sudo apt-add-repository ppa:groovy-dev/groovy
sudo apt-get update
sudo apt-get install groovy

groovy -version

Groovy Version: 1.8.6 JVM: ...

使得 groovy script 有如 shell </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/3606899051828185342/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/3606899051828185342' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3606899051828185342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3606899051828185342'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/10/gvm-groovyserv.html' title='GVM 與 GroovyServ'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-4029106149757739974</id><published>2013-08-19T18:50:00.002+08:00</published><updated>2013-08-19T18:52:22.587+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="GGTS"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><category scheme="http://www.blogger.com/atom/ns#" term="STS"/><title type='text'>Upgrade subversion 至 v1.7.11</title><summary type="text">繼上篇解決 OSX 10.6 中安裝 SVN 與 Git 的 zlib 問題；為 upgrade subversion 至 v1.7.x 好讓 GGTS／Subclipse v1.8 開發工具所使用，進行下列指令的處置:
cd /usr/local/Library/Formula/
brew update
brew versions subversion
git checkout 0060dc3 /usr/local/Library/Formula/subversion.rb
卻發生無法安裝情形:



處理的方法是改安裝 v1.7.11:
brew tap homebrew/versions
brew install --universal --java subversion17



這樣子只要再檢查 /Library/Java/Extensions 下有沒有相關的 symbolic</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/4029106149757739974/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/4029106149757739974' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/4029106149757739974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/4029106149757739974'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/08/upgrade-subversion-v1711.html' title='Upgrade subversion 至 v1.7.11'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO34hQXTSu3NvkOclRNZuSWXXs5amphaNhX7L4yxVH9GRmcaYM2qZGoQTI81XDpa6ugWEkLCpcyE2ere87dFbhdnfU1ugoho5SfGJcaftI2ZlWK5sFlxx21HdAaSDBkhlQg3-kN0O3c1-Y/s72-c/svn170fail.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-3090375607775468851</id><published>2013-08-07T17:38:00.000+08:00</published><updated>2013-09-05T10:31:42.777+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java 的檔案傳輸</title><summary type="text">說到網路通訊，在一般 Java 的實作上多半會兩種方式: HTTP 或 RMI (當然也可寫個 socket server / client)。無論坊間的教育中心或書籍，都會有基本的範例；而且現今的 Internet 中也有很多成熟的 sample code (只要問對谷歌大神)。

那檔案傳輸呢:

一般提到 Java I/O 時，很多的 software developer 並不會對它陌生；遇到 HTTP 的檔案傳輸可使用如 Apache HTTPClient 這樣子的 package，以 multi-part 方式 (MultipartEntity) 來傳輸。

但個人有遇過 &quot;咬&quot; 住的測試經驗。於是乎搬出 PipedInputStream / PipedOutputStream 再加上啟用一個 Thread 來處理，就可以解決這個問題了。以 Groovy 為例:
...
def</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/3090375607775468851/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/3090375607775468851' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3090375607775468851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/3090375607775468851'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/08/java.html' title='Java 的檔案傳輸'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-7640230831971460860</id><published>2013-08-02T12:17:00.001+08:00</published><updated>2016-09-24T21:35:32.917+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><title type='text'>Java 使用 Acrobat Reader 列印 PDF</title><summary type="text">以 Java 要列印 PDF document 基本上來說並不是什麼大問題，無論是用 AWT PrintJob 或 print service 的 DocPrintJob。

但對於字體／字型的處理，除非買授權的商用套件或統一規範產生 PDF 時的方法，不然想要以 opensource package（ex. Apache PDFBox） 來處理 PDF 中各種造字字體／字型的問題，可以說是一件殺死腦細胞的工作。(雖然我已經幹了)

除此之外，最常見的解決方法是：利用 Windows 平台，以 Acrobat Reader 來印製；好處是，字型檔的處理與前端使用者的 PC 無異。 而程式通常使用 Runtime / Process 或 ProcessBuilder class 來 invoke Acrobat Reader。

不過，依過去發生的案例發現，大體上會發生幾個狀況：

要不要</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/7640230831971460860/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/7640230831971460860' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7640230831971460860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/7640230831971460860'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/08/java-acrobat-reader-pdf.html' title='Java 使用 Acrobat Reader 列印 PDF'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-6245324411894083918</id><published>2013-08-01T01:11:00.001+08:00</published><updated>2013-08-01T01:13:08.632+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="SwingBuilder"/><title type='text'>SwingBuilder 中佈建 panel</title><summary type="text">Groovy 使用 SwingBuilder&amp;nbsp;進行 panel 佈置可有 3 種手法:
(1) 逐一佈建
import groovy.swing.SwingBuilder
import java.awt.*
import javax.swing.*

def swing = new SwingBuilder()

swing.edt {
 frame (
  title: &quot;Ex&quot;,
  defaultCloseOperation: JFrame.EXIT_ON_CLOSE,
  pack: true,
  show: true ) {
  
  borderLayout()
  panel(constraints: BorderLayout.CENTER) {
   
   borderLayout()
   panel(constraints: </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/6245324411894083918/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/6245324411894083918' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/6245324411894083918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/6245324411894083918'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/08/swingbuilder-panel.html' title='SwingBuilder 中佈建 panel'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-2492726921263340666</id><published>2013-08-01T00:13:00.001+08:00</published><updated>2013-08-01T00:27:47.419+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Groovy"/><category scheme="http://www.blogger.com/atom/ns#" term="SwingBuilder"/><title type='text'>在 SwingBuilder 中建立 CardLayout 的方式</title><summary type="text">Groovy 透過 SwingBuilder 可以用 DSL 方式表述 swing 各種 components 的佈建。
而建立 CardLayout 有 3 種方式可以進行:
(1) 由 builder 產生
import groovy.swing.SwingBuilder
import java.awt.*
import javax.swing.*

def swing = new SwingBuilder()
def cardLayout = swing.cardLayout()
def thePanel

swing.edt {
 frame (
  title: &quot;Ex&quot;,
  defaultCloseOperation: JFrame.EXIT_ON_CLOSE,
  pack: true,
  show: true ) {
  
  borderLayout()
  </summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/2492726921263340666/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/2492726921263340666' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/2492726921263340666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/2492726921263340666'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/08/swingbuilder-cardlayout.html' title='在 SwingBuilder 中建立 CardLayout 的方式'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8104116394214089859.post-1141483106028476970</id><published>2013-07-13T14:08:00.003+08:00</published><updated>2013-08-13T12:47:29.585+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><category scheme="http://www.blogger.com/atom/ns#" term="OSX"/><title type='text'>解決 OSX 10.6 中安裝 SVN 與 Git 的 zlib 問題</title><summary type="text">對於 Mac 平台的 Java 應用系統開發者來說，安裝與使用 SVN 或 Git 是工作的一環；網路資源有許多資訊可供快速建置，如：How to Install Xcode, Homebrew, Git, RVM, Ruby &amp;amp; Rails on Snow Leopard, Lion, and Mountain Lion。

然而，對我這個 Snow Leopard 用戶來說，就沒這麼順利了；原因在於過去安裝過的 package 歴經硬碟換裝、備份、移除...等，有些開發工作上一些少用的東西不復存在，而且 Apple Developer 網站也不再有與 Snow Leopard 相關的檔案下載資源。直觀上自然會借助 Homebrew 工具來安裝&amp;nbsp;SVN 或 Git。然而卻出現以下情形：


沒有 zlib 啊~。據了解它就在那些沒有下載支援的&amp;nbsp;Command</summary><link rel='replies' type='application/atom+xml' href='http://linchinghui.blogspot.com/feeds/1141483106028476970/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8104116394214089859/1141483106028476970' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/1141483106028476970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8104116394214089859/posts/default/1141483106028476970'/><link rel='alternate' type='text/html' href='http://linchinghui.blogspot.com/2013/07/osx-106-svn-git-zlib.html' title='解決 OSX 10.6 中安裝 SVN 與 Git 的 zlib 問題'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14747412560408066243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkMYht9XNpE_0mwyAXQt5HZRHmwhmRgiuuSJyN-cukVBMEuqX-XjgF_Iti8Ve6t9u9BcJyRlvUa0JJbnpG0sqJF6uE6KXvQieiiyzsg9mhiBEgUAYOzJxwhW6Yj_2NAlOc9OTCyl8RbiIK/s72-c/git-sl-prob.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>