<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Grissiom's page</title><description></description><managingEditor>noreply@blogger.com (grissiom)</managingEditor><pubDate>Tue, 25 Mar 2025 17:59:20 -0700</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">33</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://grissiom.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle/><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>Konsole 里 Session Profile 命令的解析过程</title><link>http://grissiom.blogspot.com/2011/09/2.html</link><category>Konsole</category><category>vim</category><author>noreply@blogger.com (grissiom)</author><pubDate>Thu, 1 Sep 2011 02:30:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-2572168395126904084</guid><description>&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&lt;img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/cn/88x31.png" /&gt;&lt;/a&gt;&lt;br /&gt;&amp;#26412;&amp;#20316;&amp;#21697;&amp;#37319;&amp;#29992;&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&amp;#30693;&amp;#35782;&amp;#20849;&amp;#20139;&amp;#32626;&amp;#21517;-&amp;#38750;&amp;#21830;&amp;#19994;&amp;#24615;&amp;#20351;&amp;#29992; 2.5 &amp;#20013;&amp;#22269;&amp;#22823;&amp;#38470;&amp;#35768;&amp;#21487;&amp;#21327;&amp;#35758;&lt;/a&gt;&amp;#36827;&amp;#34892;&amp;#35768;&amp;#21487;&amp;#12290;

&lt;!-- vim:sw=4:ft=rst:tw=80 --&gt;
&lt;!-- This work is released under `Attribution-Noncommercial 2.5 China Mainland Creative Commons` License --&gt;
&lt;!-- 本作品以“署名-非商业性使用 2.5 中国大陆 Creative Commons” 许可证发布 --&gt;
&lt;p&gt;如果没有强大的动力，我基本是不会主动去读 C++ 的源代码的。事情的起因其实很简单， 就是 &lt;a class="reference external" href="http://blog.zhangsen.org"&gt;Jesse&lt;/a&gt; 在 &lt;a class="reference external" href="mailto:#beihang-osc&amp;#64;freenode.net"&gt;#beihang-osc&amp;#64;freenode.net&lt;/a&gt; 上吼，想在 gnome-terminal 里不用 gconf 实现 &lt;a class="reference external" href="http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes"&gt;http://vim.wikia.com/wiki/Change_cursor_shape_in_different_modes&lt;/a&gt; 里的效果。他想 看看 Konsole 是怎么实现的。作为伪 KDE 控的我当然不能放过这个机会啦……&lt;/p&gt;

&lt;p&gt;第一步是从 anongit.kde.org 上 clone konsole 的源代码。无他，主要是为了打 patch 方便和那个无比好用的 &lt;tt class="docutils literal"&gt;git grep&lt;/tt&gt; ;P 写这篇文章的时候 git HEAD 是 d6ca64fe4d。&lt;/p&gt;

&lt;p&gt;然后这逛那逛的也一直没有头绪。忽然想，那个指令不是 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;&amp;quot;\&amp;lt;Esc&amp;gt;]50;CursorShape=1\x7&amp;quot;&lt;/span&gt;&lt;/tt&gt; 和 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;&amp;quot;\&amp;lt;Esc&amp;gt;]50;CursorShape=0\x7&amp;quot;&lt;/span&gt;&lt;/tt&gt; 么，干脆 &lt;tt class="docutils literal"&gt;git grep &lt;span class="pre"&gt;-n&lt;/span&gt; ']50'&lt;/tt&gt; 试试。嘿，还真找到了:&lt;/p&gt;

&lt;pre&gt;
src/Part.cpp:276: buffer.append(&amp;quot;\033]50;&amp;quot;).append(text.toUtf8()).append('\a');
src/konsoleprofile:3:/bin/echo -e &amp;quot;\033]50;$1\a&amp;quot;
lines 1-2/2 (END)
&lt;/pre&gt;

&lt;p&gt;火速去 src/Part.cpp 第 276 行看:&lt;/p&gt;

