<?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>Fri, 13 Jan 2012 09:14:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.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>噗浪機器人範例程式 - 使用 Plurk API 2.0</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/B5E9ikuH5Oc/</link>
		<comments>http://blog.urdada.net/2011/10/28/426/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 09:04:27 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[未分類]]></category>
		<category><![CDATA[軟體]]></category>
		<category><![CDATA[網路科技]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=426</guid>
		<description><![CDATA[這篇文章說明如何用 Plurk API 2.0 自己寫一個噗浪機器人 (本文同步發表於 噗浪官方部落格) 噗浪大部分的機器人仍然使用 Plurk 1.0 撰寫，甚至有一部分機器人使用的是非官方的 API，這篇文章將簡介如何使用 Plurk API 2.0 OAuth 的方式開發機器人程式，同時，這個範例也使用 Plurk Realtime API (Comet Push) 的方式來追蹤時間軸，避免給伺服器帶來過多的負擔 由於 Plurk API 2.0 使用 OAuth 方式，所以啟動機器人之前，您必須先獲得以下四個參數 App Key App Secret Access Token Access Token Secret 獲得 App Key 及 App Secret 的方式很簡單，首先先註冊一個新的噗浪帳號用來跑這個機器人，然後登入新帳號後，開啟以下這個連結： http://www.plurk.com/PlurkApp/ 按下「註冊新的應用服務」，填寫關於你的程式的資料，其中 OAuth callback 保持空白即可 註冊完畢後就可以看到你的應用程式列表 然後按下「編輯」這個按鈕，就可以看到以下畫面： 這邊我們就可以得到 App [...]]]></description>
			<content:encoded><![CDATA[<p>這篇文章說明如何用 <a href="http://www.plurk.com/API" target="_blank">Plurk API 2.0</a> 自己寫一個噗浪機器人</p>
<p>(本文同步發表於 <a href="http://zh.blog.plurk.com/" title="噗浪官方部落格" target="_blank">噗浪官方部落格</a>)</p>
<p>噗浪大部分的機器人仍然使用 Plurk 1.0 撰寫，甚至有一部分機器人使用的是非官方的 API，這篇文章將簡介如何使用 Plurk API 2.0 OAuth 的方式開發機器人程式，同時，這個範例也使用 Plurk Realtime API (Comet Push) 的方式來追蹤時間軸，避免給伺服器帶來過多的負擔</p>
<p>由於 Plurk API 2.0 使用 OAuth 方式，所以啟動機器人之前，您必須先獲得以下四個參數</p>
<ul>
<li>App Key</li>
<li>App Secret</li>
<li>Access Token</li>
<li>Access Token Secret</li>
</ul>
<p>獲得 App Key 及 App Secret 的方式很簡單，首先先註冊一個新的噗浪帳號用來跑這個機器人，然後登入新帳號後，開啟以下這個連結：</p>
<p><a href="http://www.plurk.com/PlurkApp/" target="_blank">http://www.plurk.com/PlurkApp/</a></p>
<p>按下「註冊新的應用服務」，填寫關於你的程式的資料，其中 OAuth callback 保持空白即可</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-11.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-11.png" alt="" title="註冊新的應用服務" width="511" height="392" class="alignnone size-full wp-image-435" /></a></p>
<p>註冊完畢後就可以看到你的應用程式列表</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-2.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-2.png" alt="" title="應用程式列表" width="471" height="113" class="alignnone size-full wp-image-437" /></a></p>
<p>然後按下「編輯」這個按鈕，就可以看到以下畫面：</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-3.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-3.png" alt="" title="應用程式資料" width="511" height="214" class="alignnone size-full wp-image-439" /></a></p>
<p>這邊我們就可以得到 App Key 以及 App Secret 了</p>
<p>接下來要進行 OAuth 的授權驗證來取得 Access Token 及 Access Token Secret</p>
<p>按下「測試工具」來開啟 OAuth 的 Test Console</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-4.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-4.png" alt="" title="Test Console" width="834" height="156" class="alignnone size-full wp-image-441" /></a></p>
<p>首先按下「Get Request Token」來取得暫時的 Request Token，<br />
接下來按下「Open Authorization URL」來開啟授權頁面：</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-5.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-5.png" alt="" title="授權" width="405" height="230" class="alignnone size-full wp-image-442" /></a></p>
<p>按下「是，我要授權」後，會得到一個認證碼：</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-6.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-6.png" alt="" title="認證碼" width="212" height="111" class="alignnone size-full wp-image-444" /></a></p>
<p>把這個六位數的認證碼記下來，然後回到 Test Console，<br />
按下「Get Access Token」，這時會提示您輸入認證碼</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-7.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-7.png" alt="" title="Get Access Token" width="426" height="172" class="alignnone size-full wp-image-445" /></a></p>
<p>把您剛剛記下來的數字填進去，按下「確定」後，<br />
就可以得到永久有效的 Access Token 及 Access Token Secret 了</p>
<p><a href="http://blog.urdada.net/wp-content/uploads/2011/10/bot-8.png" rel="lightbox[426]"><img src="http://blog.urdada.net/wp-content/uploads/2011/10/bot-8.png" alt="" title="所有需要的參數" width="360" height="121" class="alignnone size-full wp-image-446" /></a></p>
<p>然後你就可以開始寫程式了，下面是一個用 Python 寫的噗浪機器人，<br />
把其中 APP_KEY, APP_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET 置換掉即可</p>
<p>這個程式需要使用到 <a href="https://github.com/clsung/plurk-oauth" target="_blank">plurk-oauth</a> 這個 Python library，<br />
請把 plurk_oauth/ 這個目錄下的檔案下載回來跟你的程式放在一起就可以了</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="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
<span style="color: #808080; font-style: italic;"># -*- coding:utf-8 -*-</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
<span style="color: #ff7700;font-weight:bold;">import</span> json
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib2</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> PlurkAPI <span style="color: #ff7700;font-weight:bold;">import</span> PlurkAPI
&nbsp;
plurk = PlurkAPI<span style="color: black;">&#40;</span><span style="color: #483d8b;">'APP_KEY'</span>, <span style="color: #483d8b;">'APP_SECRET'</span><span style="color: black;">&#41;</span>
plurk.<span style="color: black;">authorize</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'ACCEESS_TOKEN'</span>, <span style="color: #483d8b;">'ACCESS_TOKEN_SECRET'</span><span style="color: black;">&#41;</span>
&nbsp;
comet = plurk.<span style="color: black;">callAPI</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/APP/Realtime/getUserChannel'</span><span style="color: black;">&#41;</span>
comet_channel = comet.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'comet_server'</span><span style="color: black;">&#41;</span> + <span style="color: #483d8b;">&quot;&amp;new_offset=%d&quot;</span>
jsonp_re = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'CometChannel.scriptCallback<span style="color: #000099; font-weight: bold;">\(</span>(.+)<span style="color: #000099; font-weight: bold;">\)</span>;<span style="color: #000099; font-weight: bold;">\s</span>*'</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
new_offset = -<span style="color: #ff4500;">1</span>
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">True</span>:
    plurk.<span style="color: black;">callAPI</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/APP/Alerts/addAllAsFriends'</span><span style="color: black;">&#41;</span>
    req = <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>comet_channel <span style="color: #66cc66;">%</span> new_offset, timeout=<span style="color: #ff4500;">80</span><span style="color: black;">&#41;</span>
    rawdata = req.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    match = jsonp_re.<span style="color: black;">match</span><span style="color: black;">&#40;</span>rawdata<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> match:
        rawdata = match.<span style="color: black;">group</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
    data = json.<span style="color: black;">loads</span><span style="color: black;">&#40;</span>rawdata<span style="color: black;">&#41;</span>
    new_offset = data.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'new_offset'</span>, -<span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>
    msgs = data.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'data'</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> msgs:
        <span style="color: #ff7700;font-weight:bold;">continue</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> msg <span style="color: #ff7700;font-weight:bold;">in</span> msgs:
        <span style="color: #ff7700;font-weight:bold;">if</span> msg.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'type'</span><span style="color: black;">&#41;</span> == <span style="color: #483d8b;">'new_plurk'</span>:
            pid = msg.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'plurk_id'</span><span style="color: black;">&#41;</span>
            content = msg.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'content_raw'</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> content.<span style="color: black;">find</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;hello&quot;</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= -<span style="color: #ff4500;">1</span>:
                plurk.<span style="color: black;">callAPI</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/APP/Responses/responseAdd'</span>,
                              <span style="color: black;">&#123;</span><span style="color: #483d8b;">'plurk_id'</span>: pid,
                               <span style="color: #483d8b;">'content'</span>: <span style="color: #483d8b;">'world'</span>,
                               <span style="color: #483d8b;">'qualifier'</span>: <span style="color: #483d8b;">':'</span> <span style="color: black;">&#125;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>執行方式：</p>
<pre language="shell">
# python my-robot.py
</pre>
<p>這個範例程式作的事情很簡單，就是一個無窮迴圈，首先每次都會先接受所有成為朋友的請求，然後看看有沒有新的噗，如果有新的噗，而且內容有 'hello' 字串的話，就會自動回覆一個 'world' 字串</p>
<p>提醒大家，噗浪並不反對機器人的存在，但使用這個範例程式請注意以下幾點：</p>
<ol>
<li>建議使用新的帳號，不要用原有的帳號</li>
<li>機器人請勿主動去加網友為朋友</li>
<li>機器人請勿去關注(追蹤)任何其他網友</li>
<li>請勿自動回覆未成為機器人的朋友所發的噗</li>
<li>請勿張貼廣告訊息</li>
<li>請注意回覆頻率，以不過度干擾使用者的方式為原則</li>
</ol>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/B5E9ikuH5Oc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2011/10/28/426/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2011/10/28/426/</feedburner:origLink></item>
		<item>
		<title>Linode 新增東京機房 / Hinet FTTB 50M 測試結果</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/cd6C42F6_Q0/</link>
		<comments>http://blog.urdada.net/2011/09/22/419/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 16:38:46 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[網路科技]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=419</guid>
		<description><![CDATA[http://blog.linode.com/2011/09/19/linode-cloud-asia-pacific/ 直接貼從家裡 Hinet FTTB 50M 的測試結果 --- tokyo1.linode.com ping statistics --- 10 packets transmitted, 10 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 52.412/54.710/59.112/2.365 ms --- dallas1.linode.com ping statistics --- 10 packets transmitted, 10 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 196.465/198.960/203.051/2.565 ms --- fremont1.linode.com ping statistics --- 10 packets transmitted, 10 packets received, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.linode.com/2011/09/19/linode-cloud-asia-pacific/" target="_blank">http://blog.linode.com/2011/09/19/linode-cloud-asia-pacific/</a></p>
<p>直接貼從家裡 Hinet FTTB 50M 的測試結果</p>
<p><code>--- tokyo1.linode.com ping statistics ---<br />
10 packets transmitted, 10 packets received, 0.0% packet loss<br />
round-trip min/avg/max/stddev = 52.412/54.710/59.112/2.365 ms</p>
<p>--- dallas1.linode.com ping statistics ---<br />
10 packets transmitted, 10 packets received, 0.0% packet loss<br />
round-trip min/avg/max/stddev = 196.465/198.960/203.051/2.565 ms</p>
<p>--- fremont1.linode.com ping statistics ---<br />
10 packets transmitted, 10 packets received, 0.0% packet loss<br />
round-trip min/avg/max/stddev = 144.085/146.395/150.149/2.265 ms</p>
<p>wget -O /dev/null http://tokyo1.linode.com/100MB-tokyo.bin<br />
--2011-09-22 00:10:20--  http://tokyo1.linode.com/100MB-tokyo.bin<br />
Resolving tokyo1.linode.com... 106.187.33.12<br />
Connecting to tokyo1.linode.com|106.187.33.12|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 104857600 (100M) [application/octet-stream]<br />
Saving to: `/dev/null'<br />
2011-09-22 00:11:50 (1.11 MB/s) - `/dev/null' saved [104857600/104857600]</p>
<p>wget -O /dev/null http://dallas1.linode.com/100MB-dallas.bin<br />
--2011-09-22 00:12:29--  http://dallas1.linode.com/100MB-dallas.bin<br />
Resolving dallas1.linode.com... 69.164.200.100<br />
Connecting to dallas1.linode.com|69.164.200.100|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 104857600 (100M) [application/octet-stream]<br />
Saving to: `/dev/null'<br />
2011-09-22 00:17:50 (320 KB/s) - `/dev/null' saved [104857600/104857600]</p>
<p> wget -O /dev/null http://fremont1.linode.com/100MB-fremont.bin<br />
--2011-09-22 00:19:56--  http://fremont1.linode.com/100MB-fremont.bin<br />
Resolving fremont1.linode.com... 64.71.152.17<br />
Connecting to fremont1.linode.com|64.71.152.17|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 104857600 (100M) [application/octet-stream]<br />
Saving to: `/dev/null'<br />
2011-09-22 00:24:05 (412 KB/s) - `/dev/null' saved [104857600/104857600]</code></p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/cd6C42F6_Q0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2011/09/22/419/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2011/09/22/419/</feedburner:origLink></item>
		<item>
		<title>阿嬤～謝謝您</title>
		<link>http://feedproxy.google.com/~r/cdsheen/~3/0OHV4C2cIhc/</link>
		<comments>http://blog.urdada.net/2011/01/06/402/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 03:11:02 +0000</pubDate>
		<dc:creator>dada</dc:creator>
				<category><![CDATA[心情小語]]></category>

		<guid isPermaLink="false">http://blog.urdada.net/?p=402</guid>
		<description><![CDATA[從小照顧我長大的阿嬤在去年的最後一天走了，當大家都在準備著跨年倒數的時候，我正開著車奔馳在雪山隧道趕回宜蘭的路上。而這天，正是我的農曆生日，同樣屬牛、與我相差一甲子的阿嬤就在這天走了... 九十八歲的阿嬤在最後幾年其實已經認不得我了。前幾個禮拜回宜蘭探望住院中的阿嬤，爸爸及叔叔伯伯們不忍阿嬤再受痛苦，簽下了不急救同意書，當時就有預感這可能是我最後一次見到阿嬤了。離開醫院前，阿嬤正睡著，我緊緊握著阿嬤的手，想再一次感受她的溫暖... 阿嬤以前總要我幫忙剪指甲，即使我遠在新竹讀書，一個月才回家一次，阿嬤總要撐到我回家才讓我剪，她總是說我剪得細心剪得好... 阿嬤的娘家在南方澳，舅公過世的時候，我陪著阿嬤回南方澳送舅公最後一程，告別式後我牽著她散步在漁港旁邊，阿嬤跟我說起她小時候的事情，說著說著就紅起了眼眶。阿嬤這一生很辛苦，阿嬤的母親很早就過世了，她沒受多少教育就外出工作，與阿公結婚後更是任勞任怨地養大十個兒女，之後也辛苦地照顧我們幾個同住在一起的孫子長大。 老人家的晚年其實是很孤獨的，兒女們都忙著工作，孫子也都外出念書或工作了。電視上播放的大多是阿嬤聽不懂的國語節目，所以阿嬤大多看一些動物節目，偶而看看歌仔戲。阿嬤還喜歡看日本相撲，她受過一點點日本教育，還記得五十音，所以有的相撲選手名字她可以直接念出來。 阿嬤最後幾年因為長年膝蓋關節炎問題，行動越來越不便，記憶也因為失智症問題而快速退化，慢慢的認不得家人了。有時候去探望阿嬤，阿嬤睜著眼睛看著我，我跟她說我是誰，但她卻已經認不得我了.. 很後悔沒在阿嬤認得我的時候多陪陪她，分享她的心情，聽聽她的故事... 親愛的阿嬤，今天是您頭七的日子，謝謝您，您的責任已了，您不再有痛苦，也不用再煩惱，我們都會好好的，請不用再牽掛。 ......]]></description>
			<content:encoded><![CDATA[<p>從小照顧我長大的阿嬤在去年的最後一天走了，當大家都在準備著跨年倒數的時候，我正開著車奔馳在雪山隧道趕回宜蘭的路上。而這天，正是我的農曆生日，同樣屬牛、與我相差一甲子的阿嬤就在這天走了...</p>
<p>九十八歲的阿嬤在最後幾年其實已經認不得我了。前幾個禮拜回宜蘭探望住院中的阿嬤，爸爸及叔叔伯伯們不忍阿嬤再受痛苦，簽下了不急救同意書，當時就有預感這可能是我最後一次見到阿嬤了。離開醫院前，阿嬤正睡著，我緊緊握著阿嬤的手，想再一次感受她的溫暖...</p>
<p>阿嬤以前總要我幫忙剪指甲，即使我遠在新竹讀書，一個月才回家一次，阿嬤總要撐到我回家才讓我剪，她總是說我剪得細心剪得好...</p>
<p>阿嬤的娘家在南方澳，舅公過世的時候，我陪著阿嬤回南方澳送舅公最後一程，告別式後我牽著她散步在漁港旁邊，阿嬤跟我說起她小時候的事情，說著說著就紅起了眼眶。阿嬤這一生很辛苦，阿嬤的母親很早就過世了，她沒受多少教育就外出工作，與阿公結婚後更是任勞任怨地養大十個兒女，之後也辛苦地照顧我們幾個同住在一起的孫子長大。</p>
<p>老人家的晚年其實是很孤獨的，兒女們都忙著工作，孫子也都外出念書或工作了。電視上播放的大多是阿嬤聽不懂的國語節目，所以阿嬤大多看一些動物節目，偶而看看歌仔戲。阿嬤還喜歡看日本相撲，她受過一點點日本教育，還記得五十音，所以有的相撲選手名字她可以直接念出來。</p>
<p>阿嬤最後幾年因為長年膝蓋關節炎問題，行動越來越不便，記憶也因為失智症問題而快速退化，慢慢的認不得家人了。有時候去探望阿嬤，阿嬤睜著眼睛看著我，我跟她說我是誰，但她卻已經認不得我了..</p>
<p>很後悔沒在阿嬤認得我的時候多陪陪她，分享她的心情，聽聽她的故事...</p>
<p>親愛的阿嬤，今天是您頭七的日子，謝謝您，您的責任已了，您不再有痛苦，也不用再煩惱，我們都會好好的，請不用再牽掛。</p>
<p>......</p>
<img src="http://feeds.feedburner.com/~r/cdsheen/~4/0OHV4C2cIhc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.urdada.net/2011/01/06/402/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.urdada.net/2011/01/06/402/</feedburner:origLink></item>
		<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>雖然已經不是在 ISP 業界了，不過看到這則新聞還是有深深的感慨，固然 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>34</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: #339933;">@</span><span style="color: #000000; font-weight: bold;">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>7</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: #339933;">@</span><span style="color: #000000; font-weight: bold;">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: #339933;">@</span><span style="color: #000000; font-weight: bold;">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>
	</channel>
</rss><!-- Dynamic page generated in 1.484 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-04 17:29:54 -->

