<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Dada's Blog</title>
	
	<link>http://blog.urdada.net</link>
	<description>Just for fun</description>
	<lastBuildDate>Tue, 17 Aug 2010 02:04:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/cdsheen" /><feedburner:info uri="cdsheen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-nd/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>cdsheen</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>畸形的台灣網路環境 (IP Peering)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/Jr-Yb-xI0fA/</link>
		<comments>http://blog.urdada.net/2009/03/24/197/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 16:30:51 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[網路科技]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=197</guid>
		<description><![CDATA[今天的一則新聞「拒付互連費》台灣大 槓上中華電」 好玩的是，不專業的聯合報記者把 1M (Mb/s) 的頻寬單位，自作主張翻譯成 "公尺" 這篇新聞爭論的其實是 "peering" (網路互連)，無關 "transit" (借道連外)，同時也與最後一哩 (last mile) 的電路壟斷無關。所以很多網友說到台固想用中華電信的國際頻寬不付錢，或者是批評台固沒有自建電路，這都跟這條新聞完全無關 雖然已經不是在 ISP 業界了，不過看到這則新聞還是有深深的感慨，固然 ISP 對於中華電信的反彈有其利益考量，不過真正該思考的是：中華電信造成的不公平競爭，使得網路內容提供業者 (ICP) 面臨一個被壟斷而無法公平競爭的網路環境。 Peering (網路互連) 指的是兩個 ISP (網際網路供應商) 相互連結、互通有無的情況，例如 ISP-A 的用戶可以經由 peering 來直接存取放置在 ISP-B 內的網站，反之亦然 如果兩個 ISP 之間沒有 peering 的話，就必須透過 transit 經由其他 ISP 轉接過去，不然就是透過 網路交換中心(IX) 相互連接。 以香港為例，香港網路交換中心 (HKIX) 就扮演了一個很重要的角色，從下面這張圖可以看到，HKIX 的平均流量高達 40-50 Gb/s 這是日本 JPIX 的流量圖，平均流量高達 75Gb/s [...]]]></description>
			<content:encoded><![CDATA[<p>今天的一則新聞「<a href=http://udn.com/NEWS/FINANCE/FIN3/4804341.shtml target=_blank>拒付互連費》台灣大 槓上中華電</a>」</p>
<p>好玩的是，不專業的聯合報記者把 1M (Mb/s) 的頻寬單位，自作主張翻譯成 "公尺"</p>
<p><a href="http://www.flickr.com/photos/urdada/3380080149/" title="udn-joke"><img src="http://farm4.static.flickr.com/3458/3380080149_c877570055_o.gif" width="400"  alt="udn-joke" /></a></p>
<p>這篇新聞爭論的其實是 "<a href=http://en.wikipedia.org/wiki/Peering target=_blank>peering</a>" (網路互連)，無關 "<a href=http://en.wikipedia.org/wiki/Internet_transit target=_blank>transit</a>" (借道連外)，同時也與最後一哩 (<a href=http://en.wikipedia.org/wiki/Last_mile target=_blank>last mile</a>) 的電路壟斷無關。所以很多網友說到台固想用中華電信的國際頻寬不付錢，或者是批評台固沒有自建電路，這都跟這條新聞完全無關</p>
<p>雖然<a href=http://blog.urdada.net/2008/08/28/91/ target=_blank>已經不是在 ISP 業界</a>了，不過看到這則新聞還是有深深的感慨，固然 ISP 對於中華電信的反彈有其利益考量，不過真正該思考的是：中華電信造成的不公平競爭，使得網路內容提供業者 (ICP) 面臨一個被壟斷而無法公平競爭的網路環境。</p>
<p>Peering (網路互連) 指的是兩個 ISP (網際網路供應商) 相互連結、互通有無的情況，例如 ISP-A 的用戶可以經由 peering 來直接存取放置在 ISP-B 內的網站，反之亦然</p>
<p>如果兩個 ISP 之間沒有 peering 的話，就必須透過 transit 經由其他 ISP 轉接過去，不然就是透過 <a href=http://en.wikipedia.org/wiki/Internet_Exchange_Point target=_blank>網路交換中心(IX)</a> 相互連接。</p>
<p>以香港為例，<a href=http://www.hkix.net/hkix/main.htm target=_blank>香港網路交換中心 (HKIX)</a> 就扮演了一個很重要的角色，從下面這張圖可以看到，HKIX 的平均流量高達 40-50 Gb/s<br />
<a href="http://www.flickr.com/photos/urdada/3378668479/" title="hkix"><img src="http://farm4.static.flickr.com/3662/3378668479_871e5cfefe_o.png" width="465" height="249" alt="hkix" /></a></p>
<p>這是日本 JPIX 的流量圖，平均流量高達 75Gb/s 以上:<br />
<img src="http://www.jpix.ad.jp/graphs/TOTAL.In.gif" /></p>
<p>然後我們來看看台灣的情況，有中華電信在背後當黑手的 <a href=http://www.twix.net/ target=_blank>台灣網際網路交換中心 (TWIX)</a> 的流量是這樣的:<br />
<a href="http://www.flickr.com/photos/urdada/3379485590/" title="twix"><img src="http://farm4.static.flickr.com/3600/3379485590_4cc9cb9426_o.png" width="491" height="205" alt="twix" /></a></p>
<p>你沒看錯，TWIX 的流量平均只有 3Gb/s</p>
<p>TWIX 的線路連接情況可以從 TWNIC 的「<a href=http://map.twnic.net.tw/ target=_blank>連線頻寬查詢系統</a>」查詢，簡單的說，TWIX 與各大 ISP 都有連接，但是擁有最多內容的中華電信卻只有 1Gb 的小水管連接到 TWIX。由於需求遠大於供給，逼迫各 ISP 必須直接拉線跟中華電信購買頻寬，以滿足自己的用戶所需</p>
<p>就國際上的慣例而言，兩家 ISP 互連 (peering)，會由淨流量輸入者付錢給淨流量輸出者，所以擁有比較多網站內容的 ISP 就有可能賺取這樣的 peering 費用</p>
<p>花錢買 peering 或許是合理的，尤其中華電信擁有國內最多的內容(因為用戶多)，但重點在於要花多少錢，中華電信的定價是否合理呢?</p>
<p>實際上來看，中華電信是三頭賺的:</p>
<p>網路內容業者(ICP)為了讓自己的網站用戶能有比較好的網路體驗，怕輸在起跑點上，所以必須花大錢租用中華電信的機房，把自己的網站 colocation 在中華電信</p>
<p>其他的 ISP 業者為了讓自己的寬頻用戶可以很順暢連結放在中華電信的網站，所以也要花大錢跟中華電信買頻寬</p>
<p>更重要的是，HINET寬頻用戶付了不算便宜的上網費用，卻造就了中華電信這樣的寬頻龍頭怪獸，並讓中華電信拿著當武器去壓迫其他 ICP 及 ISP...</p>
<p>依照 peering 的國際慣例計費方式，ISP 業者如果能夠爭取到比較好的內容業者，或許可以減少一些與中華電信 peering 費用，所以 ISP 業者就會盡力去以優惠價格爭取 ICP 內容業者進駐，ICP 得到扶持後，才有能力提供更多的服務給寬頻用戶，這可以使得寬頻用戶、ISP、ICP 三者間產生正向循環，這樣才能扶植網路內容產業的蓬勃發展：</p>
<p><a href="http://www.flickr.com/photos/urdada/3395410180/" title="isp1"><img src="http://farm4.static.flickr.com/3587/3395410180_276c3c9645_o.png" width="496" height="183" alt="isp1" /></a></p>
<p>但台灣因為中華電信的壟斷，導致這樣的循環無法成立，甚至變成惡性循環：</p>
<p><a href="http://www.flickr.com/photos/urdada/3395410308/" title="isp2"><img src="http://farm4.static.flickr.com/3551/3395410308_923ff4c6cc_o.png" width="496" height="205" alt="isp2" /></a></p>
<p>所以不但寬頻費用居高不下，網路內容業者(ICP)也無法藉由正向循環得到扶持</p>
<p>國內最成功的 peering 輸出國應該是<a href=http://tw.gamania.com/ target=_blank>遊戲橘子</a>，遊戲橘子有自己的 <a href="http://zh.wikipedia.org/w/index.php?title=自治系统_(互联网)&#038;variant=zh-tw" target=_blank>AS Number</a> (自治系統號碼)，藉由「<a href=http://tw.lineage.gamania.com/index.asp target=_blank>天堂</a>」這一款超人氣的線上遊戲，使得國內的一些 ISP 都不敢怠慢自己的寬頻用戶，必須乖乖掏錢出來跟遊戲橘子的代理商~和信超媒體買頻寬 (和信超媒體曾經投資過遊戲橘子)，不過，中華電信當然還是不會買的，因為他挾兩百萬的寬頻用戶自重</p>
<p>但很可惜的，國內似乎看不到其他內容業者能夠很成功的如法炮製</p>
<p>這正所謂的「養、套、殺」，網路內容業者(ICP)，如果一開始就屈服於中華電信的壟斷壓力，怕自己的用戶擁有不好的寬頻體驗，所以把自己的網站放在中華電信。等到網站越長越大，網路內容業者卻反而更擔心如果隨意搬移到其他 ISP 會導致用戶因為無法順利連結而大量流失用戶，所以就被中華電信套住了，之後當然就任意被獅子大開口，完全是賣方市場。想要多租個機櫃都可能跟你說空間不夠，要你配合搬去偏遠的機房。反而是其他 ISP 的機房空在那邊養蚊子</p>
<p>ISP 究竟能不能靠著爭取更多優質 ICP 業者的進駐而降低付給中華電信的 peering 費用呢? 在這個壟斷的環境中，事實上是很難的</p>
<p>過去和信超媒體(GIGA)提供給寬頻用戶的「免費個人網頁空間 (PWP)」曾經擁有非常大的流量輸出，這使得和信超媒體與中華電信 peering 的輸出與輸入不相上下，但中華電信認為這些都是垃圾流量而拒絕提供免費的 peering</p>
<p>曾有一次，GIGA 在國外租了個空間放 PWP 的 Proxy，然後把中華電信用戶連結 PWP 的需求經由國外 Proxy 餵回給中華電信，這一次據說就把中華電信的國際頻寬塞爆了。這個例子更顯示出中華電信對於 peering 定價的不合理性，把 proxy 放在國外餵回給中華電信，都比在國內 peering 餵給中華電信便宜</p>
<p>一個壟斷的網路環境會使得很多情況變得不合理，ICP 無法得到合理的回饋，ISP 也因為無力負擔 peering 費用而必須向 ICP 收取比較高的費用，造成惡性循環</p>
<p><a href=http://www.wretch.cc/ target=_blank>無名小站</a>在2006年曾經想如法炮製遊戲橘子的成功經驗 (後來因為被 Yahoo 買下而作罷)，無名小站那時想藉由自己用戶的壓力去逼迫中華電信屈服。但事實證明在中華電信屈服前，無名小站自己必然也會面對更大、來自原有用戶反彈的壓力！</p>
<p>要求中華電信無條件地提供免費 peering 可能是緣木求魚，或許也會有更多爭議，但還是期待中華電信能以其電信龍頭的高度，設法讓國內 ISP 及 ICP 的產業鏈更加健全，而不是只想要吸乾所有人的血。</p>
<p>遊戲橘子的成功有其時空背景，我不認為未來還會有其他家內容提供業者有這個膽識與中華電信對抗，這次 ISP 業者的反彈事實上也不是第一次了。無論如何，想要反轉這個畸形、被壟斷的網路環境，就只能期待 NCC 能有一點作為了。否則的話，台灣是永遠不可能養出像 Youtube 這樣的網站的!</p>
<p>相關討論:</p>
<ul>
<li><a href=http://vbb.twftp.org/showthread.php?t=13394 target=_blank>拒付互連費》台灣大 槓上中華電 </a> (台灣FTP聯盟)
<li><a href=http://www.pczone.com.tw/vbb3/thread/59/146301/ target=_blank>拒付互連費台灣大 槓上中華電 giga網路翻版？</a> (PCZONE)
<li><a href=http://www.mobile01.com/topicdetail.php?f=18&#038;t=987115 target=_blank>或許我們該聲援一下台灣大哥大 盼所有需要跟中華電信...</a> (Mobile01)
<li><a href=http://www.mobile01.com/topicdetail.php?f=110&#038;t=1009084 target=_blank>今天報上的新聞, 中華對台固斷訊啦</a> (Mobile01)
<li><a href=http://www.pcdvd.com.tw/showthread.php?t=847450 target=_blank>中華電逐步斷訊 衝擊台固500萬戶</a> (PCDVD)
<li><a href=http://www.pcdvd.com.tw/showthread.php?t=847610 target=_blank>台灣大：被勒索 中華電：別炒作---黑心中華電-台灣完了</a> (PCDVD)
</ul>
<p>相關新聞:</p>
<ul>
<li>2009/03/23: <a href=http://udn.com/NEWS/FINANCE/FIN3/4804341.shtml target=_blank>拒付互連費》台灣大 槓上中華電</a> (經濟日報)
<li>2009/04/09: <a href=http://udn.com/NEWS/FINANCE/FIN1/4837509.shtml target=_blank rel="nofollow">拒付互連費 中華電對台灣大斷訊</a> (經濟日報)
<li>2009/04/09: <a href=http://udn.com/NEWS/FINANCE/FIN1/4837493.shtml target=_blank>中華電：首富欠錢 台灣大：吃人夠夠</a> (經濟日報)
<li>2009/04/10: <a href=http://udn.com/NEWS/FINANCE/FIN3/4839803.shtml target=_blank>網路世界 強者恆強</a> (經濟日報)
<li>2009/04/10: <a href=http://udn.com/NEWS/FINANCE/FIN3/4839796.shtml target=_blank>NCC 今討論互連費</a> (經濟日報)
<li>2009/04/10: <a href="http://tech.chinatimes.com/2007Cti/2007Cti-News/Inc/2007cti-news-Tech-inc/Tech-Content/0,4703,12050903%20122009041000348,00.html" target=_blank>台灣大：被勒索 中華電：別炒作</a> (工商時報)
<li>2009/04/11: <a href=http://udn.com/NEWS/FINANCE/FIN3/4841563.shtml target=_blank>NCC：中華電互連費 應有折扣</a> (經濟日報)
<li>2009/04/26: <a href=http://blog.bs2.to/post/liny/17630 target=_blank>網路互連費》對外割地賠款 對內互相傾軋</a> (聯合報/民意論壇/林一平)
<li>2009/04/29: <a href=http://www.nownews.com/2009/04/29/91-2443792.htm target=_blank>網路互連費8次協商未果! NCC:樂觀看待不排除介入裁決</a> (NOWnews)
<li>2009/05/20: <a href="http://news.cnyes.com/stock/dspnewsS.asp?fi=\NEWSBASE\20090520\WEB3169&#038;vi=33936&#038;date=20090520&#038;time=19:20:21&#038;pagetype=option&#038;subtype=home&#038;cls=option" target=_blank>同業火力全開要求降價 中華電：認知有差距 協商很難喬</a> (鉅亨網)
<li>2009/05/21: <a href="http://news.chinatimes.com/CMoney/News/News-Page-content/0,4993,11050704+122009052100287,00.html" target=_blank>網路互連費 公平會、NCC介入</a> (工商時報)
<li>2009/05/21: <a href="http://mag.udn.com/mag/digital/storypage.jsp?f_MAIN_ID=314&#038;f_SUB_ID=2922&#038;f_ART_ID=195391" target=_blank>公平會：網路互連費若不降 中華電恐受罰</a> (中央社)
<li>2009/05/21: <a href="http://www.ithome.com.tw/itadm/article.php?c=55123" target=_blank>固網業者網路互連費協商仍無共識　下週將攤牌</a> (iThome)
<li>2009/05/22: <a href="http://www.runpc.com.tw/news.aspx?id=100296" target=_blank>網路互連 消費者權益才該優先考量</a> (RUN!PC)
<li>2009/06/17: <a href="http://udn.com/NEWS/NATIONAL/NAT5/4967658.shtml" target=_blank>網路互連費率 NCC：不排除啟動核定牌價制</a> (聯合晚報)
<li>2009/06/17: <a href="http://udn.com/NEWS/NATIONAL/NAT5/4967660.shtml" target=_blank>有多難喬？中華電：每M要1480元</a> (聯合晚報)
<li>2009/08/06: <a href="http://mag.udn.com/mag/digital/storypage.jsp?f_MAIN_ID=315&#038;f_SUB_ID=2926&#038;f_ART_ID=206960" target=_blank>中華電網路互連費降價</a> (經濟日報)
<li>2009/08/05: <a href="http://www.ncc.gov.tw/chinese/news_detail.aspx?site_content_sn=8&#038;is_history=0&#038;pages=0&#038;sn_f=11609" target=_blank>NCC核定第一類電信事業市場主導者網際網路互連頻寬（Peering）批發費率案</a>
</ul>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/Jr-Yb-xI0fA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2009/03/24/197/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2009/03/24/197/</feedburner:origLink></item>
		<item>
		<title>我愛用的免費軟體 (my favorite freeware)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/iglw6JYWOiE/</link>
		<comments>http://blog.urdada.net/2009/03/02/148/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 14:53:02 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[作業系統]]></category>
		<category><![CDATA[軟體]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=148</guid>
		<description><![CDATA[最近已經快滿三年的 Thinkpad X60 跑得越來越慢，又常常當機，所以找個比較有空的時間就把它重灌 Windows XP Professional，順便作一下筆記 灌好作業系統後，可以先把 ThinkVantage System Update 裝起來，這樣 Thinkpad 相關的驅動程式及軟體都可以直接從這邊更新回來。對了，記得不要裝 Client Security Solution 因為裝了真的是自找麻煩! 另外 System Migration Assistant 和 Rescue and Recovery 我也沒裝.. 接下來就是安裝應用程式了，儘可能都以免費的軟體為主: PicPick 是一個很強大的截圖軟體 XnView 看圖及簡單的圖形處理 Paint.NET 是一個短小精幹的繪圖軟體 FileZilla 支援 FTP 及 SFTP 的檔案傳輸軟體 7-Zip 檔案解壓縮工具 K-Lite Codec Pack 播放各種影音檔案 Adobe Reader 閱讀 PDF 文件 Alcohol 52% Free Edition [...]]]></description>
			<content:encoded><![CDATA[<p>最近已經快滿三年的 Thinkpad X60 跑得越來越慢，又常常當機，所以找個比較有空的時間就把它重灌 Windows XP Professional，順便作一下筆記</p>
<p>灌好作業系統後，可以先把 <a href="http://www-307.ibm.com/pc/support/site.wss/TVSU-UPDATE.html" target=_blank>ThinkVantage System Update</a> 裝起來，這樣 Thinkpad 相關的驅動程式及軟體都可以直接從這邊更新回來。對了，記得不要裝 Client Security Solution 因為裝了真的是自找麻煩! 另外 System Migration Assistant 和 Rescue and Recovery 我也沒裝..</p>
<p>接下來就是安裝應用程式了，儘可能都以免費的軟體為主:</p>
<p><a href="http://picpick.wiziple.net/" target=_blank>PicPick</a> 是一個很強大的截圖軟體<br />
<a href="http://www.xnview.com/" target=_blank>XnView</a> 看圖及簡單的圖形處理<br />
<a href="http://www.paint.net/" target=_blank>Paint.NET</a> 是一個短小精幹的繪圖軟體<br />
<a href="http://filezilla-project.org/" target=_blank>FileZilla</a> 支援 FTP 及 SFTP 的檔案傳輸軟體<br />
<a href="http://7-zip.org/" target=_blank>7-Zip</a> 檔案解壓縮工具<br />
<a href="http://www.free-codecs.com/download/K_lite_codec_pack.htm" target=_blank>K-Lite Codec Pack</a> 播放各種影音檔案<br />
<a href="http://www.adobe.com/tw/products/reader/" target=_blank>Adobe Reader</a> 閱讀 PDF 文件</p>
<p><a href="http://trial.alcohol-soft.com/en/" target=_blank>Alcohol 52% Free Edition</a> 虛擬光碟 (裝免費版的即可, 可選擇不裝贊助軟體)<br />
<a href="http://www.free-av.com/" target=_blank>Avira AntiVir</a> 掃毒軟體<br />
<a href="http://ccollomb.free.fr/unlocker/" target=_blank>Unlocker</a> 強制解鎖<br />
<a href="http://rocketdock.com/" target=_blank>RocketDock</a> 像蘋果的工具列<br />
<a href="http://chewing.csie.net/download/win32/" target=_blank>新酷音輸入法</a> (最新版: 0.3.4.8)</p>
<p>其他網路工具包含:</p>
<ul>
<li><a href="http://pank.org/im/" target=_blank>Messenger</a>
<li><a href="http://www.moztw.org/firefox/" target=_blank>Mozilla Firefox</a>
<li><a href="http://www.skype.com/intl/zh-Hant/" target=_blank>Skype</a>
<li><a href="http://pcman.openfoundry.org/" target=_blank>PCMan Lite</a>
<li><a href="http://www.flickr.com/tools/uploadr/" target=_blank>Flickr Uploadr</a>
</ul>
<p>Google 提供的工具:</p>
<ul>
<li><a href="http://www.google.com/chrome" target=_blank>Google Chrome</a>
<li><a href="http://www.google.com/talk/intl/zh-TW/" target=_blank>Google Talk</a>
<li><a href="http://earth.google.com/intl/zh-TW/" target=_blank>Google Earth</a>
<li><a href="http://picasa.google.com.tw/" target=_blank>Picasa</a>
</ul>
<p>另外微軟的 <a href="http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx" target=_blank>PowerToys for Windows XP</a> 也有幾個不錯的小工具:</p>
<ul>
<li>CmdHere
<li>PowerToy Calculator
<li>Tweak UI
</ul>
<p>還有之前微軟有提供一個 Microsoft Chinese Date and Time，是一個我很愛用的農民曆及世界時間工具，但現在微軟似乎把連結拿掉了，不過網路上搜尋一下就找到了</p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/iglw6JYWOiE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2009/03/02/148/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2009/03/02/148/</feedburner:origLink></item>
		<item>
		<title>AdSense for Domains (在未使用的網址上放廣告)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/D7VZcNqbUjo/</link>
		<comments>http://blog.urdada.net/2009/02/20/168/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 17:25:06 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[網路科技]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=168</guid>
		<description><![CDATA[Google 推出了 AdSense for Domains (AdSense 網域廣告) 引用 Google 對此產品的說明: AdSense 網域廣告可讓發佈商在未使用的網域上顯示相關內容，以協助使用者取得所需的資訊。 使用者通常會在網址列中輸入網域，或按下無效連結而連上沒有內容的網站。AdSense 網域廣告可提供連結、搜尋結果、廣告和其他內容，而不是「建置中」網頁或 404 錯誤。我們的做法是使用語意技術，根據網域名稱來指定目標。當使用者與您網站上的廣告互動時，您便可以賺取收益。 我猜這個產品推出後，獲利最大的應該是各家 registrar (網址註冊商) 吧 可能有很多人會去註冊一些網址來專門放 AdSense for Domains 廣告賺錢，畢竟網址年費還算低，好一點的網址光放 AdSense for Domains 廣告搞不好就可以回本了，而且不用自己找機器放網頁，只要把網址 DNS 指過去 Google 的伺服器即可 根據 Google 的說明，DNS 只要設定好 CNAME 以及四筆 A 記錄即可，Google 也提供了各大網域註冊商(如 GoDaddy)的詳細設定方式 www &#160; CNAME &#160; pub-xxxxxxxxx.afd.ghs.google.com. @ &#160; A &#160; 216.239.32.21 @ &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Google 推出了 <a href=https://www.google.com/adsense/support/bin/topic.py?topic=14746 target=_blank>AdSense for Domains</a> (AdSense 網域廣告)</p>
<p>引用 Google 對此產品的說明:</p>
<blockquote><p>AdSense 網域廣告可讓發佈商在未使用的網域上顯示相關內容，以協助使用者取得所需的資訊。</p>
<p>使用者通常會在網址列中輸入網域，或按下無效連結而連上沒有內容的網站。AdSense 網域廣告可提供連結、搜尋結果、廣告和其他內容，而不是「建置中」網頁或 404 錯誤。我們的做法是使用語意技術，根據網域名稱來指定目標。當使用者與您網站上的廣告互動時，您便可以賺取收益。</p></blockquote>
<p>我猜這個產品推出後，獲利最大的應該是各家 registrar (網址註冊商) 吧  <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' />  </p>
<p>可能有很多人會去註冊一些網址來專門放 AdSense for Domains 廣告賺錢，畢竟網址年費還算低，好一點的網址光放 AdSense for Domains 廣告搞不好就可以回本了，而且不用自己找機器放網頁，只要把網址 DNS 指過去 Google 的伺服器即可</p>
<p>根據 Google 的<a href=https://www.google.com/adsense/support/bin/answer.py?answer=76049&#038;topic=14746 target=_blank>說明</a>，DNS 只要設定好 CNAME 以及四筆 A 記錄即可，Google 也提供了各大網域註冊商(如 GoDaddy)的詳細設定方式</p>
<blockquote><p>www  &nbsp;  CNAME  &nbsp;  pub-xxxxxxxxx.afd.ghs.google.com.</p>
<p>@  &nbsp; A  &nbsp;   216.239.32.21<br />
@  &nbsp; A  &nbsp;  216.239.34.21<br />
@  &nbsp; A  &nbsp;  216.239.36.21<br />
@  &nbsp; A  &nbsp;  216.239.38.21
</p></blockquote>
<p>當然你也可以設定更多個 CNAME 就是了...</p>
<p>同時，對於網域廣告你還可以設定一些關鍵字，可以更精確選擇你想要顯示的廣告</p>
<p>另外「<a href=https://www.google.com/adsense/support/bin/answer.py?answer=96332&#038;topic=14746 target=_blank>AdSense 網域廣告計劃政策</a>」裡面有提到</p>
<blockquote><p>Google AdSense 網域廣告非常重視商標所有人的權利。我們希望所有廣告客戶、使用者和商標所有人都瞭解 Google 審查 AdSense 網域廣告聯播網中商標侵權案件的程序。<strong>如果 Google 發現任何包含商標 (或類似拼字) 的網域名稱，便會將該網域從 AdSense 網域廣告聯播網中移除</strong>。</p></blockquote>
<p>所以如果想要用與知名網站類似的網域名稱來使用 AdSense for Domains，也許會被移除吧</p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/D7VZcNqbUjo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2009/02/20/168/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2009/02/20/168/</feedburner:origLink></item>
		<item>
		<title>各種信用卡加油優惠整理 (2010/01)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/rxg1YqrfRpw/</link>
		<comments>http://blog.urdada.net/2009/01/03/115/#comments</comments>
		<pubDate>Sat, 03 Jan 2009 02:43:53 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[消費資訊]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=115</guid>
		<description><![CDATA[現在各種加油優惠琳瑯滿目，有些信用卡加油優惠只限每週的某一天， 萬一油箱快到底了，還是要找其他替代方案，口袋裡最好放著兩張以上信用卡比較保險 以下以每一天的優惠分列，這樣可以很快找出今天適用的優惠 (只列出汽油的優惠): 每一天: 國泰世華信用卡/金融卡 @ 全國/台亞/鯨世界: 每公升降 1.9 元 (~2010/03/31) 萬泰銀行御璽卡 @ 全國加油站: 每公升降 1.9 元 (~2010/03/31) 中國信託信用卡/金融卡(>201) @ 台灣優力: 每公升降 1.8 元 (~2010/03/31) 滙豐/兆豐/聯邦/玉山/元大信用卡 @ 全國/台亞/鯨世界: 每公升降 1.8 元 (~2010/03/31) 永豐信用卡(>201) @ 台灣優力: 每公升降 1.8 元 (~2010/03/31) 台新/日盛/信用卡 @ 全國/台亞/鯨世界: 每公升降 1.7 元 (~2010/03/31) 各銀行 VISA金融卡 @ 全國加油站: 每公升降 1.7 元 (~2010/03/31) [...]]]></description>
			<content:encoded><![CDATA[<p>現在各種加油優惠琳瑯滿目，有些信用卡加油優惠只限每週的某一天，<br />
萬一油箱快到底了，還是要找其他替代方案，口袋裡最好放著兩張以上信用卡比較保險</p>
<p>以下以每一天的優惠分列，這樣可以很快找出今天適用的優惠 (只列出汽油的優惠):</p>
<ul>
<li><strong>每一天:</strong>
<ul>
<li>國泰世華信用卡/金融卡 @ 全國/台亞/鯨世界: 每公升降 <strong>1.9</strong> 元 (~2010/03/31)
<li>萬泰銀行御璽卡 @ 全國加油站: 每公升降 <strong>1.9</strong> 元 (~2010/03/31)
<li>中國信託信用卡/金融卡(>201) @ 台灣優力: 每公升降 <strong>1.8</strong> 元 (~2010/03/31)
<li>滙豐/兆豐/聯邦/玉山/元大信用卡 @ 全國/台亞/鯨世界: 每公升降 <strong>1.8</strong> 元 (~2010/03/31)
<li>永豐信用卡(>201) @ 台灣優力: 每公升降 <strong>1.8</strong> 元 (~2010/03/31)
<li>台新/日盛/信用卡 @ 全國/台亞/鯨世界: 每公升降 <strong>1.7</strong> 元 (~2010/03/31)
<li>各銀行 VISA金融卡 @ 全國加油站: 每公升降 <strong>1.7</strong> 元 (~2010/03/31)
<li>美國運通卡 @ 全國加油站: 每公升降 <strong>2</strong> 元 (~2009/12/31)
<li>匯豐銀行信用卡 @ 全國加油站: 每公升降 <strong>1.8</strong> 元 (~2009/12/31)
<li>玉山銀行山隆卡 @ 山隆加油站: 每公升降 <strong>1.8</strong> 元 (~2009/12/31)
<li>花旗信用卡(10公升) @ 台亞/鯨世界: 每公升降 <strong>1.8</strong> 元 (~2009/12/31)
<li>VISA金融卡、信用卡 @ 中油自助加油: 每公升降 <strong>0.8</strong> 元
<p></p>
<li>大眾銀行 大眾卡 @ 任何加油站: 1%現金回饋 [下期折抵] (~2009/12/31)
<li>花旗 透明卡 @ 任何加油站: 1%現金回饋 [累計200元後折抵]
<li>RBS 樂活白金卡 @ 任何加油站: 1%以上現金回饋 [累計200元後折抵]
</ul>
<p></p>
<li><strong>每週二、四、六:</strong>
<ul>
<li>匯豐銀行信用卡 @ 台亞、鯨世界: 每公升降 <strong>2</strong> 元 (~2009/09/30)
<li>美國運通卡 @ 優力: 每公升降 <strong>1.8</strong> 元 (~2009/9/30)
</ul>
<p></p>
<li><strong>每週一:</strong>
<ul>
<li>台塑會員卡/台亞帝雉卡(現金) @ 台亞: 每公升降 <strong>2.1</strong> 元 (~2010/03/31)
</ul>
<p></p>
<li><strong>每週二:</strong>
<ul>
<li>台北富邦 A-Power 聯名卡 @ 全國加油站: 每公升降 <strong>2.1</strong> 元 (~2010/03/31)
<li>回利卡(現金) @ 全國加油站: 每公升降 <strong>2.1</strong> 元 (~2010/03/31)
</ul>
<p></p>
<li><strong>每週三:</strong>
<ul>
<li>遠東銀行 台塑聯名卡 @ 台亞/福懋/西歐/鯨世界: 每公升降 <strong>2.1</strong> 元 (~2009/12/31)
<li>現金+會員卡(>201) @ 優力: 每公升降 <strong>1.9</strong>元 (~2010/03/31)
<li>刷卡+會員卡(>201) @ 優力: 每公升降 <strong>1</strong>元 (~2010/03/31)
</ul>
<p></p>
<li><strong>每週四:</strong>
<ul>
<li>無僅適用本日之方案
</ul>
<p></p>
<li><strong>每週五:</strong>
<ul>
<li>荷蘭銀行 樂活白金卡/LEXUS聯名卡@ 全國 每公升降 <strong>2</strong> 元 (~2009/09/30)
</ul>
<p></p>
<li><strong>每週六:</strong>
<ul>
<li>無僅適用本日之方案
</ul>
<p></p>
<li><strong>每週日:</strong>
<ul>
<li>聯邦銀行 家樂福聯名卡 @ 全國/台亞: 每公升降 <strong>1.8</strong> 元 (~2010/03/31)
</ul>
</ul>
<div class=adsense></div>
<p>各加油站官方網站:</p>
<ul>
<li>全國加油站: <a href=http://www.npcgas.com.tw/ target=_blank>http://www.npcgas.com.tw/</a>
<li>優力加油站: <a href=http://www.youni.com.tw/ target=_blank>http://www.youni.com.tw/</a>
<li>台亞加油站: <a href=http://www.formosaoil.com.tw/ target=_blank>http://www.formosaoil.com.tw/</a>
<li>福懋加油站: <a href=http://www.ftc.com.tw/oil/ target=_blank>http://www.ftc.com.tw/oil/</a>
<li>西歐加油站: <a href=http://www.cocosure.com.tw/ target=_blank>http://www.cocosure.com.tw/</a>
<li>山隆加油站: <a href=http://www.slc.com.tw/08/index1.php?mp=2-3 target=_blank>http://www.slc.com.tw/</a>
<li>台灣中油: <a href=http://www.cpc.com.tw/big5/home/index.asp target=_blank>http://www.cpc.com.tw/</a>
<li>台塑石油: <a href=http://www.fpcc.com.tw/ target=_blank>http://www.fpcc.com.tw/</a>
</ul>
<p>最近更新日期: 2010/01/11</p>
<p>本文簡短網址: <a href="http://tinyurl.com/tw-oil">http://tinyurl.com/tw-oil</a></p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/rxg1YqrfRpw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2009/01/03/115/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2009/01/03/115/</feedburner:origLink></item>
		<item>
		<title>Mantis Mail Gateway (perl script)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/VM4Jnthp5lo/</link>
		<comments>http://blog.urdada.net/2008/11/11/95/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 15:09:26 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[軟體]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/11/11/95/</guid>
		<description><![CDATA[This is a simple Mantis Mail Gateway for mail-in tickets. It can be used for alert management for monitoring system. For installation, add the line below to /etc/aliases: bug: "&#124;/usr/local/bin/mantis-mail-gateway.pl &#160; PROJECT &#160; REPORTER" and then run newaliases. The incoming mail will be posted to a Mantis project named 'PROJECT' on behave of user 'REPORTER'. [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple Mantis Mail Gateway for mail-in tickets.<br />
It can be used for alert management for monitoring system.</p>
<p>For installation, add the line below to /etc/aliases:</p>
<p><strong>bug:   "|/usr/local/bin/mantis-mail-gateway.pl  &nbsp; PROJECT &nbsp;  REPORTER"</strong></p>
<p>and then run newaliases.</p>
<p>The incoming mail will be posted to a Mantis project named 'PROJECT' on behave of user 'REPORTER'. The mail subject will become the bug summary and the mail content will become the bug description.</p>
<p>Note that this script does not understand MIME multipart encoding and may have problems on mail contents besides plain-ASCII encoding.</p>
<p>You are welcome to add more features.</p>
<p><img src=http://farm4.static.flickr.com/3286/3022458848_b690e23167.jpg /></p>
<p>mantis-mail-gateway.pl: (can be downloaded <a href=http://urdada.net/codings/mantis-mail-gateway.pl>here</a>)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># mantis-mail-gateway.pl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Mantis Mail Gateway</span>
<span style="color: #666666; font-style: italic;"># Shen Cheng-Da (cdsheen AT gmail.com)</span>
<span style="color: #666666; font-style: italic;"># require DBI to connect MySQL database</span>
<span style="color: #666666; font-style: italic;"># http://blog.urdada.net/2008/11/11/95/</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> POSIX <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>strftime<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$db_host</span>    <span style="color: #339933;">=</span> <span style="color: #ff0000;">'localhost'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$db_name</span>    <span style="color: #339933;">=</span> <span style="color: #ff0000;">'mantis'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$db_user</span>    <span style="color: #339933;">=</span> <span style="color: #ff0000;">'monitor'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$db_pass</span>    <span style="color: #339933;">=</span> <span style="color: #ff0000;">'monitorpass'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$debug</span>      <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$db</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;dbi:mysql:dbname=${db_name};host=${db_host}&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Usage: $0 [project-name] [reporter]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">@ARGV</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$project_name</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$reporter_name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sql</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$project</span>  <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$reporter</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$dbh</span> <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$db</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$db_user</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$db_pass</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT id,name FROM mantis_project_table
        WHERE name LIKE '$project_name'&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">@data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow_array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$project</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">finish</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;ERROR: project <span style="color: #000099; font-weight: bold;">\`</span>$project_name' does not exist<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$project</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;project: $project_name ($project)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$debug</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT id,username FROM mantis_user_table
        WHERE username = '$reporter_name'&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">@data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow_array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$reporter</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">finish</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;ERROR: user <span style="color: #000099; font-weight: bold;">\`</span>$reporter_name' does not exist<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$reporter</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;reporter: $reporter_name ($reporter)<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$debug</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$content</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;STDIN&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #009966; font-style: italic;">s/\s+$//</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">last</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$_</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">''</span><span style="color: #339933;">;</span>
        <span style="color: #0000ff;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span> <span style="color: #b1b100;">if</span> <span style="color: #009966; font-style: italic;">/^Subject: (.+)$/</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;STDIN&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$content</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$_</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'INSERT INTO mantis_bug_text_table (description) VALUES (?)'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$content</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">finish</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$textid</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span> <span style="color: #000066;">q</span><span style="color: #009900;">&#123;</span>mysql_insertid<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;bug text id: $textid<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$debug</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'INSERT INTO mantis_bug_table
                ( project_id, reporter_id,
                  date_submitted, last_updated,
                  bug_text_id, summary )
        VALUES (?,?,?,?,?,?)'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$now</span> <span style="color: #339933;">=</span> strftime<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'%Y-%m-%d %H:%M:%S'</span><span style="color: #339933;">,</span> <span style="color: #000066;">localtime</span><span style="color: #009900;">&#40;</span><span style="color: #000066;">time</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$project</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$reporter</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$now</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$now</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$textid</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$subject</span><span style="color: #009900;">&#41;</span>
        <span style="color: #339933;">||</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">'ERROR: '</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">errstr</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">finish</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">disconnect</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/cdsheen/~4/VM4Jnthp5lo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/11/11/95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/11/11/95/</feedburner:origLink></item>
		<item>
		<title>嘟嘟房市區臨時停車台北基隆站點地圖</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/mUaOsegT55w/</link>
		<comments>http://blog.urdada.net/2008/09/29/92/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 13:36:35 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[消費資訊]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/09/29/92/</guid>
		<description><![CDATA[在台北開車是個麻煩，尤其是要找停車位的時候... 這時候查看一下你手邊的信用卡，也許有一些優惠可以用:) 這篇整理的是首開與各大信用卡合作的 中興嘟嘟房停車網 中興嘟嘟房在台北縣市很多地方的停車場都很方便.. 例如世貿站就在台北國際會議中心地下室: 除此之外，永康夜市 和 基隆廟口站 也是個好地方 嘟嘟房各站點的位置以及合作的銀行可以從嘟嘟房的網站上面找到: http://www.dodohome.com.tw/menu09/actparktable_big.asp 不過嘟嘟房的網站實在不好查，網站有點慢而且查詢層級有點亂.. orz 因此颱風假在家無聊，就把嘟嘟房台北&#038;基隆可以臨時停車的站點匯入了 Google Maps， 產生了一份「我的地圖」，方便直接查詢可以停車的站點，如下所示: 有興趣的人可以直接點選 這邊 直接連結到這份地圖 不過實際的位置狀況以及哪些銀行間可以使用還是需以嘟嘟房原始網站的說明為準 然後重點來了，到底哪些卡才能使用嘟嘟房的停車優惠呢? 其實自從卡債風暴開始，各銀行已經已經大幅縮減信用卡的免費停車優惠了， 以嘟嘟房為例，很多信用卡已經改成需要扣點數或者符合一定消費金額才能免費停車了 建議選擇不需要額外扣點數也不需要扣錢的卡，主要是需要扣點數的算起來都不太划算 更詳細即時的資訊請參考原始嘟嘟房網站上 卡友專區 的說明 本文簡短網址為: http://tinyurl.com/dodohome]]></description>
			<content:encoded><![CDATA[<p>在台北開車是個麻煩，尤其是要找停車位的時候...<br />
這時候查看一下你手邊的信用卡，也許有一些優惠可以用:)</p>
<p>這篇整理的是首開與各大信用卡合作的 <a href=http://www.dodohome.com.tw/ target=_blank>中興嘟嘟房停車網</a></p>
<p>中興嘟嘟房在台北縣市很多地方的停車場都很方便..</p>
<p>例如世貿站就在台北國際會議中心地下室:<br />
<iframe width="450" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com.tw/maps/ms?ie=UTF8&amp;hl=zh-TW&amp;msa=0&amp;msid=118338097352562522963.000456ec1e60a6adc631e&amp;s=AARTsJr4CNYzOD6dkqBZiVmkTnVB2IRRgw&amp;ll=25.034147,121.561081&amp;spn=0.006805,0.009656&amp;z=16&amp;output=embed"></iframe></p>
<p>除此之外，<a href="http://maps.google.com.tw/maps/ms?ie=UTF8&#038;hl=zh-TW&#038;msa=0&#038;msid=118338097352562522963.000456ec1e60a6adc631e&#038;s=AARTsJr4CNYzOD6dkqBZiVmkTnVB2IRRgw&#038;ll=25.032631,121.530011&#038;spn=0.006805,0.009656&amp;z=16" target=_blank>永康夜市</a> 和 <a href="http://maps.google.com.tw/maps/ms?ie=UTF8&#038;hl=zh-TW&#038;msa=0&#038;msid=118338097352562522963.000456ec1e60a6adc631e&#038;ll=25.134096,121.740274&#038;spn=0.040795,0.055275&#038;z=14&#038;brcurrent=3,0x346ef3065c07572f:0xe711f004bf9c5469" target=_blank>基隆廟口站</a> 也是個好地方 <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>嘟嘟房各站點的位置以及合作的銀行可以從嘟嘟房的網站上面找到:<br />
<a href=http://www.dodohome.com.tw/menu09/actparktable_big.asp target=_blank>http://www.dodohome.com.tw/menu09/actparktable_big.asp</a></p>
<p>不過嘟嘟房的網站實在不好查，網站有點慢而且查詢層級有點亂.. orz</p>
<p>因此颱風假在家無聊，就把嘟嘟房台北&#038;基隆可以臨時停車的站點匯入了 <a href=http://maps.google.com.tw/maps/ms?ie=UTF8&#038;hl=zh-TW&#038;msa=0&#038;msid=118338097352562522963.000456ec1e60a6adc631e&#038;z=11 target=_blank>Google Maps</a>，<br />
產生了一份「<a href=http://maps.google.com.tw/maps/ms?ie=UTF8&#038;hl=zh-TW&#038;msa=0&#038;msid=118338097352562522963.000456ec1e60a6adc631e&#038;z=11 target=_blank>我的地圖</a>」，方便直接查詢可以停車的站點，如下所示:</p>
<p><a href=http://maps.google.com.tw/maps/ms?ie=UTF8&#038;hl=zh-TW&#038;msa=0&#038;msid=118338097352562522963.000456ec1e60a6adc631e&#038;z=12 target=_blank><img src=http://farm4.static.flickr.com/3501/3235713544_483ce2d8b8_o.png /></a></p>
<p>有興趣的人可以直接點選 <a href=http://maps.google.com.tw/maps/ms?ie=UTF8&#038;hl=zh-TW&#038;msa=0&#038;msid=118338097352562522963.000456ec1e60a6adc631e&#038;z=11 target=_blank>這邊</a> 直接連結到這份地圖</p>
<p>不過實際的位置狀況以及哪些銀行間可以使用還是需以嘟嘟房原始網站的說明為準</p>
<p>然後重點來了，到底哪些卡才能使用嘟嘟房的停車優惠呢?</p>
<p>其實自從卡債風暴開始，各銀行已經已經大幅縮減信用卡的免費停車優惠了，<br />
以嘟嘟房為例，很多信用卡已經改成需要扣點數或者符合一定消費金額才能免費停車了</p>
<p>建議選擇不需要額外扣點數也不需要扣錢的卡，主要是需要扣點數的算起來都不太划算<br />
更詳細即時的資訊請參考原始嘟嘟房網站上 <a href=http://www.dodohome.com.tw/menu07/mainframebank.asp target=_blank>卡友專區</a> 的說明</p>
<p>本文簡短網址為: http://tinyurl.com/dodohome</p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/mUaOsegT55w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/09/29/92/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/09/29/92/</feedburner:origLink></item>
		<item>
		<title>Bye Bye ISP - 和信超媒體(GigaMedia)賣掉了 ISP 部門</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/KAsZ_6XtMPE/</link>
		<comments>http://blog.urdada.net/2008/08/28/91/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 15:30:44 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[網路科技]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/08/28/91/</guid>
		<description><![CDATA[和信超媒體的母公司 GigaMedia 今天宣佈以 2000 萬美元將 ISP 部門 (包含和網寬頻 KBT) 賣給中嘉網路，如果接下來兩年出售的部門達到業績目標，還可以另外再取得 500 萬美元 相關新聞: GigaMedia Sells Legacy ISP Business; One-Time Gain Expected GigaMedia unloads legacy ISP unit for $20 million 2000年進入 和信超媒體 工作時，當時公司最主要的業務就是 Cable Modem 寬頻上網，但受限於許多先天及後天因素，發展得並沒有很好。2001年開始進入 ADSL 的市場，但也因為中華電信獨占電路的關係，競爭還是處於不利地位。2006年 將 ADSL 部份賣給了現在的天空傳媒 (原Webs-TV) 之後，GigaMedia 還是持續經營著 Cable Modem 業務(和信超媒體)以及企業專線市場(和網寬頻) 中嘉網路原是和信關係企業，但在 安博凱MBK 入主之後，外資目前也佔了很大一部份股權。中嘉系統下的有線電視業者原本的 Cable Modem 寬頻上網服務就是由和信超媒體提供的，但是後來因為種種因素，中嘉還是推出了自己的 Cable Modem 品牌 [...]]]></description>
			<content:encoded><![CDATA[<p>和信超媒體的母公司 <a href=http://www.gigamedia.com.tw/ target=_blank>GigaMedia</a> 今天宣佈以 2000 萬美元將 ISP 部門 (包含<a href=http://www.kbtelecom.net/ target=_blank>和網寬頻 KBT</a>) 賣給<a href=http://www.cns.net.tw/company_info.php target=_blank>中嘉網路</a>，如果接下來兩年出售的部門達到業績目標，還可以另外再取得 500 萬美元</p>
<p>相關新聞:</p>
<ul>
<li><a href=http://biz.yahoo.com/prnews/080828/hkth009.html?.v=1 target=_blank>GigaMedia Sells Legacy ISP Business; One-Time Gain Expected</a>
<li><a href=http://biz.yahoo.com/ap/080828/gigamedia_unit_sale.html?.v=1 target=_blank>GigaMedia unloads legacy ISP unit for $20 million</a>
</ul>
<p>2000年進入 <a href=http://www.gigamedia.com.tw/ target=_blank>和信超媒體</a> 工作時，當時公司最主要的業務就是 <a href=http://en.wikipedia.org/wiki/Cable_modem target=_blank>Cable Modem</a> 寬頻上網，但受限於許多先天及後天因素，發展得並沒有很好。2001年開始進入 <a href="http://zh.wikipedia.org/w/index.php?title=ADSL&#038;variant=zh-tw" target=_blank>ADSL</a> 的市場，但也因為中華電信獨占電路的關係，競爭還是處於不利地位。2006年 <a href=http://blog.urdada.net/2006/05/16/12/ target=_blank>將 ADSL 部份賣給了現在的天空傳媒</a> (原Webs-TV) 之後，GigaMedia 還是持續經營著 Cable Modem 業務(和信超媒體)以及企業專線市場(和網寬頻)</p>
<p>中嘉網路原是和信關係企業，但在 <a href=http://www.mbkpartnerslp.com/ target=_blank>安博凱MBK</a> 入主之後，外資目前也佔了很大一部份股權。中嘉系統下的有線電視業者原本的 Cable Modem 寬頻上網服務就是由和信超媒體提供的，但是後來因為種種因素，中嘉還是推出了自己的 Cable Modem 品牌 (<a href=http://www.totalbb.net.tw/ target=_blank>互動BB</a>)，與和信超媒體 GIGA 品牌的 Cable Modem 變成競爭又合作的奇妙關係...</p>
<p>GigaMedia 事實上近幾年已經把精力幾乎都投注在線上遊戲的發展，ISP 網路部門的出售也是遲早的事。 ISP 部門尤其是企業專線市場與有線電視業者整合後，應該是能夠有更好的發展的!</p>
<p>在新聞發佈的這時候，我正在上海出差，看到這則新聞其實是有點百感交集，當初會加入這個公司，也是對 ISP 所能夠提供的服務有濃厚的興趣。從整套的寬頻網路管理系統 (內部稱 SIMBA)、ADSL 服務、<a href=http://photo.giga.net.tw/ target=_blank>網路相簿</a> 到 <a href=http://webamp.giga.net.tw/ target=_blank>WebAMP</a>，都留下了我許多參與的心血... </p>
<p>世事是很難預料的，沒想到我最終還是回到網路遊戲這一塊，我研究所兩年的主要研究  <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_wink.gif' alt=':wink:' class='wp-smiley' />  </p>
<p>無論如何，還是祝福 ISP 部門的同事們！</p>
<p>~ 希望我們的努力能讓你們手中的 option 價值更高一點  <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_razz.gif' alt=':razz:' class='wp-smiley' />  </p>
<p>延伸閱讀:</p>
<ul>
<li><a href="http://ccie11440.blogspot.com/2008/08/gigamedia-sells-legacy-isp-business-one.html" target=_blank>CCIE#11440's Blog: GigaMedia Sells Legacy ISP Business...</a>
<li><a href="http://zhchen543.bluedrongo.com/2008/08/gigamedia-unloads-legacy-isp.html" target=_blank>Life is Colorful: 該來的終於來了 GigaMedia unloads legacy ISP</a>
<li><a href="http://blog.urdada.net/2006/05/16/12/" target=_blank>和信超媒體以 1790 萬美元出售 ADSL</a>
<li><a href="http://blog.urdada.net/2005/12/19/13/" target=_blank>和信超媒體收購宏碁戲谷</a>
</ul>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/KAsZ_6XtMPE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/08/28/91/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/08/28/91/</feedburner:origLink></item>
		<item>
		<title>BloggerAds 的收益到達1000元了</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/GzrjmtQE6yI/</link>
		<comments>http://blog.urdada.net/2008/08/24/90/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 03:30:02 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[趣味軼事]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/08/24/90/</guid>
		<description><![CDATA[大約是2007年11月底抱著好玩的心裡加入 BloggerAds 的，主要使用的位置是放在我的 Blog 右方側欄的廣告，我的 Blog 流量並不多，但根據報表，平均每天還是約有200~300次的廣告曝光，大約是新台幣5~6元的收入。經過9個月的累積之後，收益終於到達 BloggerAds 訂的收益匯款門檻1000元了 相對於 Google 的 AdSense，國內廠商 BloggerAds 的好處是只要有曝光就會有收入，一般來講，收益應該會比 AdSense 好很多.. BloggerAds 除了部落格的廣告外，另外還可以經由推薦連結及黃金寫手獲取收益，但對於一般的部落客而言，放廣告還是最簡單的方式 BloggerAds 的推薦連結只能讓推薦者分享30天內的收益，而且還只有30%，實在不夠吸引人，應該適度增加回饋的比例與時間，也許再搞個 老鼠會 多層次傳銷 的模式更能吸引人.. 不過國內廣告市場長期被G/Y等業者壟斷，不知道 BloggerAds 有沒有足夠的廣告來源來支撐營運就是了.. 有興趣的人可以玩玩看，我半年才能吃一次大餐，也許你每個禮拜都能吃一次大餐]]></description>
			<content:encoded><![CDATA[<p>大約是2007年11月底抱著好玩的心裡加入 <a href="http://author.bloggerads.net/01_join_read.aspx?refid=20064&amp;id=20071122000025" target=_blank>BloggerAds</a> 的，主要使用的位置是放在我的 Blog 右方側欄的廣告，我的 Blog 流量並不多，但根據報表，平均每天還是約有200~300次的廣告曝光，大約是新台幣5~6元的收入。經過9個月的累積之後，收益終於到達 BloggerAds 訂的收益匯款門檻1000元了 <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://farm4.static.flickr.com/3056/2793318714_9d022a61b3.jpg" border=1 /></p>
<p>相對於 Google 的 <a href=https://www.google.com/adsense/home target=_blank>AdSense</a>，國內廠商 <a href="http://author.bloggerads.net/01_join_read.aspx?refid=20064&amp;id=20071122000025" target=_blank>BloggerAds</a> 的好處是<a href="http://www.bloggerads.net/15_faq_v2.aspx" target=_blank>只要有曝光就會有收入</a>，一般來講，收益應該會比 AdSense 好很多..</p>
<p><a href="http://author.bloggerads.net/01_join_read.aspx?refid=20064&amp;id=20071122000025" target=_blank>BloggerAds</a> 除了部落格的廣告外，另外還可以經由推薦連結及黃金寫手獲取收益，但對於一般的部落客而言，放廣告還是最簡單的方式</p>
<p>BloggerAds 的推薦連結只能讓推薦者分享30天內的收益，而且還只有30%，實在不夠吸引人，應該適度增加回饋的比例與時間，也許再搞個 <strike>老鼠會</strike> 多層次傳銷 的模式更能吸引人.. 不過國內廣告市場長期被G/Y等業者壟斷，不知道 BloggerAds 有沒有足夠的廣告來源來支撐營運就是了..</p>
<p>有興趣的人可以玩玩看，我半年才能吃一次大餐，也許你每個禮拜都能吃一次大餐 <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' />  </p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/GzrjmtQE6yI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/08/24/90/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/08/24/90/</feedburner:origLink></item>
		<item>
		<title>部落格的 PageRank 升到 5 了</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/A09AgAppPBw/</link>
		<comments>http://blog.urdada.net/2008/08/20/89/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 15:12:05 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[趣味軼事]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/08/20/89/</guid>
		<description><![CDATA[我的第一篇 BLOG 是三年多前，2005/03/04 發表 於 無名小站，那時候無名小站剛剛商業化脫離交通大學，然後經過一番波折搬入了 GIGA 機房... 一年前 (2007/07/26) 把 BLOG 從無名小站 搬出來 到自己用 WordPress 架的這個站台 其實這一年來實在太忙，寫文章也是斷斷續續的，心血來潮就寫一篇，忙的時候停筆一兩個月也是常有的事，從開始寫 Blog 到現在也只累積了不到百篇文章。這幾天到上海出差，下班後回到飯店，想說連上自己的 Blog 看看有沒有被「和諧」掉(還好沒有)，突然發現 PageRank 升到 5 了。今年三月的時候，PageRank 還是只有 3 而已，大約四月底升到 4，然後到現在八月中左右就升到 5 了.. 不曉得 Google 怎麼算的 不過雖然 PageRank 升到 5 了，但是我發現原來在無名小站的舊 Blog 每日訪問數都還是比新的這邊高，而且其實舊的 Blog 內的文章大部分已經被我拿掉了，但是每日訪問數還是較多。更重要的是，從 Bloglines 的訂閱數目來看，新的 Blog 還是沒有超越原來我無名小站 Blog 的訂閱數 (其實都很少 XD) 但是呢，在大陸這邊，訪問我新的 Blog 是沒問題的，而無名小站的 [...]]]></description>
			<content:encoded><![CDATA[<p>我的第一篇 BLOG 是三年多前，<a href=http://www.wretch.cc/blog/cdsheen/1796065 target=_blank>2005/03/04 發表</a> 於 <a href=http://www.wretch.cc/ target=_blank>無名小站</a>，那時候無名小站剛剛商業化脫離<a href=http://www.nctu.edu.tw/ target=_blank>交通大學</a>，然後經過一番波折搬入了 <a href=http://www.giga.net.tw/ target=_blank>GIGA</a> 機房...</p>
<p><img src=http://farm4.static.flickr.com/3186/2782403037_2ac331e02a.jpg border=1 /></p>
<p>一年前 (2007/07/26) 把 BLOG 從無名小站 <a href=http://www.wretch.cc/blog/cdsheen/14935661 target=_blank>搬出來</a> 到自己用 <a href=http://wordpress.org/ target=_blank>WordPress</a> 架的這個<a href=http://blog.urdada.net/ target=_blank>站台</a></p>
<p>其實這一年來實在太忙，寫文章也是斷斷續續的，心血來潮就寫一篇，忙的時候停筆一兩個月也是常有的事，從開始寫 Blog 到現在也只累積了不到百篇文章。這幾天到上海出差，下班後回到飯店，想說連上自己的 <a href=http://blog.urdada.net/ target=_blank>Blog</a> 看看有沒有被「<a href="http://zh.wikipedia.org/w/index.php?title=%E6%B2%B3%E8%9F%B9_(%E7%B6%B2%E8%B7%AF%E7%94%A8%E8%AA%9E)&#038;variant=zh-tw" target=_blank>和諧</a>」掉(還好沒有)，突然發現 <a href=http://en.wikipedia.org/wiki/PageRank target=_blank>PageRank</a> 升到 5 了。今年三月的時候，PageRank 還是只有 3 而已，大約四月底升到 4，然後到現在八月中左右就升到 5 了..  不曉得 Google 怎麼算的</p>
<p><img src=http://farm4.static.flickr.com/3168/2783651950_23ab13a2b8_o.png border=1 /></p>
<p>不過雖然 PageRank 升到 5 了，但是我發現原來在無名小站的舊 Blog 每日訪問數都還是比新的這邊高，而且其實舊的 Blog 內的文章大部分已經被我拿掉了，但是每日訪問數還是較多。更重要的是，從 <a href=http://www.bloglines.com/ target=_blank>Bloglines</a> 的訂閱數目來看，新的 Blog 還是沒有超越原來我無名小站 Blog 的訂閱數 (其實都很少 XD)</p>
<p>但是呢，在大陸這邊，訪問我新的 Blog 是沒問題的，而無名小站的 Blog 卻被<a href="http://zh.wikipedia.org/w/index.php?title=%E6%B2%B3%E8%9F%B9_(%E7%B6%B2%E8%B7%AF%E7%94%A8%E8%AA%9E)&#038;variant=zh-tw" target=_blank>和諧</a>掉了... 必須要 VPN 連回台灣才看得到  <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' />  </p>
<p><img src=http://farm4.static.flickr.com/3150/2783716514_8102ecf4f0.jpg border=1 /></p>
<p>不過大概是大陸舉辦奧運的關係，我三月到上海出差時 <a href=http://www.feedburner.com/ target=_blank>FeedBurner</a> 的 RSS Feed 是<a href=http://blog.urdada.net/2008/03/02/82/ target=_blank>無法直接存取</a>的，但是目前卻是一切正常的樣子，我想這或許也是大陸舉辦奧運的好處之一吧  <img src='http://blog.urdada.net/wp-includes/images/smilies/icon_confused.gif' alt=':???:' class='wp-smiley' />   </p>
<p>只是不知道奧運過了會不會恢復原狀就是了 XD </p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/A09AgAppPBw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/08/20/89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/08/20/89/</feedburner:origLink></item>
		<item>
		<title>Subversion pre-commit hook</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/wBZ2H2PpnvA/</link>
		<comments>http://blog.urdada.net/2008/07/30/88/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 16:54:26 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[軟體]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/07/30/88/</guid>
		<description><![CDATA[很多人寫完程式要 commit 的時候會偷懶不寫 log，導致有時候要追問題時， 很難得知到底別人改了什麼，這時候裝個 pre-commit hook 還是蠻有用的 下面這個 pre-commit hook 只是很簡單的不允許空白或不含字母的 commit log， 如果需要的話可以很容易擴充加上更多的判斷.. 記得要 chmod 755 喔 [Subversion pre-commit hook to reject commit with empty log] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #!/usr/bin/perl &#160; # pre-commit hook to reject [...]]]></description>
			<content:encoded><![CDATA[<p>很多人寫完程式要 commit 的時候會偷懶不寫 log，導致有時候要追問題時，<br />
很難得知到底別人改了什麼，這時候裝個 pre-commit hook 還是蠻有用的</p>
<p>下面這個 <a href=http://svnbook.red-bean.com/en/1.4/svn.ref.reposhooks.pre-commit.html target=_blank>pre-commit hook</a> 只是很簡單的不允許空白或不含字母的 commit log，<br />
如果需要的話可以很容易擴充加上更多的判斷.. 記得要 chmod 755 喔</p>
<p><strong>[Subversion pre-commit hook to reject commit with empty log]</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># pre-commit hook to reject commit with empty log</span>
<span style="color: #666666; font-style: italic;"># remember to chmod 755 on this file</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Usage: $0 [REPOS] [TXN]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">@ARGV</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$REPOS</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$TXN</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$svnlook</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'/usr/local/bin/svnlook'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$author</span><span style="color: #339933;">=</span><span style="color: #ff0000;">`$svnlook author -t $TXN $REPOS`</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$log</span><span style="color: #339933;">=</span><span style="color: #ff0000;">`$svnlook log -t $TXN $REPOS`</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$log</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">''</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^\W+$/</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Hello, $author. Empty commit log is not permitted!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>除此之外，對於 pre-commit hook，我還加上了檢查不允許跨 branch 的 commit，<br />
因為一旦有了跨 branch 的 commit，會使得未來需要作 merge 的時候遇到許多麻煩</p>
<p>例如常用的 repository 結構如下:</p>
<p>/trunk/<br />
/branches/helloworld-1.0/<br />
/branches/helloworld-1.1/</p>
<p>要防止使用者同時對兩個以上的 branch (包含 main trunk) 作 commit，<br />
可以把下面這一段程式再加進去 pre-commit 的 hook 中</p>
<p><strong>[Subversion pre-commit hook to reject cross-branch commit]</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># pre-commit hook to reject empty commit log and cross-branch commit</span>
<span style="color: #666666; font-style: italic;"># remember to chmod 755 on this file</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;Usage: $0 [REPOS] [TXN]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">@ARGV</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$REPOS</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #0000ff;">$TXN</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$ARGV</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$svnlook</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'/usr/local/bin/svnlook'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$author</span><span style="color: #339933;">=</span><span style="color: #ff0000;">`$svnlook author -t $TXN $REPOS`</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">chomp</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$log</span><span style="color: #339933;">=</span><span style="color: #ff0000;">`$svnlook log -t $TXN $REPOS`</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$log</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">''</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">$log</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^\W+$/</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Hello, $author. Empty commit log is not permitted!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>DIRS<span style="color: #339933;">,</span><span style="color: #ff0000;">&quot;$svnlook dirs-changed -t $TXN $REPOS|&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #009999;">&lt;DIRS&gt;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/^(trunk)\//</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #0000ff;">$branches</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$1</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">elsif</span><span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/^branches\/([^\/]+)/</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #0000ff;">$branches</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$1</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">++;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>DIRS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$c</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">%branches</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$c</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Hello, $author. You can't commit to $c branches at the same time!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<img src="http://feeds.feedburner.com/~r/cdsheen/~4/wBZ2H2PpnvA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/07/30/88/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/07/30/88/</feedburner:origLink></item>
		<item>
		<title>2008 高扣抵稅率概念股</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/35TUgtcDRYs/</link>
		<comments>http://blog.urdada.net/2008/05/12/86/#comments</comments>
		<pubDate>Sun, 11 May 2008 23:31:19 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[投資理財]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/05/12/86/</guid>
		<description><![CDATA[經濟日報: 18檔高節稅概念股評析 (2008-05-05) 進一步觀察這些個股的可扣抵稅率，以儒鴻（1476）36.21%最高，中鋼構（2013）35.17%、中鴻（2014）33.38%，另外，全國電（6281）、三星科技（5007）、宣昶（3315）等，可扣抵稅率都超過三成。以中鋼構為例，今年配發的現金股息為1.2元，換言之，若持有一張中鋼構參與今年的除權息，投資人將可獲得1,200元的現金股息，而其可扣抵稅率為35.17%，屆時可扣抵稅額即為422元。 法人指出，股東在申報個人綜合所得稅時，「股東可扣抵稅額」取決於「發放股利」與「稅額扣抵比率」，只要「稅額扣抵比率」高於「個人綜合所得稅率」（區分為免稅、6%、13%、21%、30%與40%），股東參與除權息，不僅可享受到股利或股息報酬，亦可額外獲得抵減稅額，可謂一魚雙吃。]]></description>
			<content:encoded><![CDATA[<p>
經濟日報: <a href=http://money.udn.com/html/rpt/rpt96682.html target=_blank>18檔高節稅概念股評析</a> (2008-05-05)<br />
<br />
<img src=http://farm4.static.flickr.com/3245/2484342275_544d05128d_o.gif /></p>
<blockquote><p>
進一步觀察這些個股的可扣抵稅率，以儒鴻（1476）36.21%最高，中鋼構（2013）35.17%、中鴻（2014）33.38%，另外，全國電（6281）、三星科技（5007）、宣昶（3315）等，可扣抵稅率都超過三成。以中鋼構為例，今年配發的現金股息為1.2元，換言之，若持有一張中鋼構參與今年的除權息，投資人將可獲得1,200元的現金股息，而其可扣抵稅率為35.17%，屆時可扣抵稅額即為422元。</p>
<p>法人指出，股東在申報個人綜合所得稅時，「股東可扣抵稅額」取決於「發放股利」與「稅額扣抵比率」，只要「稅額扣抵比率」高於「個人綜合所得稅率」（區分為免稅、6%、13%、21%、30%與40%），股東參與除權息，不僅可享受到股利或股息報酬，亦可額外獲得抵減稅額，可謂一魚雙吃。
</p></blockquote>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/35TUgtcDRYs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/05/12/86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/05/12/86/</feedburner:origLink></item>
		<item>
		<title>一個長整數各自表述 (in 64-bit system)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/fhH7S3CGK_A/</link>
		<comments>http://blog.urdada.net/2008/04/18/85/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 14:06:30 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[作業系統]]></category>
		<category><![CDATA[程式語言]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/04/18/85/</guid>
		<description><![CDATA[Size of long integer may be different between 64-bit systems (一個長整數各自表述) 不知道是不是我太落伍了... 我一直以為 C/C++ 下面 short, long, long long 三種資料型態都固定是 2, 4, 8 個 bytes 大小。只有 int 這個資料型態會因為 16-bit/32-bit 系統的不同而變成 2 或 4 bytes 的大小，所以理所當然 int 在 64-bit 的電腦也應該會變成 8 bytes (64-bit) 的大小囉 ?! 在整理前一篇文章《Bypass the 2GB file size limit on 32-bit Linux》的時候，讓我驚覺在 64-bit 的系統下，long [...]]]></description>
			<content:encoded><![CDATA[<p>Size of long integer may be different between 64-bit systems (一個長整數各自表述)</p>
<p>不知道是不是我太落伍了...</p>
<p>我一直以為 C/C++ 下面 short, long, long long 三種資料型態都固定是 2, 4, 8 個 bytes 大小。只有 int 這個資料型態會因為 16-bit/32-bit 系統的不同而變成 2 或 4 bytes 的大小，所以理所當然 int 在 64-bit 的電腦也應該會變成 8 bytes (64-bit) 的大小囉 ?!</p>
<p>在整理前一篇文章《<a href=http://blog.urdada.net/2008/04/18/84/ target=_blank>Bypass the 2GB file size limit on 32-bit Linux</a>》的時候，讓我驚覺在 64-bit 的系統下，long 的長度也是各自表述的！</p>
<p>首先，int 的大小即使到了 64-bit 的機器上，大部分的系統仍然使用 4 bytes 的大小而已，這主要是為了避免程式從 32-bit 系統轉換到 64-bit 系統需要修改太多地方</p>
<p>再來，請參考 Wikipedia: <a href=http://en.wikipedia.org/wiki/64-bit#64-bit_data_models target=_blank>64-bit data models</a> 的說明</p>
<p>絕大多數的 UNIX 系統在 64-bit 下面採用 <a href=http://www.unix.org/version2/whatsnew/lp64_wp.html target=_blank>LP64</a> 這種 data model，這時候 long 就不再是固定為 4 bytes 大小，而是變成 8 bytes 的大小了！</p>
<p>然而，Win64 卻不是使用 LP64，而是採用 LLP64 這個 data model，這時候 long 的大小仍然還是 4 bytes</p>
<p><img src=http://farm4.static.flickr.com/3219/2422521769_4f4c50c2f2.jpg /></p>
<p><strong><i>Many 64-bit compilers today use the <strong>LP64</strong> model (including Solaris, AIX, HP, Linux, Mac OS X, and IBM z/OS native compilers). Microsoft's VC++ compiler uses the <strong>LLP64</strong> model.</i></strong></p>
<p>兩種 data model 的最大差異點就是 long 這個資料型態的大小，LP64 是 64-bit，而 LLP64 則是 32-bit</p>
<p>LLP64 data model 基本上可以說跟 32-bit 的系統一樣，唯一差別只有位址(pointer)改成了 64-bit 而已。資料物件(class, structure) 等如果沒有包含 pointer 的成員的話，整個物件的大小是與 32-bit 系統一樣的！</p>
<p>而 LP64 則是除了位址(pointer)改成 64-bit 之外，long 的大小也變成了 64-bit 大小。所以在 UNIX 下面，要把 32-bit 程式 porting 到 64-bit 可能要比 Windows 多花費多一點功夫。</p>
<p>所以呢，我們觀察到兩個問題影響著程式的相容性</p>
<ol>
<li>在 UNIX 下面，long 的大小在 32-bit 與 64-bit 的系統下是不一樣的
<li>同樣是 64-bit 系統，UNIX 與 Windows 對於 long 的大小看法是不一致的
</ol>
<p>為了使程式在 32-bit 與 64-bit 之間以及 UNIX 與 Windows 之間的相容性提昇，改用固定長度的資料型態是寫程式的一個好習慣</p>
<p>在 UNIX 下面，我們可以改用 <a href=http://en.wikipedia.org/wiki/Stdint.h target=_blank>stdint.h</a> 這個 header file 中對於資料型態的定義:</p>
<pre>
int8_t     8-bit signed interger
int16_t    16-bit signed interger
int32_t    32-bit signed interger
int64_t    64-bit signed interger
uint8_t    8-bit unsigned interger
uint16_t   16-bit unsigned interger
uint32_t   32-bit unsigned interger
uint64_t   64-bit unsigned interger
</pre>
<p>在 Windows 下面，則改用下面這些整數固定大小的資料型態</p>
<pre>
INT8       8-bit signed integer
INT16      16-bit signed integer
INT32      32-bit signed integer
INT64      64-bit signed integer
UINT8      8-bit unsigned integer
UINT16     16-bit unsigned integer
UINT32     32-bit unsigned integer
UINT64     64-bit unsigned integer
</pre>
<p>絕對不要再使用 int 和 long 了！</p>
<p>尤其是寫網路程式時，很可能 client 是 Windows 而 server 是 UNIX，然後又有 32-bit 及 64-bit 系統混在裡面，一不小心就發生不相容的問題了...</p>
<p>當然，在 64-bit 的系統下寫程式，要考慮的絕對不只上面這些基本的資料型態。除了 pointer 的大小變成 64-bit 外，許多系統內建函式會用到的 size_t 及 off_t 的大小也變成 64-bit 了.... 寫程式時若有用到這些資料型態，需特別注意，尤其是 casting 時，千萬不要用 32-bit 的整數去裝這些資料，免得造成不可預期的結果！</p>
<p>最後提供一個小程式讓你得知你的系統主要資料型態的大小</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/types.h&gt;</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(short)     = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">short</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(int)       = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(long)      = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">long</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(long long) = %d<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">long</span> <span style="color: #993333;">long</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(size_t)    = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>size_t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(off_t)     = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span>off_t<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;sizeof(void *)    = %d<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>參考資料:</p>
<ol>
<li>Wikipedia: <a href=http://en.wikipedia.org/wiki/64-bit#64-bit_data_models target=_blank>64-bit data models</a>
<li><a href=http://www.unix.org/version2/whatsnew/lp64_wp.html target=_blank>64-Bit Programming Models: Why LP64?</a>
<li><a href=http://technet.microsoft.com/en-us/library/bb496995.aspx target=_blank>Introduction to Win32/Win64</a>
<li><a href=http://softwarecommunity.intel.com/articles/eng/1660.htm target=_blank>Porting 32-bit Applications to the Itanium® Architecture</a>
<li><a href=http://cache-www.intel.com/cd/00/00/01/79/17969_codeclean_r02.pdf target=_blank>Preparing Code for the IA-64 Architecture</a> (PDF)
</ol>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/fhH7S3CGK_A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/04/18/85/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/04/18/85/</feedburner:origLink></item>
		<item>
		<title>Bypass the 2GB file size limit on 32-bit Linux</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/SaNWg-g-SmQ/</link>
		<comments>http://blog.urdada.net/2008/04/18/84/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 18:18:56 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[作業系統]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/04/18/84/</guid>
		<description><![CDATA[Bypass the 2GB file size limit on 32-bit Linux (在 Linux 上面突破 2GB 的檔案大小限制) 在 32 位元的 Linux 上面寫超過 2GB 的檔案會發生錯誤，甚至導致程式終止執行 這是因為 Linux 的系統內部處理檔案時用的指標定義為 long，而 long 在 32 位元的系統上的大小為 32 位元，因此最大只能支援 2^31-1 = 2,147,483,647 bytes 等於是 2GB 扣掉 1 byte 的檔案大小 64 位元的系統 (例如 AMD64 或 IA64) 則因為 long 定義成 64 位元，所以不會有問題.. # if __WORDSIZE [...]]]></description>
			<content:encoded><![CDATA[<p>Bypass the 2GB file size limit on 32-bit Linux (在 Linux 上面突破 2GB 的檔案大小限制)</p>
<p>在 32 位元的 Linux 上面寫超過 2GB 的檔案會發生錯誤，甚至導致程式終止執行</p>
<p>這是因為 Linux 的系統內部處理檔案時用的指標定義為 long，而 long 在 32 位元的系統上的大小為 32 位元，因此最大只能支援 2^31-1 = 2,147,483,647 bytes 等於是 2GB 扣掉 1 byte 的檔案大小</p>
<p>64 位元的系統 (例如 <a href=http://en.wikipedia.org/wiki/Amd64 target=_blank>AMD64</a> 或 <a href=http://en.wikipedia.org/wiki/IA64 target=_blank>IA64</a>) 則因為 long 定義成 64 位元，所以不會有問題..</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#  if __WORDSIZE == 64</span>
<span style="color: #993333;">typedef</span> <span style="color: #993333;">long</span> <span style="color: #993333;">int</span> int64_t<span style="color: #339933;">;</span>
<span style="color: #339933;"># endif</span></pre></div></div>

<p>不過在 FreeBSD 上面，即使是 32 位元的系統，也不會有 2GB 檔案大小的限制，這是因為 FreeBSD 內部處理檔案時，本來就是使用 64 位元的數字當作指標，所以不會有問題</p>
<p>因此在 32 位元的 Linux 上面，程式需要作一些額外處理才能正確寫超過 2GB 的檔案</p>
<p>我們先寫一個小程式來測試一下 (large.c)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;fcntl.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/types.h&gt;</span>
<span style="color: #339933;">#include &lt;sys/stat.h&gt;</span>
<span style="color: #339933;">#include &lt;signal.h&gt;</span>
<span style="color: #339933;">#include &lt;unistd.h&gt;</span>
<span style="color: #339933;">#include &lt;errno.h&gt;</span>
<span style="color: #993333;">void</span> sig_xfsz<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> sig<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ERROR: SIGXFSZ (%d) signal received!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> sig<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #993333;">int</span>     i<span style="color: #339933;">,</span> fd<span style="color: #339933;">;</span>
        <span style="color: #993333;">char</span>    dummy<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">4096</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
        signal<span style="color: #009900;">&#40;</span> SIGXFSZ<span style="color: #339933;">,</span> sig_xfsz <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        unlink<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;large.log&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        fd <span style="color: #339933;">=</span> open<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;large.log&quot;</span><span style="color: #339933;">,</span> O_CREAT<span style="color: #339933;">|</span>O_WRONLY<span style="color: #339933;">,</span> <span style="color: #208080;">0644</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        bzero<span style="color: #009900;">&#40;</span> dummy<span style="color: #339933;">,</span> <span style="color: #0000dd;">4096</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #808080; font-style: italic;">/* 2GB = 4KB x 524288 */</span>
        <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> i <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span> <span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">524287</span> <span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span>
                write<span style="color: #009900;">&#40;</span> fd<span style="color: #339933;">,</span> dummy<span style="color: #339933;">,</span> <span style="color: #0000dd;">4096</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        write<span style="color: #009900;">&#40;</span> fd<span style="color: #339933;">,</span> dummy<span style="color: #339933;">,</span> <span style="color: #0000dd;">4095</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;large.log: 2147483647 bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> write<span style="color: #009900;">&#40;</span> fd<span style="color: #339933;">,</span> dummy<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #0000dd;">0</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;ERROR: %s [errno:%d]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>strerror<span style="color: #009900;">&#40;</span>errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>errno<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
                <span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;large.log: 2147483648 bytes<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        close<span style="color: #009900;">&#40;</span>fd<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        exit<span style="color: #009900;">&#40;</span><span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>在 32 位元的 Linux 下面，以上程式編譯後若沒有特殊處理，執行結果如下:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># gcc -o large32 large.c
# ./large32
large.log: 2147483647 bytes
ERROR: SIGXFSZ (25) signal received!
ERROR: File too large [errno:27]</pre></div></div>

<p>在寫第 2147483648 byte 的時候，程式會收到 signal <a href=http://en.wikipedia.org/wiki/SIGXFSZ target=_blank>SIGXFSZ</a>，同時 write() 會回傳 -1 錯誤，errno 則為 27 (File too large)。更甚者，如果程式沒有像上面一樣去處理 SIGXFSZ 的話，內定的 signal handler 甚至會造成程式停止執行並產生 core dump</p>
<p>接下來，我們在編譯同一個程式的時候加入 -D_FILE_OFFSET_BITS=64 再試看看:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># gcc -D_FILE_OFFSET_BITS=64 -o large64 large.c
# ./large64
large.log: 2147483647 bytes
large.log: 2147483648 bytes</pre></div></div>

<p>果然順利突破 2GB 的限制了!</p>
<p>而同樣的程式在 32 位元的 FreeBSD 下面，不論有沒有加這個定義，跑起來都是正確的</p>
<p>不過處理這些大檔案的時候，除了編譯程式時的參數不同外，有些函數的使用上也要作一些調整，例如 fseek() 與 ftell() 這兩個原本使用到 long integer 當作 offset 的函數:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> fseek<span style="color: #009900;">&#40;</span>FILE <span style="color: #339933;">*</span>stream<span style="color: #339933;">,</span> <span style="color: #993333;">long</span> offset<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> whence<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #993333;">long</span> ftell<span style="color: #009900;">&#40;</span>FILE <span style="color: #339933;">*</span>stream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>只要系統是 32 位元，即使是在 FreeBSD 下面，都需要改為使用 off_t 的版本:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #993333;">int</span> fseeko<span style="color: #009900;">&#40;</span>FILE <span style="color: #339933;">*</span>stream<span style="color: #339933;">,</span> off_t offset<span style="color: #339933;">,</span> <span style="color: #993333;">int</span> whence<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
off_t ftello<span style="color: #009900;">&#40;</span>FILE <span style="color: #339933;">*</span>stream<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>在 Linux 下面，如果 _FILE_OFFSET_BITS 定義為 64，則 off_t 這個型態會自動轉成 64 位元的大小（在 FreeBSD 上面，off_t 本來就是 64 位元的大小)</p>
<p>每種系統支援大於 2GB 的檔案讀寫所需要的編譯選項都會有一些差異，即使是同樣是 Linux 也會因為 32 位元或 64 位元而有不同。有一個簡單的方法可以判斷，就是利用 glibc 提供的 getconf 來取得編譯(compile)以及連結(linking)時所需的參數:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;"># getconf LFS_CFLAGS
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
# getconf LFS_LDFLAGS 
&nbsp;
#</pre></div></div>

<p>上面是在 32 位元的 Redhat Linux 上面跑出來的結果，代表的是在這個系統上，若要讓程式支援 2GB 的檔案讀寫，編譯(compile)時需要加上 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 這兩個參數，連結(linking)時則不用加任何參數</p>
<p>參考資料:</p>
<ul>
<li><a href=http://www.suse.de/~aj/linux_lfs.html target=_blank>Large File Support in Linux</a>
<li><a href=http://en.wikipedia.org/wiki/Large_file_support target=_blank>LFS: Large File Support</a> (Wikipedia)
</ul>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/SaNWg-g-SmQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/04/18/84/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/04/18/84/</feedburner:origLink></item>
		<item>
		<title>China blocked FeedBurner (problem for FeedSmith)</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/ixhMwfyZ1PI/</link>
		<comments>http://blog.urdada.net/2008/03/02/82/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 13:00:52 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[網路科技]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/03/02/82/</guid>
		<description><![CDATA[這次到大陸出差，讓我發現到一個嚴重的問題，就是 Great Firewall (GFW) 把著名的 feed service provider FeedBurner 給擋掉了，這已經是去年八月發生的事了。所以如果您自己以 WordPress 架設的 blog 使用了 FeedBurner FeedSmith 這個 WordPress plugin，就會有一些奇怪的問題發生... 首先是 blog 的 RSS/Atom 等都無法直接被訂閱了，因為 FeedSmith 自動把 RSS/Atom 導向到 FeedBurner 那邊了，所以大陸那邊的人就無法直接訂閱。 例如: 我的 blog 的 feed 是: http://blog.urdada.net/feed/ 就會被 FeedSmith 使用 HTTP Status Code 307 (Temporary Redirect) 重導到 http://feeds.feedburner.com/cdsheen，所以大陸人就看不到啦... 當然，從大陸透過 Bloglines 或 Google Reader 可能還是可以間接訂閱就是了... 另外一個問題是，所有 [...]]]></description>
			<content:encoded><![CDATA[<p>這次到大陸出差，讓我發現到一個嚴重的問題，就是 <a href=http://en.wikipedia.org/wiki/Great_Firewall target=_blank>Great Firewall</a> (GFW) 把著名的 feed service provider <a href=http://www.feedburner.com/ target=_blank>FeedBurner</a> 給擋掉了，這已經是去年八月發生的事了。所以如果您自己以 <a href=http://wordpress.org/ target=_blank>WordPress</a> 架設的 blog 使用了 <a href=http://www.feedburner.com/fb/a/help/wordpress_quickstart target=_blank>FeedBurner FeedSmith</a> 這個 <a href=http://wordpress.org/extend/plugins/ target=_blank>WordPress plugin</a>，就會有一些奇怪的問題發生...</p>
<p>首先是 blog 的 <a href=http://en.wikipedia.org/wiki/RSS_(file_format) target=_blank>RSS</a>/<a href=http://en.wikipedia.org/wiki/Atom_%28standard%29 target=_blank>Atom</a> 等都無法直接被訂閱了，因為 FeedSmith 自動把 RSS/Atom 導向到 FeedBurner 那邊了，所以大陸那邊的人就無法直接訂閱。</p>
<p>例如: 我的 blog 的 feed 是: <a href=http://blog.urdada.net/feed/ target=_blank>http://blog.urdada.net/feed/</a> 就會被 FeedSmith 使用 <a href=http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8 target=_blank>HTTP Status Code 307 (Temporary Redirect)</a> 重導到 <a href=http://feeds.feedburner.com/cdsheen target=_blank>http://feeds.feedburner.com/cdsheen</a>，所以大陸人就看不到啦...</p>
<p>當然，從大陸透過 <a href=http://www.bloglines.com/ target=_blank>Bloglines</a> 或 <a href=http://www.google.com/reader target=_blank>Google Reader</a> 可能還是可以間接訂閱就是了...</p>
<p>另外一個問題是，所有 RSS/Atom 內文章的原始連結都會被 FeedSmith 代換成 FeedBurner 的網址來追蹤點擊率，但是這些連結在大陸都沒有任何作用，無法導回原始網站了... 因此即使大陸人可以使用 Bloglines 或 Google Reader 來間接訂閱，但是當要回原網站查看原文時，也會因為 FeedBurner 被擋而無法正確連結!</p>
<p>暫時還想不到比較好的解決方法，有人建議額外使用一個沒被 GFW 擋掉的 feed service provider 來專門給大陸客使用，例如: <a href=http://www.feedsky.com/ target=_blank>FeedSky</a>，這是大陸的公司，我想應該不會被擋。不過為了不讓阿共仔的陰謀輕易得逞，我暫時還是維持只使用 FeedBurner，但是另外提供一個 feed 讓苦難的大陸同胞訂閱（雖然這樣就無法追蹤那邊的訂閱狀況了..）</p>
<p><strong># cp wp-rss.php rss-china.php</strong></p>
<p>如果您人在大陸，想要訂閱我的 blog，請改用下面這個未經 FeedSmith 處理過的 feed 吧:</p>
<p><a href=http://blog.urdada.net/rss-china.php target=_blank>http://blog.urdada.net/rss-china.php</a></p>
<p>真是無奈... 大陸對於言論審查的尺度一直跟不上經濟自由化的腳步，總有一天會出問題的</p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/ixhMwfyZ1PI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/03/02/82/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/03/02/82/</feedburner:origLink></item>
		<item>
		<title>2008 夜上海俱樂部</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/LBJFgcRWUkE/</link>
		<comments>http://blog.urdada.net/2008/02/23/81/#comments</comments>
		<pubDate>Sat, 23 Feb 2008 04:35:54 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[趣味軼事]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/2008/02/23/81/</guid>
		<description><![CDATA[2008 夜上海俱樂部 沒錯！這是敝公司今年的春酒主題，一進會場就可看到華麗的舞台佈景： 福委會鼓勵大家以「上海風」的主題打扮，同時會頒發三名最佳服裝造型獎，有豐厚的獎金。許多同事還精心去租借禮服打扮，走入會場彷彿回到民國初年的上海灘.. 近年來線上遊戲已經是公司主要的業務，所以會場還擺了輪盤、骰子及 Black Jack 三張賭桌讓大家玩一玩.. 通通玩過後可以換得一張刮刮樂彩券 最後是充滿創意的菜單: 節目是還蠻精彩的，開頭還有播放由員工合力自製的爆笑的 MV，會場有樂團的現場演唱，甚至還有請到羅賓老師來表演魔術。唯一遺憾的是，我今年又槓龜了，眼睜睜看著 Sony Bravia 40吋液晶電視、Canon EOS 400D、PSP 以及數十萬的現金大獎落入別人的口袋... 賓果遊戲沒有連線，連拿到的兩張刮刮樂彩券都沒刮中... @@ 夜上海俱樂部精彩落幕，巧的是下禮拜就要去上海出差，真正體驗現代的上海灘風情了 XD]]></description>
			<content:encoded><![CDATA[<p>2008 夜上海俱樂部</p>
<p>沒錯！這是敝公司今年的春酒主題，一進會場就可看到華麗的舞台佈景：</p>
<p><img src=http://farm4.static.flickr.com/3132/2285292394_e3fca8549c.jpg /></p>
<p>福委會鼓勵大家以「上海風」的主題打扮，同時會頒發三名最佳服裝造型獎，有豐厚的獎金。許多同事還精心去租借禮服打扮，走入會場彷彿回到民國初年的<a href=http://zh.wikipedia.org/w/index.php?title=%E4%B8%8A%E6%B5%B7&#038;variant=zh-tw target=_blank>上海灘</a>..</p>
<p><img src=http://farm3.static.flickr.com/2220/2285294624_0fa0ec0367.jpg /><br />
<br />
近年來線上遊戲已經是公司主要的業務，所以會場還擺了輪盤、骰子及 Black Jack 三張賭桌讓大家玩一玩.. 通通玩過後可以換得一張刮刮樂彩券</p>
<p><img src=http://farm4.static.flickr.com/3231/2284510919_3f4ee6d31a_m.jpg /> <img src=http://farm3.static.flickr.com/2056/2284512683_afb8a7329b_m.jpg /></p>
<p>最後是充滿創意的菜單:<br />
<img src=http://farm3.static.flickr.com/2044/2284502315_942dd362b0.jpg /></p>
<p>節目是還蠻精彩的，開頭還有播放由員工合力自製的爆笑的 MV，會場有樂團的現場演唱，甚至還有請到羅賓老師來表演魔術。唯一遺憾的是，我今年又槓龜了，眼睜睜看著 <a href=http://en.wikipedia.org/wiki/BRAVIA target=_blank>Sony Bravia</a> 40吋液晶電視、<a href=http://en.wikipedia.org/wiki/Canon_EOS_400D target=_blank>Canon EOS 400D</a>、<a href=http://en.wikipedia.org/wiki/PlayStation_Portable target=_blank>PSP</a> 以及數十萬的現金大獎落入別人的口袋... 賓果遊戲沒有連線，連拿到的兩張刮刮樂彩券都沒刮中... @@</p>
<p>夜上海俱樂部精彩落幕，巧的是下禮拜就要去上海出差，真正體驗現代的上海灘風情了 XD</p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/LBJFgcRWUkE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2008/02/23/81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2008/02/23/81/</feedburner:origLink></item>
	</channel>
</rss>
