<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8057755552333489045</id><updated>2024-09-12T03:34:03.340+08:00</updated><category term="Ubuntu"/><category term="Yii Framework"/><category term="Red5"/><category term="git"/><category term="閱讀"/><category term="Andriod"/><category term="Bison"/><category term="Flex"/><category term="Java"/><category term="Lex"/><category term="Linux"/><category term="PHP"/><category term="Yacc"/><category term="github"/><category term="版本發佈"/><category term="程式設計"/><category term="37signals"/><category term="3C 瘋"/><category term="500 error"/><category term="AES"/><category term="AJAX"/><category term="AR"/><category term="AWS"/><category term="Abyssus"/><category term="Boostrap"/><category term="C 語言"/><category term="CakePHP"/><category term="Codes"/><category term="EBS"/><category term="Epson EPL 6200L"/><category term="FTP"/><category term="Facebook"/><category term="Firefox"/><category term="Flex Builder"/><category term="HTTP"/><category term="ImageMagick"/><category term="JADE"/><category term="JDBC"/><category term="Live USB"/><category term="MG1"/><category term="MM1"/><category term="MySQL"/><category term="OSFlash"/><category term="Ontology"/><category term="Pidgin"/><category term="Razer"/><category term="Resize"/><category term="Rework"/><category term="Ruby"/><category term="Share On"/><category term="Simulator"/><category term="Step Carousel"/><category term="Syntax Highlighter"/><category term="Windows Media Service"/><category term="Windows Server 2003"/><category term="chmod"/><category term="gitolite"/><category term="jQuery"/><category term="jQuery Plugins"/><category term="mantis"/><category term="nodejs"/><category term="npm"/><category term="phpBB"/><category term="phpMyAdmin"/><category term="pull request"/><category term="ssh"/><category term="函式檔"/><category term="加密"/><category term="印表機"/><category term="地獄狂蛇"/><category term="工作大解放"/><category term="效能測試"/><category term="新功能"/><category term="模組"/><category term="滑鼠"/><category term="演講"/><category term="評測"/><category term="開箱"/><category term="電競"/><category term="驅動程式"/><title type='text'>Jiahe Jou</title><subtitle type='html'>軟體設計與開發</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>55</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-1633220207186592011</id><published>2013-03-07T11:26:00.003+08:00</published><updated>2013-03-07T11:34:10.749+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="500 error"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="pull request"/><title type='text'>Github Pull Request 500 錯誤原因</title><content type='html'>今年一月的時候，因為客戶需求開了新的 branch ，來作另一個 Android 版本的開發，卻遇到了每每 pull request 的時候，不管如何都會先吐個 500 error 給你。&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7zWfPRqDEK9gAnC5uEp0Da2DA3yZ8cQqlxxf72wnBV-aokgRItEqeTFCeDUeBudna8WBiTKRX8K-j28YXVkjsLCgjsDr9mNYkflVAu_I1iCSXA5ISAfDAvG8DtCjGtsklp3TCtM_GHxNG/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7zWfPRqDEK9gAnC5uEp0Da2DA3yZ8cQqlxxf72wnBV-aokgRItEqeTFCeDUeBudna8WBiTKRX8K-j28YXVkjsLCgjsDr9mNYkflVAu_I1iCSXA5ISAfDAvG8DtCjGtsklp3TCtM_GHxNG/s1600/Screenshot-1.png&quot; height=&quot;203&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Github 500 error.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
一開始不明白發生的原因，只能藉由手動修改網址來指定對應的 branch 下 PR。後來終於察覺到是因為在下 PR 前，雖然已經切換了 branch ，但對應到了客戶端的 repository 時，一樣會是master。&lt;br /&gt;
&lt;br /&gt;
而 Github 的答覆是：&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim_0PSn8106gED-TUd1y1_d3vS5JNlh0hGvtfw2CEiGaJKA9ACo9WLNbnJQ_wbGhmvE2qyYOZfOp9w-_nYvkPZrprZGqB71p7Uhz6RQY3TaIaxYzKUhcIYyUtGJzRqQN8jgQbKSzT0J9Oq/s1600/Screenshot.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim_0PSn8106gED-TUd1y1_d3vS5JNlh0hGvtfw2CEiGaJKA9ACo9WLNbnJQ_wbGhmvE2qyYOZfOp9w-_nYvkPZrprZGqB71p7Uhz6RQY3TaIaxYzKUhcIYyUtGJzRqQN8jgQbKSzT0J9Oq/s1600/Screenshot.png&quot; height=&quot;119&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Github response about pull request.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
只能在 PR 建立的頁面才可以選擇相對應的 branch。但是，下 PR 就發生 500 錯誤，根本沒辦法進到選擇頁面阿！！！看來目前還是只能手動改網址了...&lt;br /&gt;
&lt;br /&gt;
不過，這些問題跟 500 錯誤有什麼關係呢？當發現新 branch 下 PR 會對應到 master 時就有個底了，答案是因為相對應的 branch 差異過大，導致 Github 發生 timout 例外。&lt;br /&gt;
&lt;br /&gt;
Github 的回應是：&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJe8imuUCEvbGi1KPBn13MX79cmxkuP8GCwLcWEJ1ETCCQCwUAREA07g-N3uuRhXutrZCQ12BTZViKbhnKnO1QncBAy0Zp6v0tWnfMV8wlzrOba_Th2oXYM9rQ984ui670Su5v5z7ZmxWg/s1600/Screenshot-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJe8imuUCEvbGi1KPBn13MX79cmxkuP8GCwLcWEJ1ETCCQCwUAREA07g-N3uuRhXutrZCQ12BTZViKbhnKnO1QncBAy0Zp6v0tWnfMV8wlzrOba_Th2oXYM9rQ984ui670Su5v5z7ZmxWg/s1600/Screenshot-1.png&quot; height=&quot;150&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Github response about large diff for pull request&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
看起來 timeout 的問題 Github 目前也是無解，如果發生這些情況，只好先手動處理了。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/1633220207186592011/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/1633220207186592011' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/1633220207186592011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/1633220207186592011'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/03/github-pull-request-500.html' title='Github Pull Request 500 錯誤原因'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7zWfPRqDEK9gAnC5uEp0Da2DA3yZ8cQqlxxf72wnBV-aokgRItEqeTFCeDUeBudna8WBiTKRX8K-j28YXVkjsLCgjsDr9mNYkflVAu_I1iCSXA5ISAfDAvG8DtCjGtsklp3TCtM_GHxNG/s72-c/Screenshot-1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-8474926949252784925</id><published>2013-03-06T16:41:00.002+08:00</published><updated>2013-03-06T17:47:15.644+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="github"/><category scheme="http://www.blogger.com/atom/ns#" term="ssh"/><title type='text'>多個 SSH  Key 對應多個 Github 帳號</title><content type='html'>&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;產生個別的 ssh keys
&lt;pre class=&quot;brush:shell;&quot;&gt;$ cd ~/.ssh
$ ssh-keygen -t rsa -C &quot;account1@email.com&quot; -f id_rsa_account1
$ ssh-keygen -t rsa -C &quot;account2@email.com&quot; -f id_rsa_account2
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;建立 config 檔
&lt;pre class=&quot;brush:shell;&quot;&gt;$ cd ~/.ssh
$ touch config
$ gedit config
&lt;/pre&gt;
編輯內容如下

