<?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-1444155547342700308</id><updated>2024-09-12T19:06:59.908+08:00</updated><category term="java"/><category term="google api"/><category term="javascript"/><category term="C sharp"/><category term="知識"/><category term="Eclipse"/><category term="網路"/><category term="其他"/><category term="WebServer"/><category term="HTTP request"/><category term="jquery plugin"/><category term="Sqlite"/><category term="Android"/><category term="Flash"/><category term="asp.net"/><category term="jsp"/><category term="Database"/><category term="Sliver Light"/><category term="struts2"/><category term="實用小軟體"/><category term="應用軟體"/><category term="google earth api"/><category term="ActionScript3"/><category term="html"/><category term="GWT"/><category term="Gears"/><category term="PHP"/><category term="UML"/><category term="google map api"/><category term="hadoop"/><category term="KML"/><category term="css"/><category term="servlet"/><category term="sql"/><title type='text'>Caton + OO + Google =?</title><subtitle type='html'>This is my record about java , C# and web application</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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>327</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1444155547342700308.post-7662409049042316896</id><published>2018-02-08T22:59:00.002+08:00</published><updated>2018-02-08T23:00:13.161+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="知識"/><category scheme="http://www.blogger.com/atom/ns#" term="網路"/><title type='text'>心得 open source license 查詢</title><content type='html'>這兩天上了 開源程式碼的課程 知道有個網頁還不錯， 可以協助定義出 open source license 下&lt;br /&gt;
&lt;br /&gt;
的開發限制 ， 是否需要繼續OPEN 程式的義務 及相關的感染力&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
https://tldrlegal.com/</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/7662409049042316896/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/7662409049042316896' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7662409049042316896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7662409049042316896'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2018/02/open-source-license.html' title='心得 open source license 查詢'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-7074967899003055040</id><published>2014-11-28T14:14:00.000+08:00</published><updated>2014-11-28T14:14:28.243+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="實用小軟體"/><title type='text'>心得   icon 編輯網站</title><content type='html'>提供約500多個 icon 做編輯&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;Flatty Shadow&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;進入 網頁&lt;/span&gt;http://flattyshadow.com/&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;&amp;nbsp;上 找到&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;view dashborad &amp;nbsp;就可以開始使用了 ， 試過可以下載成PNG 或 &amp;nbsp;js,css 組成的SVG&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 18px; line-height: 24.6400012969971px;&quot;&gt;參考:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #444444; font-family: &#39;Times New Roman&#39;, Times, FreeSerif, serif; font-size: 27px; font-stretch: normal; margin: 0.75em 0px 0px; position: relative;&quot;&gt;
&lt;a href=&quot;http://www.playpcesor.com/2014/11/Flatty-Shadow-Flat-icon-download-free.html&quot;&gt;500多種扁平化陰影 ICON 自動產生器！圖示免費下載, 電腦玩物&lt;/a&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/7074967899003055040/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/7074967899003055040' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7074967899003055040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7074967899003055040'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2014/11/icon.html' title='心得   icon 編輯網站'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-2999298620859791005</id><published>2014-11-24T10:21:00.002+08:00</published><updated>2014-11-24T10:21:32.099+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>class.getResource 取得 class 目錄相對的資源</title><content type='html'>&lt;br /&gt;
利用 XXClass&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #7f0055; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.getResource&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #2a00ff; font-family: monospace; white-space: nowrap;&quot;&gt;&quot;fileName&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;; 可以取得 相對&lt;/span&gt;XXClass&amp;nbsp;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;目錄的檔案&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;這點在設計 config 檔 來控制程式方面還蠻實用的&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; white-space: nowrap;&quot;&gt;大致有兩種路徑&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;background-color: white; white-space: nowrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #3f7f5f; font-family: monospace; white-space: nowrap;&quot;&gt;absolute 絕對路徑&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: monospace; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
ex. XXClass&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #7f0055; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.getResource&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #2a00ff; font-family: monospace; white-space: nowrap;&quot;&gt;&quot;/fileName.txt&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #3f7f5f; font-family: monospace; white-space: nowrap;&quot;&gt;relative 相對路徑&lt;/span&gt;&lt;br /&gt;
ex .XXClass&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #7f0055; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.getResource&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #2a00ff; font-family: monospace; white-space: nowrap;&quot;&gt;&quot;fileName.txt&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
ex. XXClass&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #7f0055; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;b&gt;class&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;.getResource&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #2a00ff; font-family: monospace; white-space: nowrap;&quot;&gt;&quot;myConfig/fileName.txt&quot;&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: white; color: black; font-family: monospace; white-space: nowrap;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #3f7f5f; font-family: monospace; white-space: nowrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
參考:&lt;br /&gt;
http://www.java2s.com/Code/JavaAPI/java.lang/ClassgetResourceStringnamerelativetotheclasslocation.htm</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/2999298620859791005/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/2999298620859791005' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/2999298620859791005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/2999298620859791005'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2014/11/classgetresource-class.html' title='class.getResource 取得 class 目錄相對的資源'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-5214932049581518098</id><published>2014-10-15T10:13:00.003+08:00</published><updated>2014-10-15T10:13:51.291+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>心得 java.net.MalformedURLException: unknown protocol: rsrc 解決方式</title><content type='html'>出現狀況: 是在client 端測試 JMS 訂閱時發生，&lt;br /&gt;
原因:是 使用 eclipse 編譯出可執行 jar ,&lt;br /&gt;
解決方式:　直接使用 java compiler 編譯執行就可以～&lt;br /&gt;&lt;br /&gt;參考：　&lt;a href=&quot;https://community.oracle.com/thread/1178215?start=0&quot;&gt;RMI - unknown protocol: rsrc&lt;/a&gt;　　　&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/5214932049581518098/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/5214932049581518098' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5214932049581518098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5214932049581518098'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2014/10/javanetmalformedurlexception-unknown.html' title='心得 java.net.MalformedURLException: unknown protocol: rsrc 解決方式'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-7961828922480970461</id><published>2014-08-14T19:10:00.001+08:00</published><updated>2014-08-14T19:10:24.579+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jsp"/><title type='text'>心得 JSP 產生 XML 會空白幾行</title><content type='html'>算是困擾蠻久的問題，沒想到很好解&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
只要改一下習慣就好， 讓 jsp include 標籤 連在一起就好&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;font-family: Courier, monospace; font-size: 14px;&quot;&gt;&amp;lt;% ..... 
%&amp;gt;&amp;lt;% ..... 
%&amp;gt;&amp;lt;% ..... 
%&amp;gt;&lt;xml&gt;
.....
&lt;/xml&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
參考 : &lt;a href=&quot;http://www.javaworld.com.tw/jute/post/view?bid=6&amp;amp;id=233224&quot;&gt;如何解决jsp&amp;lt;%%&amp;gt;带来的空行问题, Java World&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/7961828922480970461/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/7961828922480970461' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7961828922480970461'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7961828922480970461'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2014/08/jsp-xml.html' title='心得 JSP 產生 XML 會空白幾行'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-8892001734484707929</id><published>2014-05-17T14:58:00.000+08:00</published><updated>2015-08-12T17:44:42.828+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>How to Set porxy, port in java access HTTPS webservice</title><content type='html'>主要遇到一個問題 就是 在公司內部AP 要使用 proxy 連結 HTTPS &amp;nbsp;的 網路服務 ，&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
之前 寫過記下的&amp;nbsp;How to Set porxy, port in java &amp;nbsp;, 的方法就無法使用了，&lt;br /&gt;
&lt;br /&gt;
不過只要修改一下就可以了 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.setProperty(&quot;https.proxyHost&quot;,&quot;proxy.XXX.com.tw&quot;);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.setProperty(&quot;https.proxyPort&quot;,&quot;8080&quot;); &lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考：　&lt;a href=&quot;http://stackoverflow.com/questions/15927079/how-to-use-httpsurlconnection-through-proxy-by-setproperty&quot;&gt;How to use HttpsURLConnection through proxy by setProperty? , &amp;nbsp;stackoverflow&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/8892001734484707929/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/8892001734484707929' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/8892001734484707929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/8892001734484707929'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2014/05/how-to-set-porxy-port-in-java-access.html' title='How to Set porxy, port in java access HTTPS webservice'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-329827393693844151</id><published>2013-12-18T10:23:00.002+08:00</published><updated>2013-12-18T10:23:24.067+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="知識"/><title type='text'>心得 取得TOMCAT 路徑</title><content type='html'>&amp;nbsp;可利用 下列語法取得Tomcat 執行路徑，&amp;nbsp;catalina.base&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;File catalinaBase = new File( System.getProperty( &quot;catalina.base&quot; ) ).getAbsoluteFile(); &amp;nbsp; &amp;nbsp;// &amp;nbsp; get tomcat root&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
可參考 自行 Google catalina.base&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/329827393693844151/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/329827393693844151' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/329827393693844151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/329827393693844151'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/12/tomcat.html' title='心得 取得TOMCAT 路徑'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-3577261651756482973</id><published>2013-11-06T18:16:00.000+08:00</published><updated>2013-11-06T18:16:12.649+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery plugin"/><title type='text'>jquery AJAX 更新 心得</title><content type='html'>&lt;br /&gt;
jquery AJAX 可能是會因為 cache 的關係 導致沒有更新，&lt;br /&gt;
加上這行可以確保有執行&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;alt&quot; style=&quot;background-color: #f0f0f0; font-family: &#39;Courier New&#39;; font-size: 12px; line-height: 17px; padding: 0px; width: 574.5625px;&quot;&gt;&lt;span class=&quot;rem&quot; style=&quot;color: green; margin: 0px; padding: 0px;&quot;&gt;$.ajaxSetup({ cache: false });&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
參考:&lt;br /&gt;
&lt;a href=&quot;http://blog.darkthread.net/post-2009-06-03-about-jquery-ajax-cache-option.aspx&quot;&gt;黑暗執行序 ,關於jQuery AJAX cache參數&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/3577261651756482973/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/3577261651756482973' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/3577261651756482973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/3577261651756482973'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/11/jquery-ajax.html' title='jquery AJAX 更新 心得'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-5735499963214228402</id><published>2013-11-06T18:13:00.001+08:00</published><updated>2013-11-06T18:13:12.564+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jquery plugin"/><title type='text'>jqgrid AJAX使用心得</title><content type='html'>套用 AJAX 定時更新資料時 發現&amp;nbsp;jqgrid &amp;nbsp;的 table 不會變動，&lt;br /&gt;
&lt;br /&gt;
原來需要再增加一行 code 才能讓他更新成功&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;default prettyprint prettyprinted&quot; style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 14px; line-height: 18px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; border: 0px; color: maroon; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;#XXX&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;typ&quot; style=&quot;background-color: transparent; border: 0px; color: #2b91af; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;GridUnload&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
參考:&lt;br /&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/4497130/jqgrid-refresh-a-grid-after-an-ajax-file-upload&quot;&gt;http://stackoverflow.com/questions/4497130/jqgrid-refresh-a-grid-after-an-ajax-file-upload&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/5735499963214228402/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/5735499963214228402' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5735499963214228402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5735499963214228402'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/11/jqgrid-ajax.html' title='jqgrid AJAX使用心得'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-5583935384371299087</id><published>2013-07-18T14:02:00.003+08:00</published><updated>2013-07-18T14:02:41.098+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="實用小軟體"/><category scheme="http://www.blogger.com/atom/ns#" term="知識"/><title type='text'>心得  windows 建立服務工具    ServiceEx </title><content type='html'>ServiceEx 可以讓 exe 轉換成 windows 服務&lt;br /&gt;
&lt;br /&gt;
使用方法如下:&lt;br /&gt;
&lt;br /&gt;
1. 下載 &amp;nbsp;&amp;nbsp;ServiceEx.exe&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;2. 建立 檔案的 ini 如&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; mem.ini&lt;/span&gt;&lt;/b&gt; ， 下面以執行 memcached.exe 為例&lt;br /&gt;
&lt;br /&gt;
[ServiceEx]&lt;br /&gt;
; ServiceExeFullPath EXE 路徑&lt;br /&gt;
ServiceExeFullPath = &quot;D:\msample\memcached.exe&quot;&lt;br /&gt;
; program arguments to be sent to executable ,選項設定 如這裡 設 10M item size , 128 m 的空間&lt;br /&gt;
options = &quot;-m 128 -I 10m&quot;&lt;br /&gt;
; can program interact with desktop [true | false] (default: true) ，是否會影響桌面，這我就不太了解&lt;br /&gt;
desktop = false&lt;br /&gt;
; start type (valid values: Auto Manual Disabled) (default: auto) &amp;nbsp;啟動類型&lt;br /&gt;
Start=Auto&lt;br /&gt;
; start the service upon installation [true | false] (default: no) 安裝後是否啟動 &lt;br /&gt;
StartNow=false&lt;br /&gt;
&lt;br /&gt;
3. 在 cmd 下 執行&lt;br /&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;ServiceEx install &lt;servicename&gt;&lt;/servicename&gt;&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;
&lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;如  &lt;/pre&gt;
&lt;pre style=&quot;white-space: pre-wrap; word-wrap: break-word;&quot;&gt;ServiceEx install &lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;mem&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
4. 在 windows 下 找到 服務 &amp;nbsp;，系統管理工具/服務 &amp;nbsp;確認 服務msm &amp;nbsp;是否在清單上&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, arial; font-size: 16px;&quot;&gt;參考:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: verdana, arial; font-size: 16px;&quot;&gt;[1]&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://serviceex.com/&quot;&gt;http://serviceex.com/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/5583935384371299087/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/5583935384371299087' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5583935384371299087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5583935384371299087'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/07/windows-serviceex.html' title='心得  windows 建立服務工具    ServiceEx '/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-7569647463661979809</id><published>2013-07-18T13:45:00.003+08:00</published><updated>2013-07-18T13:45:26.922+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'>心得- Memcached  儲存 1M 空間限制</title><content type='html'>&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;memached 限制每筆資料設定在 1M 大小， 但 1.4.2版之後 多了一個參數可以設定 &amp;nbsp;到 1k 到 128M [1]&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;如&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; memcached -I 10m&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;在 window 安裝方面 可以參考下載 [2] 所提供包好的 windows exe ,&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;不過要使用&amp;nbsp;&lt;strong style=&quot;background-color: white; border: 0px; font-family: Verdana, Arial, sans-serif; font-size: 12px; line-height: 18.46875px; margin: 0px; padding: 0px;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;Memcached 1.4.5&lt;/span&gt; &amp;nbsp;&lt;/strong&gt;這個版本， 以我的經驗使用 1.4.4 版的 超過 1M 的資料儲存 服務就會終止&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;但是 1.4.5 版 有一個問題就是不能 用 sc create 的方式建立服務，&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;不過還好有找到 工具 &amp;nbsp;&lt;span style=&quot;font-family: verdana, arial; font-size: 16px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;ServiceEx&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: verdana, arial; font-size: 16px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;/b&gt;可以解決這個問題&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 此外 API 也要做設定&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; 這裡我採用&amp;nbsp;xmemcached [3] ， 在程式裡加上敘述&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
xmemcached MemcachedClient client=new XMemcachedClient(&quot;127.0.0.1&quot;,11211);&lt;br /&gt;
client.setTranscoder(new SerializingTranscoder(&lt;span style=&quot;color: red;&quot;&gt;10&lt;/span&gt;*1024*1024)); &amp;nbsp; // 10M &amp;nbsp; 看大小多少這裡就要設多少&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考:&lt;br /&gt;
[1]&amp;nbsp;&lt;a href=&quot;https://code.google.com/p/memcached/wiki/ReleaseNotes142&quot;&gt;https://code.google.com/p/memcached/wiki/ReleaseNotes142&lt;/a&gt;&lt;br /&gt;
[2]&amp;nbsp;&lt;a href=&quot;http://blog.elijaa.org/index.php?post/2010/10/15/Memcached-for-Windows&amp;amp;similar&quot;&gt;http://blog.elijaa.org/index.php?post/2010/10/15/Memcached-for-Windows&amp;amp;similar&lt;/a&gt;&lt;br /&gt;
[3]&amp;nbsp;&lt;a href=&quot;https://code.google.com/p/xmemcached/&quot;&gt;https://code.google.com/p/xmemcached/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/7569647463661979809/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/7569647463661979809' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7569647463661979809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/7569647463661979809'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/07/memcached-1m.html' title='心得- Memcached  儲存 1M 空間限制'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-5580832599498397086</id><published>2013-07-17T16:25:00.000+08:00</published><updated>2013-07-17T16:25:19.847+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><category scheme="http://www.blogger.com/atom/ns#" term="jquery plugin"/><title type='text'>心得 jquery 同步</title><content type='html'>預設都是 非同步的，但是可以設定為同步&lt;br /&gt;
&lt;br /&gt;
async 屬性 設為 true 即可以&lt;br /&gt;
&lt;br /&gt;
如下面的程式&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$.ajax({&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;url:&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&quot;xxx.jsp&quot;,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; async: false ,&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; success: &amp;nbsp; function(data){&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;alert(data);&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;});&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考 :　&lt;a href=&quot;http://api.jquery.com/jQuery.ajax/&quot;&gt;http://api.jquery.com/jQuery.ajax/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/5580832599498397086/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/5580832599498397086' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5580832599498397086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/5580832599498397086'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/07/jquery.html' title='心得 jquery 同步'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-323520359456594544</id><published>2013-07-10T11:40:00.000+08:00</published><updated>2013-07-10T11:40:02.213+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="jsp"/><title type='text'>筆記 jsp 多國語言  使用 ResourceBundle </title><content type='html'>&lt;br /&gt;
出現錯誤 &amp;nbsp; :&amp;nbsp;&lt;span style=&quot;background-color: #f7f7f7; color: #0000a0; font-family: Tahoma, Georgia; font-size: 12px;&quot;&gt;org.apache.jasper.JasperException: Can&#39;t find bundle for base name XXX&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #f7f7f7; color: #0000a0; font-family: Tahoma, Georgia; font-size: 12px;&quot;&gt;, locale&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: #f7f7f7; color: #0000a0; font-family: Tahoma, Georgia; font-size: 12px;&quot;&gt;XX_XX&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
解決方式&lt;br /&gt;
&lt;br /&gt;
吧資源檔 &amp;nbsp;xxx.properties 放到&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #e69138;&quot;&gt;WEB-INF/classes &lt;/span&gt;&amp;nbsp; 下

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考 :&lt;a href=&quot;http://www.javaworld.com.tw/jute/post/view?bid=6&amp;amp;id=24795&amp;amp;sty=1&amp;amp;tpg=5&amp;amp;age=-1&quot;&gt; 在 JSP 中使用 ResourceBundle , JAVA world 文章&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/323520359456594544/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/323520359456594544' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/323520359456594544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/323520359456594544'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/07/jsp-resourcebundle.html' title='筆記 jsp 多國語言  使用 ResourceBundle '/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-4392232069609003837</id><published>2013-06-09T22:55:00.004+08:00</published><updated>2013-06-09T22:57:12.982+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Android 心得 -  隱藏 action bar 標題列</title><content type='html'>似乎 在 3.0 以後的 API 都會預設 action bar 在上 面， 若要隱藏 的 話 &lt;br /&gt;
&lt;br /&gt;
可使用下面語法&lt;br /&gt;
&lt;br /&gt;
在 &amp;nbsp;AndroidManifest.xml&lt;br /&gt;
想要隱藏的 activity 中 設定這個style&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&lt;activity span=&quot;&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;android:theme&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;@android:style/Theme.Holo.NoActionBar&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/activity&gt;&lt;/span&gt;&lt;/pre&gt;

參考:
&lt;a href=&quot;http://docs.huihoo.com/android/3.0/guide/topics/ui/actionbar.html&quot;&gt;Using the Action Bar , android api&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/4392232069609003837/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/4392232069609003837' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/4392232069609003837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/4392232069609003837'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/06/android-action-bar.html' title='Android 心得 -  隱藏 action bar 標題列'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-4514601018109493990</id><published>2013-06-02T10:21:00.002+08:00</published><updated>2013-06-02T10:22:50.466+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Android 心得 - 開發解析度</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
依據現再平台的不同分為四個尺寸&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjpQBWo6fim7la6n9KyUuULIqwYYu3zqhL061j2fkI0asSVU-h_qSLBjvbFlakIvPx934y6wbf7zYkFxPvGpX2dM1Yn9B66DZnPyy4bOK4rRSWVYKhTtX4vq_fMyqiVA6JvVaJpsoHyeU/s1600/screens-ranges.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjpQBWo6fim7la6n9KyUuULIqwYYu3zqhL061j2fkI0asSVU-h_qSLBjvbFlakIvPx934y6wbf7zYkFxPvGpX2dM1Yn9B66DZnPyy4bOK4rRSWVYKhTtX4vq_fMyqiVA6JvVaJpsoHyeU/s640/screens-ranges.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
在4.1的開發平台下， res 檔下依據不同size 要放入對應大小的圖片尺寸， 其中 xxHdpi 是應該是更大尺寸的size &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimW-T0zvunWbdPAQI-ey1laxqVOVjcS7bSfhWQFA-a1MtBMc66cPcq66KwrJEbBO3Wgs2nHyyII8d19THBHZ4hJIA8BlpzJm9knrlL9EI7hP-x_KHVYhDoOAyRQcjQ0-t_l3akGq_T2BU/s1600/andIMG.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimW-T0zvunWbdPAQI-ey1laxqVOVjcS7bSfhWQFA-a1MtBMc66cPcq66KwrJEbBO3Wgs2nHyyII8d19THBHZ4hJIA8BlpzJm9knrlL9EI7hP-x_KHVYhDoOAyRQcjQ0-t_l3akGq_T2BU/s640/andIMG.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
此外，要加入圖片的話， 就放在那些目錄下，如 drawable-mdpi, 在 Drable 下就可以選擇了&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnrkBY0rZ0FoGL1Npf1lAqUESidwuwFP72gi4y_uuPes_wCFJuTowIYtYj23dWqdrw27xNdYd4e1mchny3lwftiYqO5tWF_eIbdihtOL1nE4RbQilAYxqdLyJnYEFsm5pWcNc5qZqapyg/s1600/andIMG2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;352&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnrkBY0rZ0FoGL1Npf1lAqUESidwuwFP72gi4y_uuPes_wCFJuTowIYtYj23dWqdrw27xNdYd4e1mchny3lwftiYqO5tWF_eIbdihtOL1nE4RbQilAYxqdLyJnYEFsm5pWcNc5qZqapyg/s640/andIMG2.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考:&lt;br /&gt;
http://developer.android.com/guide/practices/screens_support.html&lt;a href=&quot;http://developer.android.com/guide/practices/screens_support.html&quot;&gt;http://developer.android.com/guide/practices/screens_support.html&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/4514601018109493990/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/4514601018109493990' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/4514601018109493990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/4514601018109493990'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/06/android_4990.html' title='Android 心得 - 開發解析度'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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/AVvXsEjjpQBWo6fim7la6n9KyUuULIqwYYu3zqhL061j2fkI0asSVU-h_qSLBjvbFlakIvPx934y6wbf7zYkFxPvGpX2dM1Yn9B66DZnPyy4bOK4rRSWVYKhTtX4vq_fMyqiVA6JvVaJpsoHyeU/s72-c/screens-ranges.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1444155547342700308.post-901869390982023659</id><published>2013-06-02T10:03:00.002+08:00</published><updated>2013-06-02T10:03:28.746+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Android 心得 - 開發憑證過期</title><content type='html'>值得注意的地方， android 的開發憑證 debuge.keystore 只有一年的時間&lt;br /&gt;
&amp;nbsp;超過時會出現: &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Error generating final archive, ... &lt;/span&gt;&lt;/b&gt;的錯誤&lt;br /&gt;
&lt;br /&gt;
解決方式&lt;br /&gt;
&lt;br /&gt;
在eclipse 下&lt;br /&gt;
Window --&amp;gt; Preferences --&amp;gt; Android --&amp;gt; Build&lt;br /&gt;
可以找到該檔案，刪除掉剛檔案就會自動產生了，此外專案記得 clean 一下&lt;br /&gt;
&lt;br /&gt;
參考:&lt;br /&gt;
&lt;a href=&quot;http://www.dotblogs.com.tw/nethawk/archive/2011/06/20/29197.aspx&quot;&gt;兩個開發Android時碰到的問題&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/901869390982023659/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/901869390982023659' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/901869390982023659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/901869390982023659'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/06/android_2.html' title='Android 心得 - 開發憑證過期'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-6517638200575546793</id><published>2013-06-02T09:51:00.001+08:00</published><updated>2013-06-02T09:51:38.581+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Android"/><title type='text'>Android 心得 - 安裝環境</title><content type='html'>
發展的現在，android APP 的開發工具算是很方便的，

就官方網站的介紹有三種方式
1. 安裝ADT(Android Developer Tools), 將eclipse 和 android 相關套件打包好的，下載後解壓縮就可以執行，熟悉eclipse 的人倒是蠻方便的
2. 自行下載SDK 安裝到現有的 eclipse 上
3. Android Studio, 在IntelliJ IDEA IDE 平台上發展開發 andorid 的工具，沒用過



參考: 
http://developer.android.com/sdk/index.html</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/6517638200575546793/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/6517638200575546793' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/6517638200575546793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/6517638200575546793'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/06/android.html' title='Android 心得 - 安裝環境'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-4791868696487631189</id><published>2013-05-15T18:56:00.001+08:00</published><updated>2013-05-15T18:56:11.917+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="知識"/><title type='text'>心得 網路服務 at winserver2008</title><content type='html'>簡短的新心得，在安裝好服務之後（如 tomcat , memched ,mysql 等等 會用到遠端連線的服務）
要使遠端的電腦能夠使用的話， 要記得設定防火牆的規則，當然用exe 安裝的話通常都會詢問防火牆開啟例外的訊息
不過用指令安裝的話 就必須設定了， ex 我是在使用   memched 的服務下遇到的</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/4791868696487631189/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/4791868696487631189' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/4791868696487631189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/4791868696487631189'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/05/at-winserver2008.html' title='心得 網路服務 at winserver2008'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-2090469392413500083</id><published>2013-04-26T18:09:00.003+08:00</published><updated>2013-04-26T18:10:41.499+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'>心得- Memcached in java</title><content type='html'>&lt;h2&gt;
簡介&lt;/h2&gt;
摘要官方網站的介紹&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
特色有&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;免費&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;open source&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;高效率&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;分散式&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;使用記憶體儲存&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;以 key value 物件的方式存取資料&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;line-height: 9px;&quot;&gt;安全性較低，所以建議放在防火牆後面的機器&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
Server 安裝&lt;/h2&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;原始Lib 並不支援windows 系統， 若是使用linux 等系統的話去官方網站下載就可以&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #333333; font-family: Helvetica Neue, Helvetica, Arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;要額外安裝 &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;memcached&lt;b&gt;&amp;nbsp;for win&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
我是&lt;b&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;參考 [2] &lt;/span&gt;&lt;/b&gt;的步驟&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;將jar 解壓縮到資料夾如D:\Appserv\memcached&lt;/li&gt;
&lt;li&gt;配置服務&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;D:\Appserv\memcached&amp;gt;sc create memcached binPath= &quot;D:\Appserv\memcached\memcached.exe -p 9999 -l 127.0.0.1 -m 128 -d runservice&quot; DisplayName= &quot;memcached server&quot; start= auto depend= TCPIP&lt;/li&gt;
&lt;li&gt;其中 -p 9999 是指透過 port 9999 監聽請求 (預設為 11211 ) ， -l 127.0.0.1 是指伺服器指定的 IP 位址 (預設為 INDRR_ANY) ， -m 128 是指 memcached 最大可用的記憶體為 128 MB (預設 64 MB) ，最後 -d runservice 就是啟動為 Windows 服務。&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;再去工作管理員開啟服務&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;h2&gt;
重要議題&lt;/h2&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: #6aa84f;&quot;&gt;參考[3]&lt;/span&gt;&lt;/b&gt; ，摘要幾個重點&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
撰寫使用 memcached 程式的基本模式就是，先查看有沒有 key-value，有就把快取資料讀出來，沒有就運算結果後存到 memcached sever。這部份算是簡單的。真正困難的事情有兩件：&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;一是&lt;span style=&quot;color: #134f5c;&quot;&gt;&lt;b&gt;清除過期的快取資料&lt;/b&gt;&lt;/span&gt;(expire)&lt;/li&gt;
&lt;li&gt;二是&lt;span style=&quot;color: #cc0000;&quot;&gt;Key的命名&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
兩種方式&lt;b&gt;&lt;span style=&quot;color: #134f5c;&quot;&gt;清除快取資料&lt;/span&gt;&lt;/b&gt;：&lt;/div&gt;
&lt;div&gt;
一是在新增/刪除資料時，順便刪掉這個快取 key-value，這樣下次 request 來時便會重新 快取。&lt;/div&gt;
&lt;div&gt;
二是在有更新的時候直接重設快取資料(Reset)。要注意的是如果您有不同的程式會直接更新資料庫(也就是不只是透過主應用程式，還有別的背景程式)，就會有可能 memcachd 裡面的資料沒有被更新到，&lt;/div&gt;
&lt;div&gt;
解法有&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
1. 清空所有資料&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
2. 有一隻程式可以重建 memcached 裡面的資料&lt;/div&gt;
&lt;div&gt;
3. 統一用一套知道 memcached 機制的介面操作&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;Key的命名&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
為了 Security 避免被人猜到 Key 和避免超過 255 bytes 的 key 長度限制，建議你將 Key hash 過&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
Client API&amp;nbsp;&lt;/h2&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
我是使用 JAVA 的API &amp;nbsp;Memcached-Java-Client&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
摘錄 &amp;nbsp;&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;MemcachedBench.java 的說明 並加上註釋&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;

&lt;code&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;/**&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* Copyright (c) 2008 Greg Whalin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* All rights reserved.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* This library is free software; you can redistribute it and/or&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* modify it under the terms of the BSD license&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* This library is distributed in the hope that it will be&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* useful, but WITHOUT ANY WARRANTY; without even the implied&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* PURPOSE.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* You should have received a copy of the BSD License along with this&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* library.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;* @author Greg Whalin &lt;greg meetup.com=&quot;&quot;&gt;&amp;nbsp;&lt;/greg&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;package com.meetup.memcached.test;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import cht.batchevent.show.EventList;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import com.meetup.memcached.*;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import org.apache.log4j.Level;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import org.apache.log4j.Logger;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;import org.apache.log4j.BasicConfigurator;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;/*&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;public class MemcachedBench2 {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// logger&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;private static Logger log =&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Logger.getLogger( MemcachedBench2.class.getName() );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public static void main(String[] args) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;BasicConfigurator.configure();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;org.apache.log4j.Logger.getRootLogger().setLevel( Level.OFF );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int runs = Integer.parseInt(args[0]);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int start = Integer.parseInt(args[1]);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;//伺服器位址清單&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String[] serverlist = { &quot;127.0.0.1:9999&quot; };&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// initialize the pool for memcache servers&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SockIOPool pool = SockIOPool.getInstance( &quot;test&quot; );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.setServers(serverlist);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.setInitConn( 100 );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.setMinConn( 100 );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.setMaxConn( 500 );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.setMaintSleep( 20 );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.setNagle( false );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;pool.initialize();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// get client instance&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;MemcachedClient mc = new MemcachedClient( &quot;test&quot; ); &amp;nbsp; &amp;nbsp; &amp;nbsp; // 要和pool 的名稱一樣&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;mc.setCompressEnable( false );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String keyBase = &quot;testKey&quot;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;//String object = &quot;This is a test of an object blah blah es, serialization does not seem to slow things down so much. &amp;nbsp;The gzip compression is horrible horrible performance, so we only use it for very large objects. &amp;nbsp;I have not done any heavy benchmarking recently&quot;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;long begin = System.currentTimeMillis();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;long end = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;long time = end - begin;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = start; i &amp;lt; start+runs; i++) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;String str = (String) mc.get(keyBase + i);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// 沒有資料時和資料庫要資料， 取得後放入 memcatch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if(str == null){&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.out.println(i+&quot; is null &quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;OBJ_obj = new OBJ();&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;StringBuffer _theobj = new StringBuffer();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;_theobj&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;_obj.getDataFromDB()&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;font-family: monospace; white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;String object =&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;_theobj&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;.toString();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;mc.set(keyBase + i, object);&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;System.out.println(i+&quot; : &quot; + str);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;time = end - begin;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(runs + &quot; gets: &quot; + time + &quot;ms&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;font-family: monospace;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;// 取得多筆&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;String[] keys = new String[ runs ];&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;int j = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = start; i &amp;lt; start+runs; i++) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;keys[ j ] = keyBase + i;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;j++;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;begin = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Map vals = mc.getMulti( keys );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;time = end - begin;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(runs + &quot; getMulti: &quot; + time + &quot;ms&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;/*&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * &amp;nbsp;//刪除的語法&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; * begin = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;for (int i = start; i &amp;lt; start+runs; i++) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;mc.delete( keyBase + i );&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;end = System.currentTimeMillis();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;time = end - begin;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #38761d; font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;System.out.println(runs + &quot; deletes: &quot; + time + &quot;ms&quot;);*/&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;SockIOPool.getInstance( &quot;test&quot; ).shutDown();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;


&lt;/code&gt;

&lt;div&gt;
&lt;span style=&quot;color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 11.666666030883789px; line-height: 8.997395515441895px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
參考：&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
[1]&amp;nbsp;&lt;a href=&quot;http://memcached.org/&quot;&gt;官方網站&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
[2]&amp;nbsp;&lt;a href=&quot;http://www.jaceju.net/blog/archives/140/&quot;&gt;在 Windows 上安裝 Memcached&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
[3]&amp;nbsp;&lt;a href=&quot;http://ihower.tw/blog/archives/1768&quot;&gt;如何使用 memcached 做快取&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 12px; line-height: 9px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline;&quot;&gt;
[4] &lt;a href=&quot;https://github.com/gwhalin/Memcached-Java-Client&quot;&gt;Memcached-Java-Client&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/2090469392413500083/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/2090469392413500083' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/2090469392413500083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/2090469392413500083'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/04/memcached-in-java.html' title='心得- Memcached in java'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-3214410283432555306</id><published>2013-03-05T15:50:00.003+08:00</published><updated>2013-03-05T15:50:40.212+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eclipse"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="其他"/><title type='text'>Hibernate心得2 in eclipse 資源檔位置</title><content type='html'>一不小心 就配置錯誤 導致&amp;nbsp;org.apache.jasper.JasperException: /hibernate.cfg.xml not found&lt;br /&gt;
&lt;br /&gt;
在此紀錄一下位置&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #e78608; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot;&gt;------解决方法--------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot;&gt;没有hibernate.cfg.xml 写一个丢到classes下去&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #e78608; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot;&gt;------解决方法--------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot;&gt;你用的hibernate.cfg.xml还是hibernate.properties&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;background-color: white; color: #e78608; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot;&gt;------解决方法--------------------------------------------------------&lt;/span&gt;&lt;br style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Tahoma; font-size: 12px; line-height: 18px;&quot;&gt;没有hibernate.cfg.xml&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====================================&lt;br /&gt;
&lt;br /&gt;
以下是我在 eclipse 放的成功 位置&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUYAT4SV6L6czLB-GuXR0sPxw227cxbn2fUGEpz_rswW6L7Yv5m0mS5e-81FLKGpIkRTSioXo1nG1G0QFsclj7fIMvi0DC7-su3KS6JhAC3kea4HbckvPcyaBGgPNVeMlHmVcvIVl77-8/s1600/hibernate_eclipse1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUYAT4SV6L6czLB-GuXR0sPxw227cxbn2fUGEpz_rswW6L7Yv5m0mS5e-81FLKGpIkRTSioXo1nG1G0QFsclj7fIMvi0DC7-su3KS6JhAC3kea4HbckvPcyaBGgPNVeMlHmVcvIVl77-8/s1600/hibernate_eclipse1.jpg&quot; height=&quot;440&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
實際部屬在Tomcat的路徑&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjodOn_k8DwDaK6qOv0nG7qLTehCBzk0brq-Fen2nnLHTpIwil8KH6Gs4gzL_CHyb1ZijkDJ0kHGUNN35McYrxORjv8zuMc4b7j1pcaqi5ENX_440x77cCit-FEVuRfOX96Zj8X7EWz734/s1600/hibernate_eclipse2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjodOn_k8DwDaK6qOv0nG7qLTehCBzk0brq-Fen2nnLHTpIwil8KH6Gs4gzL_CHyb1ZijkDJ0kHGUNN35McYrxORjv8zuMc4b7j1pcaqi5ENX_440x77cCit-FEVuRfOX96Zj8X7EWz734/s1600/hibernate_eclipse2.jpg&quot; height=&quot;512&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考來源 : &amp;nbsp;&lt;a href=&quot;http://www.myexception.cn/java%20exception/264.html&quot;&gt;http://www.myexception.cn/java%20exception/264.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/3214410283432555306/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/3214410283432555306' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/3214410283432555306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/3214410283432555306'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/03/hibernate2-in-eclipse.html' title='Hibernate心得2 in eclipse 資源檔位置'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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/AVvXsEjUYAT4SV6L6czLB-GuXR0sPxw227cxbn2fUGEpz_rswW6L7Yv5m0mS5e-81FLKGpIkRTSioXo1nG1G0QFsclj7fIMvi0DC7-su3KS6JhAC3kea4HbckvPcyaBGgPNVeMlHmVcvIVl77-8/s72-c/hibernate_eclipse1.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1444155547342700308.post-1689239080588583332</id><published>2013-03-01T17:30:00.001+08:00</published><updated>2013-03-01T17:30:31.502+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'>Hibernate心得</title><content type='html'>前幾天上了一下&amp;nbsp;Hibernate 的課程，在此作一個摘要，&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;簡單的說 Hibernate &amp;nbsp;有一個好處可以當個接口，讓資料庫找到的資料直接轉成定義好得物件。&lt;/li&gt;
&lt;li&gt;而資料庫的連結定義，試用組態的XML來定義的，要抽換更改比較有彈性&lt;/li&gt;
&lt;li&gt;除了可以使用HQL的方式查詢，也可以利用 criteria 查詢， criteria &amp;nbsp;簡單的說定一種查詢的function 而不需使用SQL 類似的查詢語句&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hibernate 網站 (&lt;a href=&quot;http://www.hibernate.org/&quot;&gt;http://www.hibernate.org/&lt;/a&gt;)</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/1689239080588583332/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/1689239080588583332' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/1689239080588583332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/1689239080588583332'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/03/hibernate.html' title='Hibernate心得'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-664266358798797206</id><published>2013-01-08T17:47:00.005+08:00</published><updated>2013-01-08T17:47:48.733+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="知識"/><title type='text'>Lambda 語法</title><content type='html'>根據MSDN 的定義如下[1]：&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: #2a2a2a; font-family: &#39;Segoe UI&#39;, &#39;Lucida Grande&#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; padding-bottom: 15px;&quot;&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;883014533071beefc1784d8bf9feffac&quot; data-source=&quot;A lambda expression is an anonymous function that you can use to create delegates or expression tree types.&quot; id=&quot;mt1&quot; xml:space=&quot;preserve&quot;&gt;&lt;sentencetext xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Lambda 運算式是可用來建立委派或運算式樹狀架構型別的匿名函式。&lt;/sentencetext&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sentence SentenceHover&quot; data-guid=&quot;ea26fde047b6ec9aa4fd9cdc56502191&quot; data-source=&quot;By using lambda expressions, you can write local functions that can be passed as arguments or returned as the value of function calls.&quot; id=&quot;mt2&quot; style=&quot;background-color: #ffffe1;&quot; xml:space=&quot;preserve&quot;&gt;&lt;sentencetext xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;使用 Lambda 運算式，您可以撰寫可當做引數或傳回做為函式呼叫之值的區域函式。&lt;/sentencetext&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; id=&quot;mt3&quot; xml:space=&quot;preserve&quot;&gt;Lambda 運算式為撰寫 LINQ 查詢運算式中特別有用。&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; xml:space=&quot;preserve&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
不過看了半天還是沒有感覺，想不到Python[2]的寫法反而比較好理解&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; xml:space=&quot;preserve&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; xml:space=&quot;preserve&quot;&gt;其他針對不同語言也有人系新的整理[3]， javascript 也蠻好讀，不過JAVA 的寫法真是好神奇&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; xml:space=&quot;preserve&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; xml:space=&quot;preserve&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;sentence&quot; data-guid=&quot;e19a5962215ea73e69128a79661be6f6&quot; data-source=&quot;Lambda expressions are particularly helpful for writing LINQ query expressions.&quot; xml:space=&quot;preserve&quot;&gt;參考：&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
[1] MSDN , Ladbda(&lt;a href=&quot;http://msdn.microsoft.com/zh-tw/library/bb397687.aspx&quot;&gt;http://msdn.microsoft.com/zh-tw/library/bb397687.aspx&lt;/a&gt;)&lt;/div&gt;
&lt;div&gt;
[2]&amp;nbsp;Falldog的程式戰場 , &lt;a href=&quot;http://falldog7.blogspot.tw/2009/07/python-lambda.html&quot;&gt;[Python] lambda簡介&lt;/a&gt;&lt;br /&gt;
[3] 石頭閒語，&lt;a href=&quot;http://blog.roodo.com/rocksaying/archives/12742243.html&quot;&gt;透過 JavaScript,Ruby,PHP,C# 語言，理解 Java 的 Lambda 語法&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/664266358798797206/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/664266358798797206' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/664266358798797206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/664266358798797206'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/01/lambda.html' title='Lambda 語法'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-6195567153800795390</id><published>2013-01-08T14:38:00.003+08:00</published><updated>2013-01-08T14:38:34.017+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>專貼 javascript 字串比對 </title><content type='html'>由於最近有使用到 判斷字串中是否有特定文字的機制，所以紀錄一下。&lt;br /&gt;
&lt;br /&gt;
比如說， 有一串字&quot; 這是測試機&quot;， 我想要判斷 是否有包含&#39;測試&#39; 這兩個字，在javascript 可以使用&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #ffd966;&quot;&gt;String.search&lt;/span&gt; ， 若有的話 則會回傳 出現在第幾個位置，沒有的話則回傳-1&lt;br /&gt;
&lt;br /&gt;
當然 其他&amp;nbsp;&lt;span style=&quot;background-color: #d9ead3;&quot;&gt;String.indexof&lt;/span&gt;, &lt;span style=&quot;background-color: #d9ead3;&quot;&gt;String.match &lt;/span&gt;等也可以達到相同的效果&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
或可以參考：&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/search&quot;&gt;https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/search&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/6195567153800795390/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/6195567153800795390' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/6195567153800795390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/6195567153800795390'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2013/01/javascript.html' title='專貼 javascript 字串比對 '/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-2106854548224417896</id><published>2012-11-27T17:47:00.001+08:00</published><updated>2012-11-27T17:54:16.538+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="javascript"/><title type='text'>javascript 心得　regexp　replace</title><content type='html'>在範例中是將英文字母由小寫轉換成大寫&lt;br /&gt;
&lt;br /&gt;
我這裡應用是將數字不分加上標籤好套用CSS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ｃｏｄｅ　如下&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;
      function change(text){
         return &quot;&amp;lt;a class=&#39;thenumber&#39;&amp;gt;&quot;+text+&quot;&amp;lt;/a&amp;gt;&quot;;  &lt;br /&gt;
       }                     &lt;br /&gt;

         
      // 強調數字部份
       function ModifyStyleSubDescription(str){   &lt;br /&gt;

       //var str= &quot;11ABC 22 DEF&quot;;               &lt;br /&gt;

       //match number in range 0-999         &lt;br /&gt;

       var _result = &quot;&quot;;                   &lt;br /&gt;

       var reg = /(\d+)/g; // 使用g　才抓的到第二組    &lt;br /&gt;
    
       _result = str.replace(reg,change);        &lt;br /&gt;

       return _result;                          &lt;br /&gt;

        }

&lt;/code&gt;



&lt;br /&gt;
&lt;br /&gt;
原本使用的函式，但IE8不支援....
&lt;br /&gt;
&lt;code&gt;
    
         
      // 強調數字部份
       function ModifyStyleSubDescription(str){&lt;br /&gt;
      var _result = &quot;&quot;;&lt;br /&gt;
      var reg = /(\d+)/;  &lt;br /&gt;
      var parts = str.split(reg);  &lt;br /&gt;
       
      for (var i = 0 ; i &amp;lt; parts.length ; i ++){   &lt;br /&gt;
           if(parts[i].match(reg)){&lt;br /&gt;
       _result +=&quot;&amp;lt;a class=&#39;thenumber&#39;&amp;gt;&quot;+parts[i]+&quot;&amp;lt;/a&amp;gt;&quot;&lt;br /&gt;
           }else{&lt;br /&gt;
        _result +=parts[i];&lt;br /&gt;
            }   &lt;br /&gt;
      }    &lt;br /&gt;
       return _result;&lt;br /&gt;
        }&lt;br /&gt;

&lt;/code&gt;

&lt;br /&gt;
參考：W3Cschool ,&amp;nbsp;&lt;a href=&quot;http://www.w3school.com.cn/js/jsref_replace.asp&quot;&gt;http://www.w3school.com.cn/js/jsref_replace.asp&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/2106854548224417896/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/2106854548224417896' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/2106854548224417896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/2106854548224417896'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2012/11/javascript-regexpreplace.html' title='javascript 心得　regexp　replace'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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-1444155547342700308.post-3639291190728551312</id><published>2012-11-14T14:02:00.000+08:00</published><updated>2012-11-14T14:02:05.429+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><title type='text'>轉貼 java ssh jar</title><content type='html'>&lt;br /&gt;
當使用者要透過遠端SSH連接遠端機器時，若使用JAVA 的話 ，可以透過 JSch.jar 提供的API 來達成目的。&lt;br /&gt;
&lt;br /&gt;
實際參考的範例，可以參考[2]， 或查詢 &quot;java sftp example jsch&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考 ：&lt;br /&gt;
&lt;br /&gt;
[1] JSch, &lt;a href=&quot;http://www.jcraft.com/jsch/&quot;&gt;http://www.jcraft.com/jsch/&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
[2] Java 實現SFTP實例，&lt;span style=&quot;background-color: white; font-family: Helvetica, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 25.200000762939453px;&quot;&gt;&lt;a href=&quot;http://www.xfok.net/2009/10/124485.html&quot;&gt;http://www.xfok.net/2009/10/124485.html&lt;/a&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://catonchuang.blogspot.com/feeds/3639291190728551312/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1444155547342700308/3639291190728551312' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/3639291190728551312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1444155547342700308/posts/default/3639291190728551312'/><link rel='alternate' type='text/html' href='http://catonchuang.blogspot.com/2012/11/java-ssh-jar.html' title='轉貼 java ssh jar'/><author><name>Cc</name><uri>http://www.blogger.com/profile/03754456132610972097</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></feed>