&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; Part&lt;span style='color:#406080; '&gt;::&lt;/span&gt;changeSessionSettings&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;const&lt;/span&gt; QString&lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt; text&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;// send a profile change command, the escape code format&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;// is the same as the normal X-Term commands used to change the window title or icon,&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;// but with a magic value of '50' for the parameter which specifies what to change&lt;/span&gt;
        Q_ASSERT&lt;span style='color:#308080; '&gt;(&lt;/span&gt; activeSession&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        QByteArray buffer&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        buffer&lt;span style='color:#308080; '&gt;.&lt;/span&gt;append&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#0f69ff; '&gt;\033&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;]50;&lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;append&lt;span style='color:#308080; '&gt;(&lt;/span&gt;text&lt;span style='color:#308080; '&gt;.&lt;/span&gt;toUtf8&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;append&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;'\a'&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        activeSession&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;emulation&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;receiveData&lt;span style='color:#308080; '&gt;(&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;.&lt;/span&gt;constData&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;,&lt;/span&gt;buffer&lt;span style='color:#308080; '&gt;.&lt;/span&gt;length&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;注释说的挺清楚了，而且 033 就是 ASCII 的 ESC，a 是 x7。一切都对应上了。最后它 把指令送给了 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;activeSession()-&amp;gt;emulation()-&amp;gt;receiveData&lt;/span&gt;&lt;/tt&gt; 。省略中间痛苦的寻找 过程直接说了，konsole 里每一个窗口/Tab都会有一个 Session， &lt;tt class="docutils literal"&gt;activeSession()&lt;/tt&gt; 获取的是当前用户正在使用的 Session。每个 Session 里都会有一个 emulation 来模拟 terminal，处理用户的输入输出(src/Session.h 的 136 行)。 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;Session-&amp;gt;emulation()&lt;/span&gt;&lt;/tt&gt; 获取的就是它。具体的东西是 src/Session.cpp 129 行的 &lt;tt class="docutils literal"&gt;_emulation = new
&lt;span class="pre"&gt;Vt102Emulation();&lt;/span&gt;&lt;/tt&gt; 嗯，跳去 src/Vt102Emulation.cpp 找 &lt;tt class="docutils literal"&gt;receiveData&lt;/tt&gt; ，木有找 到…… .h 里也没有…… 想起来有可能在鸡肋里， &lt;tt class="docutils literal"&gt;Vt102Emulation&lt;/tt&gt; 是继承 &lt;tt class="docutils literal"&gt;Emulation&lt;/tt&gt; 的，于是再跳到 src/Emulation.cpp 看 &lt;tt class="docutils literal"&gt;receiveData&lt;/tt&gt;&lt;/p&gt;

&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#595979; '&gt;/*&lt;/span&gt;
&lt;span style='color:#595979; '&gt;&amp;#xa0;&amp;#xa0;&amp;#xa0;&amp;#xa0;&amp;#xa0;&amp;#xa0;&amp;#xa0;We are doing code conversion from locale to unicode first.&lt;/span&gt;
&lt;span style='color:#595979; '&gt;&amp;#xa0;&amp;#xa0;&amp;#xa0;&amp;#xa0;&lt;/span&gt;&lt;span style='color:#ffffff; background:#808000; '&gt;TODO: Character composition from the old code.  See #96536&lt;/span&gt;&lt;span style='color:#595979; '&gt;&lt;/span&gt;
&lt;span style='color:#595979; '&gt;&amp;#xa0;&amp;#xa0;&amp;#xa0;&amp;#xa0;*/&lt;/span&gt;

    &lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; Emulation&lt;span style='color:#406080; '&gt;::&lt;/span&gt;receiveData&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;const&lt;/span&gt; &lt;span style='color:#200080; font-weight:bold; '&gt;char&lt;/span&gt;&lt;span style='color:#308080; '&gt;*&lt;/span&gt; text&lt;span style='color:#308080; '&gt;,&lt;/span&gt; &lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; length&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
        emit stateSet&lt;span style='color:#308080; '&gt;(&lt;/span&gt;NOTIFYACTIVITY&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        bufferedUpdate&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        QString unicodeText &lt;span style='color:#308080; '&gt;=&lt;/span&gt; _decoder&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;toUnicode&lt;span style='color:#308080; '&gt;(&lt;/span&gt;text&lt;span style='color:#308080; '&gt;,&lt;/span&gt;length&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        &lt;span style='color:#595979; '&gt;//send characters to terminal emulator&lt;/span&gt;
        &lt;span style='color:#200080; font-weight:bold; '&gt;for&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; i&lt;span style='color:#308080; '&gt;=&lt;/span&gt;&lt;span style='color:#008c00; '&gt;0&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;i&lt;span style='color:#308080; '&gt;&amp;lt;&lt;/span&gt;unicodeText&lt;span style='color:#308080; '&gt;.&lt;/span&gt;length&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;i&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
            receiveChar&lt;span style='color:#308080; '&gt;(&lt;/span&gt;unicodeText&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;]&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;unicode&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        &lt;span style='color:#595979; '&gt;//look for z-modem indicator&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;//-- someone who understands more about z-modems that I do may be able to move&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;//this check into the above for loop?&lt;/span&gt;
        &lt;span style='color:#200080; font-weight:bold; '&gt;for&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; i&lt;span style='color:#308080; '&gt;=&lt;/span&gt;&lt;span style='color:#008c00; '&gt;0&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;i&lt;span style='color:#308080; '&gt;&amp;lt;&lt;/span&gt;length&lt;span style='color:#406080; '&gt;;&lt;/span&gt;i&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;if&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;text&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;=&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#1060b6; '&gt;'\030'&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
            &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
                &lt;span style='color:#200080; font-weight:bold; '&gt;if&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;length&lt;span style='color:#308080; '&gt;-&lt;/span&gt;i&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#008c00; '&gt;1&lt;/span&gt; &lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt; &lt;span style='color:#008c00; '&gt;3&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt;&lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;strncmp&lt;span style='color:#308080; '&gt;(&lt;/span&gt;text&lt;span style='color:#308080; '&gt;+&lt;/span&gt;i&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#008c00; '&gt;1&lt;/span&gt;&lt;span style='color:#308080; '&gt;,&lt;/span&gt; &lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;B00&lt;/span&gt;&lt;span style='color:#800000; '&gt;"&lt;/span&gt;&lt;span style='color:#308080; '&gt;,&lt;/span&gt; &lt;span style='color:#008c00; '&gt;3&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;=&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#008c00; '&gt;0&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
                    emit zmodemDetected&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;略掉编码转换和 z-modem 的过程，这个 &lt;tt class="docutils literal"&gt;receiveData&lt;/tt&gt; 就是把东西送给了 &lt;tt class="docutils literal"&gt;receiveChar&lt;/tt&gt; 。再找 &lt;tt class="docutils literal"&gt;receiveChar&lt;/tt&gt;&lt;/p&gt;

&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#595979; '&gt;// process application unicode input to terminal&lt;/span&gt;
    &lt;span style='color:#595979; '&gt;// this is a trivial scanner&lt;/span&gt;
    &lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; Emulation&lt;span style='color:#406080; '&gt;::&lt;/span&gt;receiveChar&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; c&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
        c &lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#008000; '&gt;0xff&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        &lt;span style='color:#200080; font-weight:bold; '&gt;switch&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;c&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;case &lt;/span&gt;&lt;span style='color:#1060b6; '&gt;'\b'&lt;/span&gt;&lt;span style='color:#7d0045; '&gt;      &lt;/span&gt;&lt;span style='color:#e34adc; '&gt;:&lt;/span&gt; _currentScreen&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;backspace&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;                 &lt;span style='color:#200080; font-weight:bold; '&gt;break&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;case &lt;/span&gt;&lt;span style='color:#1060b6; '&gt;'\t'&lt;/span&gt;&lt;span style='color:#7d0045; '&gt;      &lt;/span&gt;&lt;span style='color:#e34adc; '&gt;:&lt;/span&gt; _currentScreen&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;tab&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;                       &lt;span style='color:#200080; font-weight:bold; '&gt;break&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;case &lt;/span&gt;&lt;span style='color:#1060b6; '&gt;'\n'&lt;/span&gt;&lt;span style='color:#7d0045; '&gt;      &lt;/span&gt;&lt;span style='color:#e34adc; '&gt;:&lt;/span&gt; _currentScreen&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;newLine&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;                   &lt;span style='color:#200080; font-weight:bold; '&gt;break&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;case &lt;/span&gt;&lt;span style='color:#1060b6; '&gt;'\r'&lt;/span&gt;&lt;span style='color:#7d0045; '&gt;      &lt;/span&gt;&lt;span style='color:#e34adc; '&gt;:&lt;/span&gt; _currentScreen&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;toStartOfLine&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;             &lt;span style='color:#200080; font-weight:bold; '&gt;break&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;case &lt;/span&gt;&lt;span style='color:#008000; '&gt;0x07&lt;/span&gt;&lt;span style='color:#7d0045; '&gt;      &lt;/span&gt;&lt;span style='color:#e34adc; '&gt;:&lt;/span&gt; emit stateSet&lt;span style='color:#308080; '&gt;(&lt;/span&gt;NOTIFYBELL&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;                   &lt;span style='color:#200080; font-weight:bold; '&gt;break&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;default&lt;/span&gt;        &lt;span style='color:#406080; '&gt;:&lt;/span&gt; _currentScreen&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;displayCharacter&lt;span style='color:#308080; '&gt;(&lt;/span&gt;c&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;         &lt;span style='color:#200080; font-weight:bold; '&gt;break&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;}&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;不会这么简单吧！又忽然想起来， &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;Emulation::receiveData&lt;/span&gt;&lt;/tt&gt; 可能会调用 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;Vt102Emulation::receiveChar&lt;/span&gt;&lt;/tt&gt; 的吧…… 在 src/Emulation.h 的 427 行，这货果然是 &lt;tt class="docutils literal"&gt;virtual&lt;/tt&gt; 的。于是再返回 src/Vt102Emulation.cpp 找 &lt;tt class="docutils literal"&gt;receiveChar&lt;/tt&gt; 。这回终于 找到处理字符序列的地方了。不过因为整个函数有101行，还要加上前面18行注释和15行宏 ，就不贴在这里了。那个函数主要是把用户输入 tokenize ，并且对 token 进行处理。这 整个过程我还不是完全理解，但是大概的内容可以猜的出来。对于本文起作用的主要是第 316 行&lt;/p&gt;

&lt;pre&gt;
if (Xte         ) { processWindowAttributeChange(); resetTokenizer(); return; }
&lt;/pre&gt;

&lt;p&gt;&lt;tt class="docutils literal"&gt;Xte&lt;/tt&gt; 是个判断 &lt;tt class="docutils literal"&gt;\033]&lt;/tt&gt; 的宏。(好吧，它其实只判断了 token 的位置和 &lt;tt class="docutils literal"&gt;']'&lt;/tt&gt;) &lt;tt class="docutils literal"&gt;processWindowAttributeChange&lt;/tt&gt; 就在 &lt;tt class="docutils literal"&gt;receiveChar&lt;/tt&gt; 的下面&lt;/p&gt;

&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; Vt102Emulation&lt;span style='color:#406080; '&gt;::&lt;/span&gt;processWindowAttributeChange&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
      &lt;span style='color:#595979; '&gt;// Describes the window or terminal session attribute to change&lt;/span&gt;
      &lt;span style='color:#595979; '&gt;// See Session::UserTitleChange for possible values&lt;/span&gt;
      &lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; attributeToChange &lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#008c00; '&gt;0&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
      &lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; i&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
      &lt;span style='color:#200080; font-weight:bold; '&gt;for&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;i &lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#008c00; '&gt;2&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt; i &lt;span style='color:#308080; '&gt;&amp;lt;&lt;/span&gt; tokenBufferPos     &lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt;&lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt; 
                  tokenBuffer&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#1060b6; '&gt;'0'&lt;/span&gt;  &lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt;&lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt; 
                  tokenBuffer&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#1060b6; '&gt;'9'&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt; i&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
      &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
        attributeToChange &lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#008c00; '&gt;10&lt;/span&gt; &lt;span style='color:#308080; '&gt;*&lt;/span&gt; attributeToChange &lt;span style='color:#308080; '&gt;+&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;tokenBuffer&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;]&lt;/span&gt;&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#1060b6; '&gt;'0'&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
      &lt;span style='color:#406080; '&gt;}&lt;/span&gt;

      &lt;span style='color:#200080; font-weight:bold; '&gt;if&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;tokenBuffer&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;!&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#1060b6; '&gt;';'&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; 
      &lt;span style='color:#406080; '&gt;{&lt;/span&gt; 
        reportDecodingError&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt; 
        &lt;span style='color:#200080; font-weight:bold; '&gt;return&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt; 
      &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
      
      QString newValue&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
      newValue&lt;span style='color:#308080; '&gt;.&lt;/span&gt;reserve&lt;span style='color:#308080; '&gt;(&lt;/span&gt;tokenBufferPos&lt;span style='color:#308080; '&gt;-&lt;/span&gt;i&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#008c00; '&gt;2&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
      &lt;span style='color:#200080; font-weight:bold; '&gt;for&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; j &lt;span style='color:#308080; '&gt;=&lt;/span&gt; &lt;span style='color:#008c00; '&gt;0&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt; j &lt;span style='color:#308080; '&gt;&amp;lt;&lt;/span&gt; tokenBufferPos&lt;span style='color:#308080; '&gt;-&lt;/span&gt;i&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#008c00; '&gt;2&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt; j&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
        newValue&lt;span style='color:#308080; '&gt;[&lt;/span&gt;j&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;=&lt;/span&gt; tokenBuffer&lt;span style='color:#308080; '&gt;[&lt;/span&gt;i&lt;span style='color:#308080; '&gt;+&lt;/span&gt;&lt;span style='color:#008c00; '&gt;1&lt;/span&gt;&lt;span style='color:#308080; '&gt;+&lt;/span&gt;j&lt;span style='color:#308080; '&gt;]&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
     
      _pendingTitleUpdates&lt;span style='color:#308080; '&gt;[&lt;/span&gt;attributeToChange&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;=&lt;/span&gt; newValue&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
      _titleUpdateTimer&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;start&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#008c00; '&gt;20&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;前半部分是提取 &lt;tt class="docutils literal"&gt;\033&lt;/tt&gt; 和 &lt;tt class="docutils literal"&gt;';'&lt;/tt&gt; 中间的数字，然后把剩下的字串放到 _pendingTitleUpdates 里给别人处理。这里作者启动了一个 20ms 的计时器，计时器到时 间之后才会更新。这可以压缩更新的次数，避免频繁更新吧。计时器的 callback 就在下 面&lt;/p&gt;

&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; Vt102Emulation&lt;span style='color:#406080; '&gt;::&lt;/span&gt;updateTitle&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
        QListIterator&lt;span style='color:#406080; '&gt;&amp;lt;&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt;&lt;span style='color:#406080; '&gt;&gt;&lt;/span&gt; iter&lt;span style='color:#308080; '&gt;(&lt;/span&gt; _pendingTitleUpdates&lt;span style='color:#308080; '&gt;.&lt;/span&gt;keys&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        &lt;span style='color:#200080; font-weight:bold; '&gt;while&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;iter&lt;span style='color:#308080; '&gt;.&lt;/span&gt;hasNext&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; arg &lt;span style='color:#308080; '&gt;=&lt;/span&gt; iter&lt;span style='color:#308080; '&gt;.&lt;/span&gt;next&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            emit titleChanged&lt;span style='color:#308080; '&gt;(&lt;/span&gt; arg &lt;span style='color:#308080; '&gt;,&lt;/span&gt; _pendingTitleUpdates&lt;span style='color:#308080; '&gt;[&lt;/span&gt;arg&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;    
        &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
        _pendingTitleUpdates&lt;span style='color:#308080; '&gt;.&lt;/span&gt;clear&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;    
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;简单的函数，它又发出了 &lt;tt class="docutils literal"&gt;titleChanged&lt;/tt&gt; 这个信号。这个信号是在哪处理的呢？(中间 省略N多 &lt;tt class="docutils literal"&gt;git grep&lt;/tt&gt; 之类的过程)是在 src/Session.cpp 的 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;Session::setUserTitle&lt;/span&gt;&lt;/tt&gt;&lt;/p&gt;

&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; Session&lt;span style='color:#406080; '&gt;::&lt;/span&gt;setUserTitle&lt;span style='color:#308080; '&gt;(&lt;/span&gt; &lt;span style='color:#200080; font-weight:bold; '&gt;int&lt;/span&gt; what&lt;span style='color:#308080; '&gt;,&lt;/span&gt; &lt;span style='color:#200080; font-weight:bold; '&gt;const&lt;/span&gt; QString &lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt;caption &lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
    &lt;span style='color:#308080; '&gt;.&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;
        &lt;span style='color:#200080; font-weight:bold; '&gt;if&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt;what &lt;span style='color:#308080; '&gt;=&lt;/span&gt;&lt;span style='color:#308080; '&gt;=&lt;/span&gt; ProfileChange&lt;span style='color:#308080; '&gt;)&lt;/span&gt; 
        &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
            emit profileChangeCommandReceived&lt;span style='color:#308080; '&gt;(&lt;/span&gt;caption&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            &lt;span style='color:#200080; font-weight:bold; '&gt;return&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
    &lt;span style='color:#308080; '&gt;.&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;&lt;span style='color:#308080; '&gt;.&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;这个 &lt;tt class="docutils literal"&gt;ProfileChange&lt;/tt&gt; 就等于我们所要的 50(src/Session.h, 341 行) ……再追踪 &lt;tt class="docutils literal"&gt;profileChangeCommandReceived&lt;/tt&gt; 这个信号。(别急，快完啦)处理它的是 src/SessionManager.cpp 里的 &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;SessionManager::sessionProfileCommandReceived&lt;/span&gt;&lt;/tt&gt;&lt;/p&gt;
&lt;pre style='color:#000020;background:#f6f8ff;'&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;void&lt;/span&gt; SessionManager&lt;span style='color:#406080; '&gt;::&lt;/span&gt;sessionProfileCommandReceived&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;const&lt;/span&gt; QString&lt;span style='color:#308080; '&gt;&amp;amp;&lt;/span&gt; text&lt;span style='color:#308080; '&gt;)&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;// &lt;/span&gt;&lt;span style='color:#ffffff; background:#808000; '&gt;FIXME: This is inefficient, it creates a new profile instance for&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;// each set of changes applied.  Instead a new profile should be created&lt;/span&gt;
        &lt;span style='color:#595979; '&gt;// only the first time changes are applied to a session&lt;/span&gt;

        Session&lt;span style='color:#308080; '&gt;*&lt;/span&gt; session &lt;span style='color:#308080; '&gt;=&lt;/span&gt; qobject_cast&lt;span style='color:#406080; '&gt;&amp;lt;&lt;/span&gt;Session&lt;span style='color:#308080; '&gt;*&lt;/span&gt;&lt;span style='color:#406080; '&gt;&gt;&lt;/span&gt;&lt;span style='color:#308080; '&gt;(&lt;/span&gt;sender&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        Q_ASSERT&lt;span style='color:#308080; '&gt;(&lt;/span&gt; session &lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        ProfileCommandParser parser&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        QHash&lt;span style='color:#406080; '&gt;&amp;lt;&lt;/span&gt;Profile&lt;span style='color:#406080; '&gt;::&lt;/span&gt;Property&lt;span style='color:#308080; '&gt;,&lt;/span&gt;QVariant&lt;span style='color:#406080; '&gt;&gt;&lt;/span&gt; changes &lt;span style='color:#308080; '&gt;=&lt;/span&gt; parser&lt;span style='color:#308080; '&gt;.&lt;/span&gt;parse&lt;span style='color:#308080; '&gt;(&lt;/span&gt;text&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;

        Profile&lt;span style='color:#406080; '&gt;::&lt;/span&gt;Ptr newProfile &lt;span style='color:#308080; '&gt;=&lt;/span&gt; Profile&lt;span style='color:#406080; '&gt;::&lt;/span&gt;Ptr&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;new&lt;/span&gt; Profile&lt;span style='color:#308080; '&gt;(&lt;/span&gt;_sessionProfiles&lt;span style='color:#308080; '&gt;[&lt;/span&gt;session&lt;span style='color:#308080; '&gt;]&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        
        QHashIterator&lt;span style='color:#406080; '&gt;&amp;lt;&lt;/span&gt;Profile&lt;span style='color:#406080; '&gt;::&lt;/span&gt;Property&lt;span style='color:#308080; '&gt;,&lt;/span&gt;QVariant&lt;span style='color:#406080; '&gt;&gt;&lt;/span&gt; iter&lt;span style='color:#308080; '&gt;(&lt;/span&gt;changes&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        &lt;span style='color:#200080; font-weight:bold; '&gt;while&lt;/span&gt; &lt;span style='color:#308080; '&gt;(&lt;/span&gt; iter&lt;span style='color:#308080; '&gt;.&lt;/span&gt;hasNext&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt; &lt;span style='color:#308080; '&gt;)&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;{&lt;/span&gt;
            iter&lt;span style='color:#308080; '&gt;.&lt;/span&gt;next&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
            newProfile&lt;span style='color:#308080; '&gt;-&lt;/span&gt;&lt;span style='color:#308080; '&gt;&gt;&lt;/span&gt;setProperty&lt;span style='color:#308080; '&gt;(&lt;/span&gt;iter&lt;span style='color:#308080; '&gt;.&lt;/span&gt;key&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;,&lt;/span&gt;iter&lt;span style='color:#308080; '&gt;.&lt;/span&gt;value&lt;span style='color:#308080; '&gt;(&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        &lt;span style='color:#406080; '&gt;}&lt;/span&gt; 

        _sessionProfiles&lt;span style='color:#308080; '&gt;[&lt;/span&gt;session&lt;span style='color:#308080; '&gt;]&lt;/span&gt; &lt;span style='color:#308080; '&gt;=&lt;/span&gt; newProfile&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        applyProfile&lt;span style='color:#308080; '&gt;(&lt;/span&gt;newProfile&lt;span style='color:#308080; '&gt;,&lt;/span&gt;&lt;span style='color:#200080; font-weight:bold; '&gt;true&lt;/span&gt;&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
        emit sessionUpdated&lt;span style='color:#308080; '&gt;(&lt;/span&gt;session&lt;span style='color:#308080; '&gt;)&lt;/span&gt;&lt;span style='color:#406080; '&gt;;&lt;/span&gt;
    &lt;span style='color:#406080; '&gt;}&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;还是一个挂着 FIXME 的函数呢…… 不过逻辑还是比较简单的，基本上就是把当前的Profile 作为父 Profile 新建一个 Profile。然后根据命令的内容修改 Profile 的属性。也就是说 ，理论上讲，只要是 Profile 里可以改的，就可以通过 &lt;tt class="docutils literal"&gt;\&amp;lt;ESC&amp;gt;50;x1=y1;x2=y2\x7&lt;/tt&gt; 来 修改。后来我又把 vim 里的 t_{S,E}I 修改成&lt;/p&gt;

&lt;pre&gt;
if $TERM =~ 'xterm'
        let &amp;amp;t_SI = &amp;quot;\&amp;lt;Esc&amp;gt;]50;CursorShape=1;BlinkingCursorEnabled=true\x7&amp;quot;
        let &amp;amp;t_EI = &amp;quot;\&amp;lt;Esc&amp;gt;]50;CursorShape=0;BlinkingCursorEnabled=false\x7&amp;quot;
endif
&lt;/pre&gt;

&lt;p&gt;然后在插入模式下，光标果然编程一闪一闪的竖线了。哈哈。不过需要小注意的是，用这个 方式修改的 Profile 是临时的，不会保存，新建的标签也不会继承这个 Profile。&lt;/p&gt;

&lt;p&gt;现在就拨云见日，回顾一下整个调用过程吧&lt;/p&gt;

&lt;pre&gt;
Emulation::receiveData
    ||
    \/
Vt102Emulation::receiveChar
    || tokenize/process token
    \/
Vt102Emulation::processWindowAttributeChange
    || 提取 \&amp;lt;ESC&amp;gt;] 后面的 code 和 cmd
    \/ 20ms 延迟，聚集变更
Vt102Emulation::updateTitle
    || emit titleChanged(code, cmd)
    \/
Session::setUserTitle(int, const QString &amp;amp;)
    || emit profileChangeCommandReceived(cmd)
    \/
SessionManager::sessionProfileCommandReceived(const QString)
{
    ...
    Profile::Ptr newProfile = Profile::Ptr(new Profile(_sessionProfiles[session]));
    ...
    newProfile-&amp;gt;setProperty
    ...
    _sessionProfiles[session] = newProfile;
    applyProfile(newProfile,true);
    emit sessionUpdated(session);
}
&lt;/pre&gt;

&lt;p&gt;回头来看，一步一步的到还挺清晰的。&lt;/p&gt;

&lt;p&gt;多谢各位能够读到最后。作为奖励，贴一个解决上面 FIXME 的补丁吧，哈哈&lt;/p&gt;

&lt;pre&gt;
commit 5fb452e51ac1a9d18952fdd26f8bfa55438aedf3
Author: Grissiom &amp;lt;chaos.proton&amp;#64;gmail.com&amp;gt;
Date:   Thu Sep 1 01:17:24 2011 +0800

    use a static _sessionRuntimeProfiles to store runtime profiles

diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp
index 028b76f..697589c 100644
--- a/src/SessionManager.cpp
+++ b/src/SessionManager.cpp
&amp;#64;&amp;#64; -758,9 +758,7 &amp;#64;&amp;#64; Profile::Ptr SessionManager::findByShortcut(const QKeySequence&amp;amp; shortcut)

 void SessionManager::sessionProfileCommandReceived(const QString&amp;amp; text)
 {
-    // FIXME: This is inefficient, it creates a new profile instance for
-    // each set of changes applied.  Instead a new profile should be created
-    // only the first time changes are applied to a session
+    static QHash&amp;lt;Session*,Profile::Ptr&amp;gt; _sessionRuntimeProfiles;

     Session* session = qobject_cast&amp;lt;Session*&amp;gt;(sender());
     Q_ASSERT( session );
&amp;#64;&amp;#64; -768,14 +766,23 &amp;#64;&amp;#64; void SessionManager::sessionProfileCommandReceived(const QString&amp;amp; text)
     ProfileCommandParser parser;
     QHash&amp;lt;Profile::Property,QVariant&amp;gt; changes = parser.parse(text);

-    Profile::Ptr newProfile = Profile::Ptr(new Profile(_sessionProfiles[session]));
-
+    Profile::Ptr newProfile;
+    if (!_sessionRuntimeProfiles.contains(session))
+    {
+        newProfile = new Profile(_sessionProfiles[session]);
+        _sessionRuntimeProfiles.insert(session,newProfile);
+    }
+    else
+    {
+        newProfile = _sessionRuntimeProfiles[session];
+    }
+
     QHashIterator&amp;lt;Profile::Property,QVariant&amp;gt; iter(changes);
     while ( iter.hasNext() )
     {
         iter.next();
         newProfile-&amp;gt;setProperty(iter.key(),iter.value());
-    }
+    }

     _sessionProfiles[session] = newProfile;
     applyProfile(newProfile,true);
&lt;/pre&gt;

&lt;p&gt;C++ 代码看的比较少，Konsoel 的代码也是刚看。有什么不对的地方还请指教～;P&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>两件难事</title><link>http://grissiom.blogspot.com/2010/12/blog-post.html</link><category>ideas</category><category>life</category><category>logic</category><author>noreply@blogger.com (grissiom)</author><pubDate>Mon, 13 Dec 2010 06:34:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-3200865493482700813</guid><description>&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&lt;img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/cn/88x31.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;#26412;&amp;#20316;&amp;#21697;&amp;#37319;&amp;#29992;&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&amp;#30693;&amp;#35782;&amp;#20849;&amp;#20139;&amp;#32626;&amp;#21517;-&amp;#38750;&amp;#21830;&amp;#19994;&amp;#24615;&amp;#20351;&amp;#29992; 2.5 &amp;#20013;&amp;#22269;&amp;#22823;&amp;#38470;&amp;#35768;&amp;#21487;&amp;#21327;&amp;#35758;&lt;/a&gt;&lt;br /&gt;
&lt;!-- vim:sw=4:ft=rst:tw=80 --&gt;&lt;br /&gt;
&lt;!-- This work is released under `Attribution-Noncommercial 2.5 China Mainland --&gt;&lt;br /&gt;
&lt;!-- Creative Commons` License --&gt;&lt;br /&gt;
&lt;!-- 本作品以“署名-非商业性使用 2.5 中国大陆 Creative Commons” 许可证发布 --&gt;&lt;br /&gt;
&lt;h4&gt;1，idea is cheap, show me the logic&lt;/h4&gt;&lt;p&gt;这个小标题是最近发过的一个状态。 &lt;a class="footnote-reference" href="#id5" id="id1"&gt;[1]&lt;/a&gt; 它是说在接收观点的时候，对观点的论证比观点 本身重要。(所有意义以中文为准，英文有所偏差，见谅……)而且竟然得到了片聪大牛的回复 ，虽然我用耍赖皮的方法回复了聪……其实我那个状态本身就没有show the logic ;-P&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;发这个状态的导火索是一篇好友的日志 &lt;a class="footnote-reference" href="#id6" id="id2"&gt;[2]&lt;/a&gt; 。那篇日志的观点不去评价，但是我看的时候 实在没看明白原文两个部分之间的推理关系，直到后来好友给我用四个回复给我解释了一遍 我才明白。这个时候我突然发现，观点并不那么重要，重要的是支撑观点的论据以及从论据 推导观点的逻辑。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;现在是信息时代了，每天上网都会接触各式各样的观点，想法。最近看文章有个习惯，就是 总要看看作者是用什么来论述他的观点的，怎么样用论据来论述的。(当然受限于本人低下 的语文水平，这个目标常常达到不了……)遇到那种只讲观点不讲理由的文章，一概略过。比 如以前无聊的时候看过咸郎平的一本书，书里充斥着“我预料它是这样，几年之后果然就验 证了。”、“我说XX是那样，它就是那样”的话语，然而知识性的东西很少。这就让人读着很 不爽。 &lt;a class="footnote-reference" href="#id7" id="id3"&gt;[3]&lt;/a&gt; 就好像如果我说“买黄金吧，保赚！”，但是任何一个理性的人都不会单纯因为 我这一句话而投资黄金一样。一个只有观点而没有靠谱论据的文章只能证明作者当时持有那 种观点，其他的什么都说明不了，甚至没法证明作者不是忽悠人的。&lt;/p&gt;&lt;br /&gt;
&lt;h4&gt;2，idea is cheap, show me the implementation&lt;/h4&gt;&lt;p&gt;这个小标题是说，实现想法比想法本身重要的多。这个是晚上和嘉哥聊天的时候忽然想到的 。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;可能有的人要问，为什么想法不重要呢？现在不是求创新嘛？创新就是要有新的 idea，那 么idea怎么就不重要了呢？我觉得，一个人从早晨起来到晚上睡下，睁眼看着这花花绿绿的 世界，难免会有 idea 出来。一个人要是说他什么都没想过，从来都没有过灵感，我觉得真 不可能。但是，生活为什么还是这么平淡呢？很大一部分是因为我们没有去实现自己的想法 。大的例子就不举了，一个小例子，比如，“去K歌”这个想法很多人肯定都有过。那么这个 想法和定地方，定时间再动员大家一起去这个过程比起来哪个更难呢？显然是后者。一个没 有被实现的想法就好像一个被父母抛弃到戈壁的婴儿一样，总是会夭折的。当然一个人的想 法肯定会有很多很多，不可能每个都实现。不过或许也可以想想，不知不觉中有多少有用的 想法就这样被抛弃了呢？……&lt;/p&gt;&lt;br /&gt;
&lt;h4&gt;3，cheapie is cheap, show me the valuable&lt;/h4&gt;&lt;p&gt;其实上面两条说得都是废话——接收观点的时候观点不如论证重要，想出了观点(想法)之后观 点不如实现重要——不管观点是别人给你的还是自己“凭空”想出来的，既然已经“有”了，就自 然没有那些还没有(或者不是那么明显)的东西重要啊…… 日志写到这就有一种要死的感觉， 费劲吧啦的原来说的都是废话……&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;忽然想起笑来老师曾经推荐的李宗盛的歌《你像个孩子似的》了 &lt;a class="footnote-reference" href="#id8" id="id4"&gt;[4]&lt;/a&gt; ，以此为结尾吧:&lt;/p&gt;&lt;br /&gt;
&lt;pre&gt;……
工作是容易的 赚钱是困难的
恋爱是容易的 成家是困难的
相爱是容易的 相处是困难的
决定是容易的 可是等待是困难的
……
&lt;/pre&gt;&lt;br /&gt;
&lt;table class="docutils footnote" frame="void" id="id5" rules="none"&gt;&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id1"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;这个句型只是从 Linus 早在2000年就说过的话借过来的: &lt;a class="reference external" href="http://lkml.org/lkml/2000/8/25/132"&gt;http://lkml.org/lkml/2000/8/25/132&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;table class="docutils footnote" frame="void" id="id6" rules="none"&gt;&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id2"&gt;[2]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a class="reference external" href="http://blog.renren.com/blog/229147260/504805782?fromfriendblog"&gt;http://blog.renren.com/blog/229147260/504805782?fromfriendblog&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;table class="docutils footnote" frame="void" id="id7" rules="none"&gt;&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id3"&gt;[3]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;后来有一次无聊的时候拿了他的另一本书看，貌似好些了……&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;table class="docutils footnote" frame="void" id="id8" rules="none"&gt;&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id4"&gt;[4]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a class="reference external" href="http://www.lixiaolai.com/index.php/archives/1525.html"&gt;http://www.lixiaolai.com/index.php/archives/1525.html&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;p&gt;P.S. 正如每个定理都有它的局限性一样，这里说的两个观点也有自己的局限性。不排除那 些极其牛的，极其天才的，神来之笔似的观点因为难以获得而显得珍贵。&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>第一次面试</title><link>http://grissiom.blogspot.com/2010/06/blog-post.html</link><category>career</category><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Fri, 4 Jun 2010 09:02:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-3891039546920731506</guid><description>&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&lt;img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/cn/88x31.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;#26412;&amp;#20316;&amp;#21697;&amp;#37319;&amp;#29992;&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&amp;#30693;&amp;#35782;&amp;#20849;&amp;#20139;&amp;#32626;&amp;#21517;-&amp;#38750;&amp;#21830;&amp;#19994;&amp;#24615;&amp;#20351;&amp;#29992; 2.5 &amp;#20013;&amp;#22269;&amp;#22823;&amp;#38470;&amp;#35768;&amp;#21487;&amp;#21327;&amp;#35758;&lt;/a&gt;&amp;#36827;&amp;#34892;&amp;#35768;&amp;#21487;&amp;#12290;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- vim:sw=4:ft=rst:tw=80 --&gt;&lt;br /&gt;
&lt;!-- This work is released under `Attribution-Noncommercial 2.5 China Mainland Creative Commons` License --&gt;&lt;br /&gt;
&lt;!-- 本作品以“署名-非商业性使用 2.5 中国大陆 Creative Commons” 许可证发布 --&gt;&lt;br /&gt;
&lt;ol class="arabic"&gt;&lt;li&gt;平时对细节的注意还是不够。很多细节的问题都没有答好。会用未必代表懂啊！有的问 题是看过，但是感觉太琐碎，所以没用心记，结果面试杯具了。勿以事小而不学啊……&lt;/li&gt;
&lt;li&gt;小概念区分得还是不清楚。尤其是答 sed 的时候把通配符 &lt;tt class="docutils literal"&gt;*&lt;/tt&gt; 和正则表达式里的 &lt;tt class="docutils literal"&gt;*&lt;/tt&gt; 搞混了，场面极其狼狈…… 不过最后的那个 &lt;tt class="docutils literal"&gt;char&lt;/tt&gt; 符号问题答得还是比较好的 。其实那个问题我也只是平时一不小心才注意到的……&lt;/li&gt;
&lt;li&gt;介绍自己的项目的时候还是急于显示自己的东西了，以至于一开始把面试人说得云里雾 里…… ;( 下回还是要慢慢来……&lt;/li&gt;
&lt;/ol&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total></item><item><title>北航毕设论文 latex 模板</title><link>http://grissiom.blogspot.com/2010/04/latex.html</link><category>buaa</category><category>xelatex</category><author>noreply@blogger.com (grissiom)</author><pubDate>Fri, 30 Apr 2010 20:49:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-6262436269073817043</guid><description>&lt;a href="http://creativecommons.org/licenses/by-nc/2.5/cn/" rel="license"&gt;&lt;img alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc/2.5/cn/88x31.png" style="border-width: 0;" /&gt;&lt;/a&gt;&lt;br /&gt;
本作品采用&lt;a href="http://creativecommons.org/licenses/by-nc/2.5/cn/" rel="license"&gt;知识共享署名-非商业性使用 2.5 中国大陆许可协议&lt;/a&gt;进行许可。&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;原来的源码是在北航的 ftp 上找到的，从源代码里看貌似是一个叫 WangNan 的大牛在 2006 年 3 月份写的。由于对于中文来说用 XeLateX 比较方便，而原来的模板又没有针对它的选项，所以我对原模板略作修改(改动的地方占了不到原文件的 1％)，使他能更好的支持 xelatex。源码包里有一个小例子。在 texlive-20091107(under linux) 下可以编译通过。不过需要略微注意的还是字体，adobefonts 选项会选择 adobe 的那一套中文字，winfonts 会选择 Sim 那一套。linux 下面安装很简单，找到字体文件仍到 ~/.fonts 里，应该就可以了；win 下的应该也类似。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;已知问题：&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;原模板里有一个 \CJKtilde 命令，但是他在 xeCJK 里已经没有了。因为没有找到对应的命令，所以就简单的把它注释掉了。&lt;/li&gt;
&lt;li&gt;原模板里的 BUAAbibsty.bst 貌似有问题，在我这里一直编译不过…… 我又不知道怎么样编辑 bst 文件，所以也跳过它了。&lt;/li&gt;
&lt;/ol&gt;如果有大牛能解决以上问题的，欢迎联系我。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;源码包在&lt;a href="http://beihang-open-source-club.googlegroups.com/web/buaa_latex_cls.zip"&gt;这里&lt;/a&gt;。如果您在下载过程中遭遇任何问题，那不是我们的错。您遭遇了伟大的“防火墙”。您可以先爆句粗口，再平静一下心情，看看别的“健康的”网站(比如人民网之流)。过几分钟之后把上面连接里的 http 该成 https，再试试。实在不行，可以电邮我。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;感谢国家。感谢原作者，模板版权归原作者所有。感谢&lt;a href="https://groups.google.com/group/beihang-open-source-club"&gt;北航开源软件俱乐部&lt;/a&gt;，想了半天，还是觉得把文件放到这里来共享比较合适。&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>开了一个技术博客</title><link>http://grissiom.blogspot.com/2010/02/blog-post.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Wed, 10 Feb 2010 07:58:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-6021662620251326060</guid><description>在这里： http://blog.csdn.net/grissiom (好不容易在今天完成了第一篇文章……)以后这里就放一些关于生活啊之类的碎碎念吧～那里会放一些编程啊，硬件啊之类的东西。我尽量会不转帖的。有了分享，还用转贴么？把类别分开也能方便大家看。(问题是，看的人有几个呢？嘿嘿……)&lt;br /&gt;
&lt;br /&gt;
最后，无论在哪里，都欢迎大家拍砖，人气低的时候欢迎灌水～;)</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>又是一年考期时</title><link>http://grissiom.blogspot.com/2010/01/blog-post.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Sat, 30 Jan 2010 06:50:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-4842896616488222057</guid><description>&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&lt;img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/cn/88x31.png" /&gt;&lt;/a&gt;&lt;br /&gt;
&amp;#26412;&amp;#20316;&amp;#21697;&amp;#37319;&amp;#29992;&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&amp;#30693;&amp;#35782;&amp;#20849;&amp;#20139;&amp;#32626;&amp;#21517;-&amp;#38750;&amp;#21830;&amp;#19994;&amp;#24615;&amp;#20351;&amp;#29992; 2.5 &amp;#20013;&amp;#22269;&amp;#22823;&amp;#38470;&amp;#35768;&amp;#21487;&amp;#21327;&amp;#35758;&lt;/a&gt;&amp;#36827;&amp;#34892;&amp;#35768;&amp;#21487;&amp;#12290;&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;=========================================&lt;/p&gt;&lt;p&gt;其实这是很久以前写的东西。久到大三上的那个考期，觉得郁闷，于是就写了。但是以后的考期就还是那么过的，没有什么变化…… 以后大概也就不会有考期这个东西了，把它贴出来作为纪念吧……&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;=========================================&lt;/p&gt;&lt;br /&gt;
&lt;h1 class="title"&gt;又是一年考期时&lt;/h1&gt;&lt;!-- vim:sw=4: --&gt;                   &lt;br /&gt;
&lt;p&gt;其实只是上了大学才知道“考期”这个名词，其实只是过完了大一上才知道大学里原来还有 一个“考期”的时间专门留给复习 —— 准备最后的期末考试。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;或许考试这个“龙门”就是留给有准备的人跳的。不过大学以前，印象里没有留过时间专门 复习期末考试的 —— 高考除外，其性质与期末考试不同，暂不属于讨论范畴。基本上是讲 完考，考完撤，上午一门下午一门，连考三天还不费劲。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;上了大学，风水变了。有孩子喊，14 天考 10 门，能熬出来都成神了。不禁莞儿。想想， 我也是这么一路抱怨过来的。当年也怨过也骂过也狠过。也曾经用一晚上两三个小时把一 学期要学的东西吞进去过。当年是这样，今年，恐怕还是这样。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;“大学”这两个字或许真的有魔力。进来之前是向往，进来之后是体味。甚至有大学生们常 挂在嘴边的“大学生活”这个词来凸显生活与以前别处的不同。不过显然没有“大学学习”这 个词。不过学习确实也是不一样了。以前不用专门抽时间来复习的，现在需 要腾一个月时 间了。以前上午考一门下午考一门不皱眉头的，现在今天考一门明天考一门就要抱怨了。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;我不是旁观者，我也抱怨，甚至愤恨。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;可是还是要思考为什么，为什么考试密集了会抱怨，为什么要有考期。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;可能是知识太多，太复杂。其实我觉得，刚来时的传言“讲一、练二、考三”，平心而论， 再夸张一点，其实是“讲三、练二、考一”。基本上老师都是“不为难”，考的肯定是讲的子 集。理论上说，上课听，记住了，考试过是没问题的。老师说“上课听讲，课下消化”，没 有听说过“上课听讲，考期消化”的。从这一点来说，考期并无必要。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;没有了考期，也就无从抱怨考期安排不合理了，该抱怨没有考期了。以前还有机会过，甚 至可以拿高分，现在连机会都没有了，这怎么能行呢？&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;其实是抱怨错了地方。如前所述，如果功夫下在平时，期末想过很容易。可是“平时”是个 隐性的时间，“考期”是个显形的时间。人们容易注意显性而忽略隐性的东西。比如大地震 ，举国关注，可以国内关注吸烟导致死亡的人却很少。其实，每年吸烟至死 500 万人，比 大地震死亡人数要多得多。美国的伊战在 08 年的时候已经死掉 4000 多人了。不过大部 分人不是在进攻的时候死掉的，而是在漫长的占领期内一点一点被各种事件杀掉的。如果 在第一波进攻内就死掉 4000人，估计它也就顶不住国内的压力要撤军了。可是现在，有谁 在关注么？同样是死人，“大家一起死”和“一个一个慢慢死”效果就很不同。同样是学习，“ 一个学期里 学习”和“一个考期里学习”所引起的关注也就不一样 —— 更何况考期还挂一个“ 考”字呢？&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;这也是一种懒惰。“枪打出头鸟”，“抓典型”，有意而为之的时候是一种手段、策略；无意 而为之的时候是一种祸患：只抓住了部分而没有把握整体；只听到了聒噪的“一小撮”而没 有看到“沉默的大多数”。有人可能会拿 80/20 原则来反驳。那么我会说：“ 什么样的人能 用 20% 的时间学习 80% 的知识并且把它们掌握牢固？”&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;我不是，我还是要用剩下的 20% 时间吞 80% 的知识，只期望于考试考过，不奢望于牢固 掌握。悲哀啊！莫过于此。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;恐惧源于不知，待到明了之后，也就无所谓惧怕了。&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;立此存照&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Some Twist on the Blog</title><link>http://grissiom.blogspot.com/2009/12/some-twist-on-blog.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Fri, 11 Dec 2009 15:33:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-1374680110216280779</guid><description>&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&lt;img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/2.5/cn/88x31.png" /&gt;&lt;/a&gt;&lt;br /&gt;&amp;#26412;&amp;#20316;&amp;#21697;&amp;#37319;&amp;#29992;&lt;a rel="license" href="http://creativecommons.org/licenses/by-nc/2.5/cn/"&gt;&amp;#30693;&amp;#35782;&amp;#20849;&amp;#20139;&amp;#32626;&amp;#21517;-&amp;#38750;&amp;#21830;&amp;#19994;&amp;#24615;&amp;#20351;&amp;#29992; 2.5 &amp;#20013;&amp;#22269;&amp;#22823;&amp;#38470;&amp;#35768;&amp;#21487;&amp;#21327;&amp;#35758;&lt;/a&gt;&amp;#36827;&amp;#34892;&amp;#35768;&amp;#21487;&amp;#12290;

&lt;p&gt;I spent some time on twist my blog(grissiom.blogspot.com) today. The major changes are direct RSS feed to feedburner( &lt;a class="reference external" href="http://feeds.feedburner.com/Grissiom"&gt;http://feeds.feedburner.com/Grissiom&lt;/a&gt; ) and add a CC icon on the blog. I choose &lt;cite&gt;NOT allow commercial uses of your work&lt;/cite&gt; and &lt;cite&gt;Allow modifications of your work(not require as long as others share alike)&lt;/cite&gt;. So the articles on this blog will be covered by that license. Take care of this.&lt;/p&gt;

&lt;p&gt;Also, I found a script named rst2wp.py from &lt;a class="reference external" href="http://unmaintainable.wordpress.com/2008/03/22/using-rst-with-wordpress/"&gt;Using ReStructured Text with WordPress&lt;/a&gt; which is wonderful work. I adapted it to meet my blogspot's need. The script can be found on my &lt;a class="reference external" href="http://gitorious.org/mles/mles/trees/master"&gt;MLES&lt;/a&gt; repository along with my other &lt;cite&gt;Make Life Easier Scripts&lt;/cite&gt; ;-)&lt;/p&gt;

&lt;p&gt;Hope you could enjoy them :-)&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Extract Audio to Ogg with mencoder and oggenc</title><link>http://grissiom.blogspot.com/2009/12/extract-audio-to-ogg-with-mencoder-and.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Thu, 10 Dec 2009 16:29:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-8142174639401345313</guid><description>&lt;p&gt;If you got a video of a though-provoking speech, you may want to convert it to a audio file which could copy into your mp3 player and be with you all the time. You can listen to it without boot up the computers. In some situations listen is much easier than seeing.&lt;/p&gt;                                                                                                          

&lt;p&gt;mp3 is one of the choice of the audio file formats. But for patent reason, my distribution doesn't ship lame. And I know there is ogg format &lt;a class="citation-reference" href="#ref1" id="id1"&gt;[Ref1]&lt;/a&gt; which is more open and free. So I decided to encode all the audio into ogg format.&lt;/p&gt;                                                                                     

&lt;p&gt;mencoder is part of mplayer which is very very powerful multi-media player. With mencoder/mplayer, you can play nearly all kind of video/audio files. We only care about the audio here. Let's start to work!&lt;/p&gt;                                        

&lt;p&gt;Basicly we need to extract the audio from the multi-media stream first:&lt;/p&gt;

&lt;pre&gt;
mencoder video.mp4 -of rawaudio -ovc copy -oac pcm -o audio.pcm
&lt;/pre&gt;                                                         

&lt;p&gt;&lt;cite&gt;-of rawaudio&lt;/cite&gt; tells the mencoder to output audio stream only. Although the man page told me the &lt;cite&gt;-of&lt;/cite&gt; option is still BETA but it works like a charm here. &lt;cite&gt;-ovc copy&lt;/cite&gt; tells mencoder not to decode the video stream, which would consume less resources on your computer. &lt;cite&gt;-oac pcm&lt;/cite&gt; tells mencoder to encode the audio to uncompressed PCM. Now, we can use &lt;cite&gt;ogg --raw audio.pcm&lt;/cite&gt; to convert the raw pcm file to an ogg file.&lt;/p&gt;                          

&lt;p&gt;But it's far from perfect. One big problem is this way of converting will last long time. When mencoder is extracting, oggenc doesn't convert simultaneously. So the time will be doubled. The other problem is you have to provide a relatively large temperary file to contain the pcm data. The method that could kill two birds with one stone is using a pipe. So the second version will be:&lt;/p&gt;                                                                                                               

&lt;pre&gt;
mencoder video.mp4 -of rawaudio -ovc copy -oac pcm -o - | \
    oggenc --raw - -o audio.ogg                            
&lt;/pre&gt;                                                     

&lt;p&gt;But this version have bugs too. mencoder will print out something like:&lt;/p&gt;

&lt;pre&gt;
MEncoder r29789-4.3.3 (C) 2000-2009 MPlayer Team
success: format: 0  data: 0x0 - 0x34468059      
libavformat file format detected.               
[lavf] Audio stream found,  -aid 0              
[lavf] Video stream found,  -vid 1              
VIDEO:  [H264]  1280x720  24bpp  29.970 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:44  fourcc:0x34363248  size:1280x720  fps:29.970  ftime:=0.0334
========================================================================== 
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)          
FAAD: compressed input bitrate missing,  assuming 128kbit/s!               
AUDIO: 44100 Hz,  2 ch,  s16le,  128.0 kbit/9.07% (ratio: 16000-&amp;gt;176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))    
========================================================================== 
Ignoring video stream!                                                     
videocodec: framecopy (1280x720 24bpp fourcc=34363248)                     
Pos:   0.7s     22f ( 0%)  0.00fps Trem:   0min 141mb  A-V:0.068 [0:1411]  
Skipping frame!                                                            
&lt;/pre&gt;                                                                     

&lt;p&gt;which will corrupt the pcm stream to stdout and cause a corrupted ogg file eventually. In man page, it said &lt;cite&gt;-quiet&lt;/cite&gt; will &lt;cite&gt;Make  console  output less verbose&lt;/cite&gt; and &lt;cite&gt;-really-quiet&lt;/cite&gt; will &lt;cite&gt;Display even less output and status messages than with -quiet&lt;/cite&gt; but there is no &lt;em&gt;guarantee&lt;/em&gt; that &lt;cite&gt;There won't be any message to stdout&lt;/cite&gt;. That's unbearable for our condition.&lt;/p&gt;                                                                              

&lt;p&gt;So I come up with the idea that shell can redirect file-descriptor 3-10 to stdout, stdin or stderr. So we can write the pcm stream to file descriptor 3, and redirect the fd 3 to stdout. Then, redirect the origin stdout where the messages going to /dev/null. But how to tell mencoder write the pcm stream to fd 3?  The trick is simple. Actually, fd n is /proc/self/fd/n for the process. What a great design of Linux system! Now, the pipe should be clean. Here is the final version:&lt;/p&gt;

&lt;pre&gt;
mencoder video.mp4 -of rawaudio -ovc copy -oac pcm \
    -o /proc/self/fd/3 3&amp;gt;&amp;amp;1 1&amp;gt;/dev/null | \
    oggenc --raw - -o audio.ogg
&lt;/pre&gt;

&lt;p&gt;There are two things you should care:&lt;/p&gt;

&lt;blockquote&gt;&lt;ol class="arabic"&gt;
&lt;li&gt;You must redirect fd 3 when dumping things into it, otherwise it will break.&lt;/li&gt;
&lt;li&gt;The order in redirection is important. &lt;cite&gt;3&amp;gt;&amp;amp;1&lt;/cite&gt; means redirect 3 to what 1 &lt;em&gt;currently&lt;/em&gt; is. If you &lt;cite&gt;1&amp;gt;/dev/null&lt;/cite&gt; and then &lt;cite&gt;3&amp;gt;&amp;amp;1&lt;/cite&gt;, fd 3 will be redirected to /dev/null as well.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, you can extract the audio to ogg file flawlessly. Big thanks to &lt;a class="reference external" href="http://www.commandlinefu.com"&gt;http://www.commandlinefu.com&lt;/a&gt; where tell me the usage of mencoder.&lt;/p&gt;

&lt;table class="docutils citation" frame="void" id="ref1" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id1"&gt;[Ref1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a class="reference external" href="http://www.vorbis.com/"&gt;http://www.vorbis.com/&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Gappproxy plus pac is your friend to break the wall</title><link>http://grissiom.blogspot.com/2009/12/gappproxy-plus-pac-is-your-friend-to.html</link><category>gae</category><category>gfw</category><category>pac</category><author>noreply@blogger.com (grissiom)</author><pubDate>Tue, 8 Dec 2009 17:23:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-3183177194643973964</guid><description>&lt;p&gt;Nearly everyone on the earth know that China has a Great Fire Wall to monitor and control connections abroad. It block some web pages that should not be seen by teenagers or have politic issues. But it blocks some useful webs too. For example, *.blogspot.com where holds many technical blogs, &lt;a class="reference external" href="http://chrome.google.com/extensions"&gt;http://chrome.google.com/extensions&lt;/a&gt; where you can extent you Chromium... It's unbearable for someone(like me, although I tolerated it for quite a long time) got &amp;quot;Connection Reset&amp;quot; now and then. So I decided and managed to get through it with Gappproxy.&lt;/p&gt;                                                                                                                     

&lt;h4&gt;Why Gappproxy?&lt;/h4&gt;
&lt;p&gt;It based on GAE(&lt;a class="reference external" href="http://appengine.google.com/"&gt;Google App Engine&lt;/a&gt;), which is free(within quotas) and powerful and 7x24 on line. Someone may found GAE has been blocked too. I will talk on it later. There are many ways to break walls such as buy a VPS abroad and use ssh tunnel through it or use VPN. But neither I don't have the money and time to buy a VPS nor many free VPN sites are not accessible, I choose Gappproxy as my way to embrace the free world.&lt;/p&gt;    

&lt;p&gt;There are some tutorials that could teach you how to setup a Gappproxy for yourself, search it on baidu.com will give you many results. (I nearly never search sensitive topic on Google because it would bring it into trouble) So I won't reinvent the wheel. One thing I want to mention is the Gappproxy main site was blocked too(not surprisingly). So you could not retrieve the source files unless you pass the wall... Here is a link for the tarballs and you may find it accessible behind the wall:&lt;/p&gt; 

&lt;blockquote&gt;&lt;a class="reference external" href="http://gappproxy.googlecode.com/files/gappproxy-1.0.0beta.tar.gz"&gt;http://gappproxy.googlecode.com/files/gappproxy-1.0.0beta.tar.gz&lt;/a&gt;&lt;/blockquote&gt;                                                         

&lt;p&gt;In this tarball, &lt;cite&gt;fetchserver&lt;/cite&gt; folder have the files that should be deployed to GAE, which is equivalent to the fetchserver tarball in most tutorials; in &lt;cite&gt;localproxy&lt;/cite&gt; folder there is the client need to be run on your box. Don't forget to adjust them before you deploy/run :-)&lt;/p&gt;                                                                          

&lt;p&gt;After it was fully setup, set your browser's proxy to localhost:8000. I prefer to use a pac file to do the trick.(See below) After got it run successfully, you may need to update your Gappproxy to the latest version.&lt;/p&gt;                             

&lt;h4&gt;Access to GAE&lt;/h4&gt;
&lt;p&gt;Actually it's quite easy to do the trick. Following this link &lt;a class="reference external" href="http://ftofficer.spaces.live.com/blog/cns!423B72634E2F6B7E!1073.entry"&gt;http://ftofficer.spaces.live.com/blog/cns!423B72634E2F6B7E!1073.entry&lt;/a&gt; (which is also blocked, but you can search &amp;quot;appspot www.google.cn&amp;quot; in baidu.com. It will be the third entry. Take snapshot with baidu you can know what he/she is saying about, in Chinese), you can edit your /etc/hosts to let your appspot point to a www.google.cn's IP. Now your GAE will be accessible. I hope GFW won't block www.google.cn ;-)&lt;/p&gt;                            

&lt;h4&gt;Use a pac file to setup proxy for your web browser&lt;/h4&gt;
&lt;p&gt;The last blog I mentioned above have taught me how to use a pac file to set up proxy for web browser. Why use pac file?&lt;/p&gt;

&lt;blockquote&gt;&lt;ol class="arabic"&gt;
&lt;li&gt;It's plain text file with JavaScript syntax. So it will be editable with any of your favorite text editor.  I know nothing about JavaScript but a pac file is rather easy to write and understand and thus, easy to extend.&lt;/li&gt;                        
&lt;li&gt;It's flexible and powerful. You can set different proxies for different urls or hosts. You can even tell the browser to connect to the web directly for some urls.&lt;/li&gt;                                                                                 
&lt;li&gt;It's browser-independent. It's not a fancy Firefox plugin which could not run on Chromium. It's a standard which is supported by most of the browsers, Firefox, Chromium, Opera... Maybe if you find a browser which does not support it, you should not use that browser ;-) (I haven't tested it in IE though.. ;)&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are tutorials teaching you what a pac file is and how to write a pac file &lt;a class="citation-reference" href="#ref1" id="id1"&gt;[Ref1]&lt;/a&gt;, &lt;a class="citation-reference" href="#ref2" id="id2"&gt;[Ref2]&lt;/a&gt; , so I won't reinvent the wheel again ;)&lt;/p&gt;

&lt;p&gt;Let me use one sentence to finish this article:&lt;/p&gt;

&lt;blockquote&gt;&lt;strong&gt;Standing on the Cloud, where is the Wall?&lt;/strong&gt;&lt;/blockquote&gt;

&lt;table class="docutils citation" frame="void" id="ref1" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id1"&gt;[Ref1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a class="reference external" href="http://en.wikipedia.org/wiki/Proxy_auto-config"&gt;http://en.wikipedia.org/wiki/Proxy_auto-config&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;table class="docutils citation" frame="void" id="ref2" rules="none"&gt;
&lt;colgroup&gt;&lt;col class="label" /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td class="label"&gt;&lt;a class="fn-backref" href="#id2"&gt;[Ref2]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;a class="reference external" href="http://code.google.com/p/gappproxy/wiki"&gt;http://code.google.com/p/gappproxy/wiki/UsingProxy_StepByStep#　_2._使用_PAC_文件，强大、智能&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Suspend slackware in DELL1501</title><link>http://grissiom.blogspot.com/2009/04/suspend-slackware-in-dell1501.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Thu, 16 Apr 2009 20:50:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-5274367598683073521</guid><description>&lt;p&gt;&lt;b&gt;This is not true! It seems this is a kernel regression. I will post more info after the problem is identified! &lt;/b&gt;&lt;/p&gt;
&lt;del&gt;
&lt;p&gt;Many users say that a Linux box should be shutdown as less time as possible. Because system will buffer the disk for you so the second-start-up time of an app will be much shorter. The longer time you run, the more quantity and more accurate buffer system will allocate, the faster your app will launch. If you shutdown you computer, all the buffer will gone. But I have to pay for my electricity charge! I want save power when I do not use my box. Unfortunately,  Hibernate won't help because system will free "useless" pages to optimize load time.(I think) But Suspend is will keep the buffers and consume less energy. This is tested by other people.&lt;/p&gt;

&lt;p&gt;But I suffered a disaster after resume from suspend. System goes totally unstable after resuming. I got something like this in dmesg:
&lt;pre&gt;
[ 7962.125970] BUG: unable to handle kernel paging request at f76f5004
[ 7962.125984] IP: [&lt;c01e0129&gt;] ext3_check_dir_entry+0x19/0x140
[ 7962.126000] *pde = 00007067 *pte = 77520002 
[ 7962.126010] Oops: 0000 [#1] SMP 
[ 7962.126017] last sysfs file: /sys/power/state
[ 7962.126024] Modules linked in: radeon drm vboxnetflt vboxdrv snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss ipv6 nls_cp936 vfat fat ext4 jbd2 crc16 fuse dell_laptop dcdbas b43 mac80211 joydev ricoh_mmc sdhci_pci cfg80211 led_class shpchp ohci_hcd sg input_polldev ati_agp agpgart video output
[ 7962.126075] 
[ 7962.126082] Pid: 6509, comm: pm-powersave Not tainted (2.6.29.1-slk-based-2 #4) Inspiron 1501 
[ 7962.126089] EIP: 0060:[&lt;c01e0129&gt;] EFLAGS: 00010292 CPU: 1
[ 7962.126097] EIP is at ext3_check_dir_entry+0x19/0x140
[ 7962.126102] EAX: c0463684 EBX: f76f5000 ECX: f76f5000 EDX: f6c5a478
[ 7962.126108] ESI: f6846a00 EDI: 00002000 EBP: f6c5a478 ESP: f6785cec
[ 7962.126113]  DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[ 7962.126120] Process pm-powersave (pid: 6509, ti=f6784000 task=f7031090 task.ti=f6784000)
[ 7962.126126] Stack:
[ 7962.126129]  f7781000 d9e5ad68 f6c35040 c01e6c4d 00000000 00000000 f6785dec f6785dec
[ 7962.126141]  f6785e80 c0463684 00000000 f76f5000 f6846a00 00002000 f6e246c0 c01e86f3
[ 7962.126153]  f6e246c0 00002000 f66c2cc0 f6ba1400 00000000 c01e5a07 0000000b d9c5fbb8
[ 7962.126166] Call Trace:
[ 7962.126171]  [&lt;c01e6c4d&gt;] dx_probe+0x8d/0x350
[ 7962.126180]  [&lt;c01e86f3&gt;] ext3_find_entry+0x403/0x650
[ 7962.126189]  [&lt;c01e5a07&gt;] ext3_truncate+0x317/0x8e0
[ 7962.126197]  [&lt;c01e263a&gt;] __ext3_get_inode_loc+0xda/0x2f0
[ 7962.126205]  [&lt;c012378e&gt;] __wake_up+0x3e/0x60
[ 7962.126215]  [&lt;c01e91a6&gt;] ext3_lookup+0x46/0xf0
[ 7962.126222]  [&lt;c01a4dd7&gt;] d_alloc+0xf7/0x170
[ 7962.126233]  [&lt;c019b8ba&gt;] do_lookup+0x1ba/0x1e0
[ 7962.126240]  [&lt;c019d5d5&gt;] __link_path_walk+0x675/0xd90
[ 7962.126247]  [&lt;c016baca&gt;] generic_file_aio_read+0x2fa/0x6d0
[ 7962.126257]  [&lt;c011bcdc&gt;] do_page_fault+0x28c/0x6a0
[ 7962.126266]  [&lt;c019dea4&gt;] path_walk+0x54/0xb0
[ 7962.126273]  [&lt;c019e000&gt;] do_path_lookup+0xb0/0x160
[ 7962.126280]  [&lt;c019cf26&gt;] getname+0x96/0xd0
[ 7962.126287]  [&lt;c019ec3a&gt;] user_path_at+0x5a/0x90
[ 7962.126295]  [&lt;c0197352&gt;] vfs_stat_fd+0x22/0x60
[ 7962.126305]  [&lt;c019746f&gt;] sys_stat64+0xf/0x30
[ 7962.126313]  [&lt;c010336e&gt;] syscall_call+0x7/0xb
[ 7962.126321] Code: ff ff 83 c4 0c 5b c3 90 90 90 90 90 90 90 90 90 90 90 83 ec 3c 89 6c 24 38 89 5c 24 2c 89 d5 89 74 24 30 89 7c 24 34 89 44 24 24 &lt;0f&gt; b7 41 04 3d ff ff 00 00 74 74 83 f8 0b 89 c6 0f 8f c1 00 00 
[ 7962.126379] EIP: [&lt;c01e0129&gt;] ext3_check_dir_entry+0x19/0x140 SS:ESP 0068:f6785cec
[ 7962.126390] ---[ end trace a30eca9c02841218 ]---
&lt;/pre&gt;
Some process has been terminated for some reason that I don't know. Even syslogd at worst case! Firefox won't launch, su don't work, if you click icons on panel, plasma will freeze...
&lt;/p&gt;

&lt;p&gt;After some exploring, I see these lines lay in /usr/doc/pm-utils-1.2.5/README.SLACKWARE
&lt;pre&gt;
==============================================================================

KNOWN ISSUES

****  If you encounter either of these, mail rworkman@slackware.com ****

If your alsa drivers don't correctly save and restore state across a sleep /
resume cycle (due to a buggy driver), then you will need to add the drivers
to a custom file named /etc/pm/config.d/defaults (create the file if it does
not exist already) in a variable named "SUSPEND_MODULES" - see the file at
/usr/lib/pm-utils/defaults for proper format.

The /usr/lib/pm-utils/sleep.d/90clock does not run by default.  It added
over a second to suspend, and the vast majority of hardware does not need it
to keep the clocks in sync.  If you need this hook, you can set the
NEED_CLOCK_SYNC environment variable in a custom /etc/pm/config.d/defaults
file.

==============================================================================
&lt;/pre&gt;
So I tried to set NEED_CLOCK_SYNC=1 in /etc/pm/config.d/defaults . Suspend, go to a sleep, Resume. And everything works well! Angles sing, light suddenly fills the dorm ;)
&lt;/p&gt;

&lt;p&gt;What /usr/lib/pm-utils/sleep.d/90clock actually done is here:
&lt;pre&gt;
#!/bin/sh
# Synchronize system time with hardware time.
# TODO: Do modern kernels handle this correctly?  If so, we should detect that
#       and skip this hook.

. "${PM_FUNCTIONS}"

suspend_clock()
{
        /sbin/hwclock --systohc &gt;/dev/null 2&gt;&amp;1 0&lt;&amp;1
}

resume_clock()
{
        /sbin/hwclock --hctosys &gt;/dev/null 2&gt;&amp;1 0&lt;&amp;1
}

[ "$NEED_CLOCK_SYNC" ] || exit $NA

case "$1" in
        hibernate|suspend) suspend_clock ;;
        thaw|resume) resume_clock ;;
        *) exit $NA ;;
esac


&lt;/pre&gt;
&lt;/p&gt;
&lt;/del&gt;
&lt;p&gt;A LQ post that I created to discuss this issue is &lt;a href="http://www.linuxquestions.org/questions/slackware-14/system-unstable-after-resume-from-suspend-719718/"&gt; here &lt;/a&gt;&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>终于搞定 bzr 的 launchpad 帐户了……</title><link>http://grissiom.blogspot.com/2009/03/bzr-launchpad.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Tue, 31 Mar 2009 15:51:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-3886734276745873175</guid><description>&lt;p&gt;纵使有一千个理由骂 bzr（而且确实有一千个理由），可还是要用它，入乡随俗么…… &lt;/p&gt;

&lt;p&gt;终于把 bzr 上的 launchpad 帐户搞定了。方法是在 ~/.bash_profile 里加一句 &lt;pre&gt; export CURL_CA_BUNDLE=/usr/share/apps/kssl/ca-bundle.crt&lt;/pre&gt;，那个 ca-bundle.crt 是 "grep ca-bundle.crt /var/log/packages*" 找到的，竟然是 kde 包里面的一个东西 Qrz... 而且要重新 clone 上游才能有 commit 权限……&lt;/p&gt;

&lt;p&gt;干嘛不用 git 呢？忽然想起前段时间看到的一句话："yet another f*cking wheel -- but a better one"，但是我觉得 bzr 就是"yet another f*cking wheel -- but a worse one"&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>近况</title><link>http://grissiom.blogspot.com/2009/03/blog-post.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Tue, 24 Mar 2009 07:24:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-4826385055978283551</guid><description>&lt;p&gt;&lt;ol&gt;
&lt;li&gt;&lt;p&gt;
先是帮东子装上了 Slackware，装完了之后发现 slack 确实有点不适合新手，一开始不进图形界面就是一个比较大的台阶，系统的配置都只能通过文本来解决就会让很多从 win 下转来的孩子们不知所措…… 不过还好，折腾了一下午终于大概配置好了。
&lt;/p&gt; &lt;p&gt;
不过在配置鼠标滚轮的时候发现一个问题，安装网上说的在 InputDevice 里加入：
&lt;pre&gt; Option      "ZAxisMapping" "4 5"&lt;/pre&gt;
还是不够，还需要把 Option      "Protocol" 改成 "explorerps/2" 才行…… 不知大家有没有遇到相同的问题……&lt;/p&gt;
&lt;p&gt;Update: 看了 vvoody 的回复，发现改成 "IMPS/2" 也是可以的，后来自己好奇，改成了"auto"，结果 xorg 自己探测的结果还是 "explorerps/2"，好吧，还是信任 xorg 吧～&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;最近开始看 &lt;a href="http://babiloo-project.org/wiki/index.php/Main_Page"&gt;Babiloo&lt;/a&gt;的源码了~主要是因为1)觉得不看代码还是不行2)那个东西是用 PyQt4 写的而且是个字典程序，还可以就着学点英语。不过看的时候就觉得不爽，首先是代码是用 bzr 托管在 launchpad.com，用惯了 git 感觉 bzr 作为一个 “分布式”版本控制工具怎么就不支持本地的分支和合并……（至少是迄今为止我还不知道怎么办，特性里面也没有说……）而且 bzr 和 launchpad 绑定的太紧了……代码缩进风格和自己的也不一样…… 不过能和作者直接联系这个优势是怎么样也替代不了的~ 当找到一个 bug 的时候可以和作者直接联系，他会给你讲一些全局上的事情，能让人受益匪浅。不管怎样，先坚持下去吧~&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>大刀向Google Reader的头上砍去</title><link>http://grissiom.blogspot.com/2009/03/google-reader.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Mon, 2 Mar 2009 16:59:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-593415468539906589</guid><description>&lt;p&gt;今天在 Reader 里看到这样一篇文章：&lt;a href="http://blog.antingxu.com/262/machetes-to-cut-off-the-heads-of-google-reader"&gt;《大刀向Google Reader的头上砍去》&lt;/a&gt;文章幽默诙谐，读后深有感触。于是反观自己的 Reader，嗯，是该整理了。&lt;/p&gt;

&lt;p&gt;整理的时候忽然发现 GReader 有一个十分好的功能：Trends(不清楚中文是怎么翻译的)。打开他就可以看到每个订阅的阅读率。我把低于 30% 的原则上全部退订了~一下子清闲了很多。估计以后又会有一段清闲的生活了，不过节省下来的时间去干嘛呢？……&lt;/p&gt;

&lt;p&gt;忽然记起来以前看到过一个“定律”的，就是一个人开始的时候总是会被垃圾信息包围着，但是他又不愿意去屏蔽，因为“可能”会损失有价值的信息。但是事实是从一堆垃圾信息里能提取出有价值信息的概率很小，人们总是会得到有价值信息的，但是不是通过这种“鸟枪法”。但是现在我就感觉自己的信息“确实”太闭塞了，整天两眼一摸黑，啥新闻都不知道…… 大家都是怎么样收集信息的呢？&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>感动中国 2008 之感动我</title><link>http://grissiom.blogspot.com/2009/02/2008.html</link><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Thu, 5 Feb 2009 21:24:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-5691686802298857385</guid><description>&lt;p&gt;其实一开始就觉得自己没心没肺，如果不是我妈看那个节目我也就不会搬电脑过去看了。但是既然看了，而且略微有点小感动了，那就墨迹两句吧。&lt;/p&gt;

&lt;p&gt;看完之后我妈问我，哪个给你最大的感动？我问，你呢？她说，是那个彝族教师，因为其他人其实只是做好他们的本职工作。我觉得也是。尤其是当他说自己每月的工资只有两百块钱的时候，快不成了……其实我当时很想看看主持人是什么表情，估计她的工资是这个的百倍，身上的一件衣服就顶的上人家几个月的工资…… 能够经常上网的同学们也可以想想两百块对你来说算什么？对人家来说算什么？由此，其实中国的国情也就可见一斑了。（想说当地消费水平低的滚蛋~ 每月给你两百块钱把你扔山里19年你试试？）&lt;/p&gt;

&lt;p&gt;其实还有一个感动的，就是神州七号的乘员组。可能是自己从小关心航空航天的事件，略微知道点其中的辛劳、危险的缘故。尤其是当舱内有火警时改变工作程序的那一段。虽然理智上感觉那样做不对，觉得要是真有火，还是先灭火为好，但是那种大无畏的勇气，祖国至上的精神，是最感动我而且我所应该学习的。&lt;/p&gt;

&lt;p&gt;没错，本质上说他们只是完成了自己的本职工作。但是这年头，能干好自己的本职工作就比较不错了。要是还有能力，还有意志，做到像那两个彝族教师一样更好。貌似《肖申克的救赎》里有句经典台词叫“要么好好活着，要么就去死”说的就是这个事？说了半天，其实我还是属于那种“就去死”的类型，为了以后能“好好活 ”今天就先不死了，呵呵~&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>sep.py v0.1.1 发布</title><link>http://grissiom.blogspot.com/2009/01/seppy-v01.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Wed, 14 Jan 2009 15:50:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-7543133591135521324</guid><description>&lt;p&gt;咳咳~ sep.py 是我自己写的一个 python 小脚本。用来从当前目录下提取指定扩展名的文件，并且保留其目录结构~~ 我经常是先用 &lt;a href="http://www.douban.com/people/vvoody/"&gt;vvoody&lt;/a&gt; 的 &lt;a href="http://code.google.com/p/vvoodys/source/browse/#svn/trunk/cueconv"&gt;cueconv.sh&lt;/a&gt; 转换下载下来的 flac啊，cue+ape啊什么的，然后在用这个脚本把转出来的东西一并提取出来，而且不会乱~;)&lt;/p&gt;

&lt;p&gt;源代码在这里：&lt;a href="http://github.com/grissiom/etc/raw/59d2482073b174530c27a58c8c28c8852e11d579/sep/sep.py"&gt;http://github.com/grissiom/etc/raw/59d2482073b174530c27a58c8c28c8852e11d579/sep/sep.py&lt;/a&gt;。GPLv3 的许可证吧。代码是用 github 托管的~ 感兴趣的同学可以跟踪。非常欢迎提意见或者是 bug report。要是 bug fix 更好~ ;D&lt;/p&gt;

&lt;p&gt;早晨发布的那个 v0.1 有问题，这个 v0.1.1 就好了~ 如果带来不便请见谅~;)&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>Qt4.5 will release under LGPL</title><link>http://grissiom.blogspot.com/2009/01/qt45-will-release-under-lgpl.html</link><author>noreply@blogger.com (grissiom)</author><pubDate>Wed, 14 Jan 2009 15:04:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-1921843454148770687</guid><description>&lt;a href="http://www.qtsoftware.com/about/licensing"&gt;消息来源&lt;/a&gt;。&lt;a href="http://dot.kde.org/1231920504/"&gt;这里&lt;/a&gt;还有~~</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Burning 4GB+ file(a singal large file) into a disk</title><link>http://grissiom.blogspot.com/2009/01/burning-4gb-filea-singal-large-file.html</link><category>linux</category><category>tips</category><author>noreply@blogger.com (grissiom)</author><pubDate>Tue, 13 Jan 2009 01:46:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-4999971274525069251</guid><description>&lt;p&gt;详细的讨论在这：&lt;a href="http://www.linuxquestions.org/questions/slackware-14/k3b-says-your-mkisofs-doesnt-support-large-filesetc-696073/"&gt;http://www.linuxquestions.org/questions/slackware-14/k3b-says-your-mkisofs-doesnt-support-large-filesetc-696073/&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;症状是K3b说“Used version of mkisofs does not have large file support.Files bigger than 2GB cannot be handled. ”于是，大文件都被丢掉了……&lt;/p&gt;

&lt;p&gt;一开始还以为是 mkisofs 的问题，后来经人指点才知道应该选中 ISO9660 的 Level 3。查了&lt;a href="http://en.wikipedia.org/wiki/ISO9660#The_4_GiB_.28or_2_GiB_depending_on_implementation.29_file_size_limit"&gt;维基百科&lt;/a&gt;才知道原来通过 Level 3 可以把大于4GB(或2GB)的文件分割，这样就可以刻录了。经验不敢独吞，拿出来分享~;)&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Slackware 12.2 is released!</title><link>http://grissiom.blogspot.com/2008/12/slackware-122-is-released.html</link><category>Slackware</category><author>noreply@blogger.com (grissiom)</author><pubDate>Wed, 10 Dec 2008 22:58:00 -0800</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-6895159648323340196</guid><description>Hello all slackers! I'm happy to see that Slackware 12.2 was released in Tue Dec  9 00:00:23 CST 2008 ! As said in the official announcement, it's a must-have upgrade for any Slackware user.So happy updating if you didn't keep track with the -current branch. Here is the announcement in ChangeLog:&lt;br /&gt;
===========================================================
&lt;br /&gt;
Slackware 12.2 is released as -stable.  Thanks as always to everyone who helped make this a great point release in the Slackware 12.x series.  Without such a great community surrounding it, Slackware could not possibly be as stable and
reliable as it is.  Thanks to the Slackware Crew, the users of LinuxQuestions, people contributing ideas and patches on IRC and other Slackware forums, the developers at slackbuilds.org for bringing in new technologies, and everyone
else who shared insights that helped to refine this release over many months.  Happy release day to you all!  :-)
&lt;br /&gt;&lt;br /&gt;
  Also, ISOs have been sent off to the replicator now to be pressed as a 6 CD set or a single DVD.  The store.slackware.com is taking pre-orders -- if you like Slackware, please consider supporting the project.  We've also added new black T-shirts with the traditional Slackware logo.  Check them out!
&lt;br /&gt;&lt;br /&gt;
  Once again, thanks to the entire Slackware community for all the help and encouragement as Slackware 12.2 progressed to release.  Have fun!  -P.
&lt;br /&gt;
===========================================================</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>两小无猜</title><link>http://grissiom.blogspot.com/2008/10/blog-post_24.html</link><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Fri, 24 Oct 2008 16:27:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-2420696341158945773</guid><description>遥想当年冬霜时，&lt;br /&gt;
桃花别样红。&lt;br /&gt;
&lt;br /&gt;
今年才知另所属，&lt;br /&gt;
谈笑仍依旧。&lt;br /&gt;
&lt;br /&gt;
都是两小无猜时，&lt;br /&gt;
岂曰恨与仇！&lt;br /&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total></item><item><title>必须要写了～</title><link>http://grissiom.blogspot.com/2008/10/blog-post.html</link><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Sun, 12 Oct 2008 09:02:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-66153638029713522</guid><description>&lt;p&gt;记得以前看《读者》一类的杂志，其实很无聊，不过里面的"言论"板块我挺喜欢的，就是记录一些一句话似的言论……挺能发人深思或者令人开怀大笑的。前一段时间自己也从网上收集了一些，本来想再攒攒，但是今天参加了一个经济学讲座，感觉，应该说点什么了。于是有关无关的都 dump 过来吧～欢迎大家讨论～&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;"读得太少"往往是"写不出来"的最根本原因。计算机术语中有一个有趣的缩写"GIGO"——"Garbage in, Garbage out."——"如果输入的是垃圾，那么输出的就是垃圾"。 &lt;/li&gt;

&lt;li&gt;如果你去年买了1000美元达美航空的股票，你今年只能剩下49美元。如果是房利美，你最初的1000美元只能剩下 2块5。如果是AIG，你剩下的会不足15美元。但是，如果你一年前买了1000美元的啤酒，喝光了它们，然后把喝剩的易拉罐送去回收站，你最后能换回 214美元。根据上面的事实，目前最好的投资策略是猛喝啤酒，然后回收易拉罐。&lt;/li&gt;

&lt;li&gt;一个底层结构设计是否成功，这个设计者是否称职，我一直觉得是有一个很简单的衡量标准的。你不需要看这个设计人用了多少NB的技术，你只需要关心，他的设计，是否给其他开发人员带来了困难。一个NB的设计，是将所有困难都集中在底层搞定，把其他开发人员换成白痴都可以工作的那种；一个SB的设计，是自己弄了半天，只是为了给其他开发人员一个长达250条的注意事项，然后很NB的说，你们按照这个手册去开发，就不会有问题了。。 &lt;/li&gt;

&lt;li&gt;人：什么？明天要考高数？？&lt;br /&gt;
得道：什么？下节课要考高数？？&lt;br /&gt;
入仙：什么？刚才考的是高数？？&lt;br /&gt;
成佛： 什么？昨天有考试？？&lt;br /&gt;
高级佛爷：高数？刚才考的不是英语？？&lt;br /&gt;
我寝室一哥们：高数是什么树？？ &lt;br /&gt;
有人补充：&lt;br /&gt;
佛祖：是高数还是高树玛丽亚？&lt;/li&gt;

&lt;li&gt; Two days later than initially planned, "Codename" (or more traditionally KDE 4.1.2) was released just a few minutes ago.。。。
so no new features went into KDE 4.1.2, but some nice bug fixes instead. David Faure has fixed a long-standing and annoying performance issue when deleting files using KIO, so you can now accidentally delete your home directory 32 times faster For the more faint-hearted, it will also work well with other files.&lt;/li&gt;

&lt;li&gt;Although I am a typical loner in daily life, my consciousness of belonging to the invisible community of those who strive for truth, beauty, and justice has preserved me from feeling isolated.
                                   &lt;br /&gt;&lt;div style="text-align: right;"&gt;
Albert Einstein, 1932.&lt;/div&gt;

&lt;/li&gt;

&lt;li&gt;过去366天里，美国股市市值蒸发了8万亿美元。每个美国家庭能摊十几万吧。&lt;/li&gt;

&lt;li&gt;对"钱哪儿去了"这个问题，我立即回答：蒸发了。这个回答简单并且片面，如果再加上几个字，变成"蒸发了，沉淀了，减少了"，大致就圆满了。
……
商业票据少了、银行授信少了、银行票据（如承兑汇票）少了，你说"钱"是不是实实在在地减少了？&lt;/li&gt;

&lt;p&gt;我自己说一句：&lt;/p&gt;
&lt;li&gt;
如果那天一觉醒来发现我们国家1.8万亿的美元储备不值钱了，即，平均中国每个国民损失大概一万人民币，那么，我们还会那样的崇洋媚外么？&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;其实，一开始是想搞笑的，可是发现忽然笑不起来了……&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>整理了一下Google Bookmarks，今后上网要规律了</title><link>http://grissiom.blogspot.com/2008/10/google-bookmarks.html</link><category>tips</category><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Sun, 5 Oct 2008 02:36:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-8698685689932807772</guid><description>&lt;p&gt;学习 cron 的做法，把常用的网站分成了 daily, weekly。这样以后就可以一次性地把常用网站全部打开，一个一个看完之后就下线。我上网占的时间实在是太长了，浪费的时间太多了……&lt;/p&gt;

&lt;p&gt;统计了一下，daily 的网站也就十几个，怎么就浪费这么长时间？唉……&lt;/p&gt;

&lt;p&gt;多读书多读书，学习学习~~&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total></item><item><title>逗死我了</title><link>http://grissiom.blogspot.com/2008/09/blog-post_29.html</link><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Mon, 29 Sep 2008 06:55:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-5266822357189346810</guid><description>&lt;p&gt;今天在 bugs.kde.org 上看到一段对话，差点没把我逗死：
（原文：&lt;a href="http://bugs.kde.org/show_bug.cgi?id=161673"&gt;http://bugs.kde.org/show_bug.cgi?id=161673&lt;/a&gt;）&lt;/p&gt;
&lt;div&gt;
&lt;b style="background-color: rgb(192, 192, 192);"&gt;Kevin Kofler 2008-09-27 10:38:31 Comment #31&lt;/b&gt;&lt;br /&gt;
...
The history as I recall it (and I do have experience with old M$ systems) is ...
...
And this shows that you don't have enough experience with M$ codepages to make such a change. CP 1252 obviously doesn't work because it's a Window$ codepage, not an "OEM codepage" (i.e. DO$ codepage) and FAT uses "OEM codepages".
......
&lt;/div&gt;&lt;div&gt;
&lt;b style="background-color: rgb(192, 192, 192);"&gt;Jeff Mitchell 2008-09-27 16:37:10    Comment #34&lt;/b&gt;&lt;br /&gt;
Could you $top u$ing dollar $igns everywhere? It looks $upremely $tupid.
&lt;/div&gt;&lt;div&gt;
&lt;b style="background-color: rgb(192, 192, 192);"&gt;Kevin Kofler 2008-09-27 18:59:05     Comment #35&lt;/b&gt;&lt;br /&gt;
I consider this part of freedom of expression.
&lt;/div&gt;&lt;div&gt;
&lt;b style="background-color: rgb(192, 192, 192);"&gt;Jeff Mitchell 2008-09-27 19:13:32    Comment #36&lt;/b&gt;&lt;br /&gt;
You're right. Here's my freedom of expression: It makes you look like a moron. Also, it makes what you are saying much more annoying to read.
&lt;/div&gt;&lt;div&gt;
&lt;b style="background-color: rgb(192, 192, 192);"&gt;Andreas Pakulat 2008-09-28 10:52:25    Comment #37&lt;/b&gt;&lt;br /&gt;
Could you two please discuss that via private mail? Such mails in a public bug reporting website doesn't gain any of you two anything, except a bad public image. Which also might fall back to KDE in general, because this is KDE's bugreporting website. We're not in kindergarten here.
&lt;/div&gt;
&lt;p&gt;哈哈哈哈，Geek 的世界还是很逗的~~&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>diff -u ~/powerdevil.po /usr/local/src/kde4dev/zh_CN/messages/kdebase/powerdevil.po</title><link>http://grissiom.blogspot.com/2008/09/diff-u-powerdevilpo-usrlocalsrckde4devz.html</link><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Thu, 25 Sep 2008 11:42:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-6814041651621167619</guid><description>&lt;p&gt;-号标记的是我自己翻译的，+号标记的是千里帮我修改的，记下！&lt;/p&gt;

&lt;pre&gt;
--- /home/grissiom/powerdevil.po        2008-09-23 21:07:12.000000000 +0800                       
+++ /usr/local/src/kde4dev/zh_CN/messages/kdebase/powerdevil.po 2008-09-25 21:57:23.000000000 +0800
@@ -8,12 +8,13 @@                                                                                 
"Project-Id-Version: kdebase\n"                                                                  
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"                                                    
"POT-Creation-Date: 2008-09-23 09:42+0200\n"                                                     
-"PO-Revision-Date: 2008-09-16 15:09+0800\n"                                                      
+"PO-Revision-Date: 2008-09-23 21:46+0800\n"                                                      
"Last-Translator: Grissiom &lt;chaos.proton@gmail.com&gt;\n"                                           
"Language-Team: zh_CN &lt;kde-china@kde.org&gt;\n"                                                     
"MIME-Version: 1.0\n"                                                                            
"Content-Type: text/plain; charset=UTF-8\n"                                                      
"Content-Transfer-Encoding: 8bit\n"                                                              
+"Plural-Forms: nplurals=1; plural=0;\n"                                                          
                                                                                                 
#: daemon/XSyncBasedPoller.cpp:43                                                                
msgid "XSync Based (recommended)"                                                                
@@ -21,11 +22,10 @@                                                                               
                                                                                                 
#: daemon/TimerBasedPoller.cpp:40                                                                
msgid "Timer Based"                                                                              
-msgstr "基于计时器"                                                                              
+msgstr "基于定时器"                                                                              
                                                                                                 
# 不知 Widget 在这里应该不应该翻译出来……                                                         
#: daemon/WidgetBasedPoller.cpp:40                                                               
-#, fuzzy                                                                                         
msgid "Grabber Widget Based"                                                                     
msgstr "基于 Grabber 部件"                                                                       
                                                                                                 
@@ -35,11 +35,11 @@                                                                               
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:70                                                                
msgid "A Power Management tool for KDE4"                                                         
-msgstr "KDE4 的一个电源管理工具"                                                                 
+msgstr "KDE4 的电源管理工具"                                                                     
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:71                                                                
msgid "(c) 2008 PowerDevil Development Team"                                                     
-msgstr "(c) 2008 PowerDevil Development Team"                                                    
+msgstr "(c) 2008 PowerDevil 开发组"                                                              
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:74 kcmodule/PowerDevilKCM.cpp:59                                  
msgid "Dario Freddi"                                                                             
@@ -59,44 +59,44 @@                                                                               
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:242                                                               
msgid "The power adaptor has been plugged in"                                                    
-msgstr "接入了电源适配器"                                                                        
+msgstr "电源适配器已接入"                                                                        
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:247                                                               
msgid "The power adaptor has been unplugged"                                                     
-msgstr "拔出了电源适配器"                                                                        
+msgstr "电源适配器已拔出"                                                                        
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:302                                                               
msgid "Your battery has reached critical level, the PC will now be halted..."                    
-msgstr "您的电池电量已处于危机水平，电脑现在将关机..."                                           
+msgstr "电池电量低于危急临界水平，现在电脑将关闭..."                                             
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:307                                                               
msgid ""                                                                                         
"Your battery has reached critical level, the PC will now be suspended to "                      
"disk..."                                                                                        
-msgstr "您的电池电量已处于危机水平, 电脑现在将挂起到硬盘..."                                     
+msgstr "电池电量低于危急临界水平，现在电脑将挂起到硬盘..."                                       
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:312                                                               
msgid ""                                                                                         
"Your battery has reached critical level, the PC will now be suspended to "                      
"RAM..."                                                                                         
-msgstr "您的电池电量已处于危机水平，电脑现在将挂起到内存..."                                     
+msgstr "电池电量低于危急临界水平，现在电脑将挂起到内存..."                                       
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:317                                                               
msgid "Your battery has reached critical level, the PC is now going Standby..."                  
-msgstr "您的电池电量已处于危机水平，电脑现在将会休眠..."                                         
+msgstr "电池电量低于危急临界水平，现在电脑将待机..."                                             
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:322                                                               
msgid ""                                                                                         
"Your battery has reached critical level, save your work as soon as possible!"                   
-msgstr "您的电池电量已处于危机水平, 请尽快保存您的工作！"                                        
+msgstr "电池电量低于危急临界水平, 请尽快保存您的工作！"                                          
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:327                                                               
msgid "Your battery has reached warning level"                                                   
-msgstr "您的电池电量已处于警告水平"                                                              
+msgstr "您的电池电量已处于警告临界水平"                                                          
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:330                                                               
msgid "Your battery has reached low level"                                                       
-msgstr "您的电池电量已处于低水平"                                                                
+msgstr "您的电池电量已处于低临界水平"                                                            
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:390                                                               
msgid "The computer is being halted"                                                             
@@ -104,15 +104,15 @@                                                                             
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:402                                                               
msgid "The computer will now be suspended to disk"                                               
-msgstr "现在要把计算机挂起到硬盘"                                                                
+msgstr "现在将把电脑挂起到硬盘"                                                                  
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:417                                                               
msgid "The computer will now be suspended to RAM"                                                
-msgstr "现在要把计算机挂起到内存"                                                                
+msgstr "现在将把电脑挂起到内存"                                                                  
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:432                                                               
msgid "The computer will now be put into standby"                                                
-msgstr "现在计算机将会进入待机状态"                                                              
+msgstr "现在电脑将会进入待机状态"                                                                
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:442                                                               
msgid "There was an error while suspending:"                                                     
@@ -128,13 +128,13 @@                                                                             
"The profile \"%1\" has been selected, but it does not exist!\n"                                 
"Please check your PowerDevil configuration."                                                    
msgstr ""                                                                                        
-"选择了 \"%1\" 配置，但是它并不存在！\n"                                                         
+"选择了配置“%1”，但是它并不存在！\n"                                                             
"请检查您的 PowerDevil 设置。"                                                                   
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:734                                                               
#, kde-format                                                                                    
msgid "Profile changed to \"%1\""                                                                
-msgstr "切换到 \"%1\" 配置"                                                                      
+msgstr "切换到配置“%1”"                                                                          
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:762 kcmodule/CapabilitiesPage.cpp:127                             
#: kcmodule/CapabilitiesPage.cpp:210 kcmodule/EditPage.cpp:111                                   
@@ -144,12 +144,12 @@                                                                             
#: daemon/PowerDevilDaemon.cpp:766 kcmodule/CapabilitiesPage.cpp:131                             
#: kcmodule/EditPage.cpp:115                                                                     
msgid "Dynamic (ondemand)"                                                                       
-msgstr "动态(ondemand)"                                                                          
+msgstr "动态(按需)"                                                                              
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:770 kcmodule/CapabilitiesPage.cpp:135                             
#: kcmodule/EditPage.cpp:119                                                                     
msgid "Dynamic (conservative)"                                                                   
-msgstr "动态(conservative)"                                                                      
+msgstr "动态(保守)"                                                                              
                                                                                                 
#: daemon/PowerDevilDaemon.cpp:774 kcmodule/CapabilitiesPage.cpp:139                             
#: kcmodule/EditPage.cpp:123                                                                     
@@ -194,7 +194,7 @@                                                                               
                                                                                                 
#: kcmodule/ConfigWidget.cpp:36                                                                  
msgid "Capabilities"                                                                             
-msgstr "能力"                                                                                    
+msgstr "特性"                                                                                    
                                                                                                 
#: kcmodule/GeneralPage.cpp:53 kcmodule/EditPage.cpp:79                                          
#: kcmodule/EditPage.cpp:82                                                                      
@@ -214,20 +214,21 @@                                                                             
                                                                                                 
#: kcmodule/PowerDevilKCM.cpp:53                                                                 
msgid "A configurator for PowerDevil"                                                            
-msgstr "PowerDevil 的一个配置程序"                                                               
+msgstr "PowerDevil 的配置程序"                                                                   
                                                                                                 
#: kcmodule/PowerDevilKCM.cpp:54                                                                 
msgid "(c), 2008 Dario Freddi"                                                                   
-msgstr "(c), 2008 Dario Freddi"                                                                  
+msgstr "(c)，2008 Dario Freddi"                                                                  
                                                                                                 
# powersaving profiles 貌似说不通，profile 不一定都是powersaving的吧                             
# capabilities 也不知用什么合适的翻译好……                                                        
#: kcmodule/PowerDevilKCM.cpp:55                                                                 
-#, fuzzy                                                                                         
msgid ""                                                                                         
"From this module, you can configure the Daemon, create and edit powersaving "                   
"profiles, and see your system's capabilities."                                                  
-msgstr "在这个模块里，您可以设置守护程序，创建和编辑节能配置，查看您系统的能力"                  
+msgstr ""                                                                                        
+"您可以在此模块中配置 PowerDevil 守护程序、创建和编辑节能配置、查看您的系统特"                   
+"性。"                                                                                           
                                                                                                 
#: kcmodule/PowerDevilKCM.cpp:59                                                                 
msgid "Main Developer"                                                                           
@@ -247,12 +248,12 @@                                                                             
"and you are done.&amp;lt;/p&amp;gt;"                                                                          
msgstr ""                                                                                        
"&amp;lt;h1&amp;gt;PowerDevil 配置&amp;lt;/h1&amp;gt; &amp;lt;p&amp;gt;这个模块可以让您设置 PowerDevil。PowerDevil 是一"                   
-"个随 KDE 启动而启动的守护程序(所以它在后台运行)。&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt;PowerDevil 有两个设"                   
-"置级别：一个是总会应用的常规设置；一个是基于配置文件的，可以让您为不同的环境"                   
-"设置不同的行为。您还可以在最后一个标签里查看您的系统能力。开始的时候，您可以"                   
-"先在前两个标签里进行设置。然后跳到第四个，创建/编辑您的配置。\t最后但并不是最"                  
-"不重要的，在第三个标签里指定您的配置。您不必重启 PowerDevil，只用点击“应用”就"                  
-"好了。&amp;lt;/p&amp;gt;"                                                                                     
+"个随 KDE 启动而启动的守护程序(即在后台运行)。&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt; &amp;lt;p&amp;gt;PowerDevil 有两种设置级"                   
+"别：一种是通用的常规设置；另一种是基于配置文件的，可以让您为不同的环境设置不"                   
+"同的行为。您还可以在最后一个标签里查看您的系统特性。开始使用前，您可以先在前"                   
+"两个标签里进行设置。然后跳到第四个，创建/编辑您的配置。\t最后但并不是最不重要"                  
+"的一点：要在第三个标签里指定您的配置。您不必重启 PowerDevil，点击“应用”即可。"                  
+"&amp;lt;/p&amp;gt;"                                                                                           
                                                                                                 
#: kcmodule/PowerDevilKCM.cpp:87                                                                 
msgid ""                                                                                         
@@ -260,9 +261,9 @@                                                                               
"power managers are active. If you want to use PowerDevil as your primary "                      
"power manager, please remove the existing one and restart PowerDevil service."                  
msgstr ""                                                                                        
-"检测到其他电源管理器。如果启用其他电源管理器，PowerDevil 就不会启动。如果您想"                  
-"把 PowerDevil 作为主电源管理器，请移除现有的然后重新启动 请移除其他的然后重新"                  
-"启动 PowerDevil。"                                                                              
+"检测到其他电源管理器。如果您启用了其他电源管理器，PowerDevil 就不会启动。如果"                  
+"您想把 PowerDevil 作为主电源管理器，请移除现有的然后重新启动它。请移除其他电"                   
+"源管理器后重新启动 PowerDevil。"                                                                
                                                                                                 
#: kcmodule/PowerDevilKCM.cpp:92                                                                 
msgid ""                                                                                         
@@ -270,7 +271,7 @@                                                                               
"other power managers are active. If you want to use PowerDevil as your "                        
"primary power manager, please stop powersaved and restart PowerDevil service."                  
msgstr ""                                                                                        
-"好像 powersaved 正在运行。如果启用其他电源管理器，PowerDevil 就不会启动。如果"                  
+"powersaved 似乎正在运行。如果启用其他电源管理器，PowerDevil 就不会启动。如果"                   
"您想把 PowerDevil 作为主电源管理器，请停止 powersaved 然后重新启动 "                            
"PowerDevil。"                                                                                   
                                                                                                 
@@ -291,14 +292,13 @@                                                                             
msgstr "未找到方法"                                                                              
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:206                                                             
-#, fuzzy                                                                                         
msgid ""                                                                                         
"PowerDevil was compiled without Xss and Xext support, or the XSync extension "                  
"is not available. Determining idle time will not be possible. Please "                          
"consider recompiling PowerDevil with at least one of these two libraries."                      
msgstr ""                                                                                        
-"PowerDevil 在编译时未加入 Xss 和 Xext 支持，也没有可用的 XSync 扩展。程序将不"                  
-"可能确定空闲时间。请考虑至少和其中一个库一起重新编译 PowerDevil。"                              
+"PowerDevil 在编译时未引入 Xss 和 Xext 支持，也没有可用的 XSync 扩展。因此程序"                  
+"无法确定空闲时间。请考虑至少和其中一个库一起重新编译 PowerDevil。"                              
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:212                                                             
msgid ""                                                                                         
@@ -313,21 +313,20 @@                                                                             
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:219                                                             
msgid "Attempt loading Modules"                                                                  
-msgstr ""                                                                                        
+msgstr "在尝试装载模块"                                                                          
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:220                                                             
msgid "Do not display this warning again"                                                        
-msgstr ""                                                                                        
+msgstr "不再次显示此警告"                                                                        
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:223                                                             
-#, fuzzy                                                                                         
msgid ""                                                                                         
"PowerDevil was compiled without Xext support, or the XSync extension is not "                   
"available. XSync grants extra efficiency and performance, saving your "                         
"battery and CPU. It is advised to use PowerDevil with XSync enabled."                           
msgstr ""                                                                                        
-"PowerDevil 在编译时未加入 Xext 支持, 支持 XSync 扩展也不可用。XSync 可以赋予 "                  
-"PowerDevil 额外的高效和性能，节省电池和时间。推荐使用启用了 XSync 的 "                          
+"PowerDevil 在编译时未加入 Xext 支持, 支持 XSync 扩展也不可用。XSync 可以提供 "                  
+"PowerDevil 额外的效率和性能，节省电池和时间。推荐使用启用了 XSync 的 "                          
"PowerDevil。"                                                                                   
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:242 kcmodule/CapabilitiesPage.cpp:250                           
@@ -355,7 +354,7 @@                                                                               
                                                                                                 
#: kcmodule/CapabilitiesPage.cpp:346                                                             
msgid "Modules not found"                                                                        
-msgstr ""                                                                                        
+msgstr "找不到模块"                                                                              
                                                                                                 
#: kcmodule/EditPage.cpp:81 kcmodule/EditPage.cpp:84                                             
msgid "Lock Screen"                                                                              
@@ -392,7 +391,7 @@                                                                               
                                                                                                 
#: kcmodule/EditPage.cpp:440                                                                     
msgid "Please enter a name for this profile"                                                     
-msgstr "请为这个配置输入一个名字"                                                                
+msgstr "请为此配置输入一个名字"                                                                  
                                                                                                 
#: kcmodule/EditPage.cpp:474                                                                     
msgid "Import PowerDevil profiles"                                                               
@@ -408,7 +407,7 @@                                                                               
"Do you want to save it?"                                                                        
msgstr ""                                                                                        
"未保存当前配置。\n"                                                                             
-"您想保存么？"                                                                                   
+"您想要保存吗？"                                                                                 
                                                                                                 
#: kcmodule/EditPage.cpp:522                                                                     
msgid "Save Profile"                                                                             
@@ -460,17 +459,15 @@                                                                             
#. i18n: file: kcmodule/profileEditPage.ui:100                                                   
#. i18n: ectx: property (text), widget (QCheckBox, offDisplayWhenIdle)                           
#: rc.cpp:20                                                                                     
-#, fuzzy                                                                                         
msgid "Turn off display if idle for more than"                                                   
-msgstr "关闭显示，当闲置时间长于"                                                                
+msgstr "关闭显示器，当闲置时间长于"                                                              
                                                                                                 
# 同上                                                                                           
#. i18n: file: kcmodule/profileEditPage.ui:107                                                   
#. i18n: ectx: property (toolTip), widget (QSpinBox, displayIdleTime)                            
#: rc.cpp:23                                                                                     
-#, fuzzy                                                                                         
msgid "Idle time after which the monitor should turn off"                                        
-msgstr "关闭监视器，当闲置时间长于"                                                              
+msgstr "关闭显示屏幕前等待的空闲时间"                                                            
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:110                                                   
#. i18n: ectx: property (suffix), widget (QSpinBox, displayIdleTime)                             
@@ -478,7 +475,7 @@                                                                               
#. i18n: ectx: property (suffix), widget (QSpinBox, idleTime)                                    
#: rc.cpp:26 rc.cpp:38                                                                           
msgid " min"                                                                                     
-msgstr "最小"                                                                                    
+msgstr "分钟"                                                                                    
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:126                                                   
#. i18n: ectx: property (whatsThis), widget (QLabel, PoweredIdleLabel_2)                         
@@ -493,7 +490,7 @@                                                                               
"the number of minutes below which the machine will run the configured action."                  
msgstr ""                                                                                        
"为了防止数据丢失或其他损失，您可以让系统待机或者休眠以防止突然断电。在下面设"                   
-"置将要执行动作的分钟数。"                                                                       
+"置执行前的等待分钟数。"                                                                         
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:129                                                   
#. i18n: ectx: property (text), widget (QLabel, PoweredIdleLabel_2)                              
@@ -511,13 +508,13 @@                                                                             
#. i18n: ectx: property (whatsThis), widget (KComboBox, laptopClosedCombo)                       
#: rc.cpp:47                                                                                     
msgid "This action will be performed when the laptop lid gets closed"                            
-msgstr "当合上笔记本盖时将执行这个动作"                                                          
+msgstr "当合上笔记本盖时将执行此动作"                                                            
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:189                                                   
#. i18n: ectx: property (text), widget (QCheckBox, disableCompositing)                           
#: rc.cpp:50                                                                                     
msgid "Disable KWin compositing, if active"                                                      
-msgstr ""                                                                                        
+msgstr "如果 KWin 混成功能已激活，则将其禁用"                                                    
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:197                                                   
#. i18n: ectx: attribute (title), widget (QWidget, tab)                                          
@@ -529,7 +526,7 @@                                                                               
#. i18n: ectx: property (text), widget (QLabel, label_12)                                        
#: rc.cpp:56                                                                                     
msgid "Turn off the following CPU(s)"                                                            
-msgstr "关闭下列 CPU"                                                                            
+msgstr "关闭以下 CPU"                                                                            
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:213                                                   
#. i18n: ectx: property (whatsThis), widget (QLabel, PoweredFreqLabel_2)                         
@@ -540,8 +537,8 @@                                                                               
"CPU Behaviour strongly impacts on your system performance and on your "                         
"battery's life. Here you can choose the policy best suitable for this profile"                  
msgstr ""                                                                                        
-"CPU 行为会对系统性能和续航时间产生极大影响。在这里您可以为这个配置选择最适合"                   
-"的频率策略"                                                                                     
+"CPU 行为会对系统性能和续航时间产生极大影响。在这里您可以为其配置最适合的频率"                   
+"策略"                                                                                           
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:216                                                   
#. i18n: ectx: property (text), widget (QLabel, PoweredFreqLabel_2)                              
@@ -608,25 +605,25 @@                                                                             
#. i18n: ectx: property (whatsThis), widget (KPushButton, importButton)                          
#: rc.cpp:95                                                                                     
msgid "Import profiles from a file"                                                              
-msgstr "从文件中载入配置"                                                                        
+msgstr "从文件中导入配置"                                                                        
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:386                                                   
#. i18n: ectx: property (text), widget (KPushButton, importButton)                               
#: rc.cpp:98                                                                                     
msgid "Import Profiles"                                                                          
-msgstr "载入配置"                                                                                
+msgstr "导入配置"                                                                                
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:402                                                   
#. i18n: ectx: property (whatsThis), widget (KPushButton, exportButton)                          
#: rc.cpp:101                                                                                    
msgid "Export your profiles to a file"                                                           
-msgstr "将配置输出到文件"                                                                        
+msgstr "将配置导出到文件"                                                                        
                                                                                                 
#. i18n: file: kcmodule/profileEditPage.ui:405                                                   
#. i18n: ectx: property (text), widget (KPushButton, exportButton)                               
#: rc.cpp:104                                                                                    
msgid "Export Profiles"                                                                          
-msgstr "输出配置"                                                                                
+msgstr "导出配置"                                                                                
                                                                                                 
#. i18n: file: kcmodule/profileAssignmentPage.ui:19                                              
#. i18n: ectx: property (title), widget (QGroupBox, groupBox_4)                                  
@@ -638,7 +635,7 @@                                                                               
#. i18n: ectx: property (text), widget (QLabel, label)                                           
#: rc.cpp:110                                                                                    
msgid "When AC Adaptor is plugged in"                                                            
-msgstr "当之流电源接入时"                                                                        
+msgstr "当直流电源接入时"                                                                        
                                                                                                 
#. i18n: file: kcmodule/profileAssignmentPage.ui:42                                              
#. i18n: ectx: property (text), widget (QLabel, label_2)                                         
@@ -670,7 +667,7 @@                                                                               
msgid ""                                                                                         
"The configuration module can not be started, since there seems to be a "                        
"problem with PowerDevil Daemon. Read below for more details"                                    
-msgstr "未能启动设置模块，可能是 PowerDevil 守护程序有问题。详情见下面"                          
+msgstr "未能启动设置模块，可能是 PowerDevil 守护程序有问题。详情见下"                            
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:33                                                        
#. i18n: ectx: property (text), widget (QLabel, issueIcon)                                       
@@ -684,7 +681,7 @@                                                                               
msgid ""                                                                                         
"&amp;lt;b&amp;gt;There are some issues in your configuration. Please check Capabilities "                     
"page for more details.&amp;lt;/b&amp;gt;"                                                                     
-msgstr "&amp;lt;b&amp;gt;您的设置有些问题。详情请查看能力页。&amp;lt;/b&amp;gt;"                                             
+msgstr "&amp;lt;b&amp;gt;您的设置有些问题。详情请查看特性页。&amp;lt;/b&amp;gt;"                                             
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:64                                                        
#. i18n: ectx: property (toolTip), widget (QCheckBox, lockScreenOnResume)                        
@@ -696,7 +693,7 @@                                                                               
#. i18n: ectx: property (whatsThis), widget (QCheckBox, lockScreenOnResume)                      
#: rc.cpp:140                                                                                    
msgid "You will be asked for password when resuming from sleep state"                            
-msgstr "当从休眠状态恢复时您需要密码"                                                            
+msgstr "当从休眠状态恢复时您需要密码来激活"                                                      
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:73                                                        
#. i18n: ectx: property (text), widget (QCheckBox, lockScreenOnResume)                           
@@ -708,7 +705,7 @@                                                                               
#. i18n: ectx: property (toolTip), widget (QCheckBox, dimDisplayOnIdle)                          
#: rc.cpp:146                                                                                    
msgid "Activate automatic dimming"                                                               
-msgstr "激活自动调光控制"                                                                        
+msgstr "允许自动暗化屏幕"                                                                        
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:86                                                        
#. i18n: ectx: property (whatsThis), widget (QCheckBox, dimDisplayOnIdle)                        
@@ -759,7 +756,7 @@                                                                               
msgid ""                                                                                         
"Notifications such as warnings or important events will be shown. It is "                       
"recommended to leave this enabled."                                                             
-msgstr "将会显示警告和重要事件"                                                                  
+msgstr "这将显示警告和重要事件，建议您启用此项"                                                  
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:143                                                       
#. i18n: ectx: property (text), widget (QCheckBox, warningNotificationsBox)                      
@@ -770,9 +767,8 @@                                                                               
#. i18n: file: kcmodule/generalPage.ui:156                                                       
#. i18n: ectx: property (text), widget (QPushButton, notificationsButton)                        
#: rc.cpp:176                                                                                    
-#, fuzzy                                                                                         
msgid "Configure Notifications"                                                                  
-msgstr "启用通知"                                                                                
+msgstr "配置通知"                                                                                
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:166                                                       
#. i18n: ectx: property (title), widget (QGroupBox, groupBox)                                    
@@ -784,19 +780,19 @@                                                                             
#. i18n: ectx: property (text), widget (QLabel, label_3)                                         
#: rc.cpp:182                                                                                    
msgid "Battery is at low level at"                                                               
-msgstr ""                                                                                        
+msgstr "低电量临界水平"                                                                          
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:188                                                       
#. i18n: ectx: property (toolTip), widget (KIntSpinBox, lowSpin)                                 
#: rc.cpp:185                                                                                    
msgid "Low battery level"                                                                        
-msgstr "低电池电量"                                                                              
+msgstr "低电量临界水平"                                                                          
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:191                                                       
#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, lowSpin)                               
#: rc.cpp:188                                                                                    
msgid "Battery will be considered low when it reaches this level"                                
-msgstr "当电量达到这个水平时认为电池电量低"                                                      
+msgstr "当电池电量达到这个水平时视作电量偏低"                                                    
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:194                                                       
#. i18n: ectx: property (suffix), widget (KIntSpinBox, lowSpin)                                  
@@ -813,7 +809,7 @@                                                                               
#. i18n: ectx: property (text), widget (QLabel, label_4)                                         
#: rc.cpp:195                                                                                    
msgid "Battery is at warning level at"                                                           
-msgstr ""                                                                                        
+msgstr "警告级电量临界水平"                                                                      
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:217                                                       
#. i18n: ectx: property (toolTip), widget (KIntSpinBox, warningSpin)                             
@@ -825,13 +821,13 @@                                                                             
#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, warningSpin)                           
#: rc.cpp:201                                                                                    
msgid "Battery will be considered at warning level when it reaches this level"                   
-msgstr "当电池电量达到这个水平时认为达到警告电量水平"                                            
+msgstr "当电池电量达到这个水平时视作达到警告电量水平"                                            
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:233                                                       
#. i18n: ectx: property (text), widget (QLabel, label_5)                                         
#: rc.cpp:208                                                                                    
msgid "Battery is at critical level at"                                                          
-msgstr ""                                                                                        
+msgstr "危急级电量临界水平"                                                                      
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:246                                                       
#. i18n: ectx: property (toolTip), widget (KIntSpinBox, criticalSpin)                            
@@ -843,7 +839,7 @@                                                                               
#. i18n: ectx: property (whatsThis), widget (KIntSpinBox, criticalSpin)                          
#: rc.cpp:214                                                                                    
msgid "Battery will be considered critical when it reaches this level"                           
-msgstr "当电池电量达到这个水平时认为电量危急"                                                    
+msgstr "当电池电量达到这个水平时视作电量危急"                                                    
                                                                                                 
#. i18n: file: kcmodule/generalPage.ui:265                                                       
#. i18n: ectx: property (title), widget (QGroupBox, groupBox_3)                                  
@@ -861,7 +857,7 @@
#. i18n: ectx: property (title), widget (QGroupBox, groupBox_5)
#: rc.cpp:230
msgid "System Capabilities"
-msgstr "系统能力"
+msgstr "系统特性"

#. i18n: file: kcmodule/capabilitiesPage.ui:31
#. i18n: ectx: property (text), widget (QLabel, label_10)
@@ -879,19 +875,19 @@
#. i18n: ectx: property (text), widget (QLabel, label_14)
#: rc.cpp:239
msgid "CPU can be turned Off"
-msgstr "能够关闭 CPU"
+msgstr "CPU 可关闭"

#. i18n: file: kcmodule/capabilitiesPage.ui:80
#. i18n: ectx: property (text), widget (QLabel, label_13)
#: rc.cpp:242
msgid "Scheme support"
-msgstr "方案支持"
+msgstr "支持方案"

#. i18n: file: kcmodule/capabilitiesPage.ui:94
#. i18n: ectx: property (text), widget (QLabel, label_15)
#: rc.cpp:245
msgid "Scaling capability"
-msgstr "调频能力"
+msgstr "调频特性"

#. i18n: file: kcmodule/capabilitiesPage.ui:115
#. i18n: ectx: property (text), widget (QLabel, label_16)
&lt;/kde-china@kde.org&gt;&lt;/chaos.proton@gmail.com&gt;&lt;/pre&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Vim 应用杂记</title><link>http://grissiom.blogspot.com/2008/09/vim.html</link><category>vim</category><author>noreply@blogger.com (grissiom)</author><pubDate>Fri, 19 Sep 2008 10:34:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-962640808444690540</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;h5&gt;获取当前缓冲区文件名&lt;/h5&gt;
&lt;p&gt;其实很简单，在命令行模式下用 file 就好。在脚本里 bufname('%') 就会返回当前缓冲区对应的文件名。比如"vim  ~/xx.po"，bufname('%') 就会返回 /home/you/xx.po。挺方便的。&lt;/p&gt;
&lt;/li&gt;

&lt;li&gt;&lt;h5&gt;为不同文件设置不同的折叠方法1&lt;/h5&gt;
&lt;p&gt;比如，C 要用 foldmethod=syntax，python 要用 foldmethod=indent。要想为不同文件设置不同的折叠方法，可以在 .vimrc 里设置上 filetype plugin on ，它会在 ~/.vimrc/ftplugin 里面寻找并执行 python.vim 等文件，所以就可以编写 ~/.vimrc/ftplugin/python.vim 为：
&lt;pre&gt;
set foldmethod=indent
set foldlevel=100
&lt;/pre&gt;
~/.vimrc/ftplugin/c.vim 为：
&lt;pre&gt;
set foldmethod=syntax
set foldlevel=100
&lt;/pre&gt;
然后就可以了。可能还有一种方法，就是用getftype函数，还没来得及试。&lt;/p&gt;
&lt;/li&gt;

&lt;p&gt;&lt;/p&gt;

&lt;/ul&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>今天太激动了，记录一下~</title><link>http://grissiom.blogspot.com/2008/09/blog-post.html</link><category>linux</category><category>Slackware</category><category>生活</category><author>noreply@blogger.com (grissiom)</author><pubDate>Mon, 1 Sep 2008 06:10:00 -0700</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-1701096682010489318.post-5284402942969924009</guid><description>&lt;p&gt;先是早晨起来看到我给 slackbuilds.org 发的 irqbanlance bug report 终于有人回应了，一回就回了一堆邮件。于是我又回了一封说明了一下具体情况，没过多久，传说中的 Patrick J. Volkerding 大仙竟然回复我的邮件了！他在邮件里先是礼貌地回复了一下，然后指点了一二。嗯，看来其实大家们都是非常 humble 的。&lt;/p&gt;

&lt;p&gt;然后就是发到 bugzilla.kernel.org 的 ALSA-Configuration.txt 拼写错误报告也得到回应了，回应的人竟然还把邮件发给了 Andrew Morton，邮件里竟然还提到了我的名字！虽然不是什么显著的位置~~虽然我这个小小的名字被 Linus 知道的概率为0，但是能让 Andrew Morton 过下眼睛也算是三生有幸了。&lt;/p&gt;

&lt;p&gt;太高兴了，记下。&lt;/p&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item></channel></rss>