<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9061386430991367162</id><updated>2011-11-28T08:29:37.268+08:00</updated><category term='Python'/><category term='Flash'/><category term='iPhone'/><category term='PostgreSQL'/><category term='Django'/><category term='php'/><category term='Database'/><category term='Cloud Computing'/><category term='Living'/><category term='Parser'/><category term='OOAD'/><category term='Java'/><category term='Android'/><category term='Component'/><category term='Google'/><category term='Google App Engine'/><category term='JavaFX'/><title type='text'>Beyond those variables</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>77</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-578513874672896572</id><published>2011-03-31T18:13:00.006+08:00</published><updated>2011-03-31T23:05:24.612+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>facebook api use on fb iframe canvas</title><summary type='text'>Recently there is a case that runs on facebook iframe canvas with php, which needs login verification and retrive information at each page, so I wrote a sample php to do this. fbmain.php will verify user is login or not, retrive user information and tell if user is a fan of some page. Right below is the sample that includes fbmain.php.

(P.S. To run the sample code below you need to download lib </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/578513874672896572/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2011/03/facebook-api-use-in-fb-iframe-canvas.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/578513874672896572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/578513874672896572'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2011/03/facebook-api-use-in-fb-iframe-canvas.html' title='facebook api use on fb iframe canvas'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-8695528388216047084</id><published>2010-08-14T11:24:00.000+08:00</published><updated>2010-08-14T11:24:09.892+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOAD'/><title type='text'>重構與否，不要陷入迷思</title><summary type='text'>很多對程式有著很大熱情的工程師們都會認為良好的程式碼才是一切，於是不斷找空檔將其重構。但事實上這些年我慢慢試著阻止自己這樣作，當然，如果是真的寫的很差的程式，例如每個地方都有相同一塊塊的code，整理是必需的。

不過常常重構也是產生更多問題的開始，例如已經穩定的產品，工程師為了要加入一些設計模式而造成出貨時間的延宕。在台灣大多數的公司都沒有系統架構師這個職位，所以都由工程師來擔任設計，一開始所思考的想法便不是宏觀大局的眼界，日後才會需要一直改...

寫程式的初衷是要達到它的功能，並不是為了要做出藝術品，這就是我的觀點，因為使用者不會在意背後到底是怎麼做的，如果能讓人用的滿意，就是好產品！</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/8695528388216047084/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/08/blog-post.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8695528388216047084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8695528388216047084'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/08/blog-post.html' title='重構與否，不要陷入迷思'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4485877930273899147</id><published>2010-05-14T21:40:00.002+08:00</published><updated>2010-05-28T10:43:35.708+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>iPhone App[iPeg] 上架摟～</title><summary type='text'>

經過一次的reject,整體審核時間約14天(所以其實沒有意外的話，Apple每次的審核大約是7個工作天(當地時間)),終於在今天上架了,我自己很感動的去購買第一個app(0.99 us)... 其實這過程中，程式不是最難的，是美工...程式只花2天，但美工改了6次阿...希望各位給予一點建議指教^^, 順便膨場一下！！



本次的版本共有8關：
1. Cross 
2. Addition 
3. Rocket 
4. Pyramid 
5. SingleArrow 
6. DoubleArrow 
7. Diamond 
8. SpaceShuttle 日後會繼續增加關數，如果您是這方面的好手，也可以提供我一些建議。iTunes Store位址： http://itunes.apple.com/us/app/ipeg/id370548177?mt=8或是直接在iPhone中搜尋</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4485877930273899147/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/05/iphone-appipeg.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4485877930273899147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4485877930273899147'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/05/iphone-appipeg.html' title='iPhone App[iPeg] 上架摟～'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uge0r2l3u1Q/S-1SKxL7x3I/AAAAAAAAEJM/Kc4_72B0cck/s72-c/appstore.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-3563478516971078135</id><published>2010-04-29T15:59:00.001+08:00</published><updated>2010-04-29T16:02:35.097+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>iPhone開發技巧(5) 找到先前版本的 iPhone SDK 與 Xcode</title><summary type='text'>抱歉隔了好長一大段時間才又寫了新的文章，因為Sam最近在忙論文口試與準備上架第一個iPhone App，在整個開發過程中有參考不少的網路OpenGL ES for iPhone教學，但是有些人可能會發現到因為Apple更新速度很快，所以很多程式框架是在2009年被拍成教學，但在2010年那些框架就全改了。並且，在你申請完ADC帳號後，作實機測試的時候也有一項很麻煩的問題，例如Sam的iPhone更新到3.1.3但是Xcode與SDK是3.1.2，然後執行時候它會和你說裝置版本不符合所以不能Run，這時候千萬不要Restore版本歐！！(除非你裡頭資料不要了...)，於是你上去ADC找，會發現只有最新版本Snow Leopard，通常像Sam還沒升級(還是leopard)的就認命Restore...。



Sam在這裡提供大家一個小技巧來下載之前版本的iPhone SDK與Xcode，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/3563478516971078135/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/04/iphone5-iphone-sdk-xcode.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3563478516971078135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3563478516971078135'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/04/iphone5-iphone-sdk-xcode.html' title='iPhone開發技巧(5) 找到先前版本的 iPhone SDK 與 Xcode'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-618279841604525833</id><published>2010-03-25T16:40:00.003+08:00</published><updated>2010-03-25T16:46:03.496+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>iPhone 開發技巧(4) 通知追蹤</title><summary type='text'>我們平常對於iPhone App的開發，都是著重在MVC或商業邏輯上，當然大家一定會有自己的一套除錯方式，或是利用Performance Tool等來進行調效，不過這裡Sam想和大家說一下通知追蹤。

iPhone應用程式中的互動可分為三大類：Delegate(委派)、Target-Action(目標-動作)及Notification(通知)。

Delegate(委派)的作用方式可將它想像成使用者告知A去做事，而A事先把這份責任委派給B，因此，A在接收到做事指令後會直接轉交B來執行(聽起來有點類似推卸責任...雖然最後還是會把事情做完...)。

Target-Action(目標-動作)的作用方式有點類似觸發的概念，大多用在UIControl的子類別中，例如UIBarButtonItem在新建時可以設定target與action, 表示當使用者按下這個UIBarButtonItem，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/618279841604525833/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-4.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/618279841604525833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/618279841604525833'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-4.html' title='iPhone 開發技巧(4) 通知追蹤'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uge0r2l3u1Q/S6shIDc5k0I/AAAAAAAAEA4/yy6PCrf1DuI/s72-c/Picture+1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6823981956956255782</id><published>2010-03-24T17:32:00.014+08:00</published><updated>2010-03-24T21:08:14.999+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>iPhone 開發技巧(3) 不用NIB(XIB)產生應用程式</title><summary type='text'>延續技巧(2)的結論，Sam覺得還是示範一下怎麼樣不用NIB(XIB)來產生應用程式。
首先，新建一個Window-based Application的Project，然後你會在左方看到如下圖所示的檔案清單。
 

接下來請毫不猶豫的砍掉Classes資料夾與Resources資料夾內的MainWindow.xib。刪除的同時會有視窗跳出，請選擇Also Move to Trash。
 
打開Resources資料夾中的plist，刪除下圖中紅色圈選列並存檔關閉。 
 
然後我們在Other Sources內的main.m開始編寫程式碼，有兩個最重要的介面要實作，分別是UIViewController與UIApplicationDelegate。 UIViewController的功用為建立應用程式所需之視圖，當被載入時建立一個UIView，然後在view上加入一個UILabel顯示文字</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6823981956956255782/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-3-nibxib.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6823981956956255782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6823981956956255782'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-3-nibxib.html' title='iPhone 開發技巧(3) 不用NIB(XIB)產生應用程式'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uge0r2l3u1Q/S6ndVETaMyI/AAAAAAAAD_o/qpWqAYDaRSs/s72-c/Picture+1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-8151326046737040646</id><published>2010-03-19T21:01:00.008+08:00</published><updated>2010-03-24T21:08:43.774+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>iPhone 開發技巧(2) 要不要使用NIB(XIB)?</title><summary type='text'>我們在開發應用程式的時候都會使用InterfaceBuilder的視覺化界面來配製NIB(XIB)內的元件，這樣的確是比較省事，不過說穿了，NIB(XIB)在編譯的時候一樣是去產生一堆code。如果想知道你的NIB(XIB)到底在幹嘛，Adrian Kosmaczewski這位仁兄寫了一套轉換模組nib2objc，可以拿來玩看看。 
一般開發者總是會認為從頭到尾都用code去產生的效能會最好，事實上這個觀念也沒有錯，Matt Gallagher 針對 UITableView 的顯示進行了比較，一方是由InterfaceBuilder產生，另一方用code來建立視圖。

  
不出所料，模擬器上code大勝20%
  
但是在實機上，一開始Code贏了15%，不過第三個cell之後，卻由NIB(XIB)開始領先了17%。
  
再經過微調每個儲存格中字型不要自動符合大小 </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/8151326046737040646/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-2-nib.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8151326046737040646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8151326046737040646'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-2-nib.html' title='iPhone 開發技巧(2) 要不要使用NIB(XIB)?'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uge0r2l3u1Q/S6N52eORFRI/AAAAAAAAD_Q/rsHjhe6-gM4/s72-c/100303082046f36bd7d2cd5110.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6634676666573427801</id><published>2010-03-09T16:45:00.005+08:00</published><updated>2010-03-24T21:08:57.886+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>iPhone 開發技巧(1) release 的使用</title><summary type='text'>一般而言，iPhone開發的時候要自己管理記憶體，雖然可以使用autorelease pool來讓Objective-C自動回收，但大多數的程式設計師還是喜歡自己掌控變數的生死，因此就會使用到大量的release方法。
例如:
NSMutableArray *array = [[NSMutableArray alloc] initWithObjects:@"A", @"B", @"C", nil];
[array release];

但是如果你的變數是從其他物件指定(assign)過來的話，又在指定完直接給它release的話，就會產生EXC_BAD_ACCESS的錯誤（前提是這個變數在原本物件也有被release）。而常常程式設計師在寫的昏天暗地的時候就會搞混（所以人家都說管理記憶體是一件很煩的事情），所以請記住一個口訣:
“Only release if you did an </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6634676666573427801/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-1-release.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6634676666573427801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6634676666573427801'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/03/iphone-1-release.html' title='iPhone 開發技巧(1) release 的使用'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-845462627470281846</id><published>2010-01-22T21:00:00.005+08:00</published><updated>2010-03-24T21:09:12.232+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>再會了～昇陽 So long, old friend</title><summary type='text'>歐盟今天通過了Oracle與Sun的併購案，也等於宣告Sun這個偉大公司的離去～
Java之父James Gosling在他的部落格貼出一幅畫，應該非常貼切許多Java人（或者是傾向Open Source程式開發者）的心聲...


畫中Java吉祥物Duke與疑似Linux吉祥物企鵝的角色一同悼念著Sun的墓碑。雖然Sun的業務不會消失，且Java不是依附在Sun旗下，但多少它的名義已經逝去了，以後變成與Oracle關連...有人還用語法回應了Sun的歷史，呵呵
Sun sun = new Sun( 1982 );
sun.create( "SunSparc", "Solaris", "Java", "OpenOffice" );
sun.buy( "MySQL");
oracle.buy( sun, 2010 );
oracle.getPatents( sun );
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/845462627470281846/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/01/so-long-old-friend.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/845462627470281846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/845462627470281846'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/01/so-long-old-friend.html' title='再會了～昇陽 So long, old friend'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uge0r2l3u1Q/S1miuVyanCI/AAAAAAAAD9Q/SpgHZUmfNMc/s72-c/2010012211003072.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2023426517979298069</id><published>2010-01-21T21:45:00.006+08:00</published><updated>2010-03-24T21:09:44.646+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>心智圖與甘特圖運用</title><summary type='text'>最近這兩天在整理論文的東西，也順便預定了一下論文時程，老實說，又要系統實作、手機應用加上專家訪談，真的是相當累人，所以只要一環進度落後就會造成很大的影響，因此甘特圖就是必備的東西。
甘特圖（Gantt Chart）由亨利·甘特於1910年開發的，主要為透過條狀圖來顯示項目、進度、和其它時間相關因素隨著時間進展的情況。
其中，橫軸表示時間，縱軸表示活動（項目）。線條表示在整個期間上計劃和實際的活動完成情況。甘特圖可以直覺地表明任務計劃在什麼時候進行，及實際進展與計劃要求的對比。管理者由此可以非常便利地弄清每一項任務（項目）還剩下哪些工作要做，並可評估工作是提前還是落後，亦或正常進行。除此以外，甘特圖還有簡單、醒目和便於編制等特點。

Sam自己在mac上用的是這一套自由軟體 Gantt Project，除了支援各項功能外，也支援各國語系與各系統(MacOSX, Windows, Linux</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2023426517979298069/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/01/blog-post_21.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2023426517979298069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2023426517979298069'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/01/blog-post_21.html' title='心智圖與甘特圖運用'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/S1hdsGcW7bI/AAAAAAAAD9A/kyIqElE7-Fg/s72-c/Picture+3.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-408314751864390557</id><published>2010-01-20T13:16:00.002+08:00</published><updated>2010-01-20T13:25:03.410+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>Google GO 語言獲得 TIOBE 評選為2009年度程式語言</title><summary type='text'>
TIOBE的年度語言排名又出爐了 ~ Java仍然穩站第一位，php排名提升，python仍然不動，不過由於iPhone的關係，Objective-C 躍昇到12名，而去年11月才發表的Google GO語言則莫名其妙的一下跳到13名...


原文出處：http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/408314751864390557/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/01/google-go-tiobe-2009.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/408314751864390557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/408314751864390557'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/01/google-go-tiobe-2009.html' title='Google GO 語言獲得 TIOBE 評選為2009年度程式語言'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/S1aTnGg4BiI/AAAAAAAAD84/FkEJyam6EN8/s72-c/Untitled-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-8845288633408892377</id><published>2010-01-16T22:47:00.011+08:00</published><updated>2010-03-24T21:10:13.489+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>安裝PostgreSQL on Mac OSX</title><summary type='text'>之前Sam使用過資料庫的經驗有Oracle、MSSQL，當然最常依然是MySQL。基於php全球使用人數眾多，而通常與MySQL直接綁在一起變成書籍、課程等，也讓MySQL的聲名大噪。不過最近由於論文要研究一些國外的典藏系統(DSpace)，發現他們除了商用資料庫外，也有使用PostgreSQL(念法為post-gres-ql)。PostgreSQL首次發行日為1989，MySQL為1996，所以請不要因為沒聽過它的名號就認為它很新或不夠成熟...

一般業界近年來普遍認為MySQL較為快速與容易上手，PostgreSQL則是被定義為強大的、注重資料完整性、對於SQL描述嚴格，速度較慢也較難上手。如要了解開源碼資料庫最新相關規格(2009)比較請參考http://www.devx.com/dbzone/Article/29480
而就Sam實作的典藏系統來說，Transaction</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/8845288633408892377/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/01/postgresql-on-mac-osx.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8845288633408892377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8845288633408892377'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/01/postgresql-on-mac-osx.html' title='安裝PostgreSQL on Mac OSX'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1470061080626293601</id><published>2010-01-14T12:08:00.001+08:00</published><updated>2010-03-24T21:12:18.963+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>如何做一個出色的程式人員(轉)</title><summary type='text'>轉自 http://blog.csdn.net/lkjxshi/archive/2010/01/07/5149541.aspx
愛這行！ ！ ！
從事任何行業都一樣，只有真正的愛上了這份工作，才會投入熱情，才會在順境中自我警醒，在逆境中尋找突破。這個行業的競爭很激烈，你停下來走，別人就立刻會跑步超過你，沒有對這一行業的一種熱情，就很難在困境中保持一種執著的態度堅持到底。
踏踏實實“紮馬步”
今天無意中看了“校長”的“程序員&amp;司機”，其中談到了關於程序員速成的問題。其實速成班畢業的“系統殺手”早已在遍布大江南北，只是在互聯網時代，互聯網的應用型軟件生命週期越來越短，業務驅動主導的情況下，這種速成方式看起來反而提高了企業生產效率。但這樣的人才也就只能寫幾個Facebook上的插件應用或者iGoogle上的Gadget，真的要出Google，Amazon，Yahoo改變互聯網世界的企業，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1470061080626293601/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/01/blog-post_14.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1470061080626293601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1470061080626293601'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/01/blog-post_14.html' title='如何做一個出色的程式人員(轉)'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5993588798559477837</id><published>2010-01-13T23:05:00.003+08:00</published><updated>2010-03-24T21:12:36.402+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>反三段論</title><summary type='text'>剛在JavaWorld@TW上看到有某大軟體公司在徵人，並且面試題目考的是相當有難度的Syllogism
三段論是由亞里士多德創立，用於推出結論。至於反三段，是人們日常思維中常用到的推理模式。其形式如下：
如果P並且Q則會R
所以，如果非R並且P則會非Q
或者
如果P並且Q則會R
所以，如果非R並且Q則會非P

------------------------------------------------------------------------
現試以MBA入學考試的邏輯題為例：
如果所有的鳥都會飛，並且鴕鳥是鳥，則鴕鳥會飛。
依據上述斷定，增加以下哪個條件，能推出「有些鳥不會飛」？
A. 鴕鳥不是鳥，且鴕鳥會飛；
B. 有的鳥會飛，且鴕鳥是鳥；
C. 鴕鳥不會飛，但鴕鳥是鳥；
D. 鴕鳥不會飛，且所有的鳥都會飛；
解析：前提部分可以表示用邏輯結構表示為“如果p且q則r”，有些</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5993588798559477837/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2010/01/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5993588798559477837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5993588798559477837'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2010/01/blog-post.html' title='反三段論'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-3885676469553366543</id><published>2009-12-30T18:40:00.003+08:00</published><updated>2010-03-24T21:13:03.737+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>未來五年內開發者所需的技能</title><summary type='text'>剛看到這篇有趣的文章，其中提到：
1: One of the “Big Three” (.NET, Java, PHP) - 學會三大巨頭之一(.NET, Java, PHP)
2: Rich Internet Applications (RIAs) - RIA技能(Flash, Flex, JavaFX, Sliverlight)
3: Web development - 網站開發
4: Web services - 網路服務開發
5: Soft skills - 請放眼IT產業未來的觀點，並觀察公司外的走向
6: One dynamic and/or functional programming language - 雖然Ruby, Python目前還不是主流語言，但它們觀念是，所以有朝一日爬升上來時，你會的話就很吃香


7: Agile methodologies - 敏捷開發
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/3885676469553366543/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/12/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3885676469553366543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3885676469553366543'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/12/blog-post.html' title='未來五年內開發者所需的技能'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7453934667819532112</id><published>2009-11-25T16:45:00.002+08:00</published><updated>2010-03-24T21:13:18.351+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cloud Computing'/><title type='text'>免費的雲端防毒軟體 - Panda Cloud Antivirus</title><summary type='text'>免費的雲端防毒軟體
http://www.cloudantivirus.com/en/
以「第一個沒有更新選項的防毒軟體」聞名全球的Panda Cloud Antivirus，能以最快最即時的雲端防護機制來對抗最新最危險的病毒威脅。別說不可能，藉由集體人工智慧的幫助，Panda先進的伺服器群組能在雲端收集來自世界各地用戶的惡意程式資訊，並且自動進行病毒碼辨識，進而將新的惡意程式病毒株在短短幾分鐘內歸檔完畢。集體人工智慧結合了本機電腦偵測技術與即時的雲端掃描機制，能在提供最強大防護的同時，帶給電腦最低程度的資源耗損（僅需消耗20MB的記憶體容量）。
Panda Cloud Antivirus相容於Windows XP (32位元)、 Windows Vista (32位元 / 64位元) 以及Windows 7 (32位元 / 64位元) 等知名操作系統，並且廣泛支援了11國語言。 
近期</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7453934667819532112/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/11/panda-cloud-antivirus.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7453934667819532112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7453934667819532112'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/11/panda-cloud-antivirus.html' title='免費的雲端防毒軟體 - Panda Cloud Antivirus'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1241558207788750183</id><published>2009-11-11T17:44:00.002+08:00</published><updated>2009-11-11T17:47:41.601+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Google發表新的程式語言「Go」</title><summary type='text'> 轉載自http://www.ithome.com.tw/itadm/article.php?c=58033:

Google周一（11/10）發表了新的系統程式語言「Go」，以加速程式開發。Go結合了像是Python動態語言的開發速度，以及擁有C及C++語言等編譯語言的效能及安全性，同時也是一個開放源碼計畫。

Google表示，近十多年來運算環境變化很大，但卻沒有新興的系統語言，導致軟體開發跟不上電腦發展速度。例如有愈來愈多的開發人員不喜歡Java及 C++的笨重型態，因而轉向動態的Python與JavaScript語言，而現在受歡迎的系統語言亦未妥善支援基本的垃圾蒐集或平行運算概念。

這也使得Google認為現在值得嘗試新的語言。Go是一個並行的，具垃圾蒐集功能的語言，並可快速編譯。它在單一電腦上可於幾秒內編譯一個大型的Go程式；而且提供一個軟體架構模型以讓相依分析更容易，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1241558207788750183/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/11/googlego.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1241558207788750183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1241558207788750183'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/11/googlego.html' title='Google發表新的程式語言「Go」'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4982531191832307403</id><published>2009-11-11T11:57:00.002+08:00</published><updated>2009-11-11T12:09:53.482+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google App Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Django'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Google IO大會上Guido van Rossum對於GAE的演講</title><summary type='text'>
由於python創始人Guido van Rossum被Google收錄進去...所以python可說是google開發的主力,而GAE也是基於python + django的環境改寫而成, 我們來聽聽去年Google IO大會上Guido van Rossum對於GAE的演講




然後也有介紹python的特性與其他相關部分
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4982531191832307403/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/11/google-ioguido-van-rossumgae.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4982531191832307403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4982531191832307403'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/11/google-ioguido-van-rossumgae.html' title='Google IO大會上Guido van Rossum對於GAE的演講'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1053107183273995969</id><published>2009-10-17T23:26:00.002+08:00</published><updated>2009-10-17T23:32:33.186+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Flash Loader 載入外部 swf 時 stage=null 的問題</title><summary type='text'>
剛剛寫as的時候發生一個問題，由於被載入的swf裡頭有運用stage作場景控制，故被主頁載入時出現 TypeError: Error #1009: Cannot access a property or method of a null object reference.

原因在於被載入的swf在主頁尚未將它加入至場景上時就呼叫了建構子，因此，我們可以運用以下的方法解決：

public function Page05DocumentClass()
{
    if (stage){
        initApp();
    } else {
        addEventListener(Event.ADDED_TO_STAGE, initApp);
    }
}
        
private function initApp(evt:Event=null):void
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1053107183273995969/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/10/flash-loader-swf-stagenull.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1053107183273995969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1053107183273995969'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/10/flash-loader-swf-stagenull.html' title='Flash Loader 載入外部 swf 時 stage=null 的問題'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5994370099530431282</id><published>2009-09-10T10:14:00.000+08:00</published><updated>2009-09-10T10:16:40.836+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>創造「耐心練習周期」(轉)</title><summary type='text'>的確我是一個極度沒有耐心的人，所以要從現在開始訓練...


耐心是心的一種性質，可以藉由蓄意的練習而大幅提升。我發現可以磨練耐心的一個有效方法，就是創造真正的練習周期，也就是在心中設定練習耐心藝術的時間周期。生活本身變成了一間教室，課程叫做「耐心」。

你可以從短短的五分鐘開始，然後逐漸延長你的耐心的容忍度。剛開始的時候，不妨告訴自己：「好，接下來這五分鐘，我不要對任何事情生氣，我要保持耐心。」你將會有驚人的發現。保持耐心的企圖，尤其是你知道只要忍耐一下子，就會立刻加强耐心的容忍度。耐心是那種食髓知味的特質，你將會發現，你確實有能力保持耐心，即使時間長一點也可以。日子久了以後，你甚至會變成一個很有耐心的人。

當我們保持鎮定時，不讓自己生氣或懊惱時，就可以冷靜而堅定地控制行為，這比發怒生氣有效多了。這個讓心靈朝耐心努力的過程簡單易學，重要就是把持自己想發脾氣的情緒，不再鑽牛角尖。

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5994370099530431282/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/09/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5994370099530431282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5994370099530431282'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/09/blog-post.html' title='創造「耐心練習周期」(轉)'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-8636653563050751843</id><published>2009-07-27T21:53:00.001+08:00</published><updated>2009-07-27T22:36:51.365+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>前瞻與創意思考</title><summary type='text'>創新事實上是指創意加變革，單單只有創意但未付諸行動，就還不是創新。例如 明基科技董事長 李焜耀 說過“創新是一種行為的習慣，習慣獨特的方法、理念與結果，勇於做自己”，不隨波逐流，不盲從，正是創新的根源。

 但是，創新並不是突然靈光乍現就足夠，必須還得包括詳細的分析與系統化的流程一步步實現，然而時代在變，人也在變，整個外在環境都在劇烈變動，組織的管理與運作也必須改變，不過需要改變什麼？什麼需要改變？可以奇異的領導力四個“Ｅ”為其重點：

(一) Energy : 高度的幹勁
(二) Energize : 激勵他人的能力
(三) Edge : 制定艱難決策的精準度
(四) Execute : 貫徹執行達成目標的能力

由此可見創新是能夠被管理的，但如何能有效領導創新呢？身為一個創新領導的角色，該員必須要有幹勁，並能影響其他人使他們同樣有幹勁，另外必須要精準不莽撞(瞎忙)，並要真正做的到。</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/8636653563050751843/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/07/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8636653563050751843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8636653563050751843'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/07/blog-post.html' title='前瞻與創意思考'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-3218019401861061264</id><published>2009-06-25T22:54:00.004+08:00</published><updated>2009-06-28T01:10:01.516+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>適當地運用研發與創新</title><summary type='text'>
"研發"囊括了"研究"與"發展"，並可細分為三個部分:

1. 基礎研究 - 主要為了增加科學知識，或許沒有後續的商業應用。
2. 應用研究 - 增加特定應用或需求的知識。
3. 發展 - 應用知識產生有用的實體產品。

Sam感覺大部分在台灣的中小企業都是先產生3的想法再回過頭去研究2...至於1基本上是無產值所以不太被重視。因為總是要在最短時間內得到成效，如果不好才能評估改進或淘汰，或許因應各國的風情不同會產生差異性的結果，但從過去歷史的經驗上，很多大賣的產品都不是專門為了商業利益所開發，可能是機緣巧合，也可能只是對該項事物有極大化的熱情，而促使個人與團隊不惜成本去研究，最後出乎意料的受到好評。

日前感謝"大Sam"的關照，有榮幸去參加Google Marissa Mayer的座談會，她也敘述了Google為外人津津樂道的80/20理論。Sam認為，20%</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/3218019401861061264/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/06/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3218019401861061264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3218019401861061264'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/06/blog-post.html' title='適當地運用研發與創新'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7251916006497954899</id><published>2009-06-06T20:16:00.002+08:00</published><updated>2009-06-06T20:24:30.704+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>Objective-C 初級讀本翻譯</title><summary type='text'>
由於目前 Sam 開始寫 iPhone 程式，但又完全不熟悉 Objective-C，所以只能依照 Apple dev center 內的教學流程走，當然也要從 Objective-C 的一些觀念下手，Sam 花了兩天時間將 Learning Objective-C: A Primer 這篇文章翻譯成中文，畢竟有關資源實在太少，也只能希望未來更多人能夠幫忙翻譯裡頭一些好文章，讓大家一起加入 iPhone 開發的行列。

 如果翻的不好還請多多見諒。

文章下載</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7251916006497954899/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/06/objective-c.html#comment-form' title='6 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7251916006497954899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7251916006497954899'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/06/objective-c.html' title='Objective-C 初級讀本翻譯'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-8628493249898884156</id><published>2009-05-29T11:56:00.003+08:00</published><updated>2009-05-29T12:18:59.113+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google App Engine'/><title type='text'>Mircosoft Azure 的野心</title><summary type='text'>
有在注意產業相關新聞的人應該都知道微軟已經和Zend(PHP)合作了。很多人可能覺得很奇怪，也有些人認為這樣很好，讓PHP能夠更容易在Windows伺服器上使用...

哪有那麼簡單！！！

Sam 覺得微軟是為了他們的雲端平台Azure，畢竟一開始就落後了Google, Amazon, IBM，想要及時迎頭趕上是蠻麻煩的，於是乎只好搬出這招，打著PHP的光環吸引更多PHP開發者(為數驚人的高市占率)，而且其他家平台都是 Java、Python 之類的語言，較為小眾市場或不是那麼容易入門，相對的以商業角度來看，微軟下對了一步險棋。

但就Sam開發的經驗來看，PHP似乎在系統動態套件擴充部份有一點糟糕，有玩過PHP設定的人都知道要把套件 1.重新編譯(Unix-like) 2.套件檔放到lib下然後修改設定檔(Windows) ，不過雲端平台表示碰不到系統，自然就無法安裝這些東西，這是</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/8628493249898884156/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/05/mircosoft-azure.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8628493249898884156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8628493249898884156'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/05/mircosoft-azure.html' title='Mircosoft Azure 的野心'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1014648674252478240</id><published>2009-05-26T17:36:00.004+08:00</published><updated>2009-05-26T18:36:10.862+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google App Engine'/><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>GAE ( Google App Engine ) 模式為什麼將來會流行?</title><summary type='text'>
一開始寫這篇文章標題時，本來想下"為甚麼GAE( Google App Engine )在台灣乏人問津..."，但是與其批判，不如說一些真正吸引廠商或老闆的條件比較實在。

講到GAE就不能不提雲端，雲泛指網路世界，其實中國把Cloud Computing稱作雲運算，但Sam還是覺得台灣翻的好，因為重點是終"端"使用者。Google之所以能夠讓用戶端幾近立即的得到搜尋結果，在於內部程式幾乎都實作了Map和Reduce方法去驅動機器讓資料中心平行同步幫您處裡，才能夠達到如此高的效率(參見Map-Reduce)。

這時候我們開始回歸到現實面，如果您擁有一家軟體開發，或目前已經在提供現上應用服務的企業(無論大小)，您會怎麼處理資料? 目前情況不外乎是砸錢設機房、買伺服器、請網管維護、負擔線路費用，或是中小企業租用虛擬伺服器。但如果以上都能省略呢? 俗話說 "打蛇打七寸"，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1014648674252478240/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/05/gae-google-app-engine.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1014648674252478240'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1014648674252478240'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/05/gae-google-app-engine.html' title='GAE ( Google App Engine ) 模式為什麼將來會流行?'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4122957753615755306</id><published>2009-05-26T15:11:00.003+08:00</published><updated>2009-05-26T15:35:58.614+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Web標準可能讓Flash過氣 ... 嗎?</title><summary type='text'>
早上起床看到一篇文章 Opera：Web標準可能讓Flash過氣，大致上是敘述Opera的執行長說下一版HTML網路程式設計語言推出後，可能讓Adobe公司(奧多比)的Flash技術顯得多餘。

當然不可否認的 HTML 5.0 的確新增了許多讓人心動的功能，如:

‧ 本機儲存(Local storage)，在個人的電腦上儲存資料的技術。此功能可讓你在離線狀態下使用網頁電子郵件，儲存瀏覽器擴充套件的個人設定。

‧ 影像支援(Video support)，讓影片更容易嵌入網頁，並且更容易與Flash等影像技術整合。

‧ 網路工作者(Web workers)，此功能讓瀏覽器在背景執行繁雜的處理任務，讓複雜的網路程式完成任務，又能避免造成使用者介面變得太笨重。

另外還有一些標籤更詳細的定義等...不過不要忘記，就算功能再如何增加，還是在處理Client端的事情，而目前flash</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4122957753615755306/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/05/webflash.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4122957753615755306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4122957753615755306'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/05/webflash.html' title='Web標準可能讓Flash過氣 ... 嗎?'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5355822947250918358</id><published>2009-05-20T11:43:00.007+08:00</published><updated>2009-05-20T12:10:45.590+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>學習 CakePHP</title><summary type='text'>
之前回絕掉一個cakePHP的案子, 實在是因為要寫報告和找資料太忙了...。
說到cakePHP, 最重要的就是 MVC(Model-View-Controller) 的設計模式, 以往由於php是比較近似於程序導向語言, 故大家都會把所有動作與畫面顯示寫在一隻程式上, 當然這樣是很方便的, 不過萬一遇到的不是網站而是大型的網路應用程式, 可能這個做法會讓你非常頭痛, 等到寫幾百隻php時回頭除錯真可形容為"欲哭無淚"。而 MVC 所指的是把 1.資料處裡 2.流程邏輯 3.畫面顯示 分開, 這樣針對不同的功能產生清晰的分類, 維護與除錯就不再是一件惱人的事。 

傳統的寫法 


MVC的寫法 



此外 cakePHP 在資料層(Model)做了物件關連映射 ORM(Object-Relational Mapping) 的處理, 可以以物件導向的方式操作資料庫欄位(做了映射, </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5355822947250918358/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/05/cakephp.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5355822947250918358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5355822947250918358'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/05/cakephp.html' title='學習 CakePHP'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uge0r2l3u1Q/ShOCumvuJBI/AAAAAAAAClo/j_XnO2dZi-8/s72-c/pic21.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1076249512885964993</id><published>2009-03-30T12:35:00.003+08:00</published><updated>2009-03-30T12:51:41.034+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>PyPdf 讀取中文Pdf亂碼問題</title><summary type='text'>
最近找論文資料常常會下載一堆相關題目的pdf檔然後慢慢消化，不過這樣實在是很浪費時間，所以週末就想說寫一隻程式搜尋資料夾中所有pdf，然後給它關鍵詞，最後能夠顯示這些關鍵詞在哪幾篇pdf的第幾頁中，如此一來就省事多了。

python的好處就是擴充套件多如過江之鯽，當然光pdf就好多個，這裡挑選的是PyPdf.

安裝完成之後先以取出內容文字為主寫出一段程式測試，測試pdf為中文big5編碼，但除了標題encode("big5")能夠正常顯示中文外，內容卻是一片亂碼，於是把每段文字拆解成char再使用hex code列印出來...

0xb8 0xea ... 這不是big5的"資"嗎?表示編碼是正確的阿!為何print就是有錯誤?

於是我使用一個範例字串 zh = "\xb8\xea" ，print出來是"資"沒錯，但 u"\xb8\xea" 加上unicode</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1076249512885964993/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/pypdf-pdf.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1076249512885964993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1076249512885964993'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/pypdf-pdf.html' title='PyPdf 讀取中文Pdf亂碼問題'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2536011095523129464</id><published>2009-03-26T17:22:00.002+08:00</published><updated>2009-03-26T17:26:49.431+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>妙事一籮筐</title><summary type='text'>
這幾天真的很妙~

前天收到一個加拿大台灣留學生請我幫忙寫他們教授出的python作業



今天早上iCloud CEO也發了一封信請我幫忙翻譯(當然不是只有我啦, 還有很多其他中國地區使用者)


內容大概是這樣


算是為了這周平凡無奇的生活添加一點樂趣^^</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2536011095523129464/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/blog-post_26.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2536011095523129464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2536011095523129464'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/blog-post_26.html' title='妙事一籮筐'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/SctJZZWO2hI/AAAAAAAACik/MmFcSGAVs1M/s72-c/work.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4579572058191593464</id><published>2009-03-25T15:06:00.004+08:00</published><updated>2009-03-25T15:33:06.759+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python RssParser with MySQL</title><summary type='text'>
其實繼上次寫了python資料型態上下集之後，這次應該來寫一下迴圈與條件式等的教學，但是其實那些東西都是廢話，我下一次再把一些注意事項放上來就好了!不然難道你認為if條件式會寫成怎樣??

這次開始從實例下手，之前我寫過Java RssParser，是儲存成檔案的方式，現在用python教大家如何parse Google RSS新聞檔並儲存 發布時間、標題、連結、相關內容 等資訊到MySQL中。


把玩這支程式之前請先安裝兩個函式庫，feedparser與MySQLdb(說明)。裡頭都有安裝說明與教學。

By the way, 我的python是2.5版


sql -- 建立資料庫並使用SQL新增下列資料表



CREATE TABLE IF NOT EXISTS `FEED_MSTR` (
 `ID` int(11) NOT NULL AUTO_INCREMENT,
 `</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4579572058191593464/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python-rssparser-with-mysql.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4579572058191593464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4579572058191593464'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python-rssparser-with-mysql.html' title='Python RssParser with MySQL'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-3579331187066677916</id><published>2009-03-24T16:20:00.002+08:00</published><updated>2009-03-24T16:25:35.234+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>最新十大透支健康行業</title><summary type='text'>
轉載自http://big5.xinhuanet.com/gate/big5/news.xinhuanet.com/health/2006-08/18/content_4977708.htm


很高興IT業榮獲榜首...說這句話的同時壽命又少了0.01歲...





但是國外工程師好像都很悠閒, 每天穿短褲, 到處有零食與電動...而且人家的創意與技術就是比我們強...
總有一天我也要打造這樣的環境...

健康透支十大行業依次為：

    1、IT

    2、企業高管(含民營企業主)

    3、媒體記者

    4、證券

    5、保險

    6、出租車司機

    7、交警

    8、銷售

    9、律師

    10、教師

    調查發現，精神壓力過大，生活節奏過快，飲食和生活不規律，是這十大行業的人群嚴重透支健康的主要原因。

    </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/3579331187066677916/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/blog-post_5906.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3579331187066677916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3579331187066677916'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/blog-post_5906.html' title='最新十大透支健康行業'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uge0r2l3u1Q/SciYSWu4deI/AAAAAAAACiU/qjdFJgXnO7E/s72-c/xinsrc_4220803181304250111186.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1429952158503462952</id><published>2009-03-19T10:59:00.003+08:00</published><updated>2009-03-19T11:24:36.958+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>不知道要下什麼標題</title><summary type='text'>
就像美國總統歐巴馬一樣面對AIG發放紅利氣到嗆到, 今早我也發生了一樣的事, 剛出門騎車就拋錨所以只好等附近的機車行開門就把車牽過去麻煩他修一下...以下為對話(對方可能不是老闆但我還是叫老闆):


我: "老闆, 我機車掛點了可以幫我看一下嗎?"
老闆: "...."(準備開店中...)
我: "老闆, 我把機車推上去歐"(把機車推到維修區)
老闆: "你推上去幹麼...我有叫你推上去嗎?"
我: "...拍謝"(把機車倒退回去)
我: "請問大概什麼時候能好?"
老闆: "要等啦!你先留你的聯絡方式"
我: "不能幫個忙先看一下嗎?我等等還有事"
老闆: "急什麼, 留下機車鑰匙修好在和你說!"
我: "..."(留下鑰匙默默走人)


走掉得路上我越想越氣...媽的...我是叫你修免費的歐!長得一副好像我欠他的樣子!

後來中午接到電話回去看換下來的零件, </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1429952158503462952/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/blog-post_19.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1429952158503462952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1429952158503462952'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/blog-post_19.html' title='不知道要下什麼標題'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6315005111043950230</id><published>2009-03-09T13:10:00.003+08:00</published><updated>2009-03-09T13:27:40.438+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHPMailer utf-8郵件主旨亂碼問題</title><summary type='text'>
日前使用PHPMailer發送utf-8格式的中文郵件時, 發現收件夾內接收的郵件均為亂碼, 而且連帶影響到郵件的html內文, 原因在於E-Mail標準格式中表頭的部分不允許使用雙位元的文字(也就是中文等...), 所以必須使用mb_encode_mimeheader()函式將雙位元文字編碼為單位元字串。



但是因為mb_encode_mimeheader()預設的字串編碼為西方ISO-8859-1, 所以如果你的編碼中文字為UTF-8就必須使用mb_internal_encoding()將內部預設編碼改為UTF-8。


&lt;?php
mb_internal_encoding('UTF-8');    // 內部預設編碼改為UTF-8
$mail-&gt;Subject = mb_encode_mimeheader($_POST['title'], "UTF-8");
$mail-&gt;</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6315005111043950230/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/phpmailer-utf-8.html#comment-form' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6315005111043950230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6315005111043950230'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/phpmailer-utf-8.html' title='PHPMailer utf-8郵件主旨亂碼問題'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-204866497334088498</id><published>2009-03-06T09:44:00.002+08:00</published><updated>2009-03-06T09:51:43.623+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>研究開發iPhone應用程式</title><summary type='text'>
最近和歐拔聊天, 想說來玩一下iPhone的開發, 雖然我自己去年就買了G1 Dev版, 本來要加入Android的行列, 但好死不死今年又買了MacBook而且實在逃不出它的魔掌...

首先要先從Objective-C開始學, 基本上宣告和一些寫法有點差異, 但畢竟大體上結構差不多, 只是又要自己管理記憶體有點煩就是了, 畢竟Java寫久都覺得釋放記憶體這種動作應該是VM應該做的吧~

最近也找了蠻多相關文件, 但是早上這個讓我比較興奮, 是史丹福大學的iPhone開發課程講義耶!http://www.stanford.edu/class/cs193p/cgi-bin/index.php, 裡面的程式碼與pdf都可以下載來用, 網路真是太棒了</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/204866497334088498/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/iphone.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/204866497334088498'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/204866497334088498'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/iphone.html' title='研究開發iPhone應用程式'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1856103091974011011</id><published>2009-03-04T12:19:00.000+08:00</published><updated>2009-03-04T12:20:14.615+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python 資料型態(下)</title><summary type='text'>4. Dictionaries -&gt; Dictionaries擁有鍵與值的對照, 類似Java中的Map類 

&gt;&gt;&gt; demo = {'a':123, 'b':456, 'c':789} # 使用“:“分隔鍵與值
&gt;&gt;&gt; demo['a']
123



當然也可以不必在一開始就做指定動作, 能夠在不同位置指定內容讓Dictionaries擁有了極大的彈性

&gt;&gt;&gt; demo = {}  #  指定一個空殼給demo
&gt;&gt;&gt; demo['a'] = 123
&gt;&gt;&gt; demo['b'] = 456
&gt;&gt;&gt; demo
{'a' : 123, 'b' : 456}



巢狀內容的呼叫

&gt;&gt;&gt; demo = {'name':{'first':'Bob', 'last':'Smith'},
      'job':['dev', 'mgr'],
      'age':40.5}
&gt;&gt;&gt; </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1856103091974011011/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python_3225.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1856103091974011011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1856103091974011011'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python_3225.html' title='Python 資料型態(下)'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6188009880408633859</id><published>2009-03-04T09:58:00.001+08:00</published><updated>2009-03-04T10:00:27.810+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>Python 資料型態(上)</title><summary type='text'>
Python 有一個特性, 就是變數的宣告不需要使用強型態, 你可以指定 a = 2, 也可以在下一行改變成 a = 'sample', 包括陣列存放都可以使用多種不同型態的變數例如 a = [123, 'abc', 1.23]。

介紹一下 Python 核心物件內含的資料型態 

1. Numbers -&gt; 整數(integer), 含小數的數字(floating-point numbers), 另外像是一些長整數(unlimited-precision “long” integers), 複雜的數字(complex numbers)與固定精度的小數(fixed-precision decimals)等...。 

範例: 

&gt;&gt;&gt; 123 + 456   # 整數相加
579
&gt;&gt;&gt; 1.5 * 4    # 小數運算
6.0
&gt;&gt;&gt; 2 ** 100   # 2的100次方
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6188009880408633859/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python_04.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6188009880408633859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6188009880408633859'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python_04.html' title='Python 資料型態(上)'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4498360556872017739</id><published>2009-03-03T12:24:00.003+08:00</published><updated>2009-03-03T12:32:35.419+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Python'/><title type='text'>什麼是 Python？</title><summary type='text'>

Python的創始人為Guido van Rossum。在1989年聖誕節期間的阿姆斯特丹，Guido為了打發聖誕節的無趣，決心開發一個新的指令碼解釋程式，作為ABC語言的一種繼承。之所以選中 Python（大蟒蛇的意思）作為程式的名字，是因為他是一個Monty Python的飛行馬戲團的愛好者。

就這樣，Python在Guido手中誕生了。實際上，第一個實作是在Mac機上。可以說，Python是從ABC發展起來，主要受到了Modula-3（另一種相當優美且強大的語言，為小型團體所設計的）的影響。並且結合了Unix shell和C的習慣。

雖然 Python 可能被粗略地分類為「指令碼語言」（script language），但實際上一些大規模軟體開發計劃例如 Zope、Mnet 及 BitTorrent，Google 也廣泛地使用它。 Python </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4498360556872017739/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4498360556872017739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4498360556872017739'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/python.html' title='什麼是 Python？'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/SayxsA12IJI/AAAAAAAACaQ/F8je6crbMp4/s72-c/150px-Guido_van_Rossum_OSCON_2006.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-165724165385389772</id><published>2009-03-02T16:42:00.003+08:00</published><updated>2009-03-02T17:00:07.550+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>HTML 5.0</title><summary type='text'>
W3C據說2004年就開始推動5.0草案, 但是我想根本沒有什麼人知道這件事, 直到最近Apple Sarfari 4 beta版釋出之後, 看見其中新功能支援HTML5.0影音標籤才赫然驚覺。Google一下才知道5.0是近期最大的改版行為, 目標是在2010年之前，HTML 5的正式版將面世，目標是把這種超文字標示語言（markup language) 帶往今天的豐富媒體網路環境，以新型的應用程式設計介面，控制影音內容。

其中一些改變例如引入了一整套全新的元素來讓構建頁面變得更加簡單與直接使用video, audio之類的標籤描述影像與音效嵌入等...詳細資訊可以參考這篇http://www.wowbox.com.tw/blog/article.asp?id=2446

最近剛好也寫到一篇報告, 內容是有關數位出版, 大部分的權力也是被西方組織或是出版社壟斷, </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/165724165385389772/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/03/html-50.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/165724165385389772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/165724165385389772'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/03/html-50.html' title='HTML 5.0'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6759193644090960232</id><published>2009-02-26T09:28:00.003+08:00</published><updated>2009-02-26T09:49:51.783+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Flash的鳥問題</title><summary type='text'>
這幾天用Flash做事老是碰到一堆鳥問題, 首先是前一版本編輯的class拿來cs4使用會有“The name of this class conflicts with the name of another class that was loaded”, 表示類別名稱有衝突, google一下之後, 把系統時間用NTPClock校正再重新除錯就沒問題, 這部份還好...。

昨天重灌了cs3, 為什麼呢?因為cs4 bug實在太多了, 例如像是MovieClip裡有很多文字欄位, 整個編輯的速度就會慢到不像話, 但換回去之後麻煩才大, 首先把原本的fla存成cs3格式, 打開cs3後相當順暢, Ctrl + Enter compile過程也很順利, 放到網站上, 咦...怎麼某一部份的元件就是無法addChild上去?原本還以為程式寫錯, 但是本機執行一切正常, 網路上就會有問題, </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6759193644090960232/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/02/flash.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6759193644090960232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6759193644090960232'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/02/flash.html' title='Flash的鳥問題'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/SaX1NMBR8iI/AAAAAAAACYc/cJWkJyekyh8/s72-c/32.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7290827864550122774</id><published>2009-02-18T14:46:00.005+08:00</published><updated>2009-02-18T15:35:41.500+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>程式語言版本的相容性</title><summary type='text'>
雖然Sam不會因為程式語言版本相容問題而去學習一種語言, 但最近的情況的確困擾了我。

首先是前年ActionScript2.0晉升3.0, 完全變成一種類Java語言, 當然2.0之前的概念已不復見, 即使這樣但看見優化多倍的效能時還是得盡力去學習, 目前也在專案當中使用, 事實上對於像Sam這種物件導向起家的工程師來說如此的改變再好不過, 因為有Java的底子所以學起來事半功倍, 但對於那些程序導向的工程師就...

然後PHP6的改變, 最恐怖的就是資料庫這段上面統一了(使用PDO), 不再像以前一樣每種資料庫要調用不同的module, 基於oo的立場是很好的改變但對大多數現在線上仍然使用php4, 5的朋友就是惡夢了, 表示你們要砍掉重練!

其他的變革像是:


1.支援Unicode

2.Register Globals將被移除

3.Magic Quotes 將消失

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7290827864550122774/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/02/blog-post_18.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7290827864550122774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7290827864550122774'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/02/blog-post_18.html' title='程式語言版本的相容性'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZu6RJ7UcwI/AAAAAAAACVk/4Id0DsRJ1Z8/s72-c/Untitled-1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-8345383372741452232</id><published>2009-02-07T10:29:00.004+08:00</published><updated>2009-02-07T14:55:42.429+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>一些php網頁驗證小技巧</title><summary type='text'>
一般而言坊間教學書上對於登入驗證這塊都沒有說明的很詳細, 但其實還有一些技巧需注意, 雖然這些技巧並不能讓你網站100%安全, 但是至少能夠防範"輕易"的被誤用或連結.

例如說處理表單的php來源照理來說應該要是表單的html等, 如果不判斷來源, 就能夠使用一些機器人隨意新增或修改資料, 下段程式判斷時否有來源網頁, 有的話是否是你設定的網頁.

&lt;?php
$referrer = $_SERVER['HTTP_REFERER'];
if($referrer == '' || strpos($referrer, 'your_php.php') == false){        // 判斷來源網頁
    die('來源網頁錯誤');
}
?&gt;


至於登入很多人可能會忘記要驗證當初登入的瀏覽器與IP位址, 你可以在登入時註冊一個session為如下:
&lt;?php
$_</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/8345383372741452232/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/02/php.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8345383372741452232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/8345383372741452232'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/02/php.html' title='一些php網頁驗證小技巧'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6409688276957088432</id><published>2009-01-22T16:07:00.002+08:00</published><updated>2009-01-22T16:13:27.762+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>HP Scrawlr 幫你偵測網站安全性</title><summary type='text'>
今天朋友傳了一個軟體給我玩, 主要是這隻程式會用盡辦法去入侵你輸入的網站, 也就是SQL Injection, 以香港AAStock來作測試, 發現一堆頁面都可以被攻擊, 也能掃出資料表內容...實在很可怕。

但是我是那種唯恐天下不亂的人, 所以搞不好能拿來幹些見不得人的事 :P

下載HP Scrawlr



</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6409688276957088432/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/hp-scrawlr.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6409688276957088432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6409688276957088432'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/hp-scrawlr.html' title='HP Scrawlr 幫你偵測網站安全性'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/SXgqYkGgz9I/AAAAAAAACAw/-lQsFw1xUYw/s72-c/Untitled-2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-704113520171005609</id><published>2009-01-15T18:57:00.002+08:00</published><updated>2009-01-15T20:28:14.722+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Component'/><title type='text'>去除UTF-8 BOM表頭的InputStreamReader</title><summary type='text'>
如果你曾經使用Java遇過讀一些文字檔前面出現??等亂碼的話, 表示該份文件有加入bom(byte order mark), 基本上bom的用途原本是用來讓程式辨別該份文檔的編碼格式, Microsoft在Windows 2000以後的Notepad存UTF-8的檔案會加上 BOM(Byte Order Mark, U+FEFF), 主要是因為UTF-8和ASCII是相容的, 為了避免使用者自己忘記用甚麼存, 造成UTF-8檔案用 ASCII 模式開看到是亂碼, 所以在檔案最前面加上BOM.
看到這裡可能有很多人會開始%#~!微軟...
但是碰到問題總是得解決的, 下面這個改寫InputStreamReader的UnicodeInputStreamReader就能夠讓你免去上述煩惱, 所有功能仍然和InputStreamReader相同, 只是在constructor中加入判斷bom</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/704113520171005609/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/utf-8-bominputstreamreader.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/704113520171005609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/704113520171005609'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/utf-8-bominputstreamreader.html' title='去除UTF-8 BOM表頭的InputStreamReader'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4694017333474928591</id><published>2009-01-12T09:46:00.011+08:00</published><updated>2009-01-12T23:32:10.025+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOAD'/><title type='text'>維護的重要性</title><summary type='text'>"對於日前桃園機場境管電腦大當機事件, 最後還是內政部長廖了以親自指揮, 才叫得動這套系統創始的資深工程師章毅昌上陣解決問題, 而面對這套只有「少數人才懂」的電腦系統, 移民署已決定更換。"

不知道大家對這新聞有何想法?

為什麼開放原始碼觀念帶給我們如此大的震撼?
為什麼近年來技術增長的如此快速?
為什麼Google產品能夠如此強大?

因為他們都採取"讓越多人瞭解, 讓越多人能輕易的上手"這種觀念, 唯有如此產品或技術才能以倍數發展或散佈
寫軟體, 不是自己寫了幾百支檔案, 能夠運作正常就洋洋自得。一個公司裡, 最講求的部分絕對包括效率, 當然人員的流動性也必須考慮進去, 當接手的人必須花比原開發時間多一倍甚至兩倍去閱讀程式碼, 進而重構(Refactoring), 途中更必須承擔毀損舊有結構的風險, 這時候你才會把當初懶惰, 不以為意的想法(不寫說明文件, 詳細註解, </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4694017333474928591/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/blog-post_12.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4694017333474928591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4694017333474928591'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/blog-post_12.html' title='維護的重要性'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6922921299789337318</id><published>2009-01-06T12:58:00.016+08:00</published><updated>2009-01-06T17:07:49.801+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>在ActionScript based應用程式中管理記憶體</title><summary type='text'>
Sam目前的對於Flash應用程式的作法都是"骨肉分離", 也就是畫面與程式徹底分開, 全部的動作均是由程式控制。

當然這麼作必須搭配各種事件的處理, 所以當使用者反覆開啟彈出視窗時, 偵聽事件的新增與移除就變得非常重要(因為關係到記憶體的消耗)。

Essential Actionscript 3.0作者Colin Moock說: 
當一個Sprite物件被 removeChild掉了，參照也移除了，裡頭的Listener並不會立刻停止監聽/執行，除非它被GC收走(並無法預期GC何時會來)，如果這個Sprite一直都有其他物件或變數參照到，那該Listener永遠不會消失，裡頭的程式也會不斷地執行!!

這是很糟糕的問題，所以他建議對於每個類別，都要記得規劃類似: destroy(); kill(); dispose(); deactivate();等函式：清除物件裡頭的物件資料，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6922921299789337318/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/actionscript-based.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6922921299789337318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6922921299789337318'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/actionscript-based.html' title='在ActionScript based應用程式中管理記憶體'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-3875631477089842201</id><published>2009-01-05T22:03:00.003+08:00</published><updated>2009-01-05T22:18:44.957+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>php與MySQL連接類別</title><summary type='text'>
日前整理的一個類別, 特殊的地方在於使用了Array儲存查詢結果, 所以能夠依照查詢時給予的ID重新調用結果。
此外設定檔存放在db_mysql.inc中, 如果臨時需要調換資料庫則在建構子中填入即可。

db_mysql.inc :
&lt;?php

// or set date.timezone = Asia/Taipei in php.ini
if(function_exists("date_default_timezone_set")) date_default_timezone_set('Asia/Taipei');

// database configure.
define(DB_HOST, 'localhost');
define(DB_USER, 'root');
define(DB_PASSWD, 'root1234');
define(DB_DATABASE, '</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/3875631477089842201/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/phpmysql.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3875631477089842201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3875631477089842201'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/phpmysql.html' title='php與MySQL連接類別'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-9120140279642456987</id><published>2009-01-05T14:52:00.003+08:00</published><updated>2009-01-05T15:23:34.469+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>集中注意力</title><summary type='text'>
最近發現寫專案的時候越來越容易分心, 一方面是這個案子沒有太多相關文件卻突然空降到我身上要作大幅度的修改, 自然就興趣缺缺..., 以致於只要周遭有一點點噪音或突發事件心思就馬上被吸了過去, 自我檢討了一番發現這是沒有目標(目標過於不明確)所致, 以打靶來說, 在一片遼闊的草原上放置靶紙, 你會一直開槍直到打中靶, 但是沒有靶紙的話, 東邊飛過來一隻鳥你會打鳥, 草地上跑出一隻兔子則會去打兔子...。

所以為什麼要事先規劃 -&gt; 定義焦點快速功能性的執行, 防止浪費時間。

但自我鍛鍊也是很重要, 不可能每次都有人幫你把事情整理好放在你跟前(又不是大老闆), 所以下列方式供大家參考一下:

一. 設立期限

一般人做事時，以剛開始與快結束時效率最高, 在兩者之間，將會出現效率低落、缺乏注意力的現象，心理學上稱之為“中間鬆懈”，了維持注意力，可以象馬拉松選手一樣，設立中間站，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/9120140279642456987/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/blog-post_05.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/9120140279642456987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/9120140279642456987'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/blog-post_05.html' title='集中注意力'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2377168616653914711</id><published>2009-01-02T12:03:00.002+08:00</published><updated>2009-01-02T12:15:29.245+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>部落格手動張貼程式碼</title><summary type='text'>偶然間發現一個網站Online syntax highlighting, 之前我一直都是使用SyntaxHighlighter, 但是載入速度實在太慢, 換行等又有一堆問題, 還不如用貼HTML碼的方式.

這個網站有支援幾乎所有的code種類, 算是相當齊全, 也有樣式可以選擇. 更改背景色或是自動換行只要在開頭pre後面style中加上如同下列HTML就可以了.

&lt;pre style='color:#000000;background:#f0f0f0;overflow:auto;border: 1px solid #ccc;'&gt;


貼個Java範例:
public class SyntaxTester
{
    public static void main(String[] args)
    {
        // test for code attach.
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2377168616653914711/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2009/01/blog-post.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2377168616653914711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2377168616653914711'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2009/01/blog-post.html' title='部落格手動張貼程式碼'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-3951908093874298167</id><published>2008-12-31T11:36:00.002+08:00</published><updated>2008-12-31T11:46:32.680+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>明年第一季Android Market將正式開放付費性商品</title><summary type='text'>以下節錄自Google寄送的Mail:
Additionally, I would like to confirm that Android Market will support
priced applications starting early Q1 2009, as we'd originally stated last
fall. Given the country-by-country work required to set up payment support
for developers in different countries, we will enable priced app support
in Q1 for developers operating in these countries in the following order:
(1) United </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/3951908093874298167/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/android-market.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3951908093874298167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/3951908093874298167'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/android-market.html' title='明年第一季Android Market將正式開放付費性商品'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2835988371330268574</id><published>2008-12-30T17:58:00.004+08:00</published><updated>2009-01-02T12:25:36.824+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>RIA 設計小技巧 (使用自訂事件)</title><summary type='text'>如果你目前在寫一些ActionScript3.0 based RIA的程式, 但是你卻是寫在影格上或是視窗間要溝通時設計成互相知道對方的話, 你應該要學起來下面的做法, 基本上這已經是標準動作了。
首先創建ModelLocator, 它的作用等於所有事件的轉運站, 所以內部採用Singleton模式, 外部調用時使用static方法getInstance(), 尚未創建則創建並返回, 若已經存在則返回該物件。

package {
    import flash.events.EventDispatcher;

    public class ModelLocator extends EventDispatcher {

        private static var _instance:ModelLocator;

        public function </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2835988371330268574/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/ria.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2835988371330268574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2835988371330268574'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/ria.html' title='RIA 設計小技巧 (使用自訂事件)'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5604549740471137954</id><published>2008-12-29T23:38:00.004+08:00</published><updated>2008-12-29T23:42:10.338+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Android上的中文輸入</title><summary type='text'>
睡覺前玩了一下手機發現科科輸入法有人改進了變成"嫩科科"輸入法, 有完整的注音鍵盤, 蠻不錯用的, 只有滑蓋後沒有變成橫向螢幕這個小缺點。
使用的時候按著注音鍵滑上下左右選注音與輕重音。按menu複製出去。

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5604549740471137954/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/android.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5604549740471137954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5604549740471137954'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/android.html' title='Android上的中文輸入'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uge0r2l3u1Q/SVjvJVfLXwI/AAAAAAAABwY/oBuEPxVLs2w/s72-c/DSCF0854.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5741399037096735585</id><published>2008-12-29T10:40:00.003+08:00</published><updated>2008-12-29T10:48:46.302+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>長期在電腦前工作請注意!</title><summary type='text'>
做我們這行的最常看到就是眼壓過高，而且週邊的同事或長官只要是長期在電腦前工作的小孩子生出來都是女生居多。女生是很好啦, 但是生不出男生可能會有人覺得不太好^^

所以請大家要注意一下:


電腦對人類健康的隱患，從輻射類型來看，主要包括電腦在工作時產生和發出的電磁輻射（各種電磁射線和電磁波等）、聲（噪音）、光（紫外線、紅外線輻射以及可見光等）等多種輻射「污染」。 

從輻射根源來看，它們包括CRT顯示器輻射源、機箱輻射源以及音箱、打印機、複印機等周邊設備輻射源。其中CRT（陰極射線管）顯示器的成像原理，決定了它在使用過程中難以完全消除有害輻射。因為它在工作時，其內部的高頻電子槍、偏轉線圈、高壓包以及周邊電路，會產生諸如電離輻射（低能X射線）、非電離輻射（低頻、高頻輻射）、靜電電場、光輻射（包括紫外線、紅外線輻射和可見光等）等多種射線及電磁波。

而液晶顯示器則是利用液晶的物理特性，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5741399037096735585/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/blog-post_29.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5741399037096735585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5741399037096735585'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/blog-post_29.html' title='長期在電腦前工作請注意!'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7216174445360553352</id><published>2008-12-26T21:27:00.019+08:00</published><updated>2008-12-29T12:32:20.937+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>MySQL的優化調效與應用層注意事項</title><summary type='text'>一. 系統參數 

1. key_buffer_size -&gt;

係與索引塊的緩衝區大小息息相關，故將之設定為較大後，對於來自於所有用戶執行緒的讀寫處理能力，自然有所助益，但一旦設定的太大，反而會拖累系統的執行效能。


系統的默認值為8MB，可抓系統主機記憶體容量的1/5（註：假設伺服器具2GB記憶體，則以400MB為基準)。

2. back_log -&gt;


該數值的主要意義，指MySQL暫時停止回應新請求之前的短暫時間內可允許多少個請求，被存放於堆疊之中。

期望在短暫時間內能夠連結到較多的請求數量，或在主機進程列表當中發現到大量的等待連接進程時，則可把back_log值予以增加。

但不能無限上綱地擴大，因為作業系統對於接收TCP/IP連接的listen queue大小有其上限。

系統所默認的back_log值為50，只要不把它調到10倍（亦即500）以上，通常不會有太大問題</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7216174445360553352/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/mysql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7216174445360553352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7216174445360553352'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/mysql.html' title='MySQL的優化調效與應用層注意事項'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2795712888720384734</id><published>2008-12-26T09:34:00.002+08:00</published><updated>2008-12-26T09:36:29.778+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>ECMA宣布停止ECMAScript 4</title><summary type='text'>全文引用自http://medialand.com.tw/blog/article.asp?id=782

今天早上看到的新聞，ECMA宣布暫時放棄ECMAScript 4規範而採用ECMAScript 3.1。「ECMAScript規範」這個東西雖然目前為止對我們大都數人來說沒有什麼感覺，但是有可能會對於未來一兩年內網路發展造成不太可預期的影響。

先解釋一下ECMAScript規範是啥東西。
ECMAScript是一種程式語言的標準，由ECMA這個機構所制定，跟我們切身最有關係的就是JavaScript以及Flash ActionScript，這兩種都是遵守ECMAScript規範來實作的程式語言，早期原本只有JavaScript 去鳥EMCA，當初大家也都以為JavaScript只會在網頁上來個跑馬燈或下雪花，後來ActionScript加入ECMA家族而且JavaScript</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2795712888720384734/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/ecmaecmascript-4.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2795712888720384734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2795712888720384734'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/ecmaecmascript-4.html' title='ECMA宣布停止ECMAScript 4'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2568263376453165889</id><published>2008-12-25T10:42:00.003+08:00</published><updated>2008-12-25T10:45:55.168+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>Google文件祝你聖誕快樂</title><summary type='text'>
Google員工們使用協同作業一起編出來的畫面, 真的是很佩服Google能讓員工有這麼多的自由進而發想創意。
台灣的公司就不可能了, 被看到應該馬上請你回家吃自己, 泣...
文化的不同也會造就不同的成就, 創意或代工...

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2568263376453165889/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/google.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2568263376453165889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2568263376453165889'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/google.html' title='Google文件祝你聖誕快樂'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6896138352731438468</id><published>2008-12-24T23:49:00.011+08:00</published><updated>2009-01-02T13:03:33.534+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Component'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>用php做出類似Google的字詞驗證圖片</title><summary type='text'>

雖然日前Google字詞驗證與CAPTCHA都已經宣告被破解, 但還是用php來寫出一個類似的介面, php圖片要扭曲必須要用像素位移的方式, 所以出來的圖片會有一點沙沙的感覺。 其實也可以使用其他附加軟體進行扭曲的動作, 但那樣可攜性就相對降低了。

使用時請在這支php同資料夾加上font資料夾, 裡面放置要產生驗證碼的字型, 幾個都可以, 會隨機挑選, 驗證碼存在$_SESSION['vCode']中, 格式為 驗證碼|時間, 比對時要explode("|", $_SESSION['vCode'])。
也可以加上干擾線條與點數, 變的更難辨識。





測試檔案打包下載

&lt;?php

session_start();   // if header already send, change output_buffering = On at php.ini. otherwise</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6896138352731438468/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/phpgoogle.html#comment-form' title='6 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6896138352731438468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6896138352731438468'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/phpgoogle.html' title='用php做出類似Google的字詞驗證圖片'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_uge0r2l3u1Q/SVLjmJqKXjI/AAAAAAAABvw/ynvZ87hoB3M/s72-c/verify_1.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5886173096949763979</id><published>2008-12-18T19:53:00.007+08:00</published><updated>2008-12-18T22:33:51.810+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>HTC G1 DEVELOPER PHONE (圖)</title><summary type='text'>
1. 這就是日前收到的HTC G1 DEVELOPER PHONE, 由於沒有鎖機所以任何電信公司都可以使用。

2. 我覺得比較新奇的是解碼系統像是在玩連連看遊戲, 連成當初設置的路徑才會解開!!

3. 推拉式螢幕與鍵盤的質感都很不賴, 感覺不容易壞掉, 當然show出鍵盤時螢幕會變成水平顯示

4. 收發Gmail非常方便, 如果你有設同步化的話新郵件會立即通知。

其他還有很多功能請參考: http://big5.pconline.com.cn/b5/mobile.pconline.com.cn/review/0810/1463217_4.html
總而言之, 這個版本和市售的不一樣, 以顯現Android為主, 沒有logo, 只有背面有Android機器人圖樣, 非常好用!! 現在我已經準備開始寫程式放到Android Market上去賣啦哈哈!!

 

 

 

 </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5886173096949763979/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/htc-g1-developer-phone.html#comment-form' title='5 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5886173096949763979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5886173096949763979'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/htc-g1-developer-phone.html' title='HTC G1 DEVELOPER PHONE (圖)'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_uge0r2l3u1Q/SUo5RZhbhEI/AAAAAAAABuE/l9GOdkV7uKg/s72-c/DSCF0840.JPG?size=320' height='72' width='72'/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-710995057710072003</id><published>2008-12-15T12:17:00.002+08:00</published><updated>2008-12-15T12:38:41.086+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>科技始終來自於人性</title><summary type='text'>還記得Nokia的這句廣告詞嗎? 大概80%的人都知道, 卻不了解他真正的涵義...。

最近家裡準備整修一番, 所以請了些設計師來估價:

第一次: 經驗老到的設計師一進門就開始指東指西"這裡打掉, 陽台推出去, 電視櫃不要了...", 後來我問他"那東西應該收納在哪裡?", 卻得到一句這樣的回應"你不需要太多東西!"。

第二次: 一對夫妻設計師, 從頭到尾一直在說他多厲害, 多會設計, 但他的作品樣本我很確定是另一家公司的設計圖。

第三次: 同樣也是一對夫妻, 看起來經驗沒有很老到, 坐下來談的時候一直詢問"覺得這樣改可以接受嗎?", "收納會不會不方便?", "重要的是你要住的舒服才對!" 等...。

大家覺得我會選擇哪一個呢?

自己也是做程式設計, 一直面對不同的客戶自然而然就會產生"應該照我這樣做"的想法, 覺得這樣最省事也最保險, 但是客戶真的喜歡嗎? </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/710995057710072003/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/blog-post_15.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/710995057710072003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/710995057710072003'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/blog-post_15.html' title='科技始終來自於人性'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-27787343859051454</id><published>2008-12-09T17:15:00.003+08:00</published><updated>2008-12-09T17:47:00.341+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>Rich Internet Application v.s. Window Application</title><summary type='text'>
之前一直都在開發RIA網站, 最近因為公司內部需要轉向使用Java SWT(Standard Widget Toolkit)開發視窗環境的軟體。
其實用SWT開發真的很方便, 組件完整, 事件流好控管, 版面縮放不易出錯等...真的是事倍功半(當然你要有可視化開發介面拉), 比起用ActionScript開發, 如果沒有自己先寫一套框架還真是要從頭開始作苦工。

不過我不是想討論哪個語言好壞, 而是近幾年來軟體越來越難賣, 加上RIA與SaaS的風行, 到底孰重孰輕?

基本上RIA目前已經轉向免費服務居多的方式, 除非一開始就去招募資金或是背後有金主, 否則真的相當難生存, 只是一直在燒錢而已。但是最近有些例子指出, 某方面免費資源分享(音樂, 影像等)的RIA網站開始和唱片公司電影公司合作或直接讓它收購, 這也相當聰明, 與其讓大公司摧殘你, 不如先投誠, </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/27787343859051454/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/rich-internet-application-vs-window.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/27787343859051454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/27787343859051454'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/rich-internet-application-vs-window.html' title='Rich Internet Application v.s. Window Application'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6945908033313225904</id><published>2008-12-09T09:31:00.003+08:00</published><updated>2008-12-09T09:39:14.905+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><title type='text'>Google宣佈推出一款沒有鎖Sim卡與硬體的Android智慧手機</title><summary type='text'>

剛又敗了25塊美金到Google去, 為什麼呢? 因為Google宣佈推出一款沒有鎖Sim卡與硬體的Android智慧手機給開發者用...我想都沒想就去註冊拉!!對我們而言還有什麼比能自己寫手機應用軟體兼放到Google上賣錢的好處好呢?

基本上正常銷售時它也是像iPhone那樣綁定服務商, 但是這款開發者版本卻是不限服務商與硬體。

要取得這個開發人員專用的Android Dev Phone 1，要先去Android Market網站註冊成為Android開發者，註冊費為25美元。手機則會收取399美元（美國本土免運費）。為了避免供不應求，Google表示，每個註冊帳戶只能申請一支。

目前該手機提供給18個國際市場申請，包括台灣、美國、英國、德國、日本、印度、加拿大、法國、西班牙、澳洲、新加坡、瑞典、瑞士、荷蘭、奧地利、芬蘭、波蘭、與匈牙利。Google表示未來還會開放更多地方</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6945908033313225904/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/googlesimandroid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6945908033313225904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6945908033313225904'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/googlesimandroid.html' title='Google宣佈推出一款沒有鎖Sim卡與硬體的Android智慧手機'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uge0r2l3u1Q/ST3KmkAedII/AAAAAAAABtA/QU21zmUdPz4/s72-c/android.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6353168112143531485</id><published>2008-12-08T13:53:00.002+08:00</published><updated>2008-12-08T13:57:04.868+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>轉: 無所不在的Context Switch</title><summary type='text'>
蔡學鏞大哥寫的這篇文章真的是太好了!!因此和各位分享一下...
如果有看過peopleware這本管理經典著作的話, 裡面有提到很多讓工程師分心所帶來的後果之實例。

作者：蔡學鏞

有時候電腦忽然慢下來，這時候打開「工作管理員」（Task Manager），你會驚訝地發現，怎麼有這麼多莫名其妙的「常駐程式」正同時在執行？其中一個罪魁禍首程式佔用了CPU將近百分之百的效能，難怪你的Visual Studio忽然變得這麼慢。

不僅電腦中有許多常駐程式，會來中斷我們的重要程式，我們現實的生活中，也有許多例行與非例行的事項，佔據我們一天中大多數的時間，讓我們做事的效率不彰。可能是沒有結論的無聊會議、可能是一通女友撒嬌的電話、可能是MSN上沒有意義的寒暄、合作廠商禮貌性的拜會、或者行政人員對於你請款單據的刁難。這些都會讓你的工作產能大減。

你知道，將這些亂七八糟的事情摒除於外，</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6353168112143531485/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/context-switch.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6353168112143531485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6353168112143531485'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/context-switch.html' title='轉: 無所不在的Context Switch'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7565974139175374329</id><published>2008-12-05T09:54:00.006+08:00</published><updated>2008-12-06T16:45:41.302+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaFX'/><title type='text'>JavaFX 1.0 釋出</title><summary type='text'>



昨天JavaFX釋出了1.0版本, 在RIA界中JavaFX只是個剛起步的小孩, 無論是比Flash, Flex, SilverLight都略遜一籌, 但我個人認為這兩邊的發展模式不盡相同。

公司派:
1. Adobe 部分目前佔據了大部分市場沒錯, 但對手微軟的急起直追讓Adobe不得不加緊腳步推出新產品, 品質的好壞與進步的方向有待商議, 可能競爭下的結果是兩敗俱傷。
2. Flash ,Flex 等還是有相當大的改進空間, 執行時期效能, 檔案大小等..., 至於SilverLight沒用過不便說明。
3. 例如之前macromedia公司被併購, 走向調整為AS3, 主要發展Flex等, 微軟就不用說了, 每次新產品一出來就產品就被晾一邊不再維護。
4. 足夠經費發展, 進度快很多, 開發出的產品也較完整。
5. 週邊配套措施完善, like FMS etc...。

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7565974139175374329/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/javafx-10.html#comment-form' title='4 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7565974139175374329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7565974139175374329'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/javafx-10.html' title='JavaFX 1.0 釋出'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uge0r2l3u1Q/STiPK5V2i3I/AAAAAAAABgo/RcmdWAFkoL8/s72-c/javaFX.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-73699888591512629</id><published>2008-12-04T21:05:00.005+08:00</published><updated>2009-01-02T13:20:40.605+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java FunP 自動推文程式</title><summary type='text'>
測試了一個禮拜應該是沒有問題了, 發佈出來讓大家參考, 使用此程式先要有apache HttpClient相關套件(請參閱之前發文運用Apache HttpClient實作Get與Post動作)

流程為: 登入FunP之後記住Cookie之外, 進入其他頁面必須還要傳送not_rem_login與expires等驗證資訊, 成功取得頁面內容後使用Regular Expression取得文章代號, 就可以進行推文與收藏的動作, 如果想自己執行網頁流程看看傳輸內容的話建議使用SmartSniff, 可以看見POST或GET傳輸內容與表頭。

FunpAutoLogin:
package org.sam.funp;

import java.io.BufferedInputStream;
import java.io.BufferedReader;
import </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/73699888591512629/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/java-funp.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/73699888591512629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/73699888591512629'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/java-funp.html' title='Java FunP 自動推文程式'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2084210160467325378</id><published>2008-12-04T18:04:00.005+08:00</published><updated>2009-01-02T13:26:01.370+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Parser'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java SQLParser SQL語法解析器</title><summary type='text'>最近案子因為寫了一個輕便型的小型資料庫, 所以要用的SQL指令解析來動作, 基本上這支程式解析簡單的一層SQL指令沒有問題, 多層則是不行使用的。
剛好順便複習一下Regular Expression, 都快不認識它了哈哈!!

Sample Code:

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SqlParser
{
    public static String type;
    public static String conditions;
    public static String tables;
    public static String order;
    public static String where;

    public </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2084210160467325378/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/java-sqlparser-sql.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2084210160467325378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2084210160467325378'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/java-sqlparser-sql.html' title='Java SQLParser SQL語法解析器'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-6044912917237069844</id><published>2008-12-02T19:44:00.003+08:00</published><updated>2008-12-02T19:50:11.646+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>百谷虎 BaiGooHoo 搜尋網站, 最強的搜尋網??</title><summary type='text'>
如果說美國人最有創意, 日本人做事最有規劃, 那中國人的強項一定少不了模仿。
看看這個百谷虎BaiGooHoo搜尋網站, 商標結合了三大搜尋廠特色:


再看看搜尋結果: 


虧他們想得出來用三個分頁顯示...昏倒
這...應該也算是有創意吧!!笑到肚子痛^^</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/6044912917237069844/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/baigoohoo.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6044912917237069844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/6044912917237069844'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/baigoohoo.html' title='百谷虎 BaiGooHoo 搜尋網站, 最強的搜尋網??'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_uge0r2l3u1Q/STUfyplfUJI/AAAAAAAABD0/W46r_i1H788/s72-c/Untitled-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4533447893839138057</id><published>2008-12-01T09:13:00.003+08:00</published><updated>2008-12-01T09:17:47.399+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Living'/><title type='text'>擁有各式各樣桌面圖片 -- DeskCity.com</title><summary type='text'>
如果你也像我一樣是個長時間處在電腦前面的工作者, 那麼有一個舒服的桌面非常重要。
DeskCity.com 的桌面全部都是高解析度, 不用擔心螢幕過大鉅齒狀化問題, 也有專門寬螢幕的桌面。
希望對大家有幫助^^
</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4533447893839138057/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/12/deskcitycom.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4533447893839138057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4533447893839138057'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/12/deskcitycom.html' title='擁有各式各樣桌面圖片 -- DeskCity.com'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_uge0r2l3u1Q/STM6ZMgsZaI/AAAAAAAABDs/9AZtP9xCQmE/s72-c/deskcity.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-4293389967670489579</id><published>2008-11-28T10:59:00.007+08:00</published><updated>2009-01-02T20:15:55.236+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Component'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>Flash 3D 部落格文章標籤 for Blogger</title><summary type='text'>原文出處: http://www.bloggerbuster.com/2008/08/blogumus-flash-animated-label-cloud-for.html



這個小套件可以將你Blog上的文章標籤以3D方式呈現, 跟隨滑鼠角度移動點選, 主要使用JavaScript and Flash animation。

你可以更改背景顏色, 字體顏色, 大小等參數, 如果觀看者不支援JavaScript與Flash, 雖然沒有動畫效果還是可以點擊。

安裝流程:

1. 先在版面配置HTML中展開小組件狀態下尋找這段程式碼。
&lt;b:section class='sidebar' id='sidebar' preferred='yes'&gt;


2. 在下一行貼上以下程式碼

&lt;b:widget id='Label99' locked='false' title='Labels</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/4293389967670489579/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/flash-3d-for-blogger.html#comment-form' title='2 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4293389967670489579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/4293389967670489579'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/flash-3d-for-blogger.html' title='Flash 3D 部落格文章標籤 for Blogger'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uge0r2l3u1Q/SS9f5exlXoI/AAAAAAAABDM/JLJ80VBdxcA/s72-c/label.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1578744337825894416</id><published>2008-11-27T19:24:00.005+08:00</published><updated>2009-01-02T20:11:28.187+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Component'/><title type='text'>信用卡校驗Java版</title><summary type='text'>
看了http://demo.tc/view.aspx?id=398這篇文章有感而發寫出Java版本, 以後應該有機會用到。

信用卡校驗規則為:

1.必須是十六個數字.

2.由左至右取出奇數位數字乘2, 如果大於9則減去9.

3.合併奇數位與偶數位每一個數字總合必須能夠被10整除.

4.開頭第一個字元為4則是Visa, 頭兩個字元大於50則為Master.

注意一下Java char轉int 不可以用(int)char強制轉, 否則會變成ascii code, 請使用Character的digit(char ch, int radix).我們要轉十進位數字所以radix填10.
The Character class wraps a value of the primitive type char in an object.

digit(char ch, int radix</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1578744337825894416/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/java.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1578744337825894416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1578744337825894416'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/java.html' title='信用卡校驗Java版'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7977754557386953494</id><published>2008-11-27T14:28:00.004+08:00</published><updated>2009-01-02T20:09:19.314+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Component'/><title type='text'>Java自製元件 -- HexTransfer</title><summary type='text'>分享一下我平常在使用的Java自製元件, 這個元件功能為:

1. 轉換byte成16進制HexCode String與HexCode String還原成byte。

2. 整數與byte陣列互轉(用作Socket位元傳輸很方便)。

調用方法為: HexTransfer.byteToHexString(...);

HexTransfer:
public class HexTransfer
{

    // encode byte to hex code string.
    public static String byteToHexString(byte b)
    {
        String str = "";
        if ((b &amp; 0xff) &lt; 16) {
            str = "0";
        }
        str = </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7977754557386953494/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/java-hextransfer.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7977754557386953494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7977754557386953494'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/java-hextransfer.html' title='Java自製元件 -- HexTransfer'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-7970056610976025022</id><published>2008-11-26T22:17:00.007+08:00</published><updated>2009-01-02T20:19:10.099+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>TestDriven with JUnit</title><summary type='text'>
一般程式開發人員的習慣是撰寫完一段功能後再加以測試, 也就是說先由開發者角度去創建系統。但測試驅動開發(Test-Driven-Development)卻是從使用的角度開始, 反向讓開發人員回頭撰寫正確執行的程式。

----------------- 何謂測試驅動開發TDD -----------------
你可能會覺得連內容都沒有要怎麼測試呢?沒錯, 測試驅動的用意即是如此!
例如我希望有一個功能是將輸入的兩個數字相加。那測試端就必須事先模擬ex: a = 1, b = 2 。期望值為兩數相加將會等於3, 假設我的方法沒有將處理結果等於3即為錯誤。
一開始主程式的方法只是一個框架:

public int add(int a, int b) {  
     // 尚無任何內容  
     return 0;  
}

測試框架則是已經寫完使用情形:

public int </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/7970056610976025022/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/testdriven-junit.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7970056610976025022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/7970056610976025022'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/testdriven-junit.html' title='TestDriven with JUnit'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5448142081642561898</id><published>2008-11-26T21:41:00.001+08:00</published><updated>2008-11-26T22:08:32.858+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOAD'/><title type='text'>設計原則大集合</title><summary type='text'>OOAD中除了分析案例,需求清單,架構設計等概念性的東西外,最終還是必須將專注力放在程式碼撰寫上頭,這時候設計原則便將發揮作用。
設計原則是一群能夠被應用到設計或撰寫程式碼的工具或技術,讓程式更好維護,更具有彈性與擴展力。

1. 開閉原則 (OCP, Open Close Principle)

"類別應該允許擴展而開放, 禁止修改而關閉" --- 例如: 你寫出一個完美的類別,當同事想要使用時,你所建構的類別當然不允許直接修改其中內容而變成兩個不同類別(禁止修改),同時必須能夠以達成他人目的繼承覆寫(允許擴展)。
但是...OCP的重點並不在於繼承,而是"彈性",所以只要記住大方向(類似封裝與抽象的意涵),你也可以使用合成等方式達到此目的。

2. 自我不重複原則 (DRY, Don't Repeat Yourself Principle)

"抽取類別中重複的程式碼,置放於單一地方</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5448142081642561898/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5448142081642561898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5448142081642561898'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/blog-post.html' title='設計原則大集合'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5388621647133251359</id><published>2008-11-26T17:49:00.005+08:00</published><updated>2009-02-20T12:23:51.078+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Parser'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java PDFParser</title><summary type='text'>
之前寫文件搜尋時候使用的PDF擷取器, 功能為將PDF內容抽出存成文字檔, 發布出來給大家參考。
首先要下載所需套件pdfBox: http://www.pdfbox.org/, 下載後將src/PDFBox-0.7.3.jar與external/FontBox-0.1.0-dev.jar置放到classpath中。

import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.net.MalformedURLException;
import java.net.URL;
import org.pdfbox.pdmodel.PDDocument;
import </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5388621647133251359/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/java-pdfparser.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5388621647133251359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5388621647133251359'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/java-pdfparser.html' title='Java PDFParser'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5589667502622200077</id><published>2008-11-26T17:01:00.008+08:00</published><updated>2010-03-25T13:04:35.977+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>flashplayer 9.0.124.0 跨網域無法存取 XMLSocket 解決</title><summary type='text'>這篇文章之前已經發佈過一次(我還沒被砍掉的一百多篇中...), 現在把它補回來!
flashplayer 9.0.124.0 由於SandBox存取規則變更, 所以會先從843port開始找, 如找不到在依actionscript中指定路徑或根目錄底下尋找crossdomain.xml。
但不知為何9.0.124.0版本如果沒有置放843port服務的話, 自己並不會去尋找crossdomain.xml, 這就等於逼著大家放一個驗證policy的server在伺服器上。
這裡給大家一個java寫的範本參考, 也是我目前在線上運作的版本。

SecurityServer: 
import java.net.*;
import java.io.*;

public class SecurityServer implements Runnable
{
    private </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5589667502622200077/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/flashplayer-900124-xmlsocket.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5589667502622200077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5589667502622200077'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/flashplayer-900124-xmlsocket.html' title='flashplayer 9.0.124.0 跨網域無法存取 XMLSocket 解決'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-1076963257887621993</id><published>2008-11-26T11:58:00.009+08:00</published><updated>2010-03-25T13:03:59.345+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Google News Parser</title><summary type='text'>我們都知道Google新聞裡彙整了該地區所有媒體的新聞，所以不必再一家一家查訪, 直接去Google擷取就可以。
進入Google新聞頁面後點選類別, 在左下方有一塊 RSS | ATOM 資訊提供的連結, 點選RSS並複製出網址, 這個XML內容就是我們要分析的地方。內容都包覆在item節點中, 詳細內容請各位自己判別, 這裡不多加贅述。Sample Code:import java.io.*;
import java.net.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;

public class GoogleNewsParser
{

    public GoogleNewsParser()
    {
        try {
            // create factory.
            </summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/1076963257887621993/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/google-news-parser.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1076963257887621993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/1076963257887621993'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/google-news-parser.html' title='Google News Parser'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-5219020051810048962</id><published>2008-11-26T09:58:00.010+08:00</published><updated>2009-01-05T21:58:52.966+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>運用Apache HttpClient實作Get與Post動作</title><summary type='text'>HttpClient 簡介:

HTTP 協定是現在 Internet 上使用得最多、最重要的協定，越來越多的 Java 應用程序需要直接通過 HTTP 協定來訪問網路資源。

雖然在 JDK 的 java.net 包中已經提供了訪問 HTTP 協定的基本功能，但是對於大部分應用程序來說，JDK 類別庫本身提供的功能還不夠豐富和靈活。

HttpClient 是 Apache Jakarta Common 下的子項目，用來提供高效能、最新、功能豐富的支持 HTTP 協定的client端開發工具，並且它支持 HTTP 協定最新的版本和建議。

HttpClient 已經應用在很多的項目中，比如 Apache Jakarta 上很著名的另外兩個開源項目 Cactus 和 HTMLUnit 都使用了 HttpClient，更多使用 HttpClient 的應用可以參見http://</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/5219020051810048962/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/apache-httpclientgetpost.html#comment-form' title='5 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5219020051810048962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/5219020051810048962'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/apache-httpclientgetpost.html' title='運用Apache HttpClient實作Get與Post動作'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-2860964320405400705</id><published>2008-11-25T23:30:00.011+08:00</published><updated>2010-03-25T13:03:34.506+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flash'/><title type='text'>ActionScript 3.0 線上技術分析圖</title><summary type='text'>http://twstock.age.com.tw/
Sample CandleChart screen



Using ASWing3.0


由於網誌重新整理故重新發佈了一次, 本程式當初上線時還獲得ASWing設計者青睞加入展示 ShowCase</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/2860964320405400705/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/actionscript-30.html#comment-form' title='3 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2860964320405400705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/2860964320405400705'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/actionscript-30.html' title='ActionScript 3.0 線上技術分析圖'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_uge0r2l3u1Q/SSweBlAPftI/AAAAAAAABBk/VOLXb5q9UYI/s72-c/screen1.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9061386430991367162.post-440790749708647664</id><published>2008-11-25T21:43:00.006+08:00</published><updated>2009-01-02T20:06:04.098+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Xuite Blog圖片, 無名相簿圖等下載方法</title><summary type='text'>*** 僅供技術參考, 不歡迎用作侵犯他人肖像權等用途 *** 

有時候想去下載一些圖檔但發現每一次都要另存新檔實在是很麻煩...又不想使用外面的軟體, 所以乾脆自己來寫程式, 沒想到Xuite有cookie與表頭要求驗證, 無名也有表頭驗證, 到底要怎麼作呢? 

public static void duplicateImage(String sourceURL, String imgSrc, String filename) throws Exception
{
    URL source = new URL(imgSrc);
    HttpURLConnection urlconn = (HttpURLConnection) source.openConnection();
    HttpURLConnection.setFollowRedirects(false);

</summary><link rel='replies' type='application/atom+xml' href='http://samsharehome.blogspot.com/feeds/440790749708647664/comments/default' title='張貼意見'/><link rel='replies' type='text/html' href='http://samsharehome.blogspot.com/2008/11/xuite-blog.html#comment-form' title='1 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/440790749708647664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9061386430991367162/posts/default/440790749708647664'/><link rel='alternate' type='text/html' href='http://samsharehome.blogspot.com/2008/11/xuite-blog.html' title='Xuite Blog圖片, 無名相簿圖等下載方法'/><author><name>Sam Wang</name><uri>http://www.blogger.com/profile/10160813544320583932</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://2.bp.blogspot.com/_uge0r2l3u1Q/SZvbbi6KFOI/AAAAAAAACVs/1hrVF1jdcAk/S220/DSCF1363.JPG'/></author><thr:total>1</thr:total></entry></feed>
