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

<channel>
	<title>Kanru&#039;s 探險日誌 &#187; Hack</title>
	<atom:link href="http://blog.kanru.info/archives/tag/hack/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.kanru.info</link>
	<description>當發現美好的事物時，所要做的第一件事，就是把它分享給所有人</description>
	<lastBuildDate>Sun, 23 May 2010 09:51:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Emesene &amp; SQL Optimization</title>
		<link>http://blog.kanru.info/archives/330</link>
		<comments>http://blog.kanru.info/archives/330#comments</comments>
		<pubDate>Wed, 17 Sep 2008 14:27:00 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[emesene]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[msn]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlite]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=330</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>最近都是用 <a href="http://www.emesene.org">emesene</a> 上 MSN，不過他的啟動速度實在是非常慢，啟動的時候硬碟燈狂閃，判斷應該是在讀取聯絡人的資料快取。先用 python profiler 跑過一次，結果果然是 Logger.py 裡面從 sqlite 撈資料的函式在慢。</p>

<p>大小約 17MB 的 db，每個 query 竟然都要一秒以上，難怪 emesene 啟動要這麼久了。就來幫 emesene 最佳化一下 sql 吧。</p>

<p>以底下這個 query 為例：</p>

<p><pre lang="sql">
    select e.stamp, ue.data 
    from event e, user_event ue, user u
    where e.id = ue.id_event and
    u.id = ue.id_user and
    e.name = "status-changed" and
    u.account = "%s"
    order by e.stamp desc
    limit 1
</pre>
結果是
<pre lang="c">
1221129396.22343|NLN
CPU Time: user 1.173822 sys 0.023997
</pre></p>

<p>用 explain query plan 看看</p>

<p><pre lang="c">
    0|1|TABLE user_event AS ue
    1|0|TABLE event AS e USING PRIMARY KEY
    2|2|TABLE user AS u USING PRIMARY KEY
</pre></p>

<p>應該是先把 user_event 與 event, user 三個 table join 在一起，最後再檢查 e.name 與 u.account。</p>

<p>來看看三個 table 的大小</p>

<ul>
<li>user_event: 180801 row</li>
<li>event: 192968 row</li>
<li>user: 196 row</li>
</ul>

<p>這樣 join 起來是多大的 table 呀</p>

<p>先試試改寫 from clause 裡的順序
<pre lang="sql">
    select e.stamp, ue.data 
    from user u, event e, user_event ue
    where e.id = ue.id_event and
    u.id = ue.id_user and
    e.name = "status-changed" and
    u.account = "%s"
    order by e.stamp desc
    limit 1
</pre>
結果是
<pre lang="c">
    1221129396.22343|NLN
    CPU Time: user 0.485926 sys 0.008998
</pre>
很好，時間少了一半，explain query plan 顯示
<pre lang="c">
    0|2|TABLE user_event AS ue
    1|0|TABLE user AS u USING PRIMARY KEY
    2|1|TABLE event AS e USING PRIMARY KEY
</pre>
如果幫 user_event 建個 index 呢？
<pre lang="sql">
    create index ueiduser on user_event(id_user);
</pre>
再 query 一次
<pre lang="c">
    1221129396.22343|NLN
    CPU Time: user 0.017997 sys 0.004999
</pre>
快了非常多吧！explain query plan 顯示：
<pre lang="c">
    0|0|TABLE user AS u
    1|1|TABLE user_event AS ue WITH INDEX ueiduser
    2|2|TABLE event AS e USING PRIMARY KEY
</pre>
這是因為 sqlite 會以 from clause 的第一個當作 outer loop，所以我把數量最小的 user 移到前面，再適當的建立 index，使得 query 的速度快了 100 倍&#8230;</p>

<p>參考</p>

<ul>
<li><a href="http://www.sqlite.org/optoverview.html">http://www.sqlite.org/optoverview.html</a></li>
<li><a href="http://www.sqlite.org/cvstrac/wiki?p=QueryPlans">http://www.sqlite.org/cvstrac/wiki?p=QueryPlans</a></li>
</ul>

<p>Patch <a href="http://people.debian.org.tw/~koster/misc/emesene_sqlquery_optimization.diff">在此</a></p>