&lt;pre class=&quot;brush:shell;&quot;&gt;#account1
Host github.com-account1
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_account1

#account2
Host github.com-account2
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_rsa_account2
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;修改相對應 repo 的 remote url。例如：
&lt;pre class=&quot;brush:shell;&quot;&gt;
$ cd /path/to/repo1
$ git remote set-url origin ssh://git@github.com-account1/account1/repo1.git
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;完成&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/8474926949252784925/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/8474926949252784925' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/8474926949252784925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/8474926949252784925'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/03/ssh-key-github.html' title='多個 SSH  Key 對應多個 Github 帳號'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-5422340241323704631</id><published>2013-03-06T14:39:00.003+08:00</published><updated>2013-03-06T17:07:49.124+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="HTTP"/><title type='text'>Git HTTP 協定的檔案大小限制</title><content type='html'>&lt;div&gt;
使用 git push 經由 HTTP 協定的時候要注意了，因為有檔案大小的限制，預設是 1MB。&lt;br /&gt;發生的錯誤訊息如下所示：&lt;/div&gt;
&lt;pre class=&quot;brush:shell&quot;&gt;$ git push
Counting objects: 199918, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (188542/188542), done.
error: RPC failed; result=22, HTTP code = 413MiB | 53 KiB/s   
fatal: The remote end hung up unexpectedly
Writing objects: 100% (199918/199918), 1.98 GiB | 7.61 MiB/s, done.
Total 199918 (delta 55401), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
fatal: expected ok/error,...
&lt;/pre&gt;
&lt;br /&gt;
有兩種方式可以解決這個問題：&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;使用 SSH 來作為 git 的通訊。&lt;/li&gt;
&lt;li&gt;加大 HTTP 檔案大小限制，如下：
&lt;pre class=&quot;brush:shell&quot;&gt;
git config http.postBuffer 524288000 #Set to 500MB
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/5422340241323704631/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/5422340241323704631' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5422340241323704631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5422340241323704631'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/03/git-http.html' title='Git HTTP 協定的檔案大小限制'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-7065740801469964388</id><published>2013-02-15T22:32:00.000+08:00</published><updated>2013-02-15T23:07:29.861+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Boostrap"/><category scheme="http://www.blogger.com/atom/ns#" term="Yii Framework"/><title type='text'>Yii 安裝 Bootstrap</title><content type='html'>安裝方法：&lt;br /&gt;
&lt;a href=&quot;http://www.cniska.net/yii-bootstrap/setup.html&quot;&gt;http://www.cniska.net/yii-bootstrap/setup.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Github 版的 Yii Bootstrap 可以從這邊取得：&lt;br /&gt;
&lt;a href=&quot;https://github.com/joujiahe/yii-bootstrap&quot;&gt;https://github.com/joujiahe/yii-bootstrap&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
注意： 需將&amp;nbsp;&lt;i&gt;webapp/protected/extensions/bootstrap/theme/*&amp;nbsp;&lt;/i&gt;下的檔案複製到&lt;br /&gt;
&lt;i&gt;webapp/themes/bootstrap/&amp;nbsp;&lt;/i&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/7065740801469964388/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/7065740801469964388' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/7065740801469964388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/7065740801469964388'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/02/yii-bootstrap.html' title='Yii 安裝 Bootstrap'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-2842479676104708029</id><published>2013-02-15T20:43:00.001+08:00</published><updated>2013-02-15T21:44:57.541+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Yii Framework"/><title type='text'>Yii 使用偽靜態網址</title><content type='html'>在 webapp 下新增一個 .htaccess 檔，並將以下內容複製貼上：&lt;br /&gt;
&lt;pre class=&quot;brush:shell&quot;&gt;RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php
&lt;/pre&gt;
&lt;br /&gt;
修改 webapp/protected/config/main.php 設定檔來啟用 urlManager：&lt;br /&gt;
&lt;pre class=&quot;brush:php&quot;&gt;
		// uncomment the following to enable URLs in path-format
		&#39;urlManager&#39;=&amp;gt;array(
			&#39;urlFormat&#39;=&amp;gt;&#39;path&#39;,
			&#39;showScriptName&#39;=&amp;gt;false,
			&#39;urlSuffix&#39;=&amp;gt;&#39;.html&#39;,
			&#39;rules&#39;=&amp;gt;array(
				&#39;&amp;lt;controller:\w+&amp;gt;/&amp;lt;id:\d+&amp;gt;&#39;=&amp;gt;&#39;&amp;lt;controller&amp;gt;/view&#39;,
				&#39;&amp;lt;controller:\w+&amp;gt;/&amp;lt;action:\w+&amp;gt;/&amp;lt;id:\d+&amp;gt;&#39;=&amp;gt;&#39;&amp;lt;controller&amp;gt;/&amp;lt;action&amp;gt;&#39;,
				&#39;&amp;lt;controller:\w+&amp;gt;/&amp;lt;action:\w+&amp;gt;&#39;=&amp;gt;&#39;&amp;lt;controller&amp;gt;/&amp;lt;action&amp;gt;&#39;,
			),
		),
&lt;/pre&gt;
這樣就可以將 index.php 藏起來並偽裝成 .html 的網址了。</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/2842479676104708029/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/2842479676104708029' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2842479676104708029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2842479676104708029'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/02/yii_15.html' title='Yii 使用偽靜態網址'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-5095214581894569890</id><published>2013-02-07T00:41:00.003+08:00</published><updated>2013-02-07T00:41:43.970+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Yii Framework"/><title type='text'>Yii 抽象資料庫欄位類型的支援</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
Yii Migration 支援多種抽象欄位類型，如下所示：&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;pk: an auto-incremental primary key type, will be converted into &quot;int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY&quot;&lt;/li&gt;
&lt;li&gt;string: string type, will be converted into &quot;varchar(255)&quot;&lt;/li&gt;
&lt;li&gt;text: a long string type, will be converted into &quot;text&quot;&lt;/li&gt;
&lt;li&gt;integer: integer type, will be converted into &quot;int(11)&quot;&lt;/li&gt;
&lt;li&gt;boolean: boolean type, will be converted into &quot;tinyint(1)&quot;&lt;/li&gt;
&lt;li&gt;float: float number type, will be converted into &quot;float&quot;&lt;/li&gt;
&lt;li&gt;decimal: decimal number type, will be converted into &quot;decimal&quot;&lt;/li&gt;
&lt;li&gt;datetime: datetime type, will be converted into &quot;datetime&quot;&lt;/li&gt;
&lt;li&gt;timestamp: timestamp type, will be converted into &quot;timestamp&quot;&lt;/li&gt;
&lt;li&gt;time: time type, will be converted into &quot;time&quot;&lt;/li&gt;
&lt;li&gt;date: date type, will be converted into &quot;date&quot;&lt;/li&gt;
&lt;li&gt;binary: binary data type, will be converted into &quot;blob&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/5095214581894569890/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/5095214581894569890' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5095214581894569890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5095214581894569890'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/02/yii.html' title='Yii 抽象資料庫欄位類型的支援'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-14451133426588935</id><published>2013-01-31T15:04:00.004+08:00</published><updated>2013-01-31T22:48:36.216+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="gitolite"/><category scheme="http://www.blogger.com/atom/ns#" term="mantis"/><title type='text'>整合 Mantis 與 Gitolite</title><content type='html'>前陣子整合了公司的 mantis 和 gitolite，主要的目的就是要讓開發人員 push commits 到 gitolite 的時候，能夠同時更新 mantis 的 issue ，方便持續追蹤。&lt;br /&gt;
&lt;br /&gt;
要完成這樣的功能，關鍵就在 git 的 post hooks，完整架構如下：&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyLImPpCS-AfGgdcgpe1t-_g5wq6FX5C9erM017ad6atRBVdx5RgCV3jghLMmJ-FFo-OBv5lCTvZzxi2WOyMfUAh1gRwlXWdtv_oqBwpHhqxtO4pq3qsFY1na592Hqmnd3l8G6gDmc1JJP/s1600/integrate-gitolite-with-mantis.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyLImPpCS-AfGgdcgpe1t-_g5wq6FX5C9erM017ad6atRBVdx5RgCV3jghLMmJ-FFo-OBv5lCTvZzxi2WOyMfUAh1gRwlXWdtv_oqBwpHhqxtO4pq3qsFY1na592Hqmnd3l8G6gDmc1JJP/s400/integrate-gitolite-with-mantis.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;整合 Mantis 與 Gitolite&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
如上圖所示，當 gitolite 中的 git repo 收到開發人員的 commits 時，post hooks 會被呼叫，對應到的 hook 檔是 post-receive，與 svn 的 post-commit 不同，如下圖所示：&lt;br /&gt;
&lt;table align=&quot;center&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;tr-caption-container&quot; style=&quot;margin-left: auto; margin-right: auto; text-align: center;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNS1MdLSPRW05BanC7Y9UT6YzNVKvBmxRgf3AvAvy7X20krGuqzOZIBVBCgmhp8FEPlUJdKBFTlWSqDl91QGS2pe6SNQdxPS_JtVLaUP6IdZ6S2EIaY3wSZ_uvFjFDONZn7619XInVF6Gi/s1600/hooks-procedure-of-git-push.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: auto; margin-right: auto;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNS1MdLSPRW05BanC7Y9UT6YzNVKvBmxRgf3AvAvy7X20krGuqzOZIBVBCgmhp8FEPlUJdKBFTlWSqDl91QGS2pe6SNQdxPS_JtVLaUP6IdZ6S2EIaY3wSZ_uvFjFDONZn7619XInVF6Gi/s400/hooks-procedure-of-git-push.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;tr-caption&quot; style=&quot;text-align: center;&quot;&gt;Post hook 的過程&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
瞭解了大概的架構之後，開始著手進行 post-receive 的撰寫。Gitolite 共用的 hooks 檔案位於 &quot;&lt;i&gt;/usr/share/gitolite/hooks/common/*&lt;/i&gt;&quot;，找到我們要的 post-receive 後開始編輯。&lt;br /&gt;
&lt;pre class=&quot;brush:shell&quot;&gt;# 讀取輸入的物件檔案
while read oldrev newrev ref
do
    # 取得 commit 資訊
    subj=`git show -s --format=&quot;%s&quot; $newrev`
    diff=`git show $newrev...$oldrev`
    msgs=&quot;$subj
$diff&quot;
    # 將資訊餵給用來跟 mantis 同步的 perl 程式
    /home/gitolite/git2mantis.pl &quot;$msgs&quot;
    ...
done
&lt;/pre&gt;
&lt;br /&gt;
這段 post hook 的目的是將收到的 git commit 資訊讀出來，然後餵給一隻 perl 程式來進行處理。撰寫完這個 hook ，還必須執行 gl-setup，這樣才會把這個 hook 放到每一個 git repo 下。&lt;br /&gt;
&lt;br /&gt;
接下來，來看看 &quot;&lt;i&gt;/home/gitolite/git2mantis.pl&lt;/i&gt;&quot; 做了什麼事情。&lt;br /&gt;
&lt;pre class=&quot;brush:perl&quot;&gt;#!/usr/bin/perl
#
# 使用者 mantis 的 ssh key 必須在 192.168.26.103 主機上設定好，
# 才能允許自動登入。
$host = &quot;mantis@192.168.0.1&quot;;

$sshcmd = &quot;/usr/bin/ssh &quot;;
$phpcmd = &quot;/usr/bin/php&quot;;

# mantis 的 checkin 程式
$checkincmd = &quot;/var/www/mantis/scripts/checkin.php&quot;;

$msg = $ARGV[0];

# 透過 ssh 來執行遠端主機的程式
`$sshcmd $host $phpcmd $checkincmd &amp;lt;&amp;lt;&amp;lt; &quot;$msg&quot;`;
&lt;/pre&gt;
&lt;br /&gt;
這隻 perl 程式的工作就是把收到的訊息，透過 ssh 的方式，傳送給遠端的程式並且執行。&lt;br /&gt;
&lt;br /&gt;
就這樣，完成了簡易的 mantis 和 gitolite 的整合，可以使用 mantis 來追蹤 git 的開發過程了。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/14451133426588935/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/14451133426588935' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/14451133426588935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/14451133426588935'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/mantis-gitolite.html' title='整合 Mantis 與 Gitolite'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjyLImPpCS-AfGgdcgpe1t-_g5wq6FX5C9erM017ad6atRBVdx5RgCV3jghLMmJ-FFo-OBv5lCTvZzxi2WOyMfUAh1gRwlXWdtv_oqBwpHhqxtO4pq3qsFY1na592Hqmnd3l8G6gDmc1JJP/s72-c/integrate-gitolite-with-mantis.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-2112560360582599707</id><published>2013-01-29T17:39:00.002+08:00</published><updated>2013-01-29T17:39:54.995+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="函式檔"/><title type='text'>函式檔 libXXX.a 的操作</title><content type='html'>參考：&lt;br /&gt;
&lt;a href=&quot;http://www.thegeekstuff.com/2010/08/ar-command-examples/&quot;&gt;http://www.thegeekstuff.com/2010/08/ar-command-examples/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/2112560360582599707/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/2112560360582599707' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2112560360582599707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2112560360582599707'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/libxxxa.html' title='函式檔 libXXX.a 的操作'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-24213349271664002</id><published>2013-01-28T01:43:00.002+08:00</published><updated>2013-01-28T01:43:52.539+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AR"/><category scheme="http://www.blogger.com/atom/ns#" term="Yii Framework"/><title type='text'>繼承 Yii Framework 中的 AR 類別</title><content type='html'>關聯式資料庫並不支援繼承，但是，我們可以藉由繼承 AR 的方式來產生子類別繼承。什麼時候會需要繼承 AR 呢？最常見的情況應該是使用者分角色的時候，&lt;br /&gt;
&lt;br /&gt;
例如：網站的使用者，區分為管理員、一般和進階使用者。不管哪一種角色都使用同一個資料表，並藉由繼承 User AR 的方式來產生各自的 AR。&lt;br /&gt;
&lt;br /&gt;
Yii 官方維基有一篇介紹文章，使用 Car AR 來繼承產生 Sport Car 和 Family Car。寫得簡單明瞭，可以參考看看：&lt;br /&gt;
&lt;a href=&quot;http://www.yiiframework.com/wiki/198/single-table-inheritance/&quot;&gt;http://www.yiiframework.com/wiki/198/single-table-inheritance/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/24213349271664002/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/24213349271664002' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/24213349271664002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/24213349271664002'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/yii-framework-ar.html' title='繼承 Yii Framework 中的 AR 類別'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-8586030708716665602</id><published>2013-01-24T12:09:00.001+08:00</published><updated>2013-01-25T01:30:48.943+08:00</updated><title type='text'>Git 有沒有像 SVN Export 一樣的功能?</title><content type='html'>答案是，沒有。&lt;br /&gt;
&lt;br /&gt;
在 Git 中，沒有 export 這樣的指令來將程式碼輸出。&lt;br /&gt;
&lt;br /&gt;
但是，Git 有提供封存(archive)的功能，稍微作點變化就可以達到像 svn export 一樣的功用。如下所示：&lt;br /&gt;
&lt;pre class=&quot;brush:shell&quot;&gt;
# 將當前狀態封存，並取出至指定位置
$ git archive HEAD | tar -x -C /path/to/export&lt;/pre&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/8586030708716665602/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/8586030708716665602' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/8586030708716665602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/8586030708716665602'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/git-exportsvn-export.html' title='Git 有沒有像 SVN Export 一樣的功能?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-121026825247956871</id><published>2013-01-24T11:56:00.001+08:00</published><updated>2013-01-25T01:32:30.651+08:00</updated><title type='text'>在 Git 中建立一個空的 branch</title><content type='html'>&lt;div&gt;
到 Git 庫裡面下指令：&lt;/div&gt;

&lt;pre class=&quot;brush:shell&quot;&gt;
# 建立一個獨立的分支
$ git checkout --orphan empty-branch

# 清空所有東西
$ git rm -rf .
&lt;/pre&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/121026825247956871/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/121026825247956871' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/121026825247956871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/121026825247956871'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/git-branch.html' title='在 Git 中建立一個空的 branch'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-1962224737981987006</id><published>2013-01-23T00:22:00.000+08:00</published><updated>2013-01-25T01:32:41.092+08:00</updated><title type='text'>存取 Struct 中的欄位</title><content type='html'>存取 C Struct 中的欄位，可分為變數和指標兩種型態來存取，存取方式如下所示：&lt;br /&gt;
&lt;pre class=&quot;brush:c&quot;&gt;
// 如果是變數：
fish.age

// 如果是指標：
(*fish).age
// 或
fish-&gt;age
&lt;/pre&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/1962224737981987006/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/1962224737981987006' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/1962224737981987006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/1962224737981987006'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/struct.html' title='存取 Struct 中的欄位'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-3714321266090496773</id><published>2013-01-20T04:14:00.002+08:00</published><updated>2013-01-25T01:33:07.772+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Live USB"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>建立 Ubuntu 的 Live USB</title><content type='html'>從 Ubuntu 11.04 以後，就開始支援 live USB 了。所以，不再需要額外的工具建立 bootable USB，直接使用下載的 ISO 檔來建立 live USB。&lt;br /&gt;
&lt;br /&gt;
建立方法如下：&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush:shell&quot;&gt;
$ cat ubuntu-12.10-desktop-amd64.iso &amp;gt; /dev/sdb
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
注意， sdb 是 usb 裝置的位置，實際位置依狀況會有所不同。&lt;br /&gt;
&lt;br /&gt;
接下來，就可以進入 BIOS 更改開機順序為 USB 優先，然後插入 USB 之後就可以開始進行安裝了！&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/3714321266090496773/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/3714321266090496773' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/3714321266090496773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/3714321266090496773'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/ubuntu-live-usb.html' title='建立 Ubuntu 的 Live USB'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-2597468861390325441</id><published>2013-01-16T23:06:00.001+08:00</published><updated>2013-01-20T12:10:45.887+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="程式設計"/><title type='text'> 陣列的索引值</title><content type='html'>陣列的索引值是指，距離第一個字元的偏移量（offset）。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
例如：第一個字元 a[0]，第二個字元 a[1]，以此類推。&lt;br /&gt;
&lt;br /&gt;
會有這樣的設計因為陣列指標是直接指向記憶體位址的，透過偏移量的方式可以直接運算，來取得其他元素的位置。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/2597468861390325441/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/2597468861390325441' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2597468861390325441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2597468861390325441'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/blog-post.html' title=' 陣列的索引值'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-414575200816289108</id><published>2013-01-16T22:52:00.001+08:00</published><updated>2013-01-20T12:11:23.713+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>為什麼 Mac 或 Linux 執行程式要加上 ./?</title><content type='html'>為什麼常常在 Mac 或是 Linux 中執行程式都要加上 ./&lt;br /&gt;
&lt;br /&gt;
例如：./a.out。&lt;br /&gt;
&lt;br /&gt;
這是因為在 Unix 形式的作業系統裡，要求執行的程式必須包和路徑位置，除非該路徑已被列在環境變數當中。&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/414575200816289108/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/414575200816289108' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/414575200816289108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/414575200816289108'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/mac-linux.html' title='為什麼 Mac 或 Linux 執行程式要加上 ./?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-5889100498146009881</id><published>2013-01-16T22:47:00.000+08:00</published><updated>2013-01-20T12:11:36.109+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C 語言"/><title type='text'>C 語言種類</title><content type='html'>C 語言有三種，依時間順序為：&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;C89 (1989，常被稱作 ANSI C)&lt;/li&gt;
&lt;li&gt;C99 (2000)&lt;/li&gt;
&lt;li&gt;C11 (2011)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
C99 開始支援 // 的註解形式。&lt;br /&gt;
&lt;br /&gt;
C 語言特性：
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;不支援現成的字串，而是由字元陣列取代。&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/5889100498146009881/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/5889100498146009881' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5889100498146009881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5889100498146009881'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2013/01/c.html' title='C 語言種類'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-595648381379261033</id><published>2012-04-26T20:49:00.000+08:00</published><updated>2012-04-26T20:56:49.536+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="nodejs"/><category scheme="http://www.blogger.com/atom/ns#" term="npm"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Ubuntu 上安裝 node.js 和 npm</title><content type='html'>&lt;br /&gt;
&lt;br /&gt;
1. 透過 command line 安裝 node.js 和 npm
&lt;pre class=&quot;brush: shell;&quot;&gt;
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs npm
&lt;/pre&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. 啟動 HTTP SERVER 的程式碼
&lt;pre class=&quot;brush: javascript;&quot;&gt;
var http = require(&#39;http&#39;);
http.createServer(function (req, res) {
  res.writeHead(200, {&#39;Content-Type&#39;: &#39;text/plain&#39;});
  res.end(&#39;Hello World\n&#39;);
}).listen(1337, &#39;127.0.0.1&#39;);
console.log(&#39;Server running at http://127.0.0.1:1337/&#39;);
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. 用 node 執行 server.js
&lt;pre class=&quot;brush: shell;&quot;&gt;
node server.js
Server running at http://127.0.0.1:1337/
&lt;/pre&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

4. 開啟：&lt;a href=&quot;http://127.0.0.1:1337/&quot;&gt;http://127.0.0.1:1337/&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;
看到 Hello World 就成功了！
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
參考來源：&lt;a href=&quot;http://nodejs.org/&quot;&gt;http://nodejs.org/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/595648381379261033/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/595648381379261033' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/595648381379261033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/595648381379261033'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2012/04/ubuntu-nodejs-npm.html' title='Ubuntu 上安裝 node.js 和 npm'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-1721737262892156262</id><published>2011-10-19T18:04:00.002+08:00</published><updated>2011-10-19T18:05:00.174+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AWS"/><category scheme="http://www.blogger.com/atom/ns#" term="EBS"/><category scheme="http://www.blogger.com/atom/ns#" term="Resize"/><title type='text'>調整 AWS instance 的 EBS 容量</title><content type='html'>資料來源：&lt;a href=&quot;https://forums.aws.amazon.com/thread.jspa?threadID=42501&quot;&gt;https://forums.aws.amazon.com/thread.jspa?threadID=42501&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
非常有用的一篇文章！！</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/1721737262892156262/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/1721737262892156262' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/1721737262892156262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/1721737262892156262'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/aws-instance-ebs.html' title='調整 AWS instance 的 EBS 容量'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-4564289497332330630</id><published>2011-10-15T14:30:00.000+08:00</published><updated>2011-10-15T14:33:19.545+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="JDBC"/><category scheme="http://www.blogger.com/atom/ns#" term="MySQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>在 Ubuntu 中使用 Java 連接 MySQL</title><content type='html'>首先必須要有 java 對 mysql 的連接器，並設定環境變數，安裝方法：&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: shell;&quot;&gt;sudo apt-get install libmysql-java

#取得 mysql java 連接器



CLASSPATH=$CLASSPATH:/user/share/java/mysql.jar

#設定自訂變數 CLASSPATH



export CLASSPATH

#將自定變數 &amp;nbsp;CLASSPATH 設為環境變數

&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
mysql connector 都安裝好了之後，就可以寫點小程式來測試一下啦！&lt;br /&gt;
&lt;br /&gt;
JDBCMySQL.java&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: java;&quot;&gt;import java.sql.*;

public class JDBCMySQL {
    public static void main(String[] args) {
        String driver = &quot;com.mysql.jdbc.Driver&quot;;
        String url = &quot;jdbc:mysql://localhost:3306/phpbb&quot;;
        String user = &quot;root&quot;;
        String password = &quot;5.ru8ck6&quot;;
        try {
            Class.forName(driver);
            Connection conn =
               DriverManager.getConnection(url,
                                  user, password);

            if(conn != null &amp;amp;&amp;amp; !conn.isClosed()) {
                System.out.println(&quot;資料庫連線測試成功！&quot;);
                conn.close();
            }

        }
        catch(ClassNotFoundException e) {
            System.out.println(&quot;找不到驅動程式類別&quot;);
            e.printStackTrace();
        }
        catch(SQLException e) {
            e.printStackTrace();
        }
    }
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
參考資料：&lt;br /&gt;
&lt;a href=&quot;https://help.ubuntu.com/community/JDBCAndMySQL&quot;&gt;https://help.ubuntu.com/community/JDBCAndMySQL&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://caterpillar.onlyfun.net/Gossip/JavaGossip-V2/ConnectDB.htm&quot;&gt;http://caterpillar.onlyfun.net/Gossip/JavaGossip-V2/ConnectDB.htm&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/4564289497332330630/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/4564289497332330630' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/4564289497332330630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/4564289497332330630'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/ubuntu-java-mysql.html' title='在 Ubuntu 中使用 Java 連接 MySQL'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-5951283610030525155</id><published>2011-10-15T12:08:00.000+08:00</published><updated>2011-10-15T14:32:44.763+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="版本發佈"/><title type='text'>Ubuntu 11.10 （Oneiric Ocelot）發佈囉！</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSN9Jvqga-kgte-hl_GWLU1gt5Id6gJ23bNAZaja2Svs3WR5NhEk2zNozHnTkU_1RtlQd_eoRu_qlBXTM2kkJaw6DVYfEY3pklfiftcCRLFMSEWfNm2nK6dW80FakACavnuMk_H6CnMtWy/s1600/Qref_Ubuntu_Logo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSN9Jvqga-kgte-hl_GWLU1gt5Id6gJ23bNAZaja2Svs3WR5NhEk2zNozHnTkU_1RtlQd_eoRu_qlBXTM2kkJaw6DVYfEY3pklfiftcCRLFMSEWfNm2nK6dW80FakACavnuMk_H6CnMtWy/s200/Qref_Ubuntu_Logo.png&quot; width=&quot;197&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
跟11.04的桌面有著全新的不同體驗！讚～下載位置：&lt;a href=&quot;http://www.ubuntu.com/download&quot;&gt;http://www.ubuntu.com/download&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;#以下轉自 ptt.cc Linux 板：&lt;/b&gt;&lt;br /&gt; 作者  hayatoman (小小的改變是,成功的開始)                        看板  Linux&lt;br /&gt;&lt;br /&gt; 標題  [分享] Ubuntu 11.10正式發佈&lt;br /&gt;&lt;br /&gt; 時間  Fri Oct 14 09:59:39 2011&lt;br /&gt;&lt;br /&gt;───────────────────────────────────────&lt;br /&gt;&lt;br /&gt;Ubuntu 11.10（Oneiric Ocelot）如約正式發佈了，這是Ubuntu的第15個重大版本發佈，&lt;br /&gt;&lt;br /&gt;桌面版和服務器版都有18個月的生命週期。Ubuntu 11.10包括以下版本：桌面版、服務器&lt;br /&gt;&lt;br /&gt;版、Ubuntu Cloud、Kubuntu、Xubuntu、Lubuntu、Edubuntu、Mythbuntu、Ubuntu&lt;br /&gt;&lt;br /&gt;Studio。&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ubuntu 11.10元件：&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;— Unity 3D界面4.22；&lt;br /&gt;&lt;br /&gt;— Unity 2D界面4.12；&lt;br /&gt;&lt;br /&gt;— 桌面環境GNOME 3.2.0；&lt;br /&gt;&lt;br /&gt;— Linux kernel 3.0.4；&lt;br /&gt;&lt;br /&gt;— X.Org 7.6;&lt;br /&gt;&lt;br /&gt;— Xorg Server 1.10.4;&lt;br /&gt;&lt;br /&gt;— Upstart 1.3;&lt;br /&gt;&lt;br /&gt;— GCC 4.6 toolchain;&lt;br /&gt;&lt;br /&gt;— Python 2.7.2;&lt;br /&gt;&lt;br /&gt;— Compiz Fusion 0.9.6。&lt;br /&gt;&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;Ubuntu 11.10新特性：&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;— 完善了桌面體驗；&lt;br /&gt;&lt;br /&gt;— 3D界面和2D界面兩種登錄方法，均屬Unity界面；&lt;br /&gt;&lt;br /&gt;— 全新的LightDM登錄畫面；&lt;br /&gt;&lt;br /&gt;— 新的Alt+Tab快捷鍵切換；&lt;br /&gt;&lt;br /&gt;— 14張新壁紙；&lt;br /&gt;&lt;br /&gt;— 默認的Ambiance主題進行了完善；&lt;br /&gt;&lt;br /&gt;— 全新的Ubuntu Software Center軟件中心；&lt;br /&gt;&lt;br /&gt;— 默認瀏覽器：Mozilla Firefox 7.0；&lt;br /&gt;&lt;br /&gt;— 默認郵件客戶端：Mozilla Thunderbird 7.0；&lt;br /&gt;&lt;br /&gt;— 混合CD/USB ISO鏡像：支持將ISO鏡像直接寫入USB；&lt;br /&gt;&lt;br /&gt;— 完善了對32位和64位系統的兼容性；&lt;br /&gt;&lt;br /&gt;— 服務器版本支持ARM架構；&lt;br /&gt;&lt;br /&gt;— 引入了Juju雲端服務；&lt;br /&gt;&lt;br /&gt;— 新的音樂播放器連接至Banshee；&lt;br /&gt;&lt;br /&gt;— 支持更多腳本語言，包括日語、中文和韓語；&lt;br /&gt;&lt;br /&gt;— DVD鏡像更小，包括所有你需要的應用程序。&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Ubuntu 11.10官方下載頁面：&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;http://www.ubuntu.com/&lt;br /&gt;&lt;br /&gt;http://cdimage.ubuntu.com/releases/11.10/release/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/5951283610030525155/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/5951283610030525155' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5951283610030525155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5951283610030525155'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/ubuntu-1110-oneiric-ocelot.html' title='Ubuntu 11.10 （Oneiric Ocelot）發佈囉！'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSN9Jvqga-kgte-hl_GWLU1gt5Id6gJ23bNAZaja2Svs3WR5NhEk2zNozHnTkU_1RtlQd_eoRu_qlBXTM2kkJaw6DVYfEY3pklfiftcCRLFMSEWfNm2nK6dW80FakACavnuMk_H6CnMtWy/s72-c/Qref_Ubuntu_Logo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-2325342915373363187</id><published>2011-10-14T21:21:00.001+08:00</published><updated>2011-10-14T21:28:27.731+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="37signals"/><category scheme="http://www.blogger.com/atom/ns#" term="Rework"/><category scheme="http://www.blogger.com/atom/ns#" term="工作大解放"/><category scheme="http://www.blogger.com/atom/ns#" term="閱讀"/><title type='text'>Rework - 工作大解放</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://im1.book.com.tw/exep/lib/image.php?image=http://addons.books.com.tw/G/001/2/0010482162.jpg&amp;amp;width=200&amp;amp;height=280&amp;amp;quality=80&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://im1.book.com.tw/exep/lib/image.php?image=http://addons.books.com.tw/G/001/2/0010482162.jpg&amp;amp;width=200&amp;amp;height=280&amp;amp;quality=80&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
前陣子就有聽聞這本書獨到的見解，剛好在退伍前一天，趁著放假的空閒，去書局帶了這本書回來。看完這本書我只能說，真的是大解我多年來的心頭之惑。一直以來都想著該如何創業、如何起手，讀完這本書會一掃我心中思考已久的疑惑。&lt;br /&gt;
&lt;br /&gt;
作者是著名的 37signals 創辦人，述說著他們如何從網頁設計公司轉型成為軟體公司，秉持著與 MBA 大相逕庭的理念，不主張擴張，遵循著解決自己問題的原則來開發產品，與現存大部分的軟體公司，老想著如何解決別人問題、迎合別人來規劃開發新產品的作法，是完全不同。他們不做計畫、不當工作狂、不逞英雄、不訂長遠的目標，因為訂定太大、大遠的目標只是一種猜測，猜測事情的發展會發生無法預料的後果，並教導如何靠著經營客戶來經營自己的品牌，而不是透過廣告行銷，一些大費周章卻得不到成效的白工。書中還講了好多好多很棒的內容，讀完會讓我有種恍然大悟的感覺，很久以前就一直在尋找這類的書籍，沒想到真的出版了！&lt;br /&gt;
&lt;br /&gt;
這本書中許多的專案管理理念和原則，跟我最近在讀的人月神話有許多相似的地方，最近真的是瘋狂愛上了這類的書籍...無法自拔！！&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/2325342915373363187/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/2325342915373363187' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2325342915373363187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/2325342915373363187'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/rework.html' title='Rework - 工作大解放'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-5364114533833839494</id><published>2011-10-13T16:33:00.000+08:00</published><updated>2011-10-13T16:33:24.755+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="chmod"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Linux 上 chmod 只修改檔案或是資料夾的權限</title><content type='html'>資料夾：&lt;br /&gt;
find . -type d -exec chmod 775 {} \;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
檔案：&lt;br /&gt;
find . -type f -exec chmod 664 {} \;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/5364114533833839494/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/5364114533833839494' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5364114533833839494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/5364114533833839494'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/linux-chmod.html' title='Linux 上 chmod 只修改檔案或是資料夾的權限'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-6848738065637070494</id><published>2011-10-13T15:12:00.001+08:00</published><updated>2011-10-13T15:14:22.187+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="phpBB"/><category scheme="http://www.blogger.com/atom/ns#" term="Share On"/><category scheme="http://www.blogger.com/atom/ns#" term="模組"/><title type='text'>在 phpBB 上安裝 Share On 模組</title><content type='html'>Share On 是 phpBB 官方認可的模組，安裝完之後可以在文章上看到大多數社群網站的分享按鈕，安裝的方法非常的簡單，照個官方的指示一步一步做就可以了。&lt;br /&gt;
&lt;br /&gt;
模組名稱：Share On 1.2&lt;br /&gt;
官方介紹頁面：&lt;a href=&quot;http://www.phpbb.com/customise/db/mod/share_on/&quot;&gt;http://www.phpbb.com/customise/db/mod/share_on/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
安裝完之後，會發現其實有個小 bug 需要修正。未登入的使用者，會看不到 share on 模組的語言字串 SO_SELECT，如這篇所示：&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.phpbb.com/customise/db/download/id_81247-mode_view&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;60&quot; src=&quot;http://www.phpbb.com/customise/db/download/id_81247-mode_view&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.phpbb.com/customise/db/mod/share_on/support/solved_%7B_so_select_%7D-t_94654&quot;&gt;http://www.phpbb.com/customise/db/mod/share_on/support/solved_%7B_so_select_%7D-t_94654&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
網址內所提的方法是在 viewtopic.php 內加上：&lt;br /&gt;
&lt;pre class=&quot;brush: php&quot;&gt;$user-&amp;gt;add_lang(&#39;mods/info_acp_shareon&#39;);&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
但我認為這並不是正確的修正方式，而是應該在 /phpbb/language/{lang}/common.php 再多加上：&lt;br /&gt;
&lt;pre class=&quot;brush:php;&quot;&gt;&#39;SHARE_ON_SELECT&#39; =&amp;gt; &#39;Share on&#39;,&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
並修改 /phpbb/styles/prosilver/template/viewtopiv_body.html 將：&lt;br /&gt;
SO_SELECT 改成 SHARE_ON_SELECT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
另外，&lt;a href=&quot;http://phpbb-tw.net/&quot;&gt;竹貓星球&lt;/a&gt;有提供中文化檔：&lt;a href=&quot;http://phpbb-tw.net/phpbb/viewtopic.php?t=54283&quot;&gt;http://phpbb-tw.net/phpbb/viewtopic.php?t=54283&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/6848738065637070494/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/6848738065637070494' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/6848738065637070494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/6848738065637070494'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/phpbb-share-on.html' title='在 phpBB 上安裝 Share On 模組'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-7286343250007613172</id><published>2011-10-13T12:18:00.003+08:00</published><updated>2011-10-13T12:38:39.170+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="AES"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="加密"/><title type='text'>使用 Java 進行 AES 加密</title><content type='html'>前天投了一家處理資安的公司，沒想到很快就回覆我了，而且還夾帶了一個小小的程式撰寫測驗！  &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: 新細明體; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;程式寫作測驗&lt;span lang=&quot;EN-US&quot;&gt;:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
請寫一個檔案加密的程式，輸入檔名，讀取內容，加密後輸出成另一加密檔。&lt;br /&gt;
請交原始碼、編譯環境相關檔案，可參考或使用現成的加密函式RSA, AES, DES…或者基本的XOR。&lt;br /&gt;
&lt;b&gt;評分標準：&lt;/b&gt;&lt;br /&gt;
基本項目&lt;br /&gt;
&lt;i&gt;1. coding style (Source Code)&lt;br /&gt;2. 完成度(exe檔 或 JAR檔)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
加分項目&lt;br /&gt;
&lt;i&gt;1. 可以的話用不同語言(C++, Java)撰寫&lt;br /&gt;2. 不同作業系統程式 (project or make file)&lt;br /&gt;3. 視窗介面(console, Windows 或 手機)&lt;/i&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
----&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
加密的東西其實還蠻常用到的，像是 PHP 的使用者密碼都是會經過加密在儲存到資料庫，只是用 Java 到還是頭一遭！稍微做了點功課，發現大家比較推薦的加密演算法是 AES，而且在 Java 的官網就可以找到教學文章&amp;nbsp;，所以就寫了一個簡單的 AES 加密、解密器。&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
核心程式碼如下：&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
AESEncrypter.java&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot; dir=&quot;ltr&quot; style=&quot;margin-bottom: 0pt; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;pre class=&quot;brush: java;&quot;&gt;package joujiahe.encrypt.AES;

import java.security.NoSuchAlgorithmException;

import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;

// AES Encrypt core
public class AESEncrypter {

 private SecretKeySpec skeySpec;
 private Cipher cipher;
 
 public AESEncrypter() throws NoSuchAlgorithmException, NoSuchPaddingException{
    // Get the KeyGenerator
    KeyGenerator kgen = KeyGenerator.getInstance(&quot;AES&quot;);
    kgen.init(128); // 192 and 256 bits may not be available
 
 
    // Generate the secret key specs.
    SecretKey skey = kgen.generateKey();
    byte[] raw = skey.getEncoded();
    this.skeySpec = new SecretKeySpec(raw, &quot;AES&quot;);
 
 
    // Instantiate the cipher
    this.cipher = Cipher.getInstance(&quot;AES&quot;);
 }
 
 // output encrypted bytes
 public  byte[] encrypt( byte[] original ) throws Exception{
   
    this.getCipher().init(Cipher.ENCRYPT_MODE, skeySpec);
    byte[] encrypted = cipher.doFinal(original);
    
    return encrypted;
 }

 // output decrypted bytes
 public  byte[] decrypt( byte[] original ) throws Exception{
    
    this.getCipher().init(Cipher.DECRYPT_MODE, skeySpec);
    byte[] decrypted = cipher.doFinal(original);
    
    return decrypted;
 }

 // getter and setter
 public SecretKeySpec getSkeySpec() {
  return skeySpec;
 }

 public void setSkeySpec(SecretKeySpec skeySpec) {
  this.skeySpec = skeySpec;
 }

 public Cipher getCipher() {
  return cipher;
 }

 public void setCipher(Cipher cipher) {
  this.cipher = cipher;
 }
 
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
參考資料：&lt;a href=&quot;http://java.sun.com/developer/technicalArticles/Security/AES/AES_v1.html&quot;&gt;Using AES with Java Technology&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/7286343250007613172/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/7286343250007613172' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/7286343250007613172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/7286343250007613172'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/rsa-aes-desxor-1.html' title='使用 Java 進行 AES 加密'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8057755552333489045.post-87765137794244128</id><published>2011-10-07T21:09:00.002+08:00</published><updated>2011-10-07T21:11:14.005+08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="phpMyAdmin"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Ubuntu 11.04 安裝 phpMyAdmin</title><content type='html'>phpMyAdmin 是一套用 php 開發，來管理 MySQL 的軟體。安裝的方法非常簡單：&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;code&quot;&gt;sudo apt-get install phpmyadmin&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
之後在修改 /etc/apache2/httpd.conf 加上：&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;code&quot;&gt;Include /etc/phpmyadmin/apache2.conf&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://joujiahe.blogspot.com/feeds/87765137794244128/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8057755552333489045/87765137794244128' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/87765137794244128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8057755552333489045/posts/default/87765137794244128'/><link rel='alternate' type='text/html' href='http://joujiahe.blogspot.com/2011/10/ubuntu-1104-phpmyadmin.html' title='Ubuntu 11.04 安裝 phpMyAdmin'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/13783444473777775474</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>