<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Chris &#187; 程式編寫</title>
	<atom:link href="http://blog.hehachris.com/archives/category/usg/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.hehachris.com</link>
	<description>沉默是因為包容</description>
	<lastBuildDate>Thu, 11 Nov 2010 08:55:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8220;PHP Eats Rails for Breakfast&#8221; ?</title>
		<link>http://blog.hehachris.com/archives/45</link>
		<comments>http://blog.hehachris.com/archives/45#comments</comments>
		<pubDate>Wed, 04 Jul 2007 21:21:43 +0000</pubDate>
		<dc:creator>Chris Lam</dc:creator>
				<category><![CDATA[程式編寫]]></category>

		<guid isPermaLink="false">http://chris.knetgb.com/archives/45</guid>
		<description><![CDATA[Ruby on Rails 的出現，令 Ruby 近年崛起得極快。因此很多都說 Ruby 將會成為 &#8220;PHP-killer&#8221;。
但這篇統計文章卻完全否決了有關言論：
http://www.ohloh.net/wiki/articles/php_eats_rails
Ohloh 是一個 Open Source Directory, 數據方面相當客觀及覆蓋廣泛的。
]]></description>
		<wfw:commentRss>http://blog.hehachris.com/archives/45/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>首個 100% CSS+XHTML+Tableless 網頁</title>
		<link>http://blog.hehachris.com/archives/37</link>
		<comments>http://blog.hehachris.com/archives/37#comments</comments>
		<pubDate>Sat, 24 Feb 2007 00:57:20 +0000</pubDate>
		<dc:creator>Chris Lam</dc:creator>
				<category><![CDATA[程式編寫]]></category>
		<category><![CDATA[網絡資源]]></category>

		<guid isPermaLink="false">http://chris.knetgb.com/archives/37</guid>
		<description><![CDATA[原本 daplugin.com 是在傳統 Table 排版以及大量陋習下做出來的，但始終覺得要給全世界那麼多國家的人看實在太丟人了，於是決心把網站從新寫過。
起初改用 CSS 排版很不習慣，經常弄至 DIV 左疊右疊 =3=
幸好只是習慣的問題，陋習及 XHTML 的 Tag 改變方面則有 Rapid PHP Editor 幫忙，所以很快就適應過來。
難得踏出一步，昨晚趁爹娘上了祈福就叫了個大芝心夏威夷獎勵自己 A_A
]]></description>
		<wfw:commentRss>http://blog.hehachris.com/archives/37/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在 Tomcat 下運行 JSP + MySQL / PostgreSQL</title>
		<link>http://blog.hehachris.com/archives/25</link>
		<comments>http://blog.hehachris.com/archives/25#comments</comments>
		<pubDate>Thu, 18 Jan 2007 16:19:14 +0000</pubDate>
		<dc:creator>Chris Lam</dc:creator>
				<category><![CDATA[程式編寫]]></category>

		<guid isPermaLink="false">http://chris.knetgb.com/archives/25</guid>
		<description><![CDATA[要在 Tomcat 下使用 MySQL 及 PostgreSQL, 首先要下載 JDBC Driver.
MySQL Connector: http://dev.mysql.com/downloads/connector/j/5.0.html
PostgreSQL Driver: http://jdbc.postgresql.org/download.html#jars
下載後把兩個 jar 檔案放在 /usr/local/tomcat/common/lib (或其他已設置好的 Classpath)
然後 JSP 檔案中要 import java.sql 中的 API classes:
&#60;%@ page import=&#34;java.sql.*&#34;%&#62;
JSP + MySQL:
&#60;%@ page contentType=&#34;text/html;charset=big5&#34;%&#62;
&#60;%@ page&#160;import=&#34;java.sql.*&#34;%&#62;
&#160;
&#60;%
&#160;
Class.forName(&#34;com.mysql.jdbc.Driver&#34;).newInstance();
String&#160;db_url =&#34;jdbc:mysql://localhost/db_name&#34;;
String&#160;db_user=&#34;db_user&#34;;
String&#160;db_pw=&#34;db_pwd&#34;;
Connection&#160;conn=DriverManager.getConnection(db_url, db_user, db_pw);
Statement&#160;stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String&#160;sql=&#34;SELECT id, name FROM table1&#34;;
ResultSet&#160;rs=stmt.executeQuery(sql);
&#160;
while(rs.next())
{
%&#62;
&#60;%=rs.getString(1)%&#62; &#60;%=rs.getString(2)%&#62;
&#160;
&#60;%
}
&#160;
rs.close();
stmt.close();
conn.close();
%&#62;
JSP + PostgreSQL:
&#60;%@ page contentType=&#34;text/html;charset=big5&#34;%&#62;
&#60;%@ page&#160;import=&#34;java.sql.*&#34;%&#62;
&#60;html&#62;
&#60;body&#62;
&#60;%
//Class.forName(&#34;org.gjt.mm.mysql.Driver&#34;).newInstance();
Class.forName(&#34;org.postgresql.Driver&#34;).newInstance();
String&#160;db_url =&#34;jdbc:postgresql://localhost/admin_test1&#34;;
String&#160;db_user=&#34;da_admin&#34;;
String&#160;db_pw=&#34;g639604&#34;;
Connection&#160;conn= DriverManager.getConnection(db_url, db_user, db_pw);
Statement&#160;stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String&#160;sql=&#34;SELECT table_name FROM information_schema.tables WHERE table_schema = [...]]]></description>
		<wfw:commentRss>http://blog.hehachris.com/archives/25/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>錯誤的 oo 概念</title>
		<link>http://blog.hehachris.com/archives/24</link>
		<comments>http://blog.hehachris.com/archives/24#comments</comments>
		<pubDate>Sat, 06 Jan 2007 12:12:41 +0000</pubDate>
		<dc:creator>Chris Lam</dc:creator>
				<category><![CDATA[程式編寫]]></category>

		<guid isPermaLink="false">http://chris.knetgb.com/archives/24</guid>
		<description><![CDATA[昨天看了很多同學的 java 功課&#8230;發覺大家根本不知道何謂 oo
無他，因為老師都是這樣灌輸錯誤的訊息給我們。
好不容易才找回這兩篇文章:
http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html
http://www.javaworld.com/javaworld/jw-01-2004/jw-0102-toolbox.html
該文章解釋了 getter/setter methods 不應該出現在 oo 中，因為 oo 的真義是要實行 implementation hiding.
小弟認為文中最精警的一句:
Don&#8217;t ask for the information you need to do the work; ask the object that has the information to do the work for you.
但學校的 notes, lab, 某些同學所做的功課，偏偏要為每個 attribute 寫 getter 及 setter, 簡直多此一舉。
加長程式長度之餘，又使程式更難維護 (因做不到 implementation hiding)，這些都不是 oo 的原意。明明百多行便可完成，偏偏要寫數百行，何必呢?
]]></description>
		<wfw:commentRss>http://blog.hehachris.com/archives/24/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>? VS ?</title>
		<link>http://blog.hehachris.com/archives/20</link>
		<comments>http://blog.hehachris.com/archives/20#comments</comments>
		<pubDate>Thu, 16 Nov 2006 20:16:44 +0000</pubDate>
		<dc:creator>Chris Lam</dc:creator>
				<category><![CDATA[程式編寫]]></category>

		<guid isPermaLink="false">http://chris.knetgb.com/archives/20</guid>
		<description><![CDATA[最近在 WHT 論壇掀起了不少語言之間的比較爭論，而這個帖更有會員以實例來比較 PHP, Python 及 Ruby 等:
http://webhostingtalk.com/showthread.php?t=562380
值得一看。
]]></description>
		<wfw:commentRss>http://blog.hehachris.com/archives/20/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DA-PgSQL &#8211; DirectAdmin PostgreSQL plugin</title>
		<link>http://blog.hehachris.com/archives/13</link>
		<comments>http://blog.hehachris.com/archives/13#comments</comments>
		<pubDate>Wed, 26 Jul 2006 11:44:30 +0000</pubDate>
		<dc:creator>Chris Lam</dc:creator>
				<category><![CDATA[程式編寫]]></category>

		<guid isPermaLink="false">http://chris.knetgb.com/?p=13</guid>
		<description><![CDATA[本來在 1 月已經簡簡單單的寫了個出來&#8230;但手多多 encode 了，過了好一段時間後想拿出來改良 (再拿去賣)，卻找不到源碼 -.-
一直拖到上星期才下到決心重新編寫一個，現在已寫得七七八八了。在代碼上比舊版的優化了很多，而且也比較 User Friendly.
&#160;這個 Plugin 將會以 USD 35 Lifetime Licence 出售，希望有人會買 @@
]]></description>
		<wfw:commentRss>http://blog.hehachris.com/archives/13/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