<p>Emesene svn trunk 已經收錄最新 patch <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/330/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ConTeXt 學習筆記， Using MkIV</title>
		<link>http://blog.kanru.info/archives/327</link>
		<comments>http://blog.kanru.info/archives/327#comments</comments>
		<pubDate>Tue, 16 Sep 2008 14:07:00 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[ctex]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[luatex]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=327</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img src="http://people.debian.org.tw/~koster/context/2008-09-16-213146_518x146_scrot.png" alt="ctxnotes"/></p>

<p>以下是在 <a href="http://bbs.ctex.org">CTeX 論壇</a>看到的對 ConTeXt 的評論，我覺得描述的十分貼切</p>

<blockquote>
  <p>我的理解，ConTeXt 秉承 Plain TeX 的思路和语法，是用于专门的“排版”的软件；而 LaTeX 则比较复杂，其结构化有时往往是加了许多限制，用于“写文档”的软件。
  也就是说，期刊理应用 LaTeX 而不是 ConTeXt，因为前者的标准、结构性特征。而如果是排版书籍或个人化的东西，或许 ConTeXt 更适合。
  <span style="float:right"><a href="http://bbs.ctex.org/viewthread.php?tid=45237&amp;page=1&amp;fromuid=69904#pid319890">CTeX &#8212; milksea</a></span></p>
</blockquote>

<p><a href="http://blog.kanru.info/archives/274">一年前</a>(時間過的好快！)稍稍研究了 ConTeXt 與 LuaTeX 的搭配，如今 ConTeXt MkIV 已經比當時更加的成熟，要使用多國語言簡單得多了。Li Yanrui 整理了一份 ConTeXt 的學習筆記，裡面包括了 TeX 與 ConTeXt 的簡介、ConTeXt MkIV 的安裝、ConTeXt 的文檔架構與基本命令，想要一窺究竟 ConTeXt 是在做甚麼，可以參考看看。</p>

<p>以下檔案是使用 2008/9/10 的 ConTeXt Minimals 加上一點小修改後編譯，使用的字型是 cwTeX 明體、cwTeX 粗黑體、cwTeX 楷書。</p>

<p>若要嘗試編譯此檔案者需注意</p>

<ol>
<li>ConTeXt 需<a href="http://people.debian.org.tw/~koster/context/punct-tw.diff">修改</a>以符合台灣地區標點符號擺放特性，詳細的 patch 整理之後會提交上去。</li>
<li>LuaTeX 目前還是 beta，編譯時可能會遇到各種困難，尤其是容易發生記憶體不足的情況，建議記憶體有 1G 以上才可嘗試。</li>
</ol>

<ul>
<li>md5: c2fa8602dbcd6821870e5df374d67361 <a href="http://people.debian.org.tw/~koster/context/ctxnotes-zh-tw.pdf">繁體 ctxnotes</a></li>
<li>md5: ccfd8de4964778e82cf83bf31d382869 <a href="http://people.debian.org.tw/~koster/context/ctxnotes-zh-tw.zip">繁體 ctxnotes 原始檔</a></li>
</ul>

<p>原始文件為 Li Yanrui 整理，我只是轉譯為繁體版本。原始版本可以在 <a href="http://code.google.com/p/ctxnotes/">http://code.google.com/p/ctxnotes/</a> 取得。</p>

<p>PS.</p>

<p>不知為什麼這個版本編出來的 pdf 檔案大小特大&#8230; 足足有 3 MiB 多</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/327/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ConTeXt + LuaTeX + Chinese</title>
		<link>http://blog.kanru.info/archives/274</link>
		<comments>http://blog.kanru.info/archives/274#comments</comments>
		<pubDate>Sun, 26 Aug 2007 09:57:26 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/274</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>最近這幾天玩了一下 <a href="http://wiki.contextgarden.net/">ConTeXt</a>，搭配最近開始 beta 的 <a href="http://www.luatex.org/">LuaTeX</a>，想辦法設定中文，有了小小的成果……</p>

<p>請參考這個<a href="http://people.debian.org.tw/~koster/context/howto.pdf">文件</a>，<a href="http://people.debian.org.tw/~koster/context/howto.tex">原始檔</a>。</p>

<p>因為急著要跟大家分享，所以可能寫的不是很清楚或有所遺漏，還請不吝指教 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>

<p>持續測試、改版中。</p>

<p>PS. 文中不能複製貼上的部份放在下面
<pre>
$ export TEXMFCNF=/usr/share/texmf/web2c
$ export TEXMF='{/usr/share/texmf,/usr/share/texmf-texlive,/home/kanru/texmf}'
$ export TEXMFCACHE=/tmp
$ export OSFONTDIR='{/usr/share/fonts/truetype,/home/kanru/.fonts}'
</pre></p>

