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

<channel>
	<title>霧中風景 &#187; 程設</title>
	<atom:link href="http://www.lulalala.com/wordpress/archives/category/%e7%a8%8b%e8%a8%ad/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lulalala.com/wordpress</link>
	<description>總是會慢人家一拍的動漫畫以及遊戲感想</description>
	<lastBuildDate>Fri, 03 Feb 2012 15:34:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>修復首頁</title>
		<link>http://www.lulalala.com/wordpress/archives/2653</link>
		<comments>http://www.lulalala.com/wordpress/archives/2653#comments</comments>
		<pubDate>Fri, 07 Oct 2011 15:53:31 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[日記]]></category>
		<category><![CDATA[程設]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2653</guid>
		<description><![CDATA[因為沒有想到 WordPress 會自行幫我的文章加油添醋，所以原本放在首頁的一些 html 原始碼都在斷行處添加了 &#60;p&#62; 或是 &#60;br&#62; ，導致首頁顯示到一半就出現問題。當初為了告知大家不要用 IE6 就添加了這段程式碼，結果在上次更新 Uniform Renamer 的文章時 WordPress 就自行改壞了首頁，實在是悲劇。看來得想辦法關閉那些 WP 自認為貼心的竄改文章功能，並且把 editor 從 TinyMCE 換到 WYISWYM 編輯器了。 不過過了兩三個月還沒有人說，果然這裡還是很冷……]]></description>
			<content:encoded><![CDATA[<p>因為沒有想到 WordPress 會自行幫我的文章加油添醋，所以原本放在首頁的一些 html 原始碼都在斷行處添加了 &lt;p&gt; 或是 &lt;br&gt; ，導致首頁顯示到一半就出現問題。當初為了告知大家不要用 IE6 就添加了這段程式碼，結果在上次更新 Uniform Renamer 的文章時 WordPress 就自行改壞了首頁，實在是悲劇。看來得想辦法關閉那些 WP 自認為貼心的竄改文章功能，並且把 editor 從 TinyMCE 換到 WYISWYM 編輯器了。</p>
<p>不過過了兩三個月還沒有人說，果然這裡還是很冷……</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2653&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2653&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2653&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2653&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2653&amp;linkname=%E4%BF%AE%E5%BE%A9%E9%A6%96%E9%A0%81" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2653&amp;title=%E4%BF%AE%E5%BE%A9%E9%A6%96%E9%A0%81" id="wpa2a_2">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2653/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>初級資料庫設計</title>
		<link>http://www.lulalala.com/wordpress/archives/2486</link>
		<comments>http://www.lulalala.com/wordpress/archives/2486#comments</comments>
		<pubDate>Wed, 18 May 2011 03:49:52 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[程設]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2486</guid>
		<description><![CDATA[這裡的內容來自我的老師 David White 的課以及他的書 Data Modelling The Foundation of Information Systems。目前沒有附 ERD 圖，所以可能有些地方不是很容易懂。 命名 當命名物件跟屬性時需符合以下規則： 使用單數詞作名字，不用複數詞。這樣子能更容易自動產生正確的描述句（程式可以自動判斷把單數詞改為複數詞）。 只使用一種命名規則（CamelCase 或者 Underscore_Naming），不要混用。 名字要能描述功能，比如說一個紀錄元件安裝時間的欄位該命名為 WhenComponentInstalled 而不只是 WhenInstalled ，不然在範圍外會跟其他要安裝的欄位造成混淆。試著讓文法正確。 當使用某些通用的詞（如 description），應該在詞前面添加形容詞（如 ProductDescription） 當命名屬性時需符合以下規則： 人名欄位的命名使用 GivenName（名）與 FamilyName（姓），這兩個命名沒有文化隔閡，也沒有宗教或禮俗上的含意。使用一般常見的 FirstName 或 LastName 則會導致不同文化上的理解錯誤。 （註：也可考慮提供使用者另外一個欄位，專門存放使用者自己想要看到的姓名） 多添加形容詞以避免混淆。但是在那些 Foreign Key 的欄位，還是該前置該 Key 原來的名字，以便識別。 不要使用像是 "Count" 這樣的 SQL 保留字來命名，因為資料庫不能接受這些名字。 非必要不要用 "Date" 來命名。資料庫系統有 date/time 類型的欄位，而原本設計是 Date 的欄位常會後來要改成 date/time [...]]]></description>
			<content:encoded><![CDATA[<p>這裡的內容來自我的老師 David White 的課以及他的書 Data Modelling The Foundation of Information Systems。目前沒有附 ERD 圖，所以可能有些地方不是很容易懂。</p>
<h2>命名</h2>
<p>當命名物件跟屬性時需符合以下規則：</p>
<ul>
<li>使用單數詞作名字，不用複數詞。這樣子能更容易自動產生正確的描述句（程式可以自動判斷把單數詞改為複數詞）。</li>
<li>只使用一種命名規則（CamelCase 或者 Underscore_Naming），不要混用。</li>
<li>名字要能描述功能，比如說一個紀錄元件安裝時間的欄位該命名為 WhenComponentInstalled 而不只是 WhenInstalled ，不然在範圍外會跟其他要安裝的欄位造成混淆。試著讓文法正確。</li>
<li>當使用某些通用的詞（如 description），應該在詞前面添加形容詞（如 ProductDescription）</li>
</ul>
<p>當命名屬性時需符合以下規則：</p>
<ul>
<li>人名欄位的命名使用 GivenName（名）與 FamilyName（姓），這兩個命名沒有文化隔閡，也沒有宗教或禮俗上的含意。使用一般常見的 FirstName 或 LastName 則會導致不同文化上的理解錯誤。<br />
（註：也可考慮提供使用者另外一個欄位，專門存放使用者自己想要看到的姓名）</li>
<li>多添加形容詞以避免混淆。但是在那些 Foreign Key 的欄位，還是該前置該 Key 原來的名字，以便識別。</li>
<li>不要使用像是 "Count" 這樣的 SQL 保留字來命名，因為資料庫不能接受這些名字。</li>
<li>非必要不要用 "Date" 來命名。資料庫系統有 date/time 類型的欄位，而原本設計是 Date 的欄位常會後來要改成 date/time 。使用 WhenXxxYyy 來命名 date/time 欄位，比如說 WhenEnrolled、WhenContractStarts、WhenContractEnds。</li>
</ul>
<h3>常見的命名問題</h3>
<ul>
<li>使用複數詞作名字</li>
<li>沒有依照大眾普遍接受的方式縮寫</li>
<li>英文大小寫方式不一致</li>
<li>英文動詞時態不一致，如 WhenXxxBegan 相對於 WhenXxxEnds。</li>
<li>名字不夠清楚，如 WhenInstalled 沒有標示安裝什麼東西。</li>
<li>使用太過廣義的詞，如 Description 。</li>
<li>名字欄位使用 LastName、ChristianName 等有文化差異性的命名法。</li>
<li>Foreign Key 的命名沒有前置原表的名字。比如說 Customer 應該改為 AnybodyCustomer ，才能一看就知道這欄位由 Anybody 這個 table 而來。</li>
</ul>
<h2>表格 table 設計</h2>
<p>表格應該代表一個物件不會改變的本質，而不是會改變的狀態。舉例來說，一個學校管理資料庫常常會有學生 Student 與職員 Employee 兩個表格，但是這樣子的設計沒有考量到職員也能來修課當學生的狀況，學生與職員都是一種可變動的身份，所以不應該拿來當作表格名稱。在這個情況使用「人 Person」當作表格的設計會更有彈性，因為「人」是本質，不會隨著時間改變。而會改變的狀態，通常使用一個欄位來表示。</p>
<h3>繼承與類別</h3>
<p>「人」這個概念也有狹義的時候，比如說交易時對象不一定會是人，有時候也是會有公司機關之類的，所以在民法上有「自然人」以及「法人」這兩種概念。在這個時候，使用「Anybody 主體」這個母類別表格，然後下面繼承「Person自然人」「Organization法人」兩種子類別表格，能夠做出更加有彈性的架構。當使用繼承這種機制的時候，要注意幾個事項：</p>
<ol>
<li>子類別必須是永久性的，就如自然人永遠不會變成法人。</li>
<li>子類別必須是母類別之內的，如 Person 跟 Organization 都是 Anybody。</li>
<li>各個子類別的欄位不能完全相同，不然就失去分開類別的意義了。</li>
<li>各個子類別必須有本質上的不同，如自然人是活著的，而法人是概念上的，雖然兩者都能成為簽署合約。</li>
</ol>
<p>相同的繼承概念也能夠使用在「交通工具→汽車、飛機」上。</p>
<h3>時間概念</h3>
<p>萬事都會隨著時間而改變，而資料庫最好是設計成會紀錄這些改變，以便將來能查訊。通常一個事件有開頭也有結尾，以 WhenBegan 還有 WhenEnded 來命名。WhenEnded不會是主鍵，因為主鍵不能為 null。</p>
<h3>對自身的關聯 Recursive Association</h3>
<p>一個表格可以對本身作關聯，比如說管理人這種關係。如果每個人只能有一個管理人，那麼可以直接對表格本身的 PK 作關聯，這被稱為樹狀自身關聯（Tree Recursion）。如果一個人能有複數的管理人，那就必須新增一個 Supervision （管理）表格，有兩個 FK ：PersonBeingSupervised 以及 PersonSupervisor ，這被稱為網路自身關聯（Network Recursion）。</p>
<h3>狀態</h3>
<p>如先前所探討的，事物除了能用不變的本質來區分外，也能用他們的行為或是發生在他們的事情等等依著時間發生的「狀態」來區分。就如同犯罪的人可被歸類為罪犯，簽了員工合約的人成為員工，繳了學費的成為學生。這些被視為狀態的改變，而要對這些狀態作區分就必須紀錄狀態改變的事件。</p>
<p>舉學生報名作為例子，也許我們必須紀錄以下的事件：遞交日、審核日、核可日、取消日等等。如果這些都放在 StudentEnroll 的表格上，那麼以後要增加新的狀態就必須更改整個 ERD 。為了改善這種問題，我們可以把事件集中放在另一個表格中，並且新增一個事件類別的表格。這樣子能讓狀態轉移事件有更大的彈性。</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2486&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2486&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2486&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2486&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2486&amp;linkname=%E5%88%9D%E7%B4%9A%E8%B3%87%E6%96%99%E5%BA%AB%E8%A8%AD%E8%A8%88" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2486&amp;title=%E5%88%9D%E7%B4%9A%E8%B3%87%E6%96%99%E5%BA%AB%E8%A8%AD%E8%A8%88" id="wpa2a_4">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2486/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mozilla 徵求嶄新的使用者留言概念</title>
		<link>http://www.lulalala.com/wordpress/archives/2609</link>
		<comments>http://www.lulalala.com/wordpress/archives/2609#comments</comments>
		<pubDate>Tue, 10 May 2011 08:13:37 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[程設]]></category>
		<category><![CDATA[網路]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2609</guid>
		<description><![CDATA[Mozilla Drumbeat &#124; Beyond Comment Threads Mozilla 基金會最近舉辦網路上公開徵選活動，徵求創新的未來網路新聞概念。這幾個禮拜進入第二個議題：嶄新的使用者留言概念，讓未來的網路新聞的使用者留言能夠更加進化。只要有任何奇特的想法、原型、影片等等都能上傳。而且議題也不限定於科技面，對於社群互動面也是很重要的考慮因素（比如說過濾沒有價值的留言，或者讓少數人的聲音能夠不被多數人掩蓋掉）。甚至只要有新的方法能夠讓使用者與新聞內容互動都可以提出來。 有沒有人有興趣一起想想有什麼好點子，截止日期是5月22日，我可以幫忙翻譯。]]></description>
			<content:encoded><![CDATA[<p><a href="https://drumbeat.org/en-US/challenges/beyond-comment-threads/full">Mozilla Drumbeat | Beyond Comment Threads</a></p>
<p>Mozilla 基金會最近舉辦網路上公開徵選活動，徵求創新的未來網路新聞概念。這幾個禮拜進入第二個議題：嶄新的使用者留言概念，讓未來的網路新聞的使用者留言能夠更加進化。只要有任何奇特的想法、原型、影片等等都能上傳。而且議題也不限定於科技面，對於社群互動面也是很重要的考慮因素（比如說過濾沒有價值的留言，或者讓少數人的聲音能夠不被多數人掩蓋掉）。甚至只要有新的方法能夠讓使用者與新聞內容互動都可以提出來。</p>
<p>有沒有人有興趣一起想想有什麼好點子，截止日期是5月22日，我可以幫忙翻譯。</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2609&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2609&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2609&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2609&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2609&amp;linkname=Mozilla%20%E5%BE%B5%E6%B1%82%E5%B6%84%E6%96%B0%E7%9A%84%E4%BD%BF%E7%94%A8%E8%80%85%E7%95%99%E8%A8%80%E6%A6%82%E5%BF%B5" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2609&amp;title=Mozilla%20%E5%BE%B5%E6%B1%82%E5%B6%84%E6%96%B0%E7%9A%84%E4%BD%BF%E7%94%A8%E8%80%85%E7%95%99%E8%A8%80%E6%A6%82%E5%BF%B5" id="wpa2a_6">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2609/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby 的 Method, lambda, Proc 跟 block</title>
		<link>http://www.lulalala.com/wordpress/archives/2586</link>
		<comments>http://www.lulalala.com/wordpress/archives/2586#comments</comments>
		<pubDate>Tue, 29 Mar 2011 05:54:18 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[程設]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2586</guid>
		<description><![CDATA[中文翻譯 所屬類別 意義 宣告例子 呼叫法 return的效果 參數數量檢查 Method 方法 Method 有名字的 Method def square(n) n ** 2 end method(:square) call 裡面的 return 不會造成上層的方法 return (diminutive returns) 有，數量不同會出現 error lambda Method 無名字的 Method square = lambda { &#124;n&#124; n ** 2 } call 裡面的 return 不會造成上層的方法 return (diminutive returns) 有，數量不同會出現 error Proc 程序片段 Proc 有名字的 Proc [...]]]></description>
			<content:encoded><![CDATA[<table border="0">
<thead>
<tr>
<td></td>
<td>中文翻譯</td>
<td>所屬類別</td>
<td>意義</td>
<td>宣告例子</td>
<td></td>
<td>呼叫法</td>
<td>return的效果</td>
<td>參數數量檢查</td>
</tr>
</thead>
<tbody>
<tr>
<td>Method</td>
<td>方法</td>
<td>Method</td>
<td>有名字的 Method</td>
<td>def square(n)<br />
n ** 2<br />
end</td>
<td>method(:square)</td>
<td>call</td>
<td>裡面的 return 不會造成上層的方法 return<br />
(diminutive returns)</td>
<td>有，數量不同會出現 error</td>
</tr>
<tr>
<td>lambda</td>
<td></td>
<td>Method</td>
<td>無名字的 Method</td>
<td>
<pre><code>square = lambda { |n| n ** 2 }</code></pre>
</td>
<td></td>
<td>call</td>
<td>裡面的 return 不會造成上層的方法 return<br />
(diminutive returns)</td>
<td>有，數量不同會出現 error</td>
</tr>
<tr>
<td>Proc</td>
<td>程序片段</td>
<td>Proc</td>
<td>有名字的 Proc<br />
在很多地方時重複呼叫用</td>
<td>
<pre>square = <code>Proc.new do |n|
  n ** 2
end</code></pre>
</td>
<td></td>
<td>
<pre><code>call</code></pre>
</td>
<td>裡面的 return 會造成上層的方法 return<br />
(因為return成為上層類別的一部分)</td>
<td>無</td>
</tr>
<tr>
<td>block</td>
<td></td>
<td>Proc</td>
<td>無名字的 Proc<br />
只在一個地方時用</td>
<td>
<pre>{|n|
 n ** 2
}</pre>
</td>
<td></td>
<td>yield<br />
用 Proc 的 call 呼叫法</td>
<td>裡面的 return 會造成上層的方法 return<br />
(因為return成為上層類別的一部分)</td>
<td>無</td>
</tr>
</tbody>
</table>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2586&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2586&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2586&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2586&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2586&amp;linkname=Ruby%20%E7%9A%84%20Method%2C%20lambda%2C%20Proc%20%E8%B7%9F%20block" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2586&amp;title=Ruby%20%E7%9A%84%20Method%2C%20lambda%2C%20Proc%20%E8%B7%9F%20block" id="wpa2a_8">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2586/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toolbox Blue: A WordPress Child Theme with HTML5</title>
		<link>http://www.lulalala.com/wordpress/archives/2549</link>
		<comments>http://www.lulalala.com/wordpress/archives/2549#comments</comments>
		<pubDate>Thu, 17 Feb 2011 15:58:54 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[創作]]></category>
		<category><![CDATA[程設]]></category>
		<category><![CDATA[網路]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2549</guid>
		<description><![CDATA[Toolbox Blue 是一個 WordPress 的佈景主題，是個延伸自 Toolbox 的子佈景主題，有著 HTML5 的元素以及 Fluid Blue 的外觀。 Fluid Blue 採用簡單色塊式的佈景風格，沒有使用圖片作裝飾，給予閱讀者極簡的清爽感覺。不過我一直想要使用最新的 HTML5 標籤如 &#60;article&#62; 或是 &#60;nav&#62;，所以決定拿 Toolbox 佈景主題來作改造。因為個人經驗有限，所以寫出來的 CSS 其實亂七八糟的。有些 Fluid Blue 的效果作不出來，有些地方也作了個人喜歡的修改，所以不會 100% 跟 Fluid Blue 一樣，敬請包涵。因為兩個參考的主題都是採用 GPL 授權，所以本佈景主題當然也是如此。想安裝的人請先安裝 Toolbox 主題後再到 Bitbucket 的專頁下載，因為目前的品質很爛所以還不打算放在 WordPress.org 上。目前的 bug 有 menu 位置會往右偏，如果有人知道怎樣修正就敬請指教。 Toolbox Blue is a child theme of the Toolbox theme, which [...]]]></description>
			<content:encoded><![CDATA[<p>Toolbox Blue 是一個 WordPress 的佈景主題，是個延伸自 <a href="http://themeshaper.com/2010/07/02/toolbox-html5-starter-theme/">Toolbox</a> 的子佈景主題，有著 HTML5 的元素以及 <a href="http://srinig.com/wordpress/themes/fluid-blue/">Fluid Blue</a> 的外觀。</p>
<p>Fluid Blue 採用簡單色塊式的佈景風格，沒有使用圖片作裝飾，給予閱讀者極簡的清爽感覺。不過我一直想要使用最新的 HTML5 標籤如 &lt;article&gt; 或是 &lt;nav&gt;，所以決定拿 Toolbox 佈景主題來作改造。因為個人經驗有限，所以寫出來的 CSS 其實亂七八糟的。有些 Fluid Blue 的效果作不出來，有些地方也作了個人喜歡的修改，所以不會 100% 跟 Fluid Blue 一樣，敬請包涵。因為兩個參考的主題都是採用 GPL 授權，所以本佈景主題當然也是如此。想安裝的人請先安裝 Toolbox 主題後再到<a href="https://bitbucket.org/lulalala/toolbox-blue"> Bitbucket 的專頁</a>下載，因為目前的品質很爛所以還不打算放在 WordPress.org 上。目前的 bug 有 menu 位置會往右偏，如果有人知道怎樣修正就敬請指教。</p>
<p>Toolbox Blue is a child theme of the <a href="http://themeshaper.com/2010/07/02/toolbox-html5-starter-theme/">Toolbox</a> theme, which offers HTML5 ready templates. It tries to mimic the Fluid Blue theme, but with some personal design changes. The code is located at <a href="https://bitbucket.org/lulalala/toolbox-blue">Bitbucket<br />
</a> and installing it requires installing the Toolbox theme. The quality of the code is crap so I don&#8217;t want to put it on the official repository yet, but any improvement is welcome. Current known bug includes menu item not in the correct position.</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2549&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2549&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2549&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2549&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2549&amp;linkname=Toolbox%20Blue%3A%20A%20WordPress%20Child%20Theme%20with%20HTML5" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2549&amp;title=Toolbox%20Blue%3A%20A%20WordPress%20Child%20Theme%20with%20HTML5" id="wpa2a_10">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2549/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>線上日式文字冒險遊戲平台</title>
		<link>http://www.lulalala.com/wordpress/archives/2254</link>
		<comments>http://www.lulalala.com/wordpress/archives/2254#comments</comments>
		<pubDate>Sun, 29 Aug 2010 07:32:47 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[程式]]></category>
		<category><![CDATA[程設]]></category>
		<category><![CDATA[網摘]]></category>
		<category><![CDATA[網路]]></category>
		<category><![CDATA[遊戲]]></category>
		<category><![CDATA[AVG]]></category>
		<category><![CDATA[同人]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2254</guid>
		<description><![CDATA[在歐美國家，雖然宅人口不比日本，但是宅人達力卻也跟日本不分軒輊，Ren&#8217;Py 這個開發已久的 AVG 引擎就是歐美人士開發的。它的製作人最近在網路上寫了篇有關於可下載 vs 網路遊玩的遊戲的文章，讀了以後才發現，最近因為 AJAX 技術的進步，所以歐美出現了好多新的日式文字冒險遊戲網路平台。在這些平台上，無論是創作者要撰寫故事，或者玩家要體驗遊戲，都是透過網頁遊覽器來完成。 BASS AVG 遊戲製作平台 vNovel Interactive NovelStream Datesim.org 創作者費用 免費（需用遊戲貨幣BM才能發表） 目前為展示用 免費遊戲免費 付費遊戲收取作品的 30% 收入 站方免費幫創作者移植既有的遊戲。 玩家費用 免費 免費 免費遊戲免費 付費遊戲按創作者規定收取費用 免費遊戲每個 0.5 美元， 積極參與該站的活動可免費遊玩。 編輯 採文字檔腳本方式編輯 目前為展示用 採用直覺式所見即所得的視覺方式編輯 無編輯環境，由站方移植遊戲 語音 無 支援 支援 無 存檔 無 自動讀取上次進度 支援 支援 將網頁作為遊戲的平台有許多好處，比如說： 有收費機制的平台可以有效阻礙盜版。 多人編輯與合作可透過網路完成，減少難度。 因為只需要上網就能玩，再一步縮短與一般大眾的距離，增加淺在客群。 不過 Ren&#8217;Py 的製作人認為，網路遊戲平台的缺點也不少： 無法下載所以無法備份，要是平台垮了，那麼這些創作就從此消失。 [...]]]></description>
			<content:encoded><![CDATA[<p>在歐美國家，雖然宅人口不比日本，但是宅人達力卻也跟日本不分軒輊，Ren&#8217;Py 這個開發已久的 AVG 引擎就是歐美人士開發的。它的製作人最近在網路上寫了篇有關於<a href="http://lemmasoft.renai.us/forums/viewtopic.php?f=4&amp;t=7842" target="_blank">可下載 vs 網路遊玩的遊戲</a>的文章，讀了以後才發現，最近因為 AJAX 技術的進步，所以歐美出現了好多新的日式文字冒險遊戲網路平台。在這些平台上，無論是創作者要撰寫故事，或者玩家要體驗遊戲，都是透過網頁遊覽器來完成。</p>
<table border="0">
<tbody>
<tr>
<td></td>
<td><a href="http://bassavg.com/adinU.php?id=lulalala" target="_blank">BASS AVG 遊戲製作平台</a></td>
<td><a href="http://vnovel.info/" target="_blank">vNovel Interactive</a></td>
<td><a href="http://visualnoveldai.com/novelstream" target="_blank">NovelStream</a></td>
<td><a href="http://www.datesim.org/" target="_blank">Datesim.org</a></td>
</tr>
<tr>
<td>創作者費用</td>
<td>免費（需用遊戲貨幣BM才能發表）</td>
<td>目前為展示用</td>
<td>免費遊戲免費<br />
付費遊戲收取作品的 30% 收入</td>
<td>站方免費幫創作者移植既有的遊戲。</td>
</tr>
<tr>
<td>玩家費用</td>
<td>免費</td>
<td>免費</td>
<td>免費遊戲免費<br />
付費遊戲按創作者規定收取費用</td>
<td>免費遊戲每個 0.5 美元，<br />
積極參與該站的活動可免費遊玩。</td>
</tr>
<tr>
<td>編輯</td>
<td>採文字檔腳本方式編輯</td>
<td>目前為展示用</td>
<td>採用直覺式所見即所得的視覺方式編輯</td>
<td>無編輯環境，由站方移植遊戲</td>
</tr>
<tr>
<td>語音</td>
<td>無</td>
<td>支援</td>
<td>支援</td>
<td>無</td>
</tr>
<tr>
<td>存檔</td>
<td>無</td>
<td>自動讀取上次進度</td>
<td>支援</td>
<td>支援</td>
</tr>
</tbody>
</table>
<p>將網頁作為遊戲的平台有許多好處，比如說：</p>
<ol>
<li>有收費機制的平台可以有效阻礙盜版。</li>
<li>多人編輯與合作可透過網路完成，減少難度。</li>
<li>因為只需要上網就能玩，再一步縮短與一般大眾的距離，增加淺在客群。</li>
</ol>
<p>不過 Ren&#8217;Py 的製作人認為，網路遊戲平台的缺點也不少：</p>
<ol>
<li>無法下載所以無法備份，要是平台垮了，那麼這些創作就從此消失。</li>
<li>除非平台很佛心有開放原始碼，不然在未來，也不能經由模擬器等方式讓遊戲能繼續可玩。</li>
</ol>
<p>不過這些問題也是有些解決之道，比如說開放讓創作者下載備份檔，以及額外開發備份檔的單機播放程式。不過就算是解決了這些問題，最主要的還是在於玩家們的意願。有個創作者 Ayu 舉辦了一個<a href="http://sakevisual.blogspot.com/2010/08/biweekly-poll-online-games.html" target="_blank">網路投票</a>，結果是絕大多數的人還是比較喜歡能下載的單機板遊戲。也許是因為有個可以保存的實體才讓我們有值得花錢的感覺吧。</p>
<p>在我看來，NovelStream 是裡面最成熟的一個平台，不但外觀好看又專業，而且腳本編輯器也比一般的 AVG 引擎還要友善好多，更別說是許多其他的功能（遊戲腳本版本控制、語音與讀檔功能、友善的討論社群環境）。而 vNovel Interactive 雖然目前只是展示用，但是其遊戲體驗也因流暢的圖片轉換還有語音給我很大的好感。</p>
<p>BASS則是讓我有些遺憾，因為這個平台算是最早出現的（三年前就有了），而且還是台灣人開發的，可惜介面沒有繼續發展，而使用客群也沒有複雜化。</p>
<p>這些平台都不是日本人開發的，也許網路這一塊還是日本海外發展的比較蓬勃。我比較推薦的兩個遊戲，一款是 <a href="http://visualnoveldai.com/visualnovels/narcissu" target="_blank">Narcissu</a> ，是幾年前有名的免費同人電子小說。第二個則是 <a href="http://www.sakevisual.com/ripples.html" target="_blank">Ripples</a>，一款英文同人團體製作並配音的電子小說。兩者的完成度都很高，效果也不輸給 Flash。也許這些平台真的是未來同人遊戲的一種可能性。</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2254&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2254&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2254&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2254&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2254&amp;linkname=%E7%B7%9A%E4%B8%8A%E6%97%A5%E5%BC%8F%E6%96%87%E5%AD%97%E5%86%92%E9%9A%AA%E9%81%8A%E6%88%B2%E5%B9%B3%E5%8F%B0" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2254&amp;title=%E7%B7%9A%E4%B8%8A%E6%97%A5%E5%BC%8F%E6%96%87%E5%AD%97%E5%86%92%E9%9A%AA%E9%81%8A%E6%88%B2%E5%B9%B3%E5%8F%B0" id="wpa2a_12">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2254/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Uniform Renamer 檔案更名整理器</title>
		<link>http://www.lulalala.com/wordpress/archives/2226</link>
		<comments>http://www.lulalala.com/wordpress/archives/2226#comments</comments>
		<pubDate>Thu, 05 Aug 2010 14:44:21 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[創作]]></category>
		<category><![CDATA[程設]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2226</guid>
		<description><![CDATA[看著下載資料夾裡的檔案漸漸增加，但是他們的檔名格式又參差不齊，你是否有種衝動想要找天好好把它們分門歸類，但是又覺得寸金難買吋光陰。又或者你辛苦的整理了，最後卻有著浪費時間的空虛感？請試試看這款檔名整理器，本軟體希望能幫助大家省下一半的整理時間。 本軟體的主要功能是整理資料夾與壓縮檔的檔名，而不是為同一套檔案更名編號，這是跟其他更名軟體不一樣的地方。 下載 UniformRenamer0.3.1 自解壓縮檔 基本介紹 更名是由一連串步驟組合而成，步驟有三種： 刪除 複製 更換 在視窗的上半部可以編輯規則表。下半部視窗可以選擇資料夾預覽更名的結果，最後可以選擇檔案進行實際更名。 舉一個簡單的例子： 刪除步驟能刪除舊檔名中的文字，這有助於刪除不需要的資訊，讓其他其他步驟更好處理。請在最後一列輸入要刪除的字眼，不同字眼需用 tab 鍵分開。 複製步驟能從舊檔名抓取文字放在新檔名的指定位置。請在最後一列輸入需要抓取的字眼（多項字眼一樣使用 tab 分開），並且在第三列指定目的地標籤（如&#60;集數&#62;這個標籤在新檔名格式對應到其中一個複製的步驟）。如果有多項字眼，那麼只有第一個被找到的會被複製到新的檔名。 更換步驟能從舊檔名中尋找特定字眼，要是找到了，就在新檔名放置指定的文字。比如說如果舊檔名找到漢化兩個字，程式就能自動在新檔名放置[中]這個詞。請在最後一列輸入需要更換的字眼（多項字眼一樣使用 tab 分開），第四列指定替換文字，最後在第三列只頂目的地標籤即可。 左邊的勾選欄能夠暫時停用某些步驟。要永久刪除步驟時請在該步驟上按滑鼠右鍵。 搜尋字眼（最後一列）輸入多項字眼時需要用 tab 鍵分開。某個字眼除了可以是固定的字串以外，也可以是正規式。舉例來說：(\(C\d{2}\))能夠搜尋到從(C00)到(C99)的文字，這對需要整理同人誌的人會很好用。正規式的搜尋字眼前方要有 &#8216;* &#8216;（一個半形星號加上一個半形空格）。正規式的功能十分強大，詳細內容請查閱相關書籍或者網路資源。 把複製步驟搭配正規式 * .* 十分有用，能把舊檔名所有的文字複製到新檔名。檔名中有些資訊並不易辨別（像是辨別作者/作品），所以只能靠刪除不必要的文字來留下需要的資訊。 步驟範例 「刪除步驟」 我不需要 (一般コミック)，所以使用刪除步驟來把此字串從舊檔名刪除。 上方對應之目的地標籤： 不需填 替換文字： 不需填 搜尋字眼： 要從舊檔名刪除的文字，正規式用，要多個可用 tab 分隔 delete (一般コミック) 「替代步驟」 我想把 (繁體), [漢化] 等等文字統一以 [中] 來表示，而 [中] 會被放在新檔名格式中 &#60;語言&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>看著下載資料夾裡的檔案漸漸增加，但是他們的檔名格式又參差不齊，你是否有種衝動想要找天好好把它們<span style="font-weight: bold;">分門歸類</span>，但是又覺得寸金難買吋光陰。又或者你辛苦的整理了，最後卻有著浪費時間的空虛感？請試試看這款檔名整理器，本軟體希望能幫助大家省下一半的整理時間。</p>
<p>本軟體的主要功能是整理資料夾與壓縮檔的檔名，而不是為同一套檔案更名編號，這是跟其他更名軟體不一樣的地方。</p>
<p><a href="http://sourceforge.net/projects/uniformrenamer/files/UniformRenamer.0.3.1.exe/download">下載 UniformRenamer0.3.1 自解壓縮檔</a></p>
<p><img src="http://i949.photobucket.com/albums/ad335/endofsummer1981/Other/scr1.png" alt="" /></p>
<p><span id="more-2226"></span></p>
<h2 style="font-size: 1.5em;">基本介紹</h2>
<p>更名是由一連串步驟組合而成，步驟有三種：</p>
<ol>
<li>刪除</li>
<li>複製</li>
<li>更換</li>
</ol>
<p>在視窗的上半部可以編輯規則表。下半部視窗可以選擇資料夾預覽更名的結果，最後可以選擇檔案進行實際更名。</p>
<p>舉一個簡單的例子：</p>
<p><a href="http://www.lulalala.com/wordpress/wp-content/uploads/2010/08/tutorial.png"><img class="alignnone size-full wp-image-2301" title="tutorial" src="http://www.lulalala.com/wordpress/wp-content/uploads/2010/08/tutorial.png" alt="" width="600" height="296" /></a></p>
<p><strong>刪除步驟</strong>能刪除舊檔名中的文字，這有助於刪除不需要的資訊，讓其他其他步驟更好處理。請在最後一列輸入要刪除的字眼，不同字眼需用 tab 鍵分開。</p>
<p><strong>複製步驟</strong>能從舊檔名抓取文字放在新檔名的指定位置。請在最後一列輸入需要抓取的字眼（多項字眼一樣使用 tab 分開），並且在第三列指定目的地標籤（如&lt;集數&gt;這個標籤在<em>新檔名格式</em>對應到其中一個複製的步驟）。如果有多項字眼，那麼只有第一個被找到的會被複製到新的檔名。</p>
<p><strong>更換步驟</strong>能從舊檔名中尋找特定字眼，要是找到了，就在新檔名放置指定的文字。比如說如果舊檔名找到<em>漢化</em>兩個字，程式就能自動在新檔名放置<em>[中]</em>這個詞。請在最後一列輸入需要更換的字眼（多項字眼一樣使用 tab 分開），第四列指定替換文字，最後在第三列只頂目的地標籤即可。</p>
<p>左邊的勾選欄能夠暫時停用某些步驟。要永久刪除步驟時請在該步驟上按滑鼠右鍵。</p>
<p>搜尋字眼（最後一列）輸入多項字眼時需要用 tab 鍵分開。某個字眼除了可以是固定的字串以外，也可以是正規式。舉例來說：(\(C\d{2}\))能夠搜尋到從(C00)到(C99)的文字，這對需要整理同人誌的人會很好用。<strong>正規式的搜尋字眼前方要有 &#8216;* &#8216;（一個半形星號加上一個半形空格）。</strong>正規式的功能十分強大，詳細內容請查閱相關書籍或者網路資源。</p>
<p>把複製步驟搭配正規式 * .* 十分有用，能把舊檔名所有的文字複製到新檔名。檔名中有些資訊並不易辨別（像是辨別作者/作品），所以只能靠刪除不必要的文字來留下需要的資訊。</p>
<h2>步驟範例</h2>
<p><span style="font-weight: bold;">「刪除步驟」</span></p>
<p>我不需要 <em>(一般コミック)</em>，所以使用刪除步驟來把此字串從舊檔名刪除。</p>
<table style="width: 583px; height: 57px;" border="0">
<tbody>
<tr>
<td></td>
<td>
<p>上方對應之目的地標籤：</p>
<p>不需填</p>
</td>
<td>
<p>替換文字：</p>
<p>不需填</p>
</td>
<td>
<p>搜尋字眼：</p>
<p>要從舊檔名刪除的文字，正規式用，要多個可用 tab 分隔</p>
</td>
</tr>
<tr>
<td><em>delete</em></td>
<td id="gray" class="gray" style="background-color: #778899;"></td>
<td id="gray" class="gray" style="background-color: #778899;"></td>
<td><em>(一般コミック)</em></td>
</tr>
</tbody>
</table>
<p><span style="font-weight: bold;">「替代步驟」</span></p>
<p>我想把 <em>(繁體), [漢化]</em> 等等文字統一以 <em>[中]</em> 來表示，而 <em>[中]</em> 會被放在新檔名格式中 &lt;語言&gt; 標籤的地方。</p>
<table style="width: 664px; height: 84px;" border="0">
<tbody>
<tr>
<td>replace</td>
<td>
<p>上方對應之目的地標籤：</p>
<p>用來對應到<span style="font-weight: bold;">新檔名格式</span>中替換文字該放的位置。</p>
</td>
<td>
<p>替換文字：</p>
<p>是替換後放在新檔名的文字</p>
</td>
<td>
<p>搜尋字眼：</p>
<p>要替換的目標，可用正規式，要多個可用 tab 分隔</p>
</td>
</tr>
<tr>
<td>replace</td>
<td>&lt;語言&gt;</td>
<td>[中]</td>
<td>(繁體)   [漢化]</td>
</tr>
</tbody>
</table>
<p><span style="font-weight: bold;">「複製步驟」</span></p>
<p>我想要把<em>第X巻</em>中的X取出來，把累贅的字（<span style="font-weight: bold;">第、0、</span><span style="font-weight: bold;">巻</span>）刪掉。</p>
<p>換句話說，我只想要 0 後面的數字。這需要使用正規式， (\d*) 把該數字抓出來，正規式的前面要加上 "* "，以便與一般文字作區隔。</p>
<p>而抓出來的數字會被放在新檔名格式中 &lt;集數&gt; 標籤的地方。</p>
<table style="width: 658px; height: 70px;" border="0">
<tbody>
<tr>
<td>copy</td>
<td>
<p>上方對應之目的地標籤：</p>
<p>用來對應到<span style="font-weight: bold;">新檔名格式</span>中替換文字該放的位置。</p>
</td>
<td>
<p>替換文字：</p>
<p>不需填</p>
</td>
<td>
<p>搜尋字眼：</p>
<p>要複製的文字，可用正規式，要多個可用 tab 分隔</p>
</td>
</tr>
<tr>
<td>copy</td>
<td>&lt;集數&gt;</td>
<td id="gray" class="gray" style="background-color: #778899;"></td>
<td>* 第0?(\d*)巻</td>
</tr>
</tbody>
</table>
<h2>正規式 Regular Expression</h2>
<p>正規式可以說是一種尋找特定字串的規則。可以讓你從一篇文章中找到電話號碼，也能讓你檢查 email 地址有沒有輸入正確。它使用許多符號來表達特殊的文字，比如說 \d 代表數字，*代表重複很多次等等。以下是一些正規式的初學文章：</p>
<p><a href="http://www.cyut.edu.tw/~ckhung/b/re/intro.php">Regexp 是什麼東東?</a></p>
<p><a href="http://www.cyut.edu.tw/~ckhung/b/re/intro.php">通用運算式【一】pattern</a></p>
<p><a href="http://msdn.microsoft.com/zh-tw/library/az24scfc.aspx">正規式各個符號代表的意義</a></p>
<p>正規式可以用在本軟體的「搜尋字眼」欄位（最後一欄），但是在寫正規式的時候必須在該式前面加個 &#8216;* &#8216; （也就是半形的一個星號加上空白）。</p>
<p><span style="line-height: normal; font-size: 12px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"><strong>第0?(\d*)巻</strong></span></p>
<p>上面的例子可以拿來尋找「第X<span style="line-height: normal; font-size: 12px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;">巻」的文字，其中 0 代表字串有 0 這個數字出現，但是 0? 代表這個零是可有可無的。</span></p>
<p>\d 代表一個數目字，而\d* 代表任何位數的數目字。</p>
<p>那為何 \d* 會被括號圈起來呢？這是因為我只想要抓取數目字，而把其他文字丟掉。</p>
<p><strong>中文[化版]?</strong></p>
<p>這個正規式能找到「中文」「中文化」「中文版」這三種文字。? 一樣也是代表前面 [] 中的任何一個文字出現也算。</p>
<p>本程式使用 Microsoft .Net 內建的正規式，所以只能使用 .Net 版的正規式。各種版本的正規式大部分都一樣，但是會有一些不同之處。</p>
<h2>結尾</h2>
<p>本程式目前沒有經過嚴密測試，如有出錯請多多包涵，謝謝使用也請多多提供意見，不管是說明檔（我覺得這份就寫得很爛），規則的建立方法，甚至你想要更改程式（還蠻想試試看多人的Open Source的感覺）等等都行。</p>
<p>希望您使用愉快:)</p>
<h2>更新歷程</h2>
<ul>
<li>0.3.0 以顏色區隔有改變的檔案項目，顯示檔案圖示，改善錯誤訊息。</li>
<li>0.2.3 新增三個設定，能在最後移除多餘的空白以及空括號。</li>
<li>0.2.2 新增日文介面（謝謝舞神論翻譯），修正英文介面問題。</li>
<li>0.2.1 修正步驟表無法更新之問題</li>
<li>0.2.0 新的圖形化步驟介面</li>
</ul>
<p>（第二頁為 0.1 版的舊內容說明，使用新版者不需閱讀。）</p>
<p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2226&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2226&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2226&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2226&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2226&amp;linkname=Uniform%20Renamer%20%E6%AA%94%E6%A1%88%E6%9B%B4%E5%90%8D%E6%95%B4%E7%90%86%E5%99%A8" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2226&amp;title=Uniform%20Renamer%20%E6%AA%94%E6%A1%88%E6%9B%B4%E5%90%8D%E6%95%B4%E7%90%86%E5%99%A8" id="wpa2a_14">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2226/feed</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>程式設計師對於人名的錯誤認知</title>
		<link>http://www.lulalala.com/wordpress/archives/2202</link>
		<comments>http://www.lulalala.com/wordpress/archives/2202#comments</comments>
		<pubDate>Fri, 09 Jul 2010 05:44:40 +0000</pubDate>
		<dc:creator>lulalala</dc:creator>
				<category><![CDATA[程設]]></category>

		<guid isPermaLink="false">http://www.lulalala.com/wordpress/?p=2202</guid>
		<description><![CDATA[在這一篇文章 Falsehoods Programmers Believe About Names: MicroISV on a Shoestring 提到了程式設計師對於名字所保持的錯誤認知，我覺得很有趣，簡單的翻譯了各點。這張清單有些玩笑，也有些項目是使用西歐語系的人們才會有的問題。 每個人都只有一個正式的名字 每個人都只使用一個名字 每個人，在這個時間點，只有一個正式的名字 每個人，在這個時間點，只有使用一個名字 每個人有正好 N 個名字（N可以是任何數量） 每個人的名字都能放進某個訂定數量的空位中 每個人的名字都不會改變 每個人的名字雖然會變，但是只會在特別的一些時候時會變。 每個人的名字都是用 ASCII 編碼寫的。 每個人的名字都是只由一個編碼寫的。 每個人的名字都能對應到 Unicode 字元 人名是有區分（英文）大小寫。 人名沒有區分（英文）大小寫。 有些人的名字有前綴或後綴，但是你能夠安全地忽略這些。 人名不會含有數目字 人名不會全都是（英文）大寫 人名不會全都是（英文）小寫 人名可以排序。所有系統只要使用一樣的排序方法排同批名字，就會得到相同的排序結果。 每個人的姓跟名必須是不同的。 每個人與親戚都使用一樣姓氏。 每個人的人名都是獨一無二的。 每個人的人名幾乎都是獨一無二的。 好吧但是人名應該夠多元，所以不會有百萬個人同用一個名字。 我的系統永遠不用管中國來的名字。 或者是日本名字。 或是韓國名字。 或者是愛爾蘭，英國，美國，西班牙，墨西哥，巴西，秘魯，俄國，瑞典，波札那，南非，千里達，海地，法國，或者是克林貢帝國。這些都有常見卻奇特的命名方式。 那個克林貢帝國只是個玩笑對吧？ 你那該死的文化相對論！在我的社會中，人們至少同意了一套名命標準。 世界上有個能夠無損地把名字轉換後再反轉回來的演算法。（對，只要你的演算法能傳回輸入值。你得一顆星星。） 我可以安全地假設這本髒話字典中不包涵任何人的名字。 每個人的名字都是出生時拿到的。 OK，也許不是出生時，但至少很接近出生時。 好啦，好啦，在出生後一年內。 五年內？ 你在開玩笑，對吧？ 當兩個不同的系統有同一人的資料時，會用這個人的同一個名字。 在一個設計優良的系統中，兩個不同的資料輸入端拿到一個人的名字時，一定會輸入在位元上都相同的字串。 [...]]]></description>
			<content:encoded><![CDATA[<p>在這一篇文章 <a href="http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/" target="_blank">Falsehoods Programmers Believe About Names: MicroISV on a Shoestring</a> 提到了程式設計師對於名字所保持的<strong>錯誤認知</strong>，我覺得很有趣，簡單的翻譯了各點。這張清單有些玩笑，也有些項目是使用西歐語系的人們才會有的問題。</p>
<ol>
<li>每個人都只有一個正式的名字</li>
<li>每個人都只使用一個名字</li>
<li>每個人，在這個時間點，只有一個正式的名字</li>
<li>每個人，在這個時間點，只有使用一個名字</li>
<li>每個人有正好 N 個名字（N可以是任何數量）</li>
<li>每個人的名字都能放進某個訂定數量的空位中</li>
<li>每個人的名字都不會改變</li>
<li>每個人的名字雖然會變，但是只會在特別的一些時候時會變。</li>
<li>每個人的名字都是用 ASCII 編碼寫的。</li>
<li>每個人的名字都是只由一個編碼寫的。</li>
<li>每個人的名字都能對應到 Unicode 字元</li>
<li>人名是有區分（英文）大小寫。</li>
<li>人名沒有區分（英文）大小寫。</li>
<li>有些人的名字有前綴或後綴，但是你能夠安全地忽略這些。</li>
<li>人名不會含有數目字</li>
<li>人名不會全都是（英文）大寫</li>
<li>人名不會全都是（英文）小寫</li>
<li>人名可以排序。所有系統只要使用一樣的排序方法排同批名字，就會得到相同的排序結果。</li>
<li>每個人的姓跟名必須是不同的。</li>
<li>每個人與親戚都使用一樣姓氏。</li>
<li>每個人的人名都是獨一無二的。</li>
<li>每個人的人名<em>幾乎</em>都是獨一無二的。</li>
<li>好吧但是人名應該夠多元，所以不會有百萬個人同用一個名字。</li>
<li>我的系統永遠不用管中國來的名字。</li>
<li>或者是日本名字。</li>
<li>或是韓國名字。</li>
<li>或者是愛爾蘭，英國，美國，西班牙，墨西哥，巴西，秘魯，俄國，瑞典，波札那，南非，千里達，海地，法國，或者是克林貢帝國。這些都有常見卻奇特的命名方式。</li>
<li>那個克林貢帝國只是個玩笑對吧？</li>
<li>你那該死的文化相對論！在<strong>我的社會</strong>中，人們至少同意了一套名命標準。</li>
<li>世界上有個能夠無損地把名字轉換後再反轉回來的演算法。（對，只要你的演算法能傳回輸入值。你得一顆星星。）</li>
<li>我可以安全地假設這本髒話字典中不包涵任何人的名字。</li>
<li>每個人的名字都是出生時拿到的。</li>
<li>OK，也許不是出生時，但至少很接近出生時。</li>
<li>好啦，好啦，在出生後一年內。</li>
<li>五年內？</li>
<li>你在開玩笑，對吧？</li>
<li>當兩個不同的系統有同一人的資料時，會用這個人的同一個名字。</li>
<li>在一個設計優良的系統中，兩個不同的資料輸入端拿到一個人的名字時，一定會輸入在位元上都相同的字串。</li>
<li>那些名字能把我系統弄壞的人是奇怪的異類。他們應該有個像是「田中太郎」一樣可接受的名字。（譯註：這是在英文句子裡插入日文的常用名字，反而變得不常用）</li>
<li>每個人都有名字。</li>
</ol>
<p>之後的回應還加了幾條：</p>
<ul>
<li>人名不會含有標點符號</li>
<li>人名不會含有除了單引號外的標點符號</li>
<li>每個人在不同國家的名字都一樣</li>
<li>每個人只能有一個社會地位稱謂（在德國，有兩個學位的人會用兩個 Dr 表示）</li>
<li>每個人都有姓跟名</li>
<li>名字一定有兩個字母以上</li>
</ul>
<p>還有一些奇怪名字的人</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Nicholas_Barbon" target="_blank">Nicholas If-Jesus-Christ-Had-Not-Died-For-Thee-Thou-Hadst-Been-Damned  Barbon</a>（奇特的宗教性質中間名）</li>
<li><a href="http://en.wikipedia.org/wiki/Prince_%28musician%29" target="_blank">那個原本叫做 Prince 的人</a>（原本叫做 Prince 的知名音樂家，自己後來改名為一個不能發音的符號，導致大家開始這樣稱呼他）</li>
<li><a href="http://en.wikipedia.org/wiki/N%C7%83xau" target="_blank">Nǃxau</a> 演上帝也瘋狂的主角</li>
<li><a href="http://en.wikipedia.org/wiki/Agust%C3%ADn_Lara" target="_blank">Ángel Agustín María Carlos Fausto Mariano Alfonso del Sagrado Corazón de Jesús Lara y Aguirre del Pino</a></li>
<li>Standing beside the road waiting for a bus</li>
</ul>
<p>在 Slashdot 上的<a href="http://developers.slashdot.org/story/10/06/17/2347257/Falsehoods-Programmers-Believe-About-Names?from=rss" target="_blank">討論</a>中，有幾個人提到了解決的方法：不要把名字特別區分為姓跟名分開來儲存，而是讓使用者直接輸入完整的姓名，存在一個 Unicode 的文字欄位中。此外也提供另一個文字欄位，讓使用者輸入他的日常生活常用名。而系統可以在法律需要時使用完整姓名，而在一般問候時使用常用名稱。</p>
<p>雖然這張清單有很多都是極端的例子，不過我覺得最重要的，還是「人名不會含有除了單引號外的標點符號」這條。有像是 O&#8217;Raily 之類名字的人，常常會因為 SQL injection 的因故，而不能在網站上使用自己正確的名字。程式設計師在處理姓名時，還是應該使用正確的方式好好處理標點符號，而不是直接把他們拒絕掉。</p>
<p><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2202&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2202&amp;size=medium&amp;count=false" scrolling="no" style="border:none;overflow:hidden;width:32px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2202&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2202&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><a class="a2a_button_plurk" href="http://www.addtoany.com/add_to/plurk?linkurl=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2202&amp;linkname=%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88%E5%B8%AB%E5%B0%8D%E6%96%BC%E4%BA%BA%E5%90%8D%E7%9A%84%E9%8C%AF%E8%AA%A4%E8%AA%8D%E7%9F%A5" title="Plurk" rel="nofollow" target="_blank"><img src="http://www.lulalala.com/wordpress/wp-content/plugins/add-to-any/icons/plurk.png" width="16" height="16" alt="Plurk"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.lulalala.com%2Fwordpress%2Farchives%2F2202&amp;title=%E7%A8%8B%E5%BC%8F%E8%A8%AD%E8%A8%88%E5%B8%AB%E5%B0%8D%E6%96%BC%E4%BA%BA%E5%90%8D%E7%9A%84%E9%8C%AF%E8%AA%A4%E8%AA%8D%E7%9F%A5" id="wpa2a_16">轉貼分享</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.lulalala.com/wordpress/archives/2202/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