<hr />

<p><pre>
\enableregime[utf]
\usemodule[chi-00]
\directlua0{
    function wrap(str)
        rt = ''
        for u in string.utfvalues(str) do
            up = math.ceil(u / 0x100)
            low = u - math.ceil(u / 0x100) * 0x100
            if u &lt; 127 then % need to be replace by cjk range
                rt = rt .. unicode.utf8.char(u)
            else
                rt = rt .. '&#92;lookaheaduchar{' .. up ..'}{' .. low ..'}'
            end
        end
        return rt
    end
    callback.register('process_input_buffer', wrap)
}
\beginLUATEX\insertunicodeglyph
   \unexpanded\def\insertunicodeglyph
   {\doinsertunicodeglyph\unicodeone\unicodetwo}
   \unexpanded\def\doinsertunicodeglyph#1#2%
   {\char\numexpr(#2+(#1*256))\relax}
\endLUATEX
\def\en#1{%
   \hskip\chinesesurroundskip
   \hskip\chineseinterglyphskip\relax
   #1%
   \hskip\chineseinterglyphskip\relax
   \hskip\chinesesurroundskip
   \hskip\chinesesurroundskip
   \hskip\chinesesurroundskip
   \hskip\chinesesurroundskip
   \hskip\chinesesurroundskip
   \hskip\chinesesurroundskip
   \hskip\chinesesurroundskip
   \ignorespaces
}
\starttypescript [sans] [cwheib] [name]
    \definefontsynonym [Sans]              [cwheib]
    \definefontsynonym [SansItalic]        [cwheib]
    \definefontsynonym [SansSlanted]       [cwheib]
    \definefontsynonym [SansBold]          [cwheib]
    \definefontsynonym [SansBoldSlanted]   [cwheib]
    \definefontsynonym [SansBoldItalic]    [cwheib]
\stoptypescript
\starttypescript [my] [cwheib]
    \definetypeface [cwheib][ss][sans][cwheib][default]
\stoptypescript
\usetypescript[my][cwheib]
\setupbodyfont[cwheib,ss,10pt]
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/274/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>有圖的水銀</title>
		<link>http://blog.kanru.info/archives/273</link>
		<comments>http://blog.kanru.info/archives/273#comments</comments>
		<pubDate>Tue, 14 Aug 2007 08:40:06 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/273</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>根據 <a href="http://blog.seety.org/everydaywork/">yungyuc</a> 的<a href="http://blog.seety.org/everydaywork/2007/5/19/676/">有圖的水銀</a>這篇，裝了 ActiveTCL 之後，終於把 hgk 在 Windows 上給跑了起來，不過我一直很好奇的是，Windows 版的 Python installer 預設會安裝 tcl/tk 的 module Tkinter 跟相關的 dll，難道不能用這個來跑 hgk 嗎？</p>

<p>原本是想把 hgk 一行一行搬到 python，不過這樣太慢了，後來發現有 Tkinter.Tk.eval 可以用</p>

<p>剛剛做了一下實驗，證明以下 code 可以執行：
<pre></pre></p>

<h1>run-hgk.py</h1>

<p>import sys
import Tkinter</p>

<h1>read hgk file</h1>

<p>hgk = ''.join(open('hgk', 'r').readlines())
tk = Tkinter.Tk()
tk.eval('set argv [list ' + ' '.join(sys.argv[1:]) + ']')
tk.eval('set env(HG) "hg"')
try:
    tk.eval(hgk)
    tk.mainloop()
except Tkinter.TclError, e:
    print e
</p>

<p>不過要真的可以用，還要改一下路徑的處理跟環境變數的取得 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<p>接下來，想要真的把 hgk port 到 python，現在的 hgk 幾乎是 copynpaste gitk，連 help menu 裡面都沒改過，程式裡面還參考到 GIT_DIR 環境變數&#8230; Orz</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/273/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>org.freedesktop.Notifications</title>
		<link>http://blog.kanru.info/archives/250</link>
		<comments>http://blog.kanru.info/archives/250#comments</comments>
		<pubDate>Thu, 31 Aug 2006 20:13:34 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/250</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>這東西可有趣了，freedesktop 定義了這個 dbus 介面，只要有支援的程式都可以透過它來顯示 notifywindow，比如說，我可以簡單的幫 xchat 加上有人跟我說話時自動提醒的 <a href="http://people.debian.org.tw/~koster/misc/xchat-notify.py">plugin</a>。</p>

<p><a href="http://www.flickr.com/photos/kanru/230322220/" title="Photo Sharing"><img src="http://static.flickr.com/57/230322220_282dbb81e8_o.png" width="434" height="351" alt="org.freedesktop.Notifications" /></a></p>

<p>下載這隻 <a href="http://people.debian.org.tw/~koster/misc/xchat-notify.py">plugin</a> 後只需要把它放在 <code>$HOME/.xchat2/</code> 底下，這樣每次開啟 xchat 時就會自動讀取了。它目前還很簡單，如果要設定圖示或是顯示樣式或秒數等等，自己看 code 改應該很快 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<p>其中 class Notification 是從<a href="http://blognote-info.com/index.php?2006/03/31/387-notification-framework">這裡</a>抄來的。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/250/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fancy Conversation Layout of Gaim</title>
		<link>http://blog.kanru.info/archives/246</link>
		<comments>http://blog.kanru.info/archives/246#comments</comments>
		<pubDate>Sat, 19 Aug 2006 18:19:19 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/246</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>從以前就覺得 gaim 的 conversaiton 的視窗做的像 irc 的樣子很奇怪，因為有時候對方會發送多行訊息，這時候在 gaim 的視窗中就會斷的很奇怪，或是有人同時發送多個訊息時，視窗一大部分都被 nick 佔滿了。</p>

<p>所以才會出現底下這個 hack，把 gaim 的文字多做了一層縮排，單獨顯示，每個人每次的發言會串連在一起，而不是每次顯示一行。</p>

<p><a href="http://www.flickr.com/photos/kanru/218984783/" title="Photo Sharing"><img src="http://static.flickr.com/82/218984783_cc32826522_m.jpg" width="240" height="200" alt="Fancy MSN layout of gaim." /></a></p>

<p>BTW, gaim 的 <a href="http://gaim.sourceforge.net/faq.php">faq</a> 提到<a href="http://gaim.sourceforge.net/faq.php#q14">不要使用 SVN 版</a>，不過我改了 code，所以應該可以用吧？wahaha</p>

<p><em>Update</em>:</p>

<p>補上 [3] 的連結 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>

<p>這個 patch 只能用在 svn trunk 的 gaim 喔，不會用的，最好先看一下上面那個 faq XD</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/246/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tomboy Plugin &#8211; CJKDisableSpell</title>
		<link>http://blog.kanru.info/archives/239</link>
		<comments>http://blog.kanru.info/archives/239#comments</comments>
		<pubDate>Mon, 10 Jul 2006 06:36:30 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Hack]]></category>
		<category><![CDATA[tomboy]]></category>
		<category><![CDATA[中文]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/239</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>平常已經習慣使用 <a href="http://www.beatniksoftware.com/tomboy/">Tomboy</a> 來記東西，介面還算好用，隨時都可以開新 Note 或是搜尋舊的 Note。用到現在唯一不滿意的地方是 tomboy 會對文章做 spelling check，無論內容是什麼，結果就是中文的 Note 會變成滿江紅。</p>

<p>花了一點時間寫了這個 plugin，可以針對 CJK 的部份取消 spelling check，效果還滿不錯 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>使用前：</p>

<p><a href="http://www.flickr.com/photos/kanru/186207939/" title="Photo Sharing"><img src="http://static.flickr.com/48/186207939_bff3e94537_o.png" width="350" height="252" alt="Screenshot" /></a></p>

<p>使用後：</p>

<p><a href="http://www.flickr.com/photos/kanru/186207940/" title="Photo Sharing"><img src="http://static.flickr.com/74/186207940_828e2c7a3d_o.png" width="351" height="253" alt="Screenshot-1" /></a></p>

<p>使用方法，下載 <a href="http://people.debian.org.tw/~koster/misc/CJKDisableSpellPlugin.cs">CJKDisableSpellPlugin.cs</a> 後自己編譯：</p>

<pre><code>    mcs -t:library CJKDisableSpellPlugin.cs -r:/usr/lib/tomboy/Tomboy.exe -pkg:gtk-sharp-2.0
</code></pre>

<p>或是直接下載編譯好的 <a href="http://people.debian.org.tw/~koster/misc/CJKDisableSpellPlugin.dll">CJKDisableSpellPlugin.dll</a></p>

<p>將 dll 放置在 <code>~/.tomboy/Plugins/</code> 後，重新啟動 Tomboy 即可。</p>

<p>2008-12-08 Update:</p>

<p>tomboy 從 0.7 版以後改用 mono addin 架構，更新的程式在</p>

<p><a href="http://github.com/kanru/tomboy-cjk-disable-spellcheck/">http://github.com/kanru/tomboy-cjk-disable-spellcheck/</a></p>

<p>也可以直接下載 <a href="http://people.debian.org.tw/~koster/misc/CJKDisableSpellAddin.dll">CJKDisableSpellAddin.dll</a></p>

<p>不過我沒有仔細測試過，使用時可能會遇到問題。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/239/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>壓榨你的電腦</title>
		<link>http://blog.kanru.info/archives/223</link>
		<comments>http://blog.kanru.info/archives/223#comments</comments>
		<pubDate>Mon, 08 May 2006 17:06:54 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/223</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>感謝 Optical-dlz 提供的這個網址 <a href="http://linux-phc.sourceforge.net/">Linux-PHC</a>，這個計畫提供了可以在 runtime 改變 speedstep 各個階段的電壓的 patch..</p>

<p>之前使用從 -mm kernel 裡面拿出來的 patch 只包含了 intel spec 中提供的保證工作電壓，是安全數值而比真正最低電壓還高一點，Linux-PHC 這個 patch 也預設了這個值，只是還可以在 runtime 手動調整為更低的數值。</p>

<p>經過不斷的測試，終於找出一組我的電腦可以接受的最低電壓.. 結果還不錯，在 600 MHz 還有 800 MHz 的時候都可以用最低電壓 700 mV 來跑&#8230; 15000 MHz 的時候也只有 940 mV，比原本 600 MHz 用的 988 mV 還低。比這組數值再低一點雖然還可以正常開機，但是在某些情況下會出現奇怪的 error 像是 kernel oops 或是 gcc internal error .. 所以後來挑選了一組比較高的，用 compile scim 來測試，目前還滿穩定的 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<p>經過這翻調整，目前使用電池在一般工作環境下，可以持續使用 4.5 小時.. 算是非常不錯的成果 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/223/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Cairo Clock without composite manager</title>
		<link>http://blog.kanru.info/archives/249</link>
		<comments>http://blog.kanru.info/archives/249#comments</comments>
		<pubDate>Mon, 01 May 2006 02:08:50 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=249</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://macslow.thepimp.net/?page_id=23">cairo-clock</a> from <a href="http://macslow.thepimp.net/">MackSlow</a> is indeed has very good look and feel. But it&#8217;s transparent background is depend on cairo&#8217;s alpha channel and Xorg&#8217;s composite extension. I did not enable this extension defautly because gnome doesn&#8217;t have it&#8217;s own composite manager and rely on xcompmgr. But xcompmgr always cause gnome-panel to be overlayed by other window. Then I think, “this clock almost won&#8217;t move after it was lauched, why not make a fake transparent background for it?” So that&#8217;s it, the screenshot:</p>

<p><a href="http://www.flickr.com/photos/kanru/228389505/" title="Photo Sharing"><img src="http://static.flickr.com/58/228389505_5c1b6e989b_o.png" width="393" height="309" alt="Cairo Clock" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/249/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Summer of Code 2006</title>
		<link>http://blog.kanru.info/archives/218</link>
		<comments>http://blog.kanru.info/archives/218#comments</comments>
		<pubDate>Mon, 17 Apr 2006 16:57:58 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Hack]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/218</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/summerofcode.html">Google Summer of Code</a> 又來了，獎金可觀的 Google Summer of Code 今年也有舉辦，這是個由 google 贊助的學生 open source 計畫，去年的計畫有許多成功的案例，今年，各個組織也紛紛開始丟出題目。</p>

<p>jserv 提供了兩個網址，分別是 <a href="http://gcc.gnu.org/java/projects.html">GCJ</a> 的和 <a href="http://developer.classpath.org/mediation/ClasspathOpenTasks#head-2e9597e0ba49cf0e3b1a1ddd4ab9ae7218d4ea91">GNU Classpath</a> 的。</p>

<p>有興趣的學生可以趕快報名參加！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/218/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
