<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-703243932000138747</id><updated>2011-11-28T08:27:06.111+08:00</updated><category term='linux'/><category term='sf'/><category term='mood'/><category term='fvwm'/><category term='emacs'/><category term='office'/><category term='八卦系列'/><category term='xmpp'/><category term='tex'/><category term='kernel_note'/><category term='python'/><category term='tool'/><category term='web'/><category term='perl'/><category term='sawfish'/><category term='clisp'/><category term='algorithm'/><category term='bash'/><category term='book'/><category term='hardware'/><category term='c'/><title type='text'>皇上回宫</title><subtitle type='html'>I'm back.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default?start-index=101&amp;max-results=100'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>113</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4334238956696273975</id><published>2010-03-02T20:00:00.000+08:00</published><updated>2010-03-02T20:00:17.949+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='web'/><title type='text'>how to make a div tag fill the remaining height of its parent tag?</title><content type='html'>It is a common problem I think, but the solutions that can be found via google are somehow too &amp;nbsp; ugly, however, like an absolute position or table-like display(see css property position and display).&lt;br /&gt;&lt;br /&gt;&amp;nbsp;Finally, I found that css3 gives a perfect solution: with a {display:box} and {box-orient:vertical} applied to the parent tag and {box-flex: 1} applied to the greedy div tag. If you are using chrome/chromium, replace box with -webkit-box, box-orient with -webkit-box-orient and box-flex with -webkit-box-flex, elif firefox, google it, elif IE, forget it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4334238956696273975?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4334238956696273975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4334238956696273975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4334238956696273975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4334238956696273975'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2010/03/how-to-make-div-tag-fill-remaining.html' title='how to make a div tag fill the remaining height of its parent tag?'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7256413798961052610</id><published>2010-02-21T21:23:00.000+08:00</published><updated>2010-02-21T21:23:01.763+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>make ipython work better with emacs</title><content type='html'>&lt;a href="http://ipython.scipy.org/"&gt;ipython&lt;/a&gt; is an excellent python shell to be used with emacs.&amp;nbsp;&lt;a href="http://ipython.scipy.org/dist/ipython.el"&gt;ipython.el&lt;/a&gt;&amp;nbsp;is the emacs extension which communicates with ipython on behalf of emacs.&lt;br /&gt;&lt;br /&gt;When ipython is activated in emacs, we can complete functions, attributes, variables or something else with the TAB key, if there are more than one possible completions, a new buffer &amp;nbsp;will created to show them. However, the new buffer can not automatically disappear just as in slime does, so I make some modifications to ipython.el.&lt;br /&gt;&lt;br /&gt;1. create a new file named tempbuffer.el with the following elisp source code as content:&lt;br /&gt;&lt;br /&gt;&lt;div style="background-color: black; color: lightskyblue;"&gt;&lt;pre&gt;(&lt;span style="color: lime;"&gt;defvar&lt;/span&gt; &lt;span style="color: #ee00ee;"&gt;saved&lt;/span&gt; nil)&lt;br /&gt;&lt;br /&gt;(&lt;span style="color: lime;"&gt;defun&lt;/span&gt; &lt;span style="color: white;"&gt;restore-after-temp-buffer&lt;/span&gt; ()&lt;br /&gt;  (remove-hook 'pre-command-hook 'restore-after-temp-buffer)&lt;br /&gt;  (&lt;span style="color: lime;"&gt;when&lt;/span&gt; saved&lt;br /&gt;    (&lt;span style="color: lime;"&gt;progn&lt;/span&gt; (set-window-configuration saved)&lt;br /&gt;           (setf saved nil))))&lt;br /&gt;&lt;br /&gt;(&lt;span style="color: lime;"&gt;defun&lt;/span&gt; &lt;span style="color: white;"&gt;delay-restoring-after-temp-buffer&lt;/span&gt; ()&lt;br /&gt;  (add-hook 'pre-command-hook 'restore-after-temp-buffer))&lt;br /&gt;&lt;br /&gt;(&lt;span style="color: lime;"&gt;defmacro&lt;/span&gt; &lt;span style="color: white;"&gt;with-output-to-restorable-temp-buffer&lt;/span&gt; (bufname &lt;span style="color: steelblue;"&gt;&amp;amp;rest&lt;/span&gt; body)&lt;br /&gt;  `(&lt;span style="color: lime;"&gt;progn&lt;/span&gt; (setf saved (current-window-configuration))&lt;br /&gt;          (&lt;span style="color: lime;"&gt;with-output-to-temp-buffer&lt;/span&gt; ,bufname&lt;br /&gt;            ,@body)&lt;br /&gt;          (delay-restoring-after-temp-buffer)))&lt;br /&gt;&lt;br /&gt;(&lt;span style="color: lime;"&gt;provide&lt;/span&gt; 'tempbuffer)&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;2. put tempbuffer.el into somewhere emacs can find.&lt;br /&gt;&lt;br /&gt;3. add &lt;i&gt;(require 'tempbuffer)&lt;/i&gt;&amp;nbsp;to ipython.el and replace &lt;i&gt;with-output-to-tempbuffer&lt;/i&gt; with &lt;i&gt;with-output-to-restorable-temp-buffer&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;after done this, the new buffer showing possible completions will close as soon as we type something in emacs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7256413798961052610?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7256413798961052610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7256413798961052610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7256413798961052610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7256413798961052610'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2010/02/make-ipython-work-better-with-emacs.html' title='make ipython work better with emacs'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6897940885822275168</id><published>2010-02-16T00:37:00.000+08:00</published><updated>2010-02-16T00:37:50.856+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='八卦系列'/><title type='text'>一个关于macro的故事</title><content type='html'>&lt;div&gt;很久很久以前，有一个由lisp程序员组成的公司。这个公司所处的时代太早，以至于当时的lisp还没有macro。每当有不能用函数来定义或者特殊操作符来实现的东西，就得全部手工写，这是相当无聊的事。不幸的是，这个公司的程序员虽然都很有才华，同时却又灰常懒。在写程序的时候，当他们觉得写一长串代码实在太麻烦了，就会在程序里写上描述他们实际上所需要写的代码的记录。更不幸的是，这些人实在太懒了，所以他们也痛恨回过头去完成那些记录所描述的代码。没过多久，公司就拥有了一堆没人能运行地起来的程序，因为这些程序充斥着关于未完成的代码的记录。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;大老板很绝望，请了一个名叫Mac的不那么牛逼的程序员，让他从程序里找出记录，写出所需的代码，然后把代码插入程序以代替记录。Mac从来不运行那些程序，因为很显然，程序还没完成，所以他没法运行。然而就算程序完成了，Mac也不知道应该给它们提供什么输入。所以他只是根据记录的内容写出代码，然后发给原作者。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;在Mac的帮助下，很快所有的程序都完成了，公司卖掉这些程序，赚了一大笔钱，足够把开发人数加倍。但是不知道怎么回事，没人想到要再雇一个人帮Mac；很快，出现了Mac一个人协助一大坨程序员的状况。为了避免把所有的时间都花在找记录上，Mac对程序员们所用的编译器做了一点改动，这样，任何时候编译器遇到一个记录，就会通过email发给Mac，然后等Mac把代码发回来代替记录。悲剧的是，即使这样，Mac也很难赶上这么多程序员的进度。他尽可能认真地工作，但是有时候——尤其是记录写得不是很明确的情况下——他会犯错误。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;然而程序员们注意到，如果他们的记录写地越精确，那么Mac就越能发回正确的代码。有一天，一个程序员写记录写得很痛苦，于是在一个记录里写了一段能生成他所需要代码的lisp代码。这下爽了Mac，他运行了这段代码，然后把结果送给编译器。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;下一个创新是，一个程序员在他的一个程序里放了一个记录，包括一个函数定义和一段注释："Mac，这里不用写代码，留着这个函数就行，我在别的记录里要用到这个函数。"这个程序里别的记录则是这样的："Mac，用符号x和y作为参数运行刚才那个函数，返回的结果替代这个记录。"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;这项技术流行地很快，没过几天，大部分程序都包含了很多定义函数的记录，而这些函数在其他记录中被使用。为了让Mac容易挑选只包含定义而不需要马上响应的记录，程序员们为这种记录加上了标准的开头："Definition for Mac，read only"，而这帮程序员又太懒，所以很快缩短为"DEF.MAC R/O"，接着又变成"DEFMACRO"。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;没过多久，给Mac的记录里已经没有真正的英语了。他每天所做的事就是接受、回复来自编译器的邮件，这些邮件是包含DEFMACRO的记录或者是对DEFMACRO里的函数的调用。既然记录里的lisp代码做了真正的工作，那么赶上email的进度就没那么困难了。Mac突然有了大把的时间可以坐在办公室里做着关于白色沙滩、蓝色海水和放着小纸伞的饮料（貌似是鸡尾酒？）的白日梦。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;几个月以后，程序员们意识到已经有段时间没人见到过Mac了。当他们去了他的办公室，发现所有的东西上都蒙了一层薄薄的灰尘，桌子上放着一堆关于热带地区旅游的小册子，而电脑是关着的。但是编译器正常工作着啊，怎么可能呢？最后他们发现Mac给编译器做了在最后一个改动：编译器不再用email给Mac发记录，而是把DEFMACRO里定义的函数保存下来，当其他记录调用的时候就运行这些函数。程序员们觉得木有必要告诉大老板Mac再也不用来办公室了，所以Mac至今还领着薪水，时不时地从各种不同的热带场所给程序员们发张贺卡来。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;*****************************华丽的分割线***************************&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;这个故事是《practical common lisp》第八章讲到的，我翻译地不好，不过领会精神是够了。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;先看不相关的，懒惰是美德。故事里的人物，各个都懒得出奇，精英程序员们太过牛逼，以至于写代码都懒，直接写上伪代码了事。Mac虽然是junior programmer，但是一旦抓到机会，就会想到办法让机器帮他做事。而大老板，作为一个万恶的资本家，竟然连自己花钱雇用的工人光拿钱不干活也不知道，莫非就是每天打打高尔乎，心情好了就去公司闪现一下？哈哈。但是就是这么一帮人，也能挣大钱，也能创新，事实上，创新恰恰来自于懒惰，值得大家学习。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;然后是一点关于macro的东西，主要是针对非科班出身又对编译原理很恐惧的同学。但凡编程语言，都不会对使用者掌握编译原理有明确的要求，但同时，诸如"掌握编译原理对写出正确、高效的代码至关重要"这类的言论也是非常多的。编译是一个灰常可怕的过程，如果说通过那门课程是皮毛的话，那我是只有皮木有毛。这里结合我自己的体会，讲讲macro，达人请无视。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;不少童鞋初学编程语言，拿了书上的例子来跑，这样很好，动手才是王道。但是相当多的人，比如说学C，课后习题都做完了，却不知道自己的代码是怎么在机器上跑的，这样就很不好。下面是编译型语言的基本过程：&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1 把代码敲入编辑器（editor），保存。&lt;/div&gt;&lt;div&gt;2 调用编译器（compiler）把源代码编译成可执行程序。&lt;/div&gt;&lt;div&gt;3 运行程序。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;IDE会把编辑器和编译器以及调试器整成一坨，这样方便了开发者，却不利于初学者搞懂整个过程，以至于有些童鞋连编辑器和编译器都会混淆。在这里顺便鄙视一下某公司的Visual叉叉叉，我有一次试图写个程序，却被一大堆的菜单彻底弄晕了，以至于我至今不会用visual叉叉叉写程序。&lt;br /&gt;&lt;br /&gt;而编译再分成几步，以C为例：&lt;br /&gt;&lt;br /&gt;1 头文件插入，宏替换&lt;br /&gt;2 词法分析&lt;br /&gt;3 语法分析&lt;br /&gt;4 中间代码生成&lt;br /&gt;5 生成汇编代码&lt;br /&gt;6 汇编，生成目标文件&lt;br /&gt;7 链接，生成可执行文件&lt;br /&gt;&lt;br /&gt;很多童鞋搞不清宏到底是怎么回事，从上面的过程可以看到，宏替换发生在第一步（严格来说，这一步不算在编译里），而你在代码里所写的函数是在你执行了第七步里生成的可执行文件以后才会被调用，这就是一个运行时的概念。所以宏和其他的代码的区别就很明显了：宏只在编译之前存在，编译以后，宏被展开，变成具体的代码，自己也消失了。&lt;br /&gt;&lt;br /&gt;因为事实上C的macro基本上只是简单的替换，而common lisp的macro更为强大，所以主要还是八卦一下common lisp的macro吧。&lt;br /&gt;&lt;br /&gt;其实开头的故事把macro和function的区别讲得很清楚，Mac没法运行程序，因为他工作的阶段是编译时，更确切地讲是宏展开时，而不是运行时，所以整个程序运行所依赖的环境还没建立起来，所以他根本不知道该给函数什么样的输入。而其他的精英程序员们后来在DEFMACRO里的函数其实就是macro，作用就是生成代码，Mac在调用DEFMACRO里的函数的时候，给的参数是精英程序员指定的，比如x和y，这两个参数不是来自于运行时环境，当编译完成后，DEFMACRO里的函数也就没有用了，因为它们已经根据参数生成了具体的代码，在运行时执行的则是具体的代码。大部分情况下，参数都是符号，而不是具体的变量，所以macro其实会涉及到很多的符号计算。&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;很多人说common lisp的macro太强大了，以至于跟C的macro根本不是一个东西。其实我还不是很理解这种说法。就我自己的体会，common lisp的macro强大在defmacro有整个语言的核心的支持，而C的macro并不作为编译器的一部分存在，而只是预处理器，并且也没有C语言的核心的支持，只有很简单的计算能力。至于在内部实现上，暂时我还没这个能力去探究，任重而道远啊。&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6897940885822275168?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6897940885822275168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6897940885822275168' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6897940885822275168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6897940885822275168'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2010/02/macro.html' title='一个关于macro的故事'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1478602652479594974</id><published>2010-01-20T21:49:00.000+08:00</published><updated>2010-01-20T21:49:04.276+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><title type='text'>use emacs to generate highlighted code</title><content type='html'>&lt;div&gt;1. set htmlize-output-type to 'inline-css&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;2. type the code in emacs, with the appropriate mode;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. run the command htmlize-buffer, a new buffer will rise&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. replace "&amp;lt;body&amp;gt;" and "&amp;lt;/body&amp;gt;" with "&amp;lt;div&amp;gt;" and "&amp;lt;/div&amp;gt;", and cut the whole "div" (former "body") into editor of blogger (in html mode)&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. preview it. it looks exactly like in emacs.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1478602652479594974?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1478602652479594974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1478602652479594974' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1478602652479594974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1478602652479594974'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2010/01/use-emacs-to-generate-highlighted-code.html' title='use emacs to generate highlighted code'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-2299711024531246792</id><published>2010-01-19T21:37:00.005+08:00</published><updated>2010-01-20T20:11:21.751+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><title type='text'>How to set cursor shape using clx</title><content type='html'>&lt;div class="gmail_quote"&gt;&lt;div&gt;Actually it's just the same as using xlib.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. open a font named "cursor", it's a collection of different cursor shapes.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. create a cursor object which can be used in somewhere like :cursor of window or grab-pointer.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;example:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="background-color: black; color: lightskyblue;"&gt;&lt;pre&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: lime;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;defun&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: white;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;create-cursor&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; (char)&lt;br /&gt;  (&lt;/span&gt;&lt;/span&gt;&lt;span style="color: lime;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;let&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; ((cursor-font (xlib:open-font *display* &lt;/span&gt;&lt;/span&gt;&lt;span style="color: turquoise;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;"cursor"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;))&lt;br /&gt;        (black (xlib:make-color &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:red&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; 0.0 &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:green&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; 0.0 &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:blue&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; 0.0))&lt;br /&gt;        (white (xlib:make-color &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:red&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; 1.0 &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:green&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; 1.0 &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:blue&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; 1.0)))&lt;br /&gt;    (xlib:create-glyph-cursor &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:source-font&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; cursor-font&lt;br /&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:source-char&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; char&lt;br /&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:mask-font&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; cursor-font&lt;br /&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:mask-char&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; (1+ char)&lt;br /&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:background&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; black&lt;br /&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #cd0000;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;:foreground&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; white)))&lt;br /&gt;&lt;br /&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="color: lime;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;defvar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ee00ee;"&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;*cursor*&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt; (create-cursor 68))&lt;br /&gt;&lt;br /&gt;(setf (xlib:window-cursor screen-root) *cursor)&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the effect is to make the default cursor shape an arrow (indicated by 68).&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the char argument of create-cursor indicated the shape, which can be revealed as the screenshot below by running "xfd -fn cursor" in shell.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/__ZpHvfkfhIQ/S1W6A0j-OGI/AAAAAAAAAIU/hhk7KEisgAA/s1600-h/cursors.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/__ZpHvfkfhIQ/S1W6A0j-OGI/AAAAAAAAAIU/hhk7KEisgAA/s320/cursors.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-2299711024531246792?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/2299711024531246792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=2299711024531246792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2299711024531246792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2299711024531246792'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2010/01/how-to-set-cursor-shape-using-clx_19.html' title='How to set cursor shape using clx'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/__ZpHvfkfhIQ/S1W6A0j-OGI/AAAAAAAAAIU/hhk7KEisgAA/s72-c/cursors.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3965068022735823732</id><published>2010-01-13T13:13:00.002+08:00</published><updated>2010-01-19T21:46:16.780+08:00</updated><title type='text'>去死吧，spammer们</title><content type='html'>&lt;div&gt;之前忙考试，没空收拾你们，这次全清理掉了。&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;to spammers: go back to hell.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3965068022735823732?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3965068022735823732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3965068022735823732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3965068022735823732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3965068022735823732'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2010/01/spammer_13.html' title='去死吧，spammer们'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6749451797740700926</id><published>2009-04-11T00:13:00.005+08:00</published><updated>2010-01-20T18:46:03.273+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>comint-within-quotes in emacs</title><content type='html'>&lt;div&gt;the function comint-within-quotes tells whether the cursor in quotes by counting the number of quotes from a start position to an end position.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;but it can not handle an empty string like this: ""&lt;br /&gt;&lt;/div&gt;&lt;div&gt;it counts the first quote but ignores the second one.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;and the single quote ' in common lisp has it's special using other than quoting something,oh,well,I mean it quotes something not with a pair but a single one.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;so I hope I can have the function count only double quotes when editing common lisp and this is what I've defuned:&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;pre class="prettyprint lang-el"&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;(defun comint-within-single-quotes (beg end)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp;(let ((countsq (comint-how-many-region "\\(\\=\\|[^\\\\]\\)\'" beg end)))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(= (mod countsq 2) 1)))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;(defun comint-within-double-quotes (beg end)&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp;(let ((countdq (comint-how-many-region "\\(\\=\\|[^\\\\]\\)\"" beg end)))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(= (mod countdq 2) 1)))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;(defun* comint-within-quotes-2 (beg end &amp;amp;key (quotes :both))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp;(case quotes&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(:both (comint-within-quotes beg end))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(:single (comint-within-single-quotes beg end))&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'courier new', monospace;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;(:double (comint-within-double-quotes beg end)))) &amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6749451797740700926?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6749451797740700926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6749451797740700926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6749451797740700926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6749451797740700926'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2009/04/comint-within-quotes-in-emacs_11.html' title='comint-within-quotes in emacs'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1887900873497492713</id><published>2008-09-12T11:14:00.002+08:00</published><updated>2009-04-10T23:21:13.890+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>ipython in emacs with dark background</title><content type='html'>I use a black bg color theme in emacs,while ipython outputs like this by default:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_mH1Ych5Vwjg/SMne3XADVeI/AAAAAAAAAFE/ltvmrvvRQjY/s1600-h/lightbg.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_mH1Ych5Vwjg/SMne3XADVeI/AAAAAAAAAFE/I65TSCD9zeA/s320-R/lightbg.png" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;well,some part of the output is black,it sucks&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;after a travel in the source code of ipython.el and python-mode.el,I found that ipython.el add a "-color lightbg" to command args when start ipython by default,as following:&lt;/div&gt;&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;(unless (member "-colors" py-python-command-args)&lt;br /&gt;  (setq py-python-command-args&lt;br /&gt; (nconc py-python-command-args&lt;br /&gt;        (list "-colors"&lt;br /&gt;       (cond&lt;br /&gt;        ((eq frame-background-mode 'dark)&lt;br /&gt;         "Linux")&lt;br /&gt;        ((eq frame-background-mode 'light)&lt;br /&gt;         "LightBG")&lt;br /&gt;        (t ; default (backg-mode isn't always set by XEmacs)&lt;br /&gt;         "LightBG"))))))&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;so I can either modify the py-python-command-args variable or frame-background-mode variable to stop it sucking.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I choose the latter one.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&amp;nbsp;&lt;a href="http://2.bp.blogspot.com/_mH1Ych5Vwjg/SMng8QANtQI/AAAAAAAAAFM/q1q0hGCEBfg/s1600-h/linux.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_mH1Ych5Vwjg/SMng8QANtQI/AAAAAAAAAFM/OMvGfXKnCts/s320-R/linux.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;BTW:both ways the variable must be set before ipython.el is loaded,for the code above is runned while loading rather than in a function which runned later.&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1887900873497492713?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1887900873497492713/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1887900873497492713' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1887900873497492713'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1887900873497492713'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2008/09/ipython-in-emacs-with-dark-background.html' title='ipython in emacs with dark background'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_mH1Ych5Vwjg/SMne3XADVeI/AAAAAAAAAFE/I65TSCD9zeA/s72-Rc/lightbg.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6486619861888086157</id><published>2008-07-25T14:12:00.007+08:00</published><updated>2009-04-10T23:17:27.305+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kernel_note'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>ULK note (1):Segment in linux</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;According to ULK,linux uses segmentation in a very limit way,namely,linux uses 4 segments,two for user mode and two for kernel mode.Linux also defines macros as segment selectors of these 4 segments:__USER_CS,__USER_DS,__KERNEL_CS,__KERNEL_DS.&lt;br /&gt;&lt;br /&gt;I lookup the definition in include/asm-i386/segment.h(crash &lt;a href="http://lxr.linux.no/#linux-bk+v2.6.11.5/include/asm-i386/segment.h#L55" target="" title=""&gt;here&lt;/a&gt; for details),let's take a look at __USER_CS and __KERNEL_CS:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;#define GDT_ENTRY_DEFAULT_USER_CS 14&lt;br /&gt;#define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS * 8 &lt;span style="color: white;"&gt;+ 3&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;#define GDT_ENTRY_KERNEL_BASE 12&lt;br /&gt;#define GDT_ENTRY_KERNEL_CS (GDT_ENTYY_KERNEL_BASE + 0)&lt;br /&gt;#define __KERNEL_CS (GDT_ENTRY_KERNEL_CS * 8)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;well,14(GDT_ENTRY_DEFAULT_USER_CS) is the user data segment descriptor's offset in GDT.&lt;br /&gt;&lt;br /&gt;8 is the length of segment descriptor,easy to understand,huh(it's my first thought)?But what is the "+ 3"?&lt;br /&gt;&lt;br /&gt;In fact,8 is (1000) in binary,so multiplying 8 left shift GDT_ENTRY_DEFAULT_USER_CS by 3 bits.aha!It's the TI and RPL fields in segment selector!so what the red "+ 3" turns out:it means this segment is in GDT(TI cleared) and it's in user mode(RPL=11).&lt;br /&gt;&lt;br /&gt;Similar to __USER_CS,RPL of __KERNEL_CS is set to 00 to indicate that the segment is in kernel mode,so nothing needs to be added.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6486619861888086157?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6486619861888086157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6486619861888086157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6486619861888086157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6486619861888086157'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2008/07/ulk-note-1segment-in-linux.html' title='ULK note (1):Segment in linux'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3004779521062260527</id><published>2008-07-04T16:37:00.004+08:00</published><updated>2009-04-10T23:07:13.584+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><title type='text'>a note about sbcl and slime</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;recently I switch to stumpwm,getting it work with sbcl,I enjoyed hacking.&lt;br /&gt;but then I found that when slime read or print Chinese characters,the connection to sbcl will be broken.&lt;br /&gt;Actually,I did set slime-net-coding-system to utf-8-unix,which dosen't help at all.&lt;br /&gt;At last the problem turned out to be due to the coding system of swank side.&lt;br /&gt;as we know,slime connects to a server that was provided by a package named swank.&lt;br /&gt;if I type M-x slime in emacs,everything works well cause emacs runs an sbcl process and set coding system at both side for me,but when sbcl started seperatly by xdm from slime,I forgot to set coding system of swank.&lt;br /&gt;so after I start swank like this:&lt;br /&gt;&lt;code class="prettyprint"&gt;&lt;br /&gt;(swank:create-server :dont-close t :coding-system "uft-8-unix")&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I can input Chinese and get correct output at REPL.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3004779521062260527?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3004779521062260527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3004779521062260527' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3004779521062260527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3004779521062260527'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2008/07/note-about-sbcl-and-slime.html' title='a note about sbcl and slime'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1795530167736548396</id><published>2008-04-02T10:04:00.002+08:00</published><updated>2008-04-02T10:06:53.970+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>ssh to remote server without password</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;ol&gt;&lt;li&gt;install openssh in both local and remote machine;&lt;/li&gt;&lt;li&gt;run &lt;strong&gt;ssh-keygen&lt;/strong&gt; in the local machine,you'll get &lt;strong&gt;id_rsa&lt;/strong&gt; and &lt;strong&gt;id_rsa.pub&lt;/strong&gt;;&lt;/li&gt;&lt;li&gt;well,the file &lt;strong&gt;id_rsa&lt;/strong&gt; stors your private key,you must keep it secret;&lt;/li&gt;&lt;li&gt;while &lt;strong&gt;id_rsa.pub&lt;/strong&gt; is the public key,just keep it from writing by others.&lt;/li&gt;&lt;li&gt;deliver id_rsa.pub to the remote server you want to login without password by whatever ways,e.g. &lt;em&gt;scp .ssh/id_rsa.pub user@server:.ssh/&lt;/em&gt; of course you will be prompted for password this time,make sure there is a .ssh directory in the remote server and it's mode is 700&lt;/li&gt;&lt;li&gt;&lt;em&gt;cat .ssh/id_rsa.pub &amp;amp;gt;&amp;amp;gt; .ssh/authorized_keys&lt;/em&gt; (run in remote server)&lt;/li&gt;&lt;li&gt;&lt;em&gt;chmod 644 .ssh/id_rsa.pub .ssh/authorized_keys&lt;/em&gt; (also in remote server)&lt;/li&gt;&lt;li&gt;now have a try.&lt;/li&gt;&lt;/ol&gt;note:when you run &lt;em&gt;ssh server&lt;/em&gt; without a username,ssh asumes you want to login to remote server with the same user as the local&lt;em&gt;&lt;em&gt;&lt;/em&gt; one.&lt;br /&gt;note2:&lt;/em&gt;if you put your non-root user's public key to &lt;span style="font-weight: bold;"&gt;/root/.ssh&lt;/span&gt; of the remote server,then you can login to remote server as root directory,so either avoid this situation or protect the password of your local account.&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1795530167736548396?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1795530167736548396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1795530167736548396' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1795530167736548396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1795530167736548396'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2008/04/ssh-to-remote-server-without-password.html' title='ssh to remote server without password'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-35330839785501299</id><published>2008-02-22T14:32:00.002+08:00</published><updated>2008-02-22T15:36:40.272+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><title type='text'>a note about autoconf and automake</title><content type='html'>after several hours,I got autoconf and automake to work on my program,known as following(with autoconf-2.61 and automake-1.10):&lt;br /&gt;&lt;br /&gt;1.run &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;autoscan&lt;/span&gt; &lt;/span&gt;&lt;span&gt;in the source directory,and we can get a file named &lt;span style="font-weight: bold; font-style: italic;"&gt;configure.scan&lt;/span&gt;&lt;span&gt;&lt;br /&gt;&lt;br /&gt;2.&lt;/span&gt;&lt;/span&gt;&lt;span&gt;modify the &lt;span style="font-weight: bold; font-style: italic;"&gt;configure.scan &lt;/span&gt;so that it makes sense to our project,&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span&gt;first of all is &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;AC_INIT  &lt;/span&gt;&lt;/span&gt;macro,i.e. our project name,version,and contact address;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;then add a macro &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;A&lt;span style="color: rgb(255, 0, 0);"&gt;M&lt;/span&gt;_INIT_AUTOMAKE&lt;/span&gt;&lt;/span&gt; (be careful of the red M),fill it with the project name and version,if it does not exist,then aclocal will not work properly;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;and do not touch &lt;span style="font-weight: bold;"&gt;&lt;span style="font-style: italic;"&gt;AC_CONFIG_HEADER &lt;/span&gt;&lt;/span&gt;,it's for people who want make their project portable with a "config.h",so do not feed your project's header files to it;at last comes &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;AC_OUTPUT&lt;/span&gt;&lt;/span&gt;,set it with "Makefile";&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;other macros are project specified,so we skip them here;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;rename &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;configure.scan&lt;/span&gt;&lt;/span&gt; to  &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;configure.ac&lt;/span&gt;&lt;/span&gt; or &lt;span style="font-weight: bold; font-style: italic;"&gt;configure.in&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span&gt;3.run &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;aclocal&lt;/span&gt;&lt;/span&gt; to generate &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;aclocal.m4&lt;/span&gt;&lt;/span&gt;(if no aclocal.m4 generated,there must be something wrong)&lt;br /&gt;&lt;br /&gt;4.run &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;autoconf&lt;/span&gt;&lt;/span&gt; to generate &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;configure&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5.create a file &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Makefile.am&lt;/span&gt;&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;set macro &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;bin_PROGRAMS=&lt;span style="color: rgb(102, 102, 102);"&gt;name&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;s&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;(it's the executable file's name,like emacs,mplayer,etc)&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;name_SOURCES=&lt;span style="color: rgb(102, 102, 102);"&gt;files&lt;/span&gt;&lt;/span&gt;(it's the sources files whitch the binary relies on)&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;name_LDFLAGS=&lt;span style="color: rgb(102, 102, 102);"&gt;flags&lt;/span&gt;&lt;/span&gt;(e.g. if we use expat, add -lexpat here)&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;many other macros can be useful,too,but omitted here.&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;6.run &lt;span style="font-weight: bold; font-style: italic;"&gt;automake -a&lt;/span&gt;,touch files which it complains can not find.&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;7.all right,run &lt;span style="font-weight: bold; font-style: italic;"&gt;./configure&lt;/span&gt; now, we can get Makefile automatically,wonderful,isn't it?&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-35330839785501299?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/35330839785501299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=35330839785501299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/35330839785501299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/35330839785501299'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2008/02/note-about-autoconf-and-automake.html' title='a note about autoconf and automake'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8115534201185371531</id><published>2007-12-06T10:59:00.000+08:00</published><updated>2007-12-06T11:07:59.153+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><title type='text'>slime-close-parens-at-point</title><content type='html'>the default key binding of the function slime-close-parens-at-point is C-c C-q&lt;br /&gt;but it's obsolete from slime-2.0_p20070816-r1,the comments in the source file are as following:&lt;br /&gt;&lt;br /&gt;;; SLIME-CLOSE-PARENS-AT-POINT is obsolete:&lt;br /&gt;&lt;br /&gt;;; It doesn't work correctly on the REPL, because there&lt;br /&gt;;; BEGINNING-OF-DEFUN-FUNCTION and END-OF-DEFUN-FUNCTION is bound to&lt;br /&gt;;; SLIME-REPL-MODE-BEGINNING-OF-DEFUN (and&lt;br /&gt;;; SLIME-REPL-MODE-END-OF-DEFUN respectively) which compromises the&lt;br /&gt;;; way how they're expect to work (i.e. END-OF-DEFUN does not signal&lt;br /&gt;;; an UNBOUND-PARENTHESES error.)&lt;br /&gt;&lt;br /&gt;;; Use SLIME-CLOSE-ALL-PARENS-IN-SEXP instead.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;well,bind slime-close-all-parens-in-sexp to C-c C-q,and I can pretend that nothing happened in my world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8115534201185371531?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8115534201185371531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8115534201185371531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8115534201185371531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8115534201185371531'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/12/slime-close-parens-at-point.html' title='slime-close-parens-at-point'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6577134751599588021</id><published>2007-10-02T22:35:00.000+08:00</published><updated>2007-10-08T10:40:22.339+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>to thinkpaders,about tp-fancontrol</title><content type='html'>from a certain version of thinkpad_acpi,fan_control is disabled by default,as Documentation/thinkpad-acpi.txt said:&lt;br /&gt;&lt;br /&gt;NOTE NOTE NOTE: fan control operations are disabled by default for&lt;br /&gt;safety reasons.  To enable them, the module parameter "fan_control=1"&lt;br /&gt;must be given to thinkpad-acpi.&lt;br /&gt;&lt;br /&gt;so the tp-fancontrol daemon won't work any more if the thinkpad_acpi module isn't told that it should enable the fan_control.&lt;br /&gt;&lt;br /&gt;let's do that:&lt;br /&gt;&lt;br /&gt;#vim /etc/modules.d/thinkpad_acpi&lt;br /&gt;&lt;br /&gt;then add the following line:&lt;br /&gt;options thinkpad_acpi fan_control=1&lt;br /&gt;&lt;br /&gt;:wq&lt;br /&gt;&lt;br /&gt;#update-modules&lt;br /&gt;&lt;br /&gt;now tp-fancontrol should work again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6577134751599588021?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6577134751599588021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6577134751599588021' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6577134751599588021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6577134751599588021'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/10/to-thinkpadersabout-tp-fancontrol.html' title='to thinkpaders,about tp-fancontrol'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7771495289844103754</id><published>2007-09-13T17:24:00.000+08:00</published><updated>2007-09-13T17:29:03.516+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>Yodaesque</title><content type='html'>what?yes!yodaesque!&lt;br /&gt;Practical Common Lisp,Page 285,it reads:&lt;br /&gt;"Compared to the clauses I’ve described so far, with their prepositions and subclauses, do is a model of Yodaesque simplicity."&lt;br /&gt;&lt;br /&gt;and...the footnote:&lt;br /&gt;“No! Try not. Do . . . or do not. There is no try.” —Yoda, The Empire Strikes Back&lt;br /&gt;&lt;br /&gt;Orz...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7771495289844103754?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7771495289844103754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7771495289844103754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7771495289844103754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7771495289844103754'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/09/yodaesque.html' title='Yodaesque'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6527625830889546062</id><published>2007-07-24T10:46:00.000+08:00</published><updated>2007-07-24T10:54:37.968+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>emacs-unicode-2 compile error</title><content type='html'>several days ago,an error was reported (SYNTAX_ENTRY_FOLLOW_PARENT undefined) when emerge emacs-cvs,I tried to make a patch to get it compiled,but failed.however,the problem is resolved taday after cvs update.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6527625830889546062?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6527625830889546062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6527625830889546062' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6527625830889546062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6527625830889546062'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/07/emacs-unicode-2-compile-error.html' title='emacs-unicode-2 compile error'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1847504477737566007</id><published>2007-07-17T16:21:00.000+08:00</published><updated>2007-07-17T16:28:08.205+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>app-emacs/cedet-1.0_pre4-r1</title><content type='html'>maybe there is a bug in cedet-1.0_pre4-r1,everytime I open a .c file,emacs will complain that "Autoloading failed to define function semantic-default-c-setup",and it occurs even when I create a semanticdb,so I try to downgrade cedet to 1.0_pre3-r2,no problems any more.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1847504477737566007?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1847504477737566007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1847504477737566007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1847504477737566007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1847504477737566007'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/07/app-emacscedet-10pre4-r1.html' title='app-emacs/cedet-1.0_pre4-r1'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-5690473054510893592</id><published>2007-06-17T21:31:00.000+08:00</published><updated>2007-06-17T23:38:39.094+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>a gtk+'s bug fixed</title><content type='html'>the bug wat not fixed until gtk+-2.10.13&lt;br /&gt;with previous gtk+ versions,a save dialog will stretch out and draw back very frequently,as a result,the cpu load will be 100%&lt;br /&gt;now all gtk+ applications get right.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-5690473054510893592?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/5690473054510893592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=5690473054510893592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5690473054510893592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5690473054510893592'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/06/gtks-bug-fixed.html' title='a gtk+&apos;s bug fixed'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1585553812293243446</id><published>2007-06-15T19:53:00.001+08:00</published><updated>2007-06-16T16:05:58.834+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>a bug of x60</title><content type='html'>if the modem is disabled in bios,then the sound card will be disabled,too.&lt;br /&gt;after I disabled the modem,I must run "alsaconf" to drive the sound card every rebooting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1585553812293243446?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1585553812293243446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1585553812293243446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1585553812293243446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1585553812293243446'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/06/bug-of-x60.html' title='a bug of x60'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8634377731571625434</id><published>2007-06-12T15:59:00.000+08:00</published><updated>2007-06-12T16:15:18.565+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kernel_note'/><title type='text'>paging in linux</title><content type='html'>ever since 2.6.11,there is a new level named pud(page upper directory) plusing to pgd,pmd,pte,and so something chaged.&lt;br /&gt;what confused me is that,as ULK said:&lt;br /&gt;"For 32-bit architectures with no Physical Address Extension, two paging levels are sufficient. Linux essentially eliminates the Page Upper&lt;br /&gt;Directory and the Page Middle Directory fields by saying that they contain zero bits. However, the positions of the Page Upper Directory&lt;br /&gt;and the Page Middle Directory in the sequence of pointers are kept so that the same code can work on 32-bit and 64-bit architectures. The&lt;br /&gt;kernel keeps a position for the Page Upper Directory and the Page Middle Directory by setting the number of entries in them to 1 and&lt;br /&gt;mapping these two entries into the proper entry of the Page Global Directory."&lt;br /&gt;so I wonder how does the kernel eliminate pud and pmd as well as keep the position of them to make the code work on 32-bit and 64-bit arch?&lt;br /&gt;&lt;br /&gt;at first,I thought pgd still leads the paging unit to pud,then pud to pmd,blablabla...&lt;br /&gt;but it is completely wrong,coz the paging unit in x86 knows only 2-level paging when with pae disabled!&lt;br /&gt;so in the hardware paging unit(x86)'s perspective,there are only pgd,pte,nothing else.&lt;br /&gt;&lt;br /&gt;but how to understand "the same code can work on 32-bit and 64-bit architechtures"?&lt;br /&gt;well,I think it means the kernel folds pud and pmd away,so any functions or macros operating on pud or pmd will be lead to pgd,thus the code need no change between 32-bit and 64-bit.&lt;br /&gt;&lt;br /&gt;anyone any ideas?plz show me:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8634377731571625434?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8634377731571625434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8634377731571625434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8634377731571625434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8634377731571625434'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/06/paging-in-linux.html' title='paging in linux'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6541979245046879878</id><published>2007-05-21T13:56:00.001+08:00</published><updated>2007-05-21T14:09:52.299+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>example of Bresenham's line algorithm</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;it depends on gtk+-2.0,using function &lt;b&gt;gdk_draw_point&lt;/b&gt; to draw points.I wrote this little program because the stupid Chinese education:they are still writing c programs compiled by turbo c and with a "graphic.h" to draw graphics.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#include &amp;lt;gdk/gdk.h&amp;gt;//in fact,I do not know whether I need this&lt;br /&gt;&lt;br /&gt;#include &amp;lt;gtk/gtk.h&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void linebres(int xa, int ya, int xb, int yb,GtkWidget *widget,GdkDrawable *drawable)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; int dx = abs(xa-xb), dy = abs(ya-yb);&lt;br /&gt;&lt;br /&gt; int p;&lt;br /&gt;&lt;br /&gt; int twody, twodx;&lt;br /&gt;&lt;br /&gt; int x,y,xend,yend;&lt;br /&gt;&lt;br /&gt; float k=dy/dx;&lt;br /&gt;&lt;br /&gt; int temp;&lt;br /&gt;&lt;br /&gt; if(k &amp;gt; 1|| k &amp;lt; -1){&lt;br /&gt;&lt;br /&gt;  temp = xa;&lt;br /&gt;&lt;br /&gt;  xa = ya;&lt;br /&gt;&lt;br /&gt;  ya = temp;&lt;br /&gt;&lt;br /&gt;  temp = xb;&lt;br /&gt;&lt;br /&gt;  xb = yb;&lt;br /&gt;&lt;br /&gt;  yb = temp;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; p = 2 * dy - dx;&lt;br /&gt;&lt;br /&gt; twody = 2 * dy;&lt;br /&gt;&lt;br /&gt; twodx = 2 * dx;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; if(xa - xb &amp;gt; 0){&lt;br /&gt;&lt;br /&gt;  x = xb;&lt;br /&gt;&lt;br /&gt;  y = yb;&lt;br /&gt;&lt;br /&gt;  xend=xa;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; else{&lt;br /&gt;&lt;br /&gt;  x = xa;&lt;br /&gt;&lt;br /&gt;  y = ya;&lt;br /&gt;&lt;br /&gt;  xend = xb;&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; gdk_draw_point (drawable,widget-&amp;gt;style-&amp;gt;black_gc,x,y);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; while(x &amp;lt; xend){&lt;br /&gt;&lt;br /&gt;  x++;&lt;br /&gt;&lt;br /&gt;  if(p &amp;lt; 0)&lt;br /&gt;&lt;br /&gt;   p += twody;&lt;br /&gt;&lt;br /&gt;  else{&lt;br /&gt;&lt;br /&gt;   y++;&lt;br /&gt;&lt;br /&gt;   p += (twody-twodx);&lt;br /&gt;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  gdk_draw_point (drawable,widget-&amp;gt;style-&amp;gt;black_gc,x,y);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;static void on_destroy (GtkWidget * widget, gpointer data)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; gtk_main_quit ();&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;gint expose_callback(GtkWidget *widget, GdkEventAny *event, gpointer data)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; GdkDrawable *drawable;&lt;br /&gt;&lt;br /&gt; int i;&lt;br /&gt;&lt;br /&gt; drawable=widget-&amp;gt;window;&lt;br /&gt;&lt;br /&gt; linebres (10,5,180,60,widget,drawable);&lt;br /&gt;&lt;br /&gt; return 0;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int main(int argc, char **argv)&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt; gtk_init ( &amp;argc, &amp;argv);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; GdkWindowAttr attr;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; GtkWidget *window;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; GtkWidget *widget = gtk_drawing_area_new ();&lt;br /&gt;&lt;br /&gt; gtk_drawing_area_size (GTK_DRAWING_AREA (widget),200,200);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; window = gtk_window_new (GTK_WINDOW_TOPLEVEL);&lt;br /&gt;&lt;br /&gt; gtk_container_add (GTK_CONTAINER (window),widget);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; g_signal_connect (G_OBJECT (window), "destroy",G_CALLBACK (on_destroy), NULL);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; g_signal_connect (G_OBJECT(widget), "expose_event",GTK_SIGNAL_FUNC(expose_callback), NULL);&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; gtk_widget_show_all (window);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; gtk_main ();&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; return 0;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6541979245046879878?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6541979245046879878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6541979245046879878' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6541979245046879878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6541979245046879878'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/example-of-bresenham-line-algorithm.html' title='example of Bresenham&amp;#39;s line algorithm'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4184135238515282109</id><published>2007-05-20T23:56:00.001+08:00</published><updated>2007-05-20T23:56:45.393+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>hdaps disk parking patch for kernel 2.6.21</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;a href='http://fvwmer.googlepages.com/02-disk-protect-for-2.6.21.patch'&gt;hdaps_protect-2.6.21.patch&lt;/a&gt;&lt;br&gt;&lt;/br&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4184135238515282109?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4184135238515282109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4184135238515282109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4184135238515282109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4184135238515282109'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/hdaps-disk-parking-patch-for-kernel.html' title='hdaps disk parking patch for kernel 2.6.21'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7909865979145212216</id><published>2007-05-16T18:01:00.001+08:00</published><updated>2007-05-16T18:01:14.983+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>trackpoint in gentoo</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;trackpoint will work fine in gentoo by the following steps:&lt;br /&gt;1.enable "press to select"&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;echo -n 1 &amp;gt; /sys/devices/platform/i8042/serio1/press_to_select&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2.to enable scrolling,put the following lines into xorg.conf's trackpoint section(it's an "InputDevice" section)&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;	Option      "Emulate3Buttons"     "on"&lt;br /&gt;	Option      "Emulate3TimeOut"     "50"&lt;br /&gt;	Option      "EmulateWheel"        "on"&lt;br /&gt;	Option      "EmulateWheelTimeOut" "200"&lt;br /&gt;	Option      "EmulateWheelButton"    "2"&lt;br /&gt;	Option      "YAxisMapping"        "4 5"&lt;br /&gt;	Option      "XAxisMapping"        "6 7"&lt;br /&gt;	Option      "ZAxisMapping"        "4 5"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;now restart X,and enjoy the trackpoint.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7909865979145212216?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7909865979145212216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7909865979145212216' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7909865979145212216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7909865979145212216'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/trackpoint-in-gentoo.html' title='trackpoint in gentoo'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7165681900747668674</id><published>2007-05-10T21:15:00.001+08:00</published><updated>2007-05-10T21:15:12.192+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>installed gentoo 2007.0 amd64</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;the new livecd of 2007.0(amd64) now bootable,so I installed a 64bit gentoo.&lt;br /&gt;64bit firefox can use 32bit flash plugin now:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#emerge netscape-flash&lt;br /&gt;#emerge nspluginwrapper&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;everything should be all right now,if not,execute the following command:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$nspluginwrapper -i /usr/lib32/nsbrowser/plugins/libflashplayer.so&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7165681900747668674?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7165681900747668674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7165681900747668674' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7165681900747668674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7165681900747668674'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/installed-gentoo-20070-amd64.html' title='installed gentoo 2007.0 amd64'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-5147872297834911343</id><published>2007-05-09T23:45:00.001+08:00</published><updated>2007-05-09T23:50:42.826+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>usb cd writer howto</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;1.build a kernel supporting usb cd&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;Device Drivers  ---&amp;gt;&lt;br /&gt;&lt;br /&gt;   SCSI device support  ---&amp;gt;&lt;br /&gt;&lt;br /&gt;   &lt;m&gt;[M]   SCSI CDROM support&lt;br /&gt;&lt;br /&gt;   [ ]   Enable vendor-specific extensions (for SCSI CDROM)&lt;br /&gt;&lt;br /&gt;   &lt;m&gt;[M]   SCSI generic support&lt;br /&gt;&lt;br /&gt;&lt;/m&gt;&lt;/m&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;2.install packages that do the cd burning&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#emerge cdrtools&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3.do the burning with cdrecord&lt;br /&gt;&lt;br /&gt;say,I want to burn livecd-amd64-installer-2007.0.iso&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;#cdrecord -speed=4 dev=/dev/sr0 -v livecd-amd64-installer-2007.0.iso&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and wait for it until finish burning&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-5147872297834911343?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/5147872297834911343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=5147872297834911343' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5147872297834911343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5147872297834911343'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/usb-cd-writer-howto.html' title='usb cd writer howto'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4235192384473515588</id><published>2007-05-07T00:09:00.001+08:00</published><updated>2007-05-07T00:09:45.141+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>use wpa_supplicant</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I choose WPA-PSK for my wireless router,so the corresponding configure is like following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$wpa_passphrase ssid passphrase&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;where passphrase is the router's PSK pass,and it outputs a string which should be assigned to "psk" in wpa_supplicant.conf,like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;network={&lt;br /&gt;        ssid="ssid"&lt;br /&gt;	proto=WPA&lt;br /&gt;	key_mgmt=WPA-PSK&lt;br /&gt;	pairwise=TKIP&lt;br /&gt;	group=TKIP&lt;br /&gt;	psk=psk	&lt;br /&gt;	priority=2&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4235192384473515588?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4235192384473515588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4235192384473515588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4235192384473515588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4235192384473515588'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/use-wpasupplicant.html' title='use wpa_supplicant'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7798764829967978028</id><published>2007-05-05T16:51:00.001+08:00</published><updated>2007-05-05T18:27:54.684+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>browse chinese bbs with urxvt in utf8</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;for most chinese bbs output gbk encoding,so the urxvt should be told that it is going to treat the stream as gbk,more than that,it should also be told that the input mothod works in a utf8 enviroment,so I start a urxvt to browse bbs like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;LC_ALL=zh_CN.GBK urxvt -imlocale 'zh_CN.utf8' -fn '10x20,xft:AR PL&lt;br /&gt;New Sung:antialias=false' -e screen&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;it looks perfect&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7798764829967978028?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7798764829967978028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7798764829967978028' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7798764829967978028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7798764829967978028'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/browse-chinese-bbs-with-urxvt-in-utf8.html' title='browse chinese bbs with urxvt in utf8'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6837861758253616766</id><published>2007-05-05T02:03:00.001+08:00</published><updated>2007-05-05T02:03:47.503+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='kernel_note'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>ENTRY in *.S files</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;the gdt of a cpu is described like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ENTRY(cpu_gdt_table)&lt;br /&gt;    .quad 0x0000000000000000&lt;br /&gt;    ...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;while ENTRY is a macro defined in include/linux/linkage.h ike this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#define ENTRY(name) \&lt;br /&gt;   .globl name; \&lt;br /&gt;   ALIGN; \&lt;br /&gt;   name:&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;so it means a globally visible label leading a memory of data(gdt)?hmmm&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6837861758253616766?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6837861758253616766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6837861758253616766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6837861758253616766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6837861758253616766'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/05/entry-in-s-files.html' title='ENTRY in *.S files'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4703640946164659514</id><published>2007-04-24T13:08:00.001+08:00</published><updated>2007-04-25T17:29:51.673+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>at last,ipw3945 gets no hot any more on my x60</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;It really sucks when my x60's right palm-rest gets too hot in summer because of ipw3945.The record has got up to 54 degree.&lt;br&gt;&lt;/br&gt;At last,I find a way to get it cooler:&lt;br&gt;&lt;/br&gt;#iwpriv eth1 set_power 7&lt;br&gt;&lt;/br&gt;and it will never gets too hot.&lt;br&gt;&lt;/br&gt;Now in my box,the PCI temperature(that's exactly ipw3945) is 44 degree.&lt;br&gt;&lt;/br&gt;Wonderful!&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;&lt;br&gt;&lt;/br&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4703640946164659514?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4703640946164659514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4703640946164659514' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4703640946164659514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4703640946164659514'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/04/at-lastipw3945-gets-no-hot-any-more-on.html' title='at last,ipw3945 gets no hot any more on my x60'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6144689915633174452</id><published>2007-04-08T15:56:00.000+08:00</published><updated>2007-04-25T17:14:06.335+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>a problem of openssl 0.9.8e</title><content type='html'>if your openssl version is 0.9.8e and you are using openssh to connect to an ssh1 host,you will get an error like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Disconnecting: Corrupted check bytes on input&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;to solve the problem,use openssl 0.9.8d or other no-bug version.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6144689915633174452?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6144689915633174452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6144689915633174452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6144689915633174452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6144689915633174452'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/04/problem-of-openssl-098e.html' title='a problem of openssl 0.9.8e'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6267268666910658436</id><published>2007-04-04T15:27:00.000+08:00</published><updated>2007-04-04T15:41:52.895+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>practical common lisp</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_mH1Ych5Vwjg/RhNWsyXNrdI/AAAAAAAAAAw/DMDDwAlgIjY/s1600-h/practical-common-lisp.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_mH1Ych5Vwjg/RhNWsyXNrdI/AAAAAAAAAAw/DMDDwAlgIjY/s320/practical-common-lisp.jpg" alt="" id="BLOGGER_PHOTO_ID_5049474934645829074" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I am reading this book these days.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6267268666910658436?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6267268666910658436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6267268666910658436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6267268666910658436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6267268666910658436'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/04/practical-common-lisp.html' title='practical common lisp'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_mH1Ych5Vwjg/RhNWsyXNrdI/AAAAAAAAAAw/DMDDwAlgIjY/s72-c/practical-common-lisp.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-25925742695766469</id><published>2007-03-16T23:08:00.000+08:00</published><updated>2007-03-16T23:30:18.160+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>xmms2</title><content type='html'>As everyone knows,xmms is a great audio player,except it depends on gtk+,so I turned to bmp which depends on gtk+-2.0.But letting bmp to play flac is diffculty,so I choosed bmpx.&lt;br /&gt;At first,bmpx satisfied me,until version 3.&lt;br /&gt;1.compiling bmpx take 99% of my memory!you know,I have 1GB ram,it sucks!&lt;br /&gt;2.shout cast or something is cool,BUT,I did,do,and will never need that!But everytime bmpx tries to access the stupid network address that I cat not connect to from my network in order to get information about shout cast which makes bmpx's starting up take at least 5 minutes!What's more,bmpx does not provide an option to close the sucking function until a recent version.&lt;br /&gt;So,now I give bmpx up and get &lt;a href=http://wiki.xmms2.xmms.se/index.php/Main_Page&gt;xmms2&lt;/a&gt;,a C/S audio player.I can choose different clients as I wish to communicate with the xmms2 server,it's cool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-25925742695766469?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/25925742695766469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=25925742695766469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/25925742695766469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/25925742695766469'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/03/xmms2.html' title='xmms2'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3097735107237797234</id><published>2007-03-15T11:10:00.000+08:00</published><updated>2007-03-15T12:16:52.573+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>hdaps now works</title><content type='html'>At last I found an &lt;a href=http://fvwmer.googlepages.com/hdaps_protect-2.6.20.patch.bz2&gt;hdaps protect patch&lt;/a&gt; for kernel 2.6.20,patch it:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#patch -p1 &amp;lt; /path/to/hdaps_protect-2.6.20.patch&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;remember to compile hdaps as a module&lt;br /&gt;then install the tp_smapi with hdaps support:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#USE="hdaps" emerge tp_smapi&lt;br /&gt;#modprobe tp_smapi&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and install hdapsd:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#emerge hdapsd&lt;br /&gt;#rc-update add hdapsd default battery&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;after reboot,try it with updatedb,when I shake my laptop,the hard drive stops working,and when I stop,it remains working,cool!&lt;br /&gt;ps:&lt;br /&gt;first,when a boot the laptop with the new patched kernel,something goes wrong:&lt;br /&gt;my ethernet card can not be brought up,due to EEPROM checksum error,&lt;br /&gt;then I insert a cable,remove the e1000 module and probe it again,it works.Then I use &lt;a href=fvwmer.googlepages.com/vidalia-eeprom-mod-script&gt;a script&lt;/a&gt; from lenovo,run it:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#./vidalia-eeprom-mod-script eth0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;now problem resolved&lt;br /&gt;:P&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3097735107237797234?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3097735107237797234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3097735107237797234' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3097735107237797234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3097735107237797234'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/03/hdaps-now-works.html' title='hdaps now works'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-9011560811965153101</id><published>2007-03-10T22:11:00.000+08:00</published><updated>2007-03-10T22:41:58.433+08:00</updated><title type='text'>hibernate-ram,special keys,etc,on x60</title><content type='html'>At last,with a suspend2-sources-2.6.20,I have make the hibernate-ram work,it's great!I use acpid to grab fn+f4 or lid off to get hibernate-ram activate automatically:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;x60 shelling # cat /etc/acpi/events/tp_hotkey &lt;br /&gt;event=ibm/hotkey.*&lt;br /&gt;action=/etc/acpi/actions/tp_hotkey.sh "%e"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;x60 shelling # cat /etc/acpi/actions/tp_hotkey.sh &lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;#receive our hotkey event&lt;br /&gt;event=$1&lt;br /&gt;&lt;br /&gt;#ibm thinkpad x60 hotkeys&lt;br /&gt;nop="ibm/hotkey HKEY 00000080 00000000"&lt;br /&gt;fnf1="ibm/hotkey HKEY 00000080 00001001"&lt;br /&gt;fnf2="ibm/hotkey HKEY 00000080 00001002"&lt;br /&gt;fnf3="ibm/hotkey HKEY 00000080 00001003"&lt;br /&gt;fnf4="ibm/hotkey HKEY 00000080 00001004"&lt;br /&gt;fnf5="ibm/hotkey HKEY 00000080 00001005"&lt;br /&gt;fnf6="ibm/hotkey HKEY 00000080 00001006"&lt;br /&gt;fnf7="ibm/hotkey HKEY 00000080 00001007"&lt;br /&gt;fnf8="ibm/hotkey HKEY 00000080 00001008"&lt;br /&gt;fnf9="ibm/hotkey HKEY 00000080 00001009"&lt;br /&gt;fnf10="ibm/hotkey HKEY 00000080 0000100a"&lt;br /&gt;fnf11="ibm/hotkey HKEY 00000080 0000100b"&lt;br /&gt;fnf12="ibm/hotkey HKEY 00000080 0000100c"&lt;br /&gt;fnbksps="ibm/hotkey HKEY 00000080 0000100d"&lt;br /&gt;#fnhome="ibm/hotkey HKEY 00000080 00001010"&lt;br /&gt;#fnend="ibm/hotkey HKEY 00000080 00005010"&lt;br /&gt;wireless_switch="ibm/hotkey HKEY 00000080 00007000"&lt;br /&gt;&lt;br /&gt;case $event in&lt;br /&gt;$nop)&lt;br /&gt; ;;&lt;br /&gt;$fnf1)&lt;br /&gt; ;;&lt;br /&gt;$fnf2)&lt;br /&gt; /usr/bin/xscreensaver-command -lock&lt;br /&gt; ;;&lt;br /&gt;$fnf3)&lt;br /&gt; ;;&lt;br /&gt;$fnf4)&lt;br /&gt; sudo /usr/sbin/hibernate-ram&lt;br /&gt; ;;&lt;br /&gt;$fnf5)&lt;br /&gt; ;;&lt;br /&gt;$fnf6)&lt;br /&gt; ;;&lt;br /&gt;$fnf7)&lt;br /&gt; ;;&lt;br /&gt;$fnf8)&lt;br /&gt; ;;&lt;br /&gt;$fnf9)&lt;br /&gt; ;;&lt;br /&gt;$fnf10)&lt;br /&gt; ;;&lt;br /&gt;$fnf11)&lt;br /&gt; ;;&lt;br /&gt;$fnf12)&lt;br /&gt; ;;&lt;br /&gt;#$fnhome)&lt;br /&gt;# echo 'up' &amp;gt; /proc/acpi/ibm/brightness&lt;br /&gt;# ;;&lt;br /&gt;#$fnend)&lt;br /&gt;# echo 'down' &amp;gt; /proc/acpi/ibm/brightness&lt;br /&gt;# ;;&lt;br /&gt;$wireless_switch)&lt;br /&gt; if [ -f /var/run/ipw3945d/ipw3945d.pid ]&lt;br /&gt; then&lt;br /&gt;  /etc/init.d/ipw3945d stop&lt;br /&gt; else&lt;br /&gt;  /etc/init.d/ipw3945d start&lt;br /&gt; fi&lt;br /&gt; ;;&lt;br /&gt;esac&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;x60 shelling # cat /etc/acpi/events/lm_lid &lt;br /&gt;event=button[ /]lid&lt;br /&gt;action=/etc/acpi/actions/lm_lid.sh %e&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;x60 shelling # cat /etc/acpi/actions/lm_lid.sh &lt;br /&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;test -f /usr/sbin/hibernate-ram || exit 0&lt;br /&gt;&lt;br /&gt;# lid button pressed/released event handler&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;#/usr/sbin/laptop_mode auto&lt;br /&gt;/usr/sbin/hibernate-ram&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The volume controlling keys are actually valid without any configuration,and using a tpb with xosd support,we can see it working;&lt;br /&gt;&lt;br /&gt;And the BACK and FORWARD key need xmodmap:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;x60 shelling # cat .Xmodmap &lt;br /&gt;! Page left&lt;br /&gt;keycode 234 = F19&lt;br /&gt;! Page right&lt;br /&gt;keycode 233 = F20&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now make a little mod to firefox:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#cd /usr/lib/mozilla-firefox/chrome&lt;br /&gt;#unzip browser.jar&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;and add the following two lines (the lines with "TP") to content/browser/browser.xul:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    &amp;lt;key id="goBackKb"  keycode="VK_LEFT" command="Browser:Back" modifiers="alt"/&amp;gt;&lt;br /&gt;    &amp;lt;key id="goForwardKb"  keycode="VK_RIGHT" command="Browser:Forward" modifiers="alt"/&amp;gt;&lt;br /&gt;    &amp;lt;key id="goBackTP" keycode="VK_F19" command="Browser:Back"/&amp;gt;&lt;br /&gt;    &amp;lt;key id="goForwardTP" keycode="VK_F20" command="Browser:Forward" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;restart firefox,now BACK makes firefox back and FORWARD makes firefox forward.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-9011560811965153101?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/9011560811965153101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=9011560811965153101' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/9011560811965153101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/9011560811965153101'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/03/hibernate-ramspecial-keysetcon-x60.html' title='hibernate-ram,special keys,etc,on x60'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-871042776305518443</id><published>2007-03-09T11:51:00.000+08:00</published><updated>2007-04-25T17:11:01.432+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>my new laptop:lenovo thinkpad x60</title><content type='html'>with core 2 duo T5500,512m ram,60g hd,it provides me an excellent experience.&lt;br /&gt;however,without an internal cdrom,it's difficult to install an os.I still choose gentoo,but whose livecds can not be booted from a usb drive.so at last,I use a knoppix liveusb to boot the laptop,and installed gentoo 2006.1 for x86(for knoppix is  32bit,I have no choise but install a 32bit os).&lt;br /&gt;anyhow,it's beautiful,and my ethernet card,wireless card,sound card are all driven,hdpas not configured yet.&lt;br /&gt;now I am writing this blog via wireless network,it's great.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-871042776305518443?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/871042776305518443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=871042776305518443' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/871042776305518443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/871042776305518443'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/03/my-new-laptoplenovo-thinkpad-x60.html' title='my new laptop:lenovo thinkpad x60'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4822123892487253237</id><published>2007-02-05T13:55:00.000+08:00</published><updated>2007-02-05T14:15:28.766+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xmpp'/><title type='text'>just a note,about vcard-based avatars in xmpp</title><content type='html'>It used to confuse me,but at last I understand.Well,everyone in the roster has a vcard,something recording his personal information.And to get someone's avatar,one of the methods is vcard-based.&lt;br /&gt;Maybe someone's presence stanza is like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;presence from='juliet@capulet.com/balcony'&amp;gt;&lt;br /&gt;  &amp;lt;x xmlns='vcard-temp:x:update'&amp;gt;&lt;br /&gt;    &amp;lt;photo&amp;gt;sha1-hash-of-image&amp;lt;/photo&amp;gt;&lt;br /&gt;  &amp;lt;/x&amp;gt;&lt;br /&gt;&amp;lt;/presence&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;on receiving it,we can check the sha1sums of all the cached avatars,if there is an avatar's sha1sum matches the "photo" element's content,then just use the avatar,otherwise,we need to retrieve the complete vcard infomation like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;iq from='romeo@montague.net/orchard' &lt;br /&gt;    to='juliet@capulet.com'&lt;br /&gt;    type='get' &lt;br /&gt;    id='vc2'&amp;gt;&lt;br /&gt;  &amp;lt;vCard xmlns='vcard-temp'/&amp;gt;&lt;br /&gt;&amp;lt;/iq&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then we wait for the response:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;iq from='juliet@capulet.com' &lt;br /&gt;    to='romeo@montague.net/orchard' &lt;br /&gt;    type='result'&lt;br /&gt;    id='vc2'&amp;gt;&lt;br /&gt;  &amp;lt;vCard xmlns='vcard-temp'&amp;gt;&lt;br /&gt;    &amp;lt;BDAY&amp;gt;1476-06-09&amp;lt;/BDAY&amp;gt;&lt;br /&gt;    &amp;lt;ADR&amp;gt;&lt;br /&gt;      &amp;lt;CTRY&amp;gt;Italy&amp;lt;/CTRY&amp;gt;&lt;br /&gt;      &amp;lt;LOCALITY&amp;gt;Verona&amp;lt;/LOCALITY&amp;gt;&lt;br /&gt;      &amp;lt;HOME/&amp;gt;&lt;br /&gt;    &amp;lt;/ADR&amp;gt;&lt;br /&gt;    &amp;lt;NICKNAME/&amp;gt;&lt;br /&gt;    &amp;lt;N&amp;gt;&amp;lt;GIVEN&amp;gt;Juliet&amp;lt;/GIVEN&amp;gt;&amp;lt;FAMILY&amp;gt;Capulet&amp;lt;/FAMILY&amp;gt;&amp;lt;/N&amp;gt;&lt;br /&gt;    &amp;lt;EMAIL&amp;gt;jcapulet@shakespeare.lit&amp;lt;/EMAIL&amp;gt;&lt;br /&gt;    &amp;lt;PHOTO&amp;gt;&lt;br /&gt;      &amp;lt;TYPE&amp;gt;image/jpeg&amp;lt;/TYPE&amp;gt;&lt;br /&gt;      &amp;lt;BINVAL&amp;gt;&lt;br /&gt;        Base64-encoded-avatar-file-here!&lt;br /&gt;      &amp;lt;/BINVAL&amp;gt;&lt;br /&gt;    &amp;lt;/PHOTO&amp;gt;&lt;br /&gt;  &amp;lt;/vCard&amp;gt;&lt;br /&gt;&amp;lt;/iq&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ok,decode the base64-encoded-avatar-file in the "BINVAL" and we can get the avatar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4822123892487253237?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4822123892487253237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4822123892487253237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4822123892487253237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4822123892487253237'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/02/just-noteabout-vcard-based-avatars-in.html' title='just a note,about vcard-based avatars in xmpp'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7089010517132544889</id><published>2007-02-03T14:17:00.000+08:00</published><updated>2007-02-03T14:32:53.598+08:00</updated><title type='text'>ebank of spdb</title><content type='html'>Shanghai Pudong Development Bank's new version of ebank can now be accessed under linux,using firefox,either version 1.5 or 2.0.&lt;br /&gt;It's a milestone for Chinese banks,for there was never a bank escaped from evil  MS,until spdb.&lt;br /&gt;Personally,I am excited:I can throw terrible windows over completely,I can get it out of my hard disk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7089010517132544889?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7089010517132544889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7089010517132544889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7089010517132544889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7089010517132544889'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/02/ebank-of-spdb.html' title='ebank of spdb'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1455833524265692578</id><published>2007-01-09T10:02:00.000+08:00</published><updated>2007-01-09T11:06:45.753+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perl'/><title type='text'>use XML::Simple</title><content type='html'>suppose I have a .passwds.xml file like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0"?&amp;gt;&lt;br /&gt;&amp;lt;users&amp;gt;&lt;br /&gt; &amp;lt;user&amp;gt;&lt;br /&gt;  &amp;lt;uid&amp;gt;0&amp;lt;/uid&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;root&amp;lt;/name&amp;gt;&lt;br /&gt;  &amp;lt;passwd&amp;gt;123456&amp;lt;/passwd&amp;gt;&lt;br /&gt;  &amp;lt;identity&amp;gt;root&amp;lt;/identity&amp;gt;&lt;br /&gt; &amp;lt;/user&amp;gt;&lt;br /&gt; &amp;lt;user&amp;gt;&lt;br /&gt;  &amp;lt;uid&amp;gt;1&amp;lt;/uid&amp;gt;&lt;br /&gt;  &amp;lt;name&amp;gt;test&amp;lt;/name&amp;gt;&lt;br /&gt;  &amp;lt;passwd&amp;gt;123456&amp;lt;/passwd&amp;gt;&lt;br /&gt;  &amp;lt;identity&amp;gt;root&amp;lt;/identity&amp;gt;&lt;br /&gt; &amp;lt;/user&amp;gt;&lt;br /&gt;&amp;lt;/users&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and I can use the following perl script to parse it and determin whether a user can login&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/usr/bin/perl&lt;br /&gt;use XML::Simple;&lt;br /&gt;&lt;br /&gt;$passwds = ".passwds.xml";&lt;br /&gt;&lt;br /&gt;my $xmlobj = new XML::Simple(KeyAttr=&amp;gt;[]);&lt;br /&gt;&lt;br /&gt;my $data = $xmlobj-&amp;gt;XMLin("$passwds");&lt;br /&gt;&lt;br /&gt;my $loggedin = -1;&lt;br /&gt;&lt;br /&gt;my $username = "test";&lt;br /&gt;&lt;br /&gt;my $password = "123456";&lt;br /&gt;&lt;br /&gt;foreach  (@{$data-&amp;gt;{"user"}}){&lt;br /&gt; if (($_-&amp;gt;{"name"} ne $username)){&lt;br /&gt;  next;&lt;br /&gt; }&lt;br /&gt; $loggedin = 0;&lt;br /&gt; if ($_-&amp;gt;{"passwd"} eq $password){&lt;br /&gt;  $loggedin = 1;&lt;br /&gt; }&lt;br /&gt; last;&lt;br /&gt;}&lt;br /&gt;if ($loggedin == -1){&lt;br /&gt; print "username incorrect\n";&lt;br /&gt; die;&lt;br /&gt;}&lt;br /&gt;if ($loggedin == 0){&lt;br /&gt; print "password incorrect";&lt;br /&gt; die;&lt;br /&gt;}&lt;br /&gt;print "successfully login\n";&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1455833524265692578?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1455833524265692578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1455833524265692578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1455833524265692578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1455833524265692578'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/01/use-xmlsimple.html' title='use XML::Simple'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1711692979909427198</id><published>2007-01-04T22:40:00.000+08:00</published><updated>2007-02-05T16:32:05.709+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>strlen&amp;sizeof</title><content type='html'>strlen is a function calculating the length of a string,i.e.,'\0' excluded,&lt;br /&gt;while sizeof is an operator calculating a variable's size when compiling,i.e.,if affect on a string,'\0' will be included.&lt;br /&gt;just as is shown in this little programme:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;#include &amp;lt;string.h&amp;gt;&lt;br /&gt;&lt;br /&gt;#define s "hello"&lt;br /&gt;int main ()&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  printf ("strlen:%d\n",strlen (s));&lt;br /&gt;  printf ("sizeof:%d\n",sizeof (s));&lt;br /&gt;  return 0;/*thank u,anonymous,haha*/&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;after executed,it outputs:&lt;br /&gt;strlen:5&lt;br /&gt;sizeof:6&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1711692979909427198?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1711692979909427198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1711692979909427198' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1711692979909427198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1711692979909427198'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2007/01/strlen.html' title='strlen&amp;sizeof'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6116589933166745505</id><published>2006-12-08T13:28:00.001+08:00</published><updated>2007-01-05T23:11:29.094+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>a lot of strcmps...</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;A lot of strcmps,like:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (!strcmp (cs,ct)){&lt;br /&gt;  ...&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;else if (!strcmp (cs,ct)){&lt;br /&gt;  ...&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;else{&lt;br /&gt;  ...&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;it's too expensive,I think hash will performance better.&lt;br /&gt;&lt;br /&gt;Let me try it out...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="poweredbyperformancing"&gt;powered by &lt;a href="http://performancing.com/firefox"&gt;performancing firefox&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6116589933166745505?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6116589933166745505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6116589933166745505' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6116589933166745505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6116589933166745505'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/12/lot-of-strcmps.html' title='a lot of strcmps...'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-9222936390748895754</id><published>2006-12-01T19:30:00.000+08:00</published><updated>2006-12-08T13:31:39.853+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sawfish'/><title type='text'>a sawfish extension:care-eyes</title><content type='html'>May be there are many people working just like me,staring at the monitor for a long time.However you are busy,must you take a rest every one or two hours,otherwise,your body will be wore out.&lt;br /&gt;Until now,I have several  problems which make me not so good.I can't see clearly those far from me.And after sitting for a while,my neck aches.But often I forgot my discomfort when I am coding or seeing a film or playing a game.So I write this extension to remind me to take a rest.&lt;br /&gt;You can download it &lt;a href="http://fvwmer.googlepages.com/care-eyes.jl"&gt;here&lt;/a&gt;.&lt;br /&gt;Put it to your sawfish's extension directory,and add the following lisp expressions to  your sawfish configure file:&lt;br /&gt;(require 'care-eyes)&lt;br /&gt;(eye-care-init 7200 300 nil nil)&lt;br /&gt;here,7200 is the seconds you may work for a longgest time without a rest,i.e. 2 hours,and then you will rest for 5 minutes.&lt;br /&gt;Generally you can ignore the last two arguments,the extension will call xscreensaver to activate the screensaver.Before that,it display a message like this by default:&lt;br /&gt;have a rest,care your eyes:)&lt;br /&gt;You will be able to customize it by set the "resting-message" variable.&lt;br /&gt;That's all,any suggestion or problem,mail to fvwmer[AT]gmail[DOT]com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-9222936390748895754?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/9222936390748895754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=9222936390748895754' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/9222936390748895754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/9222936390748895754'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/12/sawfish-extension.html' title='a sawfish extension:care-eyes'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7439062798690457331</id><published>2006-11-29T11:00:00.000+08:00</published><updated>2006-11-29T11:38:24.468+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>a problem of CLRS</title><content type='html'>Water jugs&lt;br /&gt;Suppose that you are given &lt;span style="font-style: italic;"&gt;n&lt;/span&gt;  red and  &lt;span style="font-style: italic;"&gt;n&lt;/span&gt; blue water jugs,all of different shapes and sizes.All red jugs hold different amounts of water,as do the blue ones.Moreover,for every red jug,there is  a blue jug that holds the same amount of water,and vice versa.&lt;br /&gt; It is your task to find a grouping of the jugs into pairs of red and blue jugs that hold the same amount of water.To do so,you may perform the following operation:pick a pair of jugs in which one is red and one is blue,fill the red jug with water,and then pour the water int to the blue jug.This operation will tell you whether the red or the blue jug can hold more water,or if they are of the same volume.Assume that such a comparison takes one time unit.Your goal is to find an algorithm that makes a minimum number of comparisons do determine the grouping.Remember that you may not directly compare two red jugs or two blue jugs.&lt;br /&gt;&lt;br /&gt;my solution(Ω (nlgn)):&lt;span lang="EN-US"&gt;&lt;span style="font-size:100%;"&gt;for a particular first red jug,each of &lt;span style="font-style: italic;"&gt;n&lt;/span&gt; blue jugs may has the same amount ,compare this red one with each blue one,and put all the blue ones those hold less amount of water to a set,say,S1,all the blue ones those hold more amount of water to another set,say S2,and make the blue one holds the same amount of water grouped with the red one,then choose a second red jug,compare it with the blue one which holds the same amount of water with the first red jug,if it holds more,then do the same thing with on the first red jug int S2,otherwise in S1,and so on...until all the jugs are grouped&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7439062798690457331?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7439062798690457331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7439062798690457331' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7439062798690457331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7439062798690457331'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/problem-of-clrs.html' title='a problem of CLRS'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6284244255822566273</id><published>2006-11-26T11:25:00.000+08:00</published><updated>2006-11-26T11:40:21.253+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><title type='text'>slime's cool feature</title><content type='html'>in REPL,when I input "(" and a function name,and then,a space,something happens!slime will prompt the expected arguments in emacs's minibuffer,it's cool!and of course very useful.but,I found that when editing a common lisp source code file,slime does nothing when I do exactly as in REPL,it's strange.so I compared the two modes,at last it turned out that the slime function "slime-indent-and-complete-symbol" does the work I want.so I redefined the "TAB" key-binding like this:&lt;br /&gt;(define-key slime-mode-map (kbd "TAB") 'slime-indent-and-complete-symbol)&lt;br /&gt;everything is perfect now,oh,maybe.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/x/blogger2/5627/85845206542985/1600/680029/2006-11-26_1280x1024_scrot.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/x/blogger2/5627/85845206542985/320/920303/2006-11-26_1280x1024_scrot.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6284244255822566273?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6284244255822566273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6284244255822566273' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6284244255822566273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6284244255822566273'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/slimes-cool-feature.html' title='slime&apos;s cool feature'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-2357810316852823776</id><published>2006-11-22T10:23:00.000+08:00</published><updated>2006-11-22T17:04:58.966+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>Practical Common Lisp</title><content type='html'>有书不看那是罪恶，不过对着显示器看书确实挺累的，所以把这本书打印出来了，继续好好学习&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-2357810316852823776?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/2357810316852823776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=2357810316852823776' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2357810316852823776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2357810316852823776'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/practical-common-lisp.html' title='Practical Common Lisp'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3688865853481594106</id><published>2006-11-15T15:26:00.000+08:00</published><updated>2006-11-15T15:45:06.004+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>apache2</title><content type='html'>信息系统的课设打算做成c/s的，于是先在自己机器上配了一下apache2，以前没配过，没经验，遇到以下问题：&lt;br /&gt;mod_perl起不来，报错如下：&lt;br /&gt;* Apache2 has detected a syntax error in your configuration files:&lt;br /&gt;Syntax error on line 3 of /etc/apache2/modules.d/75_mod_perl.conf:&lt;br /&gt;Cannot load /usr/lib64/apache2/modules/mod_perl.so into server: /usr/lib64/apache2/modules/mod_perl.so: undefined symbol: Perl_Ipatchlevel_ptr&lt;br /&gt;google出来有三种说法，第一种说httpd.conf里有mod_perl的相关语句，应该去掉&lt;br /&gt;第二种说系统里有不止一个版本的perl，并且/usr/lib下有libperl.so&lt;br /&gt;前两种是扯淡，而且占据了90%的搜索结果，可见大家抄来抄去的风气达到了什么程度&lt;br /&gt;我的httpd.conf里没有跟mod_perl有关的任何东西，我的系统也只装了一个版本的perl，5.8.8的&lt;br /&gt;第三种说法是libperl需要加上ithreads的支持，这是正解&lt;br /&gt;事实上我的libperl应该是有ithreads的，但是由于一开始我猜测可能就是ithreads的问题，所以把它去掉后重新emerge了&lt;br /&gt;后来把ithreads加上，并且把perl和libperl都重新emerge了，apache终于顺利启动了。&lt;br /&gt;然后试了两个默认的cgi脚本，都执行失败了，其实应该把/cgi-bin目录的权限设置好，默认是644，没有可执行的权限，755就好了，再低的还没试。&lt;br /&gt;还有一个很恐怖的问题：nm说libc.so.6和libperl.so.1都是no symbols，太恐怖了！&lt;br /&gt;但是readelf -sd是可以显示的，什么问题？who knows?tell me please.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3688865853481594106?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3688865853481594106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3688865853481594106' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3688865853481594106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3688865853481594106'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/apache2.html' title='apache2'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6183583538994522246</id><published>2006-11-13T19:57:00.000+08:00</published><updated>2006-11-15T10:09:37.949+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tex'/><title type='text'>latex with graphics</title><content type='html'>据说latex对eps格式的图片支持最好，又据说pdflatex不支持eps，嗯，我就说eps的，因为今天就用了这个。&lt;br /&gt;先准备eps的图片，我今天是截了一些终端的窗口，试了一下，发现import可以直接输出eps，先运行import，比如import test.eps，然后鼠标会变成一个十字，点击一下需要截的窗口，当前目录下就会出现一个test.eps，可以用gs看，把它用在latex里的方法如下：&lt;br /&gt;在导言区加上\usepackage{graphicx}&lt;br /&gt;在需要插入图片的地方写上\includegraphics{test.eps}，编译就可以看到效果。&lt;br /&gt;特殊处理：&lt;br /&gt;如果需要对图片进行缩放，可以这样写：&lt;br /&gt;\scalebox{.5}{\includegraphics{test.eps}}，可以按比例缩到原来的0.5&lt;br /&gt;如果有多幅图片，可能会出现图片出现在同一行上导致后面的无法显示的问题，可以在刚才这一句前后一行都加上$&lt;br /&gt;如果图片插入后出现大块的空白，可以这样写：&lt;br /&gt;\begin{figure}&lt;br /&gt;\scalebox{.5}{\includegraphics{test.eps}}&lt;br /&gt;\caption{test}&lt;br /&gt;\end{figure}&lt;br /&gt;这是告诉tex把图片放在最合适的地方，使得页面上不要出现大块的空白，\caption{test}可以用来在其他地方引用这幅图片。&lt;br /&gt;就这些了。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6183583538994522246?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6183583538994522246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6183583538994522246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6183583538994522246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6183583538994522246'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/latex-with-graphics.html' title='latex with graphics'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4928275197877264132</id><published>2006-11-13T08:24:00.000+08:00</published><updated>2006-11-13T08:25:08.126+08:00</updated><title type='text'>test</title><content type='html'>test&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4928275197877264132?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4928275197877264132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4928275197877264132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4928275197877264132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4928275197877264132'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/test.html' title='test'/><author><name>fanmmm</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3335036822418557319</id><published>2006-11-12T10:39:00.000+08:00</published><updated>2007-05-18T15:16:04.664+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tex'/><title type='text'>tetex in utf8搞定</title><content type='html'>大部分内容都是参照&lt;a href="http://blog.t-times.net/ada/space/start/2006-11-02/1"&gt;这里&lt;/a&gt;&lt;br /&gt;app-text/tetex-3.0_p1-r3&lt;br /&gt;dev-tex/cjk-latex-4.5.2&lt;br /&gt;media-libs/freetype-1.3.1-r5&lt;br /&gt;然后保存以下内容成为一个脚本mktfm.sh，或者从&lt;a href="http://fvwmer.googlepages.com/mktfm.sh"&gt;这里&lt;/a&gt;下载：&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/sh&lt;br /&gt;#&lt;br /&gt;# Edward G.J. Lee &amp;lt;edt1023@info.sayya.org&amp;gt; 2005.01.13&lt;br /&gt;# You need freetype1/contrib current version.&lt;br /&gt;# This script is Public Domain&lt;br /&gt;# $Id: mktfm.sh,v 1.4 2005/03/19 06:01:51 edt1023 Exp $&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;if [ $# -ne 3 ]&lt;br /&gt;then&lt;br /&gt; echo&lt;br /&gt; echo "Usage: `basename $0` your.ttf cjk_name font_encoding"&lt;br /&gt; echo "For example:"&lt;br /&gt; echo "`basename $0` cwming.ttf cwming Big5"&lt;br /&gt; echo "`basename $0` cwming.ttf cwmu Unicode"&lt;br /&gt; echo&lt;br /&gt; exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;DATE=`date`&lt;br /&gt;TTFONT=$1&lt;br /&gt;BTTFONT=`basename $1`&lt;br /&gt;eval `echo $TTFONT | awk -F. '{printf "FHEAD=%s;FTAIL=%s",\$1,\$2}'`&lt;br /&gt;CJKNAME=$2&lt;br /&gt;TTMAP=$3&lt;br /&gt;#TOTFM=/usr/local/FT1/bin/ttf2tfm&lt;br /&gt;`which ttf2tfm &amp;gt; /dev/null 2&amp;gt;&amp;1`;ISTFM=$?&lt;br /&gt;if [ $ISTFM -eq 0 ]&lt;br /&gt;then&lt;br /&gt; if [ `ttf2tfm --version|awk '/version/ {print $3*10}'` -lt 15 ]&lt;br /&gt; then&lt;br /&gt;   echo&lt;br /&gt;   echo "This script need ttf2tfm version 1.5 or later."&lt;br /&gt;   echo "Please install FreeType1/contrib current version."&lt;br /&gt;   echo&lt;br /&gt;   exit&lt;br /&gt; else&lt;br /&gt;   TOTFM=ttf2tfm&lt;br /&gt; fi&lt;br /&gt;else&lt;br /&gt; echo&lt;br /&gt; echo "This script need ttf2tfm!"&lt;br /&gt; echo&lt;br /&gt; exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;case $TTMAP in&lt;br /&gt; Big5)&lt;br /&gt; PSENC=ETen-B5&lt;br /&gt; CJKENC=00&lt;br /&gt; NUMLIST=`awk 'BEGIN{n=1; while(n&amp;lt;56){printf "%02d\n",n; n++}}'`&lt;br /&gt; ;;&lt;br /&gt; Unicode)&lt;br /&gt; PSENC=Identity&lt;br /&gt; CJKENC=70&lt;br /&gt; NUMLIST=`awk 'BEGIN{n=0; while(n&amp;lt;256){printf "%02x\n",n; n++}}'`&lt;br /&gt; ;;&lt;br /&gt; UGB)&lt;br /&gt; PSENC=UniGB-UCS2&lt;br /&gt; CJKENC=10&lt;br /&gt; NUMLIST=`awk 'BEGIN{n=1; while(n&amp;lt;36){printf "%02d\n",n; n++}}'`&lt;br /&gt; ;;&lt;br /&gt; UJIS)&lt;br /&gt; PSENC=UniJIS-UCS2&lt;br /&gt; CJKENC=40&lt;br /&gt; NUMLIST=`awk 'BEGIN{n=1; while(n&amp;lt;36){printf "%02d\n",n; n++}}'`&lt;br /&gt; ;;&lt;br /&gt; UKS)&lt;br /&gt; PSENC=UniKS-UCS2&lt;br /&gt; CJKENC=60&lt;br /&gt; NUMLIST=`awk 'BEGIN{n=1; while(n&amp;lt;36){printf "%02d\n",n; n++}}'`&lt;br /&gt; ;;&lt;br /&gt; *)&lt;br /&gt; echo&lt;br /&gt; echo "Not support yet!"&lt;br /&gt; echo&lt;br /&gt; ;;&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;create_cidmap()&lt;br /&gt;{&lt;br /&gt;cat &amp;gt;&amp;gt; cid-x.map.append &amp;lt;&amp;lt; EoF&lt;br /&gt;% created by Edward G.J. Lee &amp;lt;edt1023@info.sayya.org&amp;gt;&lt;br /&gt;% $DATE&lt;br /&gt;% Please append to cid-x.map.&lt;br /&gt;%&lt;br /&gt;$CJKNAME@$TTMAP@ ${PSENC}-H :0:$BTTFONT&lt;br /&gt;${CJKNAME}s@$TTMAP@ ${PSENC}-H :0:$BTTFONT -s .167&lt;br /&gt;$CJKNAME@$TTMAP@ ${PSENC}-H :0:$BTTFONT,Bold&lt;br /&gt;${CJKNAME}s@$TTMAP@ ${PSENC}-H :0:$BTTFONT,Bold -s .167&lt;br /&gt;EoF&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;create_newmap()&lt;br /&gt;{&lt;br /&gt;cat &amp;gt;&amp;gt; cid-x.map.append &amp;lt;&amp;lt; EoF&lt;br /&gt;% created by Edward G.J. Lee &amp;lt;edt1023@info.sayya.org&amp;gt;&lt;br /&gt;% $DATE&lt;br /&gt;% Please append to cid-x.map.&lt;br /&gt;%&lt;br /&gt;$CJKNAME@$TTMAP@ ${PSENC}-H $BTTFONT&lt;br /&gt;${CJKNAME}s@$TTMAP@ ${PSENC}-H $BTTFONT -s .167&lt;br /&gt;EoF&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;create_cjkfd()&lt;br /&gt;{&lt;br /&gt;cat &amp;gt; c${CJKENC}${CJKNAME}.fd &amp;lt;&amp;lt; EoF&lt;br /&gt;% This is c${CJKENC}${CJKNAME}.fd for CJK package.&lt;br /&gt;% created by Edward G.J. Lee &amp;lt;edt1023@info.sayya.org&amp;gt;&lt;br /&gt;% $DATE&lt;br /&gt;%&lt;br /&gt;\ProvidesFile{c${CJKENC}${CJKNAME}.fd}[\filedate\space\fileversion]&lt;br /&gt;\DeclareFontFamily{C${CJKENC}}{$CJKNAME}{\hyphenchar \font\m@ne}&lt;br /&gt;\DeclareFontShape{C${CJKENC}}{$CJKNAME}{m}{n}{&amp;lt;-&amp;gt; CJK * $CJKNAME}{}&lt;br /&gt;\DeclareFontShape{C${CJKENC}}{$CJKNAME}{m}{sl}{&amp;lt;-&amp;gt; CJK * ${CJKNAME}s}{}&lt;br /&gt;\DeclareFontShape{C${CJKENC}}{$CJKNAME}{m}{it}{&amp;lt;-&amp;gt; CJKssub * $CJKNAME/m/sl}{}&lt;br /&gt;\DeclareFontShape{C${CJKENC}}{$CJKNAME}{bx}{n}{&amp;lt;-&amp;gt; CJKb * $CJKNAME}{\CJKbold}&lt;br /&gt;\DeclareFontShape{C${CJKENC}}{$CJKNAME}{bx}{sl}{&amp;lt;-&amp;gt; CJKb * ${CJKNAME}s}{\CJKbold}&lt;br /&gt;\DeclareFontShape{C${CJKENC}}{$CJKNAME}{bx}{it}{&amp;lt;-&amp;gt; CJKssub * $CJKNAME/bx/sl}{\CJKbold}&lt;br /&gt;\endinput&lt;br /&gt;EoF&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;create_pdftexmap()&lt;br /&gt;{&lt;br /&gt; # determinate NUMLIST here.&lt;br /&gt; ENCMAP=${CJKNAME}-enc.map&lt;br /&gt; cat &amp;gt; $ENCMAP &amp;lt;&amp;lt; EoF&lt;br /&gt;% This is map file for PDFLaTeX and LaTeX CJK package to embed TTF.&lt;br /&gt;% Created by Edward G.J. Lee &amp;lt;edt1023@info.sayya.org&amp;gt;&lt;br /&gt;% $DATE&lt;br /&gt;EoF&lt;br /&gt; for i in $NUMLIST&lt;br /&gt; do&lt;br /&gt;   cat &amp;gt;&amp;gt; $ENCMAP &amp;lt;&amp;lt; EoF&lt;br /&gt;${FHEAD}$i &amp;lt;${FHEAD}$i.enc &amp;lt;${BTTFONT}&lt;br /&gt;EoF&lt;br /&gt; done&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;# for normal font&lt;br /&gt;echo&lt;br /&gt;echo "Please wait..."&lt;br /&gt;echo "Create tfm/fd files for LaTeX-CJK."&lt;br /&gt;echo "And cid-x.map for dvipdfmx."&lt;br /&gt;echo&lt;br /&gt;$TOTFM $TTFONT -q -w ${CJKNAME}@${TTMAP}@ &amp;gt;&amp;gt; ttfonts.map #/dev/null 2&amp;gt;&amp;1&lt;br /&gt;# for other TTF to fit cwttf.&lt;br /&gt;#$TOTFM $TTFONT -e 0.92 -w ${CJKNAME}@${TTMAP}@ &amp;gt; /dev/null 2&amp;gt;&amp;1&lt;br /&gt;# for slant font&lt;br /&gt;$TOTFM $TTFONT -q -s 0.167 -w ${CJKNAME}s@${TTMAP}@ &amp;gt;&amp;gt;ttfonts.map # /dev/null 2&amp;gt;&amp;1&lt;br /&gt;#$TOTFM $TTFONT -e 0.92 -s 0.167 -w ${CJKNAME}s@${TTMAP}@ &amp;gt; /dev/null 2&amp;gt;&amp;1&lt;br /&gt;&lt;br /&gt;create_cjkfd&lt;br /&gt;&lt;br /&gt;`which dvipdfmx &amp;gt; /dev/null 2&amp;gt;&amp;1`;ISPDFMX=$?&lt;br /&gt;if [ $ISPDFMX -eq 0 ]&lt;br /&gt;then&lt;br /&gt; DVERSION=`dvipdfmx --version 2&amp;gt;&amp;amp;1 |awk '/dvipdfmx-/ {print substr($3,10)}'`&lt;br /&gt; if [ $DVERSION -le 20031116 ]&lt;br /&gt; then&lt;br /&gt;   create_cidmap&lt;br /&gt; else&lt;br /&gt;   create_newmap&lt;br /&gt; fi&lt;br /&gt;else&lt;br /&gt; echo&lt;br /&gt; echo "You didn't install dvipdfmx, script abort!"&lt;br /&gt; echo&lt;br /&gt; exit&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;脚本不是我写的，我只是修改一下让它能生成ttfonts.map文件，如此，准备工作完成&lt;br /&gt;如果脚本抱怨ttf2tfm版本太低的话就下载这个&lt;a href="http://fvwmer.googlepages.com/ttf2tfm"&gt;ttf2tfm&lt;/a&gt;放到/usr/bin下&lt;br /&gt;先在$TEXMFLOCAL/fonts下建立truetype目录，把需要用到的字体复制过来或者符号链接过来，并且把mktfm.sh也放在这个目录下面，再下载&lt;a href="http://fvwmer.googlepages.com/Unicode.sfd"&gt;Unicode.sfd&lt;/a&gt;，同样放在这个目录，然后用脚本生成一大堆文件，比如我在用uming和ukai，我就执行./mktfm.sh ukai.ttf ukai Unicode和./mktfm.sh uming.ttf uming Unicode，然后建立放tfm文件的目录：&lt;br /&gt;mkdir -p $TEXMFLOCAL/fonts/tfm/CJK/ukai&lt;br /&gt;mkdir $TEXMFLOCAL/fonts/tfm/CJK/uming&lt;br /&gt;然后把当前目录下所有ukai的tfm文件移到对应的目录下，uming也一样：&lt;br /&gt;mv ukai*.tfm $TEXMFLOCAL/fonts/tfm/CJK/ukai/&lt;br /&gt;mv uming*.tfm $TEXMFLOCAL/fonts/tfm/CJK/uming/&lt;br /&gt;再建立放enc文件的目录：&lt;br /&gt;mkdir -p $TEXMFLOCAL/fonts/enc/CJK/ukai&lt;br /&gt;mkdir $TEXMFLOCAL/fonts/enc/CJK/uming&lt;br /&gt;把当前目录下所有ukai的enc文件移动对应目录下，uming也一样：&lt;br /&gt;mv ukai*.enc $TEXMFLOCAL/fonts/enc/CJK/ukai/&lt;br /&gt;mv uming*.enc $TEXMFLOCAL/fonts/enc/CJK/uming/&lt;br /&gt;把*.fd文件放到它们应该在的地方：&lt;br /&gt;mkdir -p $TEXMFLOCAL/tex/latex/cjk-latex/UTF8&lt;br /&gt;mv *.fd $TEXMFLOCAL/tex/latex/cjk-latex/UTF8/&lt;br /&gt;让生成的cid-x.map.append也完成它的使命：&lt;br /&gt;mkdir -p $TEXMFLOCAL/fonts/map/dvipdfm&lt;br /&gt;cat cid-x.map.append &gt;&gt; $TEXMFLOCAL/fonts/map/dvipdfm/cid-x.map&lt;br /&gt;把Unicode.sfd放到$TEXMFLOCAL/fonts/sfd下&lt;br /&gt;把生成的ttfonts.map放到/usr/local/share/texmf/ttf2pk/&lt;br /&gt;最后执行texhash，&lt;br /&gt;以及updmap --enable Map ttfonts.map&lt;br /&gt;&lt;br /&gt;这样utf8的latex就建立好了，随便建一个中文的tex文件试试就知道了&lt;br /&gt;我刚开始没有emerge freetype，中文的tex文件可以编译，但是生成的dvi文件无法预览，要是用dvipdfmx生成pdf的话是正常的，问题是出现在mktexpk无法从ttf生成pk字体，而原因是我的ttf2pk是直接下载的二进制文件，它竟然无法找到ttf2pk.cfg或者ttfonts.map，我试图下载ttf2pk的源代码修改之，却发现原来ttf2pk是包含在freetype里的，然后emerge之，再用xdvi看dvi文件，一切正常，大功告成！&lt;br /&gt;&lt;br /&gt;第一次完全搞定中文latex，顺便庆祝我的第一篇用latex完成的论文。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3335036822418557319?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3335036822418557319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3335036822418557319' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3335036822418557319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3335036822418557319'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/tetex-in-utf8.html' title='tetex in utf8搞定'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-322458007429877883</id><published>2006-11-07T19:41:00.000+08:00</published><updated>2006-11-07T19:55:28.941+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>vmplayer安装vmware tools</title><content type='html'>我的情况：&lt;br /&gt;hostos:Linux 2.6.18-gentoo smp x86_64&lt;br /&gt;guestos:Window$ XP&lt;br /&gt;先找个qemu来，用qemu-img create -f vmdk filename.vmdk [size]建立一个给vmplayer用的硬盘，size可以用M为单位，也可以用G为单位，然后去&lt;a href="http://www.easyvmx.com/expertform.shtml"&gt;这个地方&lt;/a&gt;生成一个.vmx文件，好了以后用vmplayer打开它，开机后进入bios设置为从光驱启动，记得抬头看看CD-ROM是不是红叉，是的话把光驱启用了先，然后跟平常一样装xp。就绪后下载一个for linux的vmware-workstation来，把里面的vmware-distrib/lib/isoimages/的windows.iso解出来，再把windows.iso解压，运行里面的setup就可以安装vmware tools了，重启后guestos就能正常识别显卡。&lt;br /&gt;关于vmware shared folders，网上有人说支持也有人说不支持，我反正还没发现怎么让vmplayer可以支持，不过我倾向于vmplayer可以支持，可能需要一些特殊处理。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-322458007429877883?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/322458007429877883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=322458007429877883' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/322458007429877883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/322458007429877883'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/vmplayervmware-tools.html' title='vmplayer安装vmware tools'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1279466242290768774</id><published>2006-11-07T14:09:00.000+08:00</published><updated>2006-11-07T14:30:37.473+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>vmplayer的bug？</title><content type='html'>需要一个window$，于是用vmplayer，但是跟上次一样的问题又来了，上次在vmplayer上装gentoo的时候也是无论怎么弄都没办法从iso启动，.vmx改了无数遍还是一样，一启动就dhcp了。突然注意到vmplayer打开以后上面的CD-ROM按钮是一个红叉，点一下以后就突然可以了，而且这是在.vmx里的ide1:0.startConnected = "TRUE"的情况下。不知道这算不算一个bug。还发现了一个sawfish的问题，vmplayer grab当前的输入期间新启动的程序sawfish似乎不能很好地处理，比如我先用win-o启动一个ooo，然后马上在vmplayer里操作，因为ooo启动比较慢，所以等ooo窗口出现的时候vmplayer已经grab输入了，这个时候如果再把ooo聚焦，sawfish的一切快捷键都会失效。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1279466242290768774?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1279466242290768774/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1279466242290768774' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1279466242290768774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1279466242290768774'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/vmplayerbug.html' title='vmplayer的bug？'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-713134748540068479</id><published>2006-11-05T01:28:00.000+08:00</published><updated>2006-11-22T17:07:31.218+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>An Introduction To Functional Programming Through Lambda Calculus</title><content type='html'>一共十章内容，第9章没看，因为第9章是ML，而第10章才是我感兴趣的common lisp。&lt;br /&gt;这是我第一次接触λ calculus，我只能说，这本书写得非常好。作者展示了怎么样利用一个λ白手起家，先建立逻辑模型，再建立自然数模型，再利用这些东西，建立起其他的作为一门语言所需要的东西，类型，表，字符，字符串，复杂的数据结构等等，让我大开眼界。最精彩的我觉得是自然数的建立，因为之前几乎是空白，只有几个很基本的函数，identity，self_apply，select_first，select_second，由此构造出的and，or，not，true，false，然后，奇迹般地，就突然有了自然数，而且，每个自然数还竟然是一个函数。这是一个函数的世界，后来定义的加减乘除只是作用在函数上的函数，而乘方等运算又可以通过包装这些函数得到。这听起来很疯狂，但是仔细想想看，有什么不可以的呢？如果给我一个金属盒子，告诉我，插上电源，它可以运行一个叫linux的系统，那难道它不就是一台电脑吗？即使事实是盒子里躲了一只黑猩猩在狂按0和1以输出我所需要的东西，那又有什么重要的呢？只要对我来说它完成的是电脑的功能就可以了。再回到自然数，也一样，我何必在乎它是一个数字还是一个函数呢？只要我把1和2相加得到的是3,那就能满足我的需要了。&lt;br /&gt;然后是lazy evaluation，这是我很早就听说过lisp采用的一种技术，书里讲得不多，只有一节，举了几个例子，所以理解并不是很深刻，我猜想，只有有了lazy evaluation，lisp才能成为可能，因为无论是normal order evaluation还是applicative order evaluation，都有其致命弱点，前者的重复计算太多，如果直接应用，估计速度会比蜗牛还慢，后者则很有可能导致计算无法终止，那对于实际应用来说会更致命，但是lazy evaluation很好的结合了两者的长处，只在需要时才计算一个λ expression，并且计算以后会代换每一个该表达式的occurence，所以也被称为call by need。&lt;br /&gt;我只能用神奇来形容λ calculus。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-713134748540068479?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/713134748540068479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=713134748540068479' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/713134748540068479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/713134748540068479'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/introduction-to-functional-programming.html' title='An Introduction To Functional Programming Through Lambda Calculus'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1012770116097917493</id><published>2006-11-04T18:52:00.000+08:00</published><updated>2006-11-04T19:02:49.480+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>加了块硬盘</title><content type='html'>st 7200.7 sata 120G&lt;br /&gt;插上，重新编译内核，加上sata支持，重启，开始一切正常，但是系统服务启动完了以后就kernel panic，怀疑是硬件问题，然后把硬盘拔了，还是一样，再用旧内核启动，还是一样！这下崩溃了，以为是硬件出问题了，然后在启动服务的时候按I，跳过服 务的启动，直接开一个shell，发现是没有任何问题的，所以就怀疑是某个服务出了问题，然后又重启，只加载几个自己认为必要的服务，也没有问题，后来把 vmware一开，又是死机，就最终锁定目标了，把vmware去掉，再正常启动，就没有kernel panic了，但是关机或者重启的时候只说：INIT:no more processes left in this runlevel，然后就没反应了，只能手动关掉电源，最后是reemerge了sys-apps/sysvinit以后才解决的。&lt;br /&gt;哪儿来的问题？似乎都是跟硬盘没关系的，却偏偏在我插上硬盘后一起冒出来。vmware到现在还没搞定，还是一开就死，只能暂时不用了。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1012770116097917493?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1012770116097917493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1012770116097917493' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1012770116097917493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1012770116097917493'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/11/blog-post.html' title='加了块硬盘'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3212062581779542157</id><published>2006-10-25T10:51:00.000+08:00</published><updated>2006-10-25T10:54:58.606+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><title type='text'>程序员里的jedi</title><content type='html'>may the force be with you!&lt;br /&gt;这是jedi之间相互祝福的话，其实程序员里也有jedi，下面是slime启动后的截图：&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/5627/85845206542985/1600/2006-10-25_1280x1024_scrot.0.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger2/5627/85845206542985/320/2006-10-25_1280x1024_scrot.0.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3212062581779542157?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3212062581779542157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3212062581779542157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3212062581779542157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3212062581779542157'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/10/jedi.html' title='程序员里的jedi'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1785844448828375243</id><published>2006-10-22T20:43:00.000+08:00</published><updated>2006-11-22T17:07:01.146+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><category scheme='http://www.blogger.com/atom/ns#' term='book'/><title type='text'>一本书：An Introduction To Functional Programming Through Lambda Calculus</title><content type='html'>终于找到一本讲lambda演算的书了，作者是Greg Michaelson，我把它打印了出来，然后装订了一下，一下子就很像本书了：）看来学校里那些打印店的人手艺还不错的，以后有书买不到就可以打了。&lt;br /&gt;这本书ms写于1988年，好老啊，不过lisp也很老了么，这才说明价值，这下可以好好学习lambda演算了，然后是common lisp，加油。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1785844448828375243?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1785844448828375243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1785844448828375243' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1785844448828375243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1785844448828375243'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/10/introduction-to-functional-programming.html' title='一本书：An Introduction To Functional Programming Through Lambda Calculus'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-665543620881830360</id><published>2006-10-20T20:44:00.000+08:00</published><updated>2006-10-20T21:30:58.069+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>nvidia驱动的一个“诡异”问题</title><content type='html'>最近很忙，没空玩无冬，没空玩暗黑，今天周末，想着，玩一会儿吧，却发现cedega找不到显卡的信息，nwn也启动不了了，从终端启动，发现是找不到libGL.so.1，locate了一下，发现好端端地在/usr/lib64/opengl/nvidia/lib下躺着呢，而且glxgears glxinfo都是正常的，尝试revdep-rebuild，故障依旧，回想了一下，最近几天好像没做什么破坏性的举动啊，再google，才知道是multilib的问题！一直以来，玩游戏了，就从菜单启动一下，却没有想过我装的游戏是32bit的！这下问题明朗了，再locate libGL.so.1，发现/usr/lib32下果然是没有这个文件的。但是是什么原因导致共享库丢失的呢？然后想起来前两天切换到2.6.18的内核了，隐约记得当时重新emerge nvidia-drivers的时候是有个警告的，于是再次emerge了一下nvidia-drivers，问题消失了。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-665543620881830360?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/665543620881830360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=665543620881830360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/665543620881830360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/665543620881830360'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/10/nvidia.html' title='nvidia驱动的一个“诡异”问题'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6986597808718314666</id><published>2006-10-19T15:19:00.000+08:00</published><updated>2006-10-19T15:27:11.042+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='algorithm'/><title type='text'>插入排序&amp;折半查找</title><content type='html'>插入排序的时间复杂度不必多说，O(n^2)，但是如果把寻找插入位置的操作用折半查找来代替，那会不会优化到O(nlgn)？&lt;br /&gt;不会，因为寻找到插入位置后还是要做插入操作，而元素的移动总数还是一样的，所以在理论上性能虽然会有所改进，但是改变不了插入排序的先天不足。&lt;br /&gt;但是归并排序在把序列划分到足够小之后用插入排序来完成底层的排序工作还是挺有吸引力的，O(nlg(n/k))，如果是对k个元素的子序列插入排序的话。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6986597808718314666?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6986597808718314666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6986597808718314666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6986597808718314666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6986597808718314666'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/10/blog-post_19.html' title='插入排序&amp;折半查找'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8518401150041619787</id><published>2006-10-13T16:57:00.000+08:00</published><updated>2006-10-13T17:07:41.533+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>emacs占用cpu的问题终于解决了</title><content type='html'>这次的系统的make.conf被我改了一下，编译出来的emacs特别怪，scroll bar特别宽，开始以为是color-theme的原因，后来看configure的结果，发现是toolkit-scroll-bar没有enable，再用新学到的一招：equery u emacs-cvs，发现就是这个参数没有加上，改了一下make.conf再重新emerge就正常了，然后是大问题：只要cedet和ecb加载了，打开一个文件后idle几秒钟emacs就会占100%的CPU，虽然是双核，也不能这么折腾呀。google中文结果找不到，后来试着搜了一下emacs cpu load，还真找到一个邮件组，里面有个达人声称是cedet的问题，并且在cvs版本中已经解决，于是从cedet的cvs仓库中下载了semantic-idle.el文件，替换掉原来的，再byte-compidle-file semantic-idle.el，restart emacs，症状消失！&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8518401150041619787?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8518401150041619787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8518401150041619787' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8518401150041619787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8518401150041619787'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/10/emacscpu.html' title='emacs占用cpu的问题终于解决了'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6787542421415452740</id><published>2006-09-28T11:47:00.000+08:00</published><updated>2006-09-28T11:51:22.186+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><title type='text'>vmplayer的小问题</title><content type='html'>vmplayer是免费的，当然就不需要去做那些找序列号之类的猥琐事了，不过在gentoo里emerge了vmplayer以后普通用户无法正常执行：&lt;br /&gt;VMware Player Error:&lt;br /&gt;VMware Player must be set-UID root, "/opt/vmware/player/lib/bin/vmware-vmx" is not.  Are you running /opt/vmware/player/lib/bin/vmware-vmx from its distribution directory?  That copy of the program is not set-UID root.&lt;br /&gt;又google，找到答案：&lt;br /&gt;#chmod 4755 /opt/vmware/player/lib/bin/vmware-vmx&lt;br /&gt;再运行，没有报错了&lt;br /&gt;这个4表示可以set-uid root&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6787542421415452740?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6787542421415452740/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6787542421415452740' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6787542421415452740'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6787542421415452740'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/09/vmplayer.html' title='vmplayer的小问题'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7893307323770249423</id><published>2006-09-27T11:14:00.000+08:00</published><updated>2006-09-27T11:24:51.767+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>64-bit环境下C语言的变量类型长度</title><content type='html'>受了16bit和32bit环境的影响，以为在我的gentoo 2006.1 amd64上int肯定是64bit的，结果发现是32bit，很是奇怪，难道是“伪64bit”，于是google之，找到资料，原文在&lt;a href="http://www.unix.org/version2/whatsnew/lp64_wp.html"&gt;这里&lt;/a&gt;&lt;br /&gt;原来还有个model的问题，有三个model可选择，ILP64   LP64   LLP64&lt;br /&gt;在ILP64下，int long pointer都是64bit，而LP64下int是32bit，long和pointer是64bit，LLP64的int和long都是32bit,pointer是64bit，要表达64bit的数据，要用long long来表示（非标准）&lt;br /&gt;又说三个model里LP64的过渡最平滑，在64bit环境里写的代码不需要经过多大修改就能运行在32bit环境中，而其他两个model不是需要借助非标准的类型就是太依赖于环境，使得移植困难。 &lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7893307323770249423?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7893307323770249423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7893307323770249423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7893307323770249423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7893307323770249423'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/09/64-bitc.html' title='64-bit环境下C语言的变量类型长度'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1091206397099004767</id><published>2006-09-26T16:33:00.000+08:00</published><updated>2006-09-26T16:51:19.612+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>避免全局变量</title><content type='html'>全局变量是方便，但是在多线程/进程环境下是不安全的，所以在有潜在多线程/进程应用的情况下应该尽量避免全局变量。事实上，全局变量也不利于程序的模块化。&lt;br /&gt;举个例子，一个自己遇到的小问题。&lt;br /&gt;我有一个结构体：&lt;br /&gt;typedef struct _gtalk_user{&lt;br /&gt;  gtalk_user_data_ptr gudp;&lt;br /&gt;  gtalk_buddy_ptr gbp;&lt;br /&gt;  gtalk_connection_ptr gcp;&lt;br /&gt;  gtalk_handlers_ptr ghp;&lt;br /&gt;  XML_Parser parser;&lt;br /&gt;  int errorno;&lt;br /&gt; &lt;br /&gt;}gtalk_user;&lt;br /&gt;&lt;br /&gt;结构体的成员包括了四个结构体指针，一个expat的解析器，还有一个错误号变量，这个程序可以让用户选择是否进行tls连接，所以gudp-&gt;use_tls是根据用户的输入赋值的，这相当于一个用户的偏好，而事实上真正要用到这个值的是在连接的时候。由于某种原因，我不想让网络连接的模块知道gtalk_user里除gcp以外的信息，又不想让调用网络连接模块里的函数的用户知道gtalk_user里的信息，难道只能把use_tls声明为全局变量吗？&lt;br /&gt;我是这么做的：&lt;br /&gt;void gtalk_connection_init (gtak_user_ptr)是连接初始化函数，这是对外的接口，而事实上我把它定义成了&lt;br /&gt;#define gtalk_connection_init(gup) _connection_init(gup-&gt;gcp,gup-&gt;gudp-&gt;use_tls)&lt;br /&gt;真正办实事的函数_connection_init的原型为&lt;br /&gt;void _connection_init (gtalk_connection_ptr gcp,int use_tls);&lt;br /&gt;这样，对于用户来说，只管对gup所代表的gtalk_user这个抽象的对象调用gtalk_connection_init函数，它不需要了解gtalk_user内部的细节&lt;br /&gt;对于_connection_init函数来说，它也不需要了解gcp以外的信息。&lt;br /&gt;其实质是我用宏定义把给_connection_init函数传递use_tls参数的过程对用户屏蔽了，于是达到了我的目的。&lt;br /&gt;&lt;br /&gt;一点体会，有错误欢迎指正。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1091206397099004767?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1091206397099004767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1091206397099004767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1091206397099004767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1091206397099004767'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/09/blog-post.html' title='避免全局变量'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-539342706511834154</id><published>2006-09-16T02:18:00.000+08:00</published><updated>2006-10-25T10:49:31.288+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>gentoo 2006.1 amd64</title><content type='html'>第三次装gentoo了，只用了一天时间就把基本系统装好了，算是相当顺利了。&lt;br /&gt;这次弄明白了一些问题：&lt;br /&gt;lcd的刷新率太高，用gtf生成的modeline根本就不起作用，后来知道nvidia的驱动提供了刷新率的设置，如下：&lt;br /&gt;Section "Device"&lt;br /&gt; Identifier  "Nvidia Geforce 7600GS"&lt;br /&gt; Driver      "nvidia"&lt;br /&gt; Option      "VertRefresh"   "60"  #####这一行设置刷新率&lt;br /&gt; Option      "NvAGP" "1"&lt;br /&gt; Option      "RenderAccel"   "true"&lt;br /&gt; Option      "CursorShadow"  "true"&lt;br /&gt; Option      "AllowGLXWithComposite" "true"&lt;br /&gt; Option      "Coolbits"      "1"&lt;br /&gt; VideoRam    262144&lt;br /&gt;EndSection&lt;br /&gt;&lt;br /&gt;另外是搞定了gensplash，非常pp，原来是要在编译内核的时候加上FB_VESA的支持，内核加上参数vga=795是让控制台的分辨率为1280x1024，791是1024x768,以下是截图&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger2/5627/85845206542985/1600/splash.0.png"&gt;&lt;img style="cursor: pointer;" src="http://photos1.blogger.com/blogger2/5627/85845206542985/320/splash.0.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;说说2006.1的livecd&lt;br /&gt;已经可以直接显示中文，查资料的时候方便了很多，而且中文显示效果很不错&lt;br /&gt;软件包的版本倒是没什么好惊奇的&lt;br /&gt;不过那个图形化的系统安装工具我还是不敢试，自从第一次它带的分区工具把我整块硬盘都格式化之后我就打算老老实实手动安装，也没什么不好的&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-539342706511834154?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/539342706511834154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=539342706511834154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/539342706511834154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/539342706511834154'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/09/gentoo-20061-amd64.html' title='gentoo 2006.1 amd64'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-9025179754118896983</id><published>2006-08-31T12:17:00.000+08:00</published><updated>2006-08-31T12:26:57.961+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>双核的威力</title><content type='html'>athlon64x2 3800+ dfi nf4-d geil 512M*2&lt;br /&gt;看看编译速度的对比&lt;br /&gt; # genlop -t xorg-server&lt;br /&gt; * x11-base/xorg-server&lt;br /&gt;&lt;br /&gt;     Sun Jul 23 18:48:30 2006 &gt;&gt;&gt; x11-base/xorg-server-1.1.1&lt;br /&gt;       merge time: 21 minutes and 35 seconds.&lt;br /&gt;&lt;br /&gt;     Tue Jul 25 00:57:54 2006 &gt;&gt;&gt; x11-base/xorg-server-1.0.2-r7&lt;br /&gt;       merge time: 28 minutes and 31 seconds.&lt;br /&gt;&lt;br /&gt;     Wed Aug 30 15:10:47 2006 &gt;&gt;&gt; x11-base/xorg-server-1.1.1&lt;br /&gt;       merge time: 9 minutes and 28 seconds.&lt;br /&gt;&lt;br /&gt;前两次是athlon64 3000+ kst512M的时间，最后一次是现在的时间&lt;br /&gt;排除掉内存双通道和超频的因素，速度的增长依然十分可观&lt;br /&gt;&lt;br /&gt;整个系统发热也不算很高，开了cool'n'quiet后cpu空载时只有30度，满载45度，散热器是tt金星9,当然现在气温低，夏天的时候肯定还要高&lt;br /&gt;&lt;br /&gt;之前在cool'n'quiet开启的情况下超频不稳定，一编译就死机，后来发现是因为跑的是270*9，而默认倍频是10,在空载的时候自动降频，倍频 变成5,负载一高就自动变成10了，270*10就挂了，其实bios里有个选项是什么什么max fid，默认就是10,设置成9就不会出现这个情况了&lt;br /&gt;&lt;br /&gt;新的blogger，玩一下，觉得不错&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-9025179754118896983?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/9025179754118896983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=9025179754118896983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/9025179754118896983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/9025179754118896983'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/08/blog-post.html' title='双核的威力'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1844340631269974151</id><published>2006-08-12T14:58:00.000+08:00</published><updated>2006-08-31T16:36:26.508+08:00</updated><title type='text'>到目前为止的进展</title><content type='html'>在写一个google talk的客户端，目前为止核心还没有完成，打算先实现xmpp规定的功能特性的一个基本子集&lt;br /&gt;我发现google的talk服务器也并不是严格地实现了所有xmpp的服务器端功能特性，比如说客户端发送的流里存在某些错误的时候 talk.google.com并不会返回错误的类型，而是直接发送&amp;lt;/stream&amp;gt;然后关闭所有已建立的连接，比较暴 力，呵呵&lt;br /&gt;现在存在的问题的：因为xml解析器用的是expat，基于回调函数，限制非常大，因为我不可能把什么东西都通过expat传递给回调函数，那样就破坏了 各个模块的独立性。所以打算第一个版本就expat了，但是完成之后第一件事就是自己实现一个针对xmpp的解析器，不会很复杂，差不多应该相当于一个词 法分析器的复杂度？&lt;br /&gt;这两天停下来了，因为要实习，累得开不了工，还有一个原因是我还没想好要怎么处理&amp;lt;message&amp;gt;&amp;lt;/message&amp;gt;，因为这里会涉及到后面的gui和cli要用到的接口，不考虑全面一点以后免不了要重写&lt;br /&gt;收获还是很大的&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1844340631269974151?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1844340631269974151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1844340631269974151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1844340631269974151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1844340631269974151'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/08/blog-post_12.html' title='到目前为止的进展'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4963976011715153436</id><published>2006-08-07T15:27:00.000+08:00</published><updated>2006-08-31T16:35:40.960+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>atoi?itoa?</title><content type='html'>atoi ()是库函数，用于把字符串转换成整数，实现起来相当容易，于是我傻乎乎地开始去找itoa，找了一圈，终于发现了，没有itoa啊&lt;br /&gt;然后转念一想，要itoa做什么！真要的话自己写一个，几分钟的事情，但是现成的sprintf放这儿不用就真的傻了&lt;br /&gt;而且sprintf显然更方便，因为它有转义字符可以控制输出的格式，于是结论：C语言哪里需要什么itoa嘛！&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4963976011715153436?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4963976011715153436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4963976011715153436' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4963976011715153436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4963976011715153436'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/08/atoiitoa.html' title='atoi?itoa?'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8768967508068259505</id><published>2006-07-28T16:38:00.000+08:00</published><updated>2006-08-31T16:34:29.522+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>解压一大堆文件的脚本</title><content type='html'>&lt;code&gt;#!/bin/bash&lt;br /&gt;do_dir ()&lt;br /&gt;{&lt;br /&gt;    cd $1&lt;br /&gt;    for i in *&lt;br /&gt;    do&lt;br /&gt;    if [[ -f $i ]]&lt;br /&gt;    then&lt;br /&gt;        decompress $i&lt;br /&gt;    elif [[ $i == "." ]] || [[ $i == ".." ]]&lt;br /&gt;    then&lt;br /&gt;        continue&lt;br /&gt;    elif [[ -d $i ]]&lt;br /&gt;    then&lt;br /&gt;        [[ $recue == 1 ]] &amp;&amp;amp; do_dir $i&lt;br /&gt;    fi&lt;br /&gt;    done&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;decompress ()&lt;br /&gt;{&lt;br /&gt;    case $1 in&lt;/code&gt;&lt;code&gt;&lt;br /&gt;    *.tar.bz2)&lt;br /&gt;        tar jxvf $1&lt;br /&gt;        ;;&lt;br /&gt;    *.tar.gz)&lt;br /&gt;        tar zxvf $1&lt;br /&gt;        ;;&lt;br /&gt;    *.rar)&lt;br /&gt;        rar x $1&lt;br /&gt;        ;;&lt;br /&gt;    *.gz)&lt;br /&gt;        gzip -d $1&lt;br /&gt;        ;;&lt;br /&gt;    *.bz2)&lt;br /&gt;        bzip2 -d $1&lt;br /&gt;        ;;&lt;br /&gt;    *)&lt;br /&gt;        echo "$1:not a compressed file,do nothing"&lt;br /&gt;        return&lt;br /&gt;        ;;&lt;br /&gt;    esac&lt;br /&gt;    [[ $del == 1 ]] &amp;&amp;amp; rm  $1&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;get_help ()&lt;br /&gt;{&lt;br /&gt;    echo "this bash script is written to get all the compressed files under a directory to be uncompressed."&lt;br /&gt;    echo "Usage:tarball.sh [OPTION] [DIR]"&lt;br /&gt;    echo "OPTION:"&lt;br /&gt;    echo -e "\t-r\trecursively"&lt;br /&gt;    echo -e "\t-d\tremove the file after decompress it"&lt;br /&gt;}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;if [[ $# == 0 ]]&lt;br /&gt;then&lt;br /&gt;    echo "no arguments detected,do you want to continue or just get help?[c/H]:"&lt;br /&gt;    read help&lt;br /&gt;fi&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;[[ $help != "c" ]] &amp;&amp;amp; get_help &amp;&amp;amp; exit 0&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;for arg in $@&lt;br /&gt;do&lt;br /&gt;    case $arg in&lt;br /&gt;    -r)&lt;br /&gt;        recue=1&lt;br /&gt;        ;;&lt;br /&gt;    -d)&lt;br /&gt;        del=1&lt;br /&gt;        ;;&lt;br /&gt;    -h)&lt;br /&gt;        get_help&lt;br /&gt;        exit 0&lt;br /&gt;        ;;&lt;br /&gt;    -*)&lt;br /&gt;        echo "unknown arg:$arg"&lt;br /&gt;        echo "type tarball.sh -h to get help"&lt;br /&gt;        get_help&lt;br /&gt;        exit 1&lt;br /&gt;        ;;&lt;br /&gt;    *)&lt;br /&gt;        [[ $arg != $0 ]] &amp;&amp;amp; [ -d $arg ] &amp;&amp;amp; name=$arg&lt;br /&gt;        ;;&lt;br /&gt;    esac&lt;br /&gt;done&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;if [[ -n $name ]]&lt;br /&gt;then&lt;br /&gt;    do_dir $name&lt;br /&gt;else&lt;br /&gt;    do_dir "."&lt;br /&gt;fi&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8768967508068259505?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8768967508068259505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8768967508068259505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8768967508068259505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8768967508068259505'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/07/blog-post_28.html' title='解压一大堆文件的脚本'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-5490112957156132880</id><published>2006-07-27T01:08:00.000+08:00</published><updated>2006-08-31T16:33:04.271+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sawfish'/><title type='text'>sawfish-ui</title><content type='html'>sawfish-ui我一直没怎么重视，今天才发现简直太有用了&lt;br /&gt;直到今天之前我一直在纳闷，fvwm能够指定特定的程序map到特定的桌面，也能在聚焦的同时提升窗口，为什么sawfish都不行呢？&lt;br /&gt;原来都可以在sawfish-ui里设置的&lt;br /&gt;在Focus标签下有三个子标签：Focus，Window Cycling和Auto-Raise&lt;br /&gt;第一个设置聚焦方式，第二个没兴趣，第三个设置聚焦的时候要不要自动提升&lt;br /&gt;还有一个叫Matched Windows的标签，可以根据名字等匹配窗口，然后对窗口做特殊的设定，这样就可以让fvwm一样了，hoho&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-5490112957156132880?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/5490112957156132880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=5490112957156132880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5490112957156132880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5490112957156132880'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/07/sawfish-ui.html' title='sawfish-ui'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3131000286940311024</id><published>2006-07-27T00:57:00.000+08:00</published><updated>2006-08-31T16:32:29.339+08:00</updated><title type='text'>rxvt-unicode的问题</title><content type='html'>之前用得好好的，不知道怎么回事突然出问题了，具体表现为在有中文时CPU会占到100%好一会儿，然后才能把中文显示出来，而且中文变得奇丑无比。刚开 始判断可能是字体没找到，于是调整了.Xdefaults，字体是找到了，但是CPU100%的问题依旧。改了无数次，还是没用，google也没结果， 很是郁闷。&lt;br /&gt;后来才知道原来是urxvtd的原因。要把urxvtd重启才能应用新设置。&lt;br /&gt;顺便强烈推荐一下urxvtd和urxvtc的组合，开新term的速度那叫一个快呀&lt;br /&gt;再顺便贴一下.Xdefaults&lt;br /&gt;&lt;code&gt;Xft.dpi:96&lt;br /&gt;URxvt.background:black&lt;br /&gt;URxvt.foreground:white&lt;br /&gt;URxvt.scrollBar:False&lt;br /&gt;URxvt.saveLines:3000&lt;br /&gt;URxvt.color12:DodgerBlue&lt;br /&gt;URxvt.font:7x14,xft:AR PL New Sung:antialias=false&lt;br /&gt;URxvt.mfont:7x14,xft:AR PL New Sung:antialias=false&lt;br /&gt;URxvt.boldFont:7x14,xft:AR PL New Sung:antialias=false&lt;br /&gt;URxvt.italicFont:7x14,xft:Bitstream Vera Sans:antialias=true&lt;br /&gt;URxvt.boldItalicFont:7x14,xft:Bitstream Vera Sans:sytle=Bold:antialias=true&lt;br /&gt;URxvt.preeditType:Root&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3131000286940311024?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3131000286940311024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3131000286940311024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3131000286940311024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3131000286940311024'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/07/rxvt-unicode.html' title='rxvt-unicode的问题'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1254588807986867023</id><published>2006-07-26T18:11:00.000+08:00</published><updated>2006-08-31T16:31:00.334+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sawfish'/><title type='text'>sawfish第一篇</title><content type='html'>换到sawfish以来第一次写关于它的东东，主要是sawfish的资料比起fvwm来少得多，而且它的那个文档也不怎么样，所以玩起来比较吃力啊，不过那个sawfish wiki还是不错的，扩展很多！&lt;br /&gt;第一个，一个小函数：&lt;br /&gt;&lt;code&gt;(defun one-instance-exec (prog)&lt;br /&gt;  (interactive)&lt;br /&gt;  (if (= (ash (system (concat "ps -C" prog)) -8) 0)&lt;br /&gt;      ()&lt;br /&gt;    (system (concat prog " &amp;"))&lt;br /&gt;    ))&lt;/code&gt;&lt;br /&gt;这个函数先检查是不是有进程和要运行的程序同名，如果是就什么都不干，如果不是就运行这个程序，也就是说，它只运行某个程序的一个实例，这在某些场合是很有用的，尤其是程序自身并不检查是不是有自己在运行的时候&lt;br /&gt;比如说，urxvtd，我让它在sawfish启动的时候运行，要是我重启一下sawfish，就会有两个urxvtd，虽然没什么危害，不过浪费总是不好的&lt;br /&gt;&lt;br /&gt;我是忘了把学校的配置文件拷过来了，所以现在的配置文件都是重新写的，函数就写了这么一个，下面是一个变量&lt;br /&gt;(setq viewport-dimensions '(2 . 2))&lt;br /&gt;这个viewport-dimensions找了我好久，viewport是显示器上能显示的那一块，还有一个workspace其实就是桌面，如果 view-port-dimensions是1x1的话，viewport和workspace就是一样大的，如果是这里的2x2的话，那一个 viewport就是一个workspace的1/4&lt;br /&gt;&lt;br /&gt;现在的bmpx搞个什么dbus，我不知道那是什么玩意儿，我只想听歌，但是没有dbus的话bmpx就罢工：（&lt;br /&gt;bmpx官方网站上说要这样：&lt;br /&gt;在.xinitrc里，把原本运行窗口管理器的那一行前面加上dbus-launch --auto-syntax --exit-with-session&lt;br /&gt;这个暂时不关我的事，等我想知道了再去看它是怎么回事&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1254588807986867023?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1254588807986867023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1254588807986867023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1254588807986867023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1254588807986867023'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/07/sawfish.html' title='sawfish第一篇'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-5761089856557821504</id><published>2006-07-24T23:33:00.000+08:00</published><updated>2006-08-31T16:30:21.081+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>拨号又有新玩法！</title><content type='html'>其实rp-pppoe挺好用的，不过我就是这么喜欢折腾&lt;br /&gt;pppd说它把rp-pppoe变成它的一个module了，好呀，于是我决定不要rp-pppoe了&lt;br /&gt;关键在于/etc/conf.d/net文件，更关键的在于/etc/conf.d/net.example，因为后者把前者的配置方法讲得特别特别详细&lt;br /&gt;不过鉴于一些同胞不屑于看英文，我就啰索一下吧&lt;br /&gt;先假设涉及到的设备名是eth0和ppp0&lt;br /&gt;&lt;br /&gt;&lt;code&gt;config_eth0=("null")   #先把eth0弄成null，不要问我为什么，那个net.example教我的！&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;config_ppp0=("ppp")&lt;br /&gt;link_ppp0="eth0"   #这个表示其实我们还是要靠eth0来办事的，所以总得给它点面子&lt;br /&gt;plugins_ppp0=("pppoe")  #传说中的pppd的module啊，果然是百闻不如一见啊&lt;br /&gt;username_ppp0='your_adsl_username'  # 不要照搬啊，那就太傻了&lt;br /&gt;password_ppp0='your_adsl_password'    # 这个也是&lt;br /&gt;pppd_ppp0=("debug" "defaultroute" "usepeerdns") #debug表示往系统日志里多写点东西，defaulteroute和usepeerdns都表示默认啊默认，把ppp设备做为默认route，dns 连接上了就有了，不用自己指定&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;好，这个关键性文件好了，然后ln -s /etc/init.d/net.lo /etc/init.d/net.ppp0&lt;br /&gt;如果想开机就连接上的话：rc-update add net.ppp0 default&lt;br /&gt;另外，如果原来runlevel里有net.eth0的话，就不要了：rc-update del net.eth0&lt;br /&gt;&lt;br /&gt;另外我还折腾了一下动态域名&lt;br /&gt;先去www.3322.org注册一个帐号，建一个域名，信息自己记住啊，我不负责的&lt;br /&gt;emerge ez-ipupdate&lt;br /&gt;然后在/etc/ez-ipupdate/下建立一个.conf文件，名字你自己随便起，假设是qdns.conf&lt;br /&gt;内容如下&lt;br /&gt;&lt;br /&gt;&lt;code&gt;user=username:password  #这是你在3322.org的帐号和密码&lt;br /&gt;host=yourhost.3322.org   #这是你申请的二级域名，当然，你要有钱，非要自己买顶级域名，那我只能膜拜了：）&lt;br /&gt;interface=ppp0  #ppp设备名&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;运行一下ez-ipupdate -S qdns -c /etc/ez-ipupdate/qdns.conf&lt;br /&gt;再ping一下那个域名，看看能不能解析出来&lt;br /&gt;&lt;br /&gt;现在开机能自动拨号了，但是域名的指向还要手动，那就不理想了，于是：&lt;br /&gt;把/etc/ppp/ip-up给翻出来&lt;br /&gt;这个文件由三个if...fi组成，可以发现第一个if...fi是关于usepeerdns的，显然跟我们没关系，而第二个if...fi里有这么一句：/etc/init.d/net.$1 --quiet start&lt;br /&gt;可以看到ppp0就是从这里启动的，那么如果它起动成功的话就可以跟3322.org建立连接了，所以在后面加上：&amp;&amp;amp; ez-ipupdate -c /etc/ez-ipupdate/qdns.conf -S qdns&lt;br /&gt;OK了&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-5761089856557821504?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/5761089856557821504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=5761089856557821504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5761089856557821504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5761089856557821504'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/07/blog-post.html' title='拨号又有新玩法！'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4486625924853730334</id><published>2006-07-24T23:10:00.000+08:00</published><updated>2006-08-31T16:29:02.980+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>第二次装gentoo</title><content type='html'>这次比上次熟练了，不过也花了三天时间，总结一下：&lt;br /&gt;先是gcc-config无法升级了，确切的症状是编译正常，但是旧版本无法删除，而且从这里开始以后不管装什么软件都出错，具体信息忘记了，好像说是什 么call back还是fall back之类的，反正不管装什么东西都是出来这么一屏，google了一晚上，无果，后来怀疑是portage的问题，于是把当前版本mask掉，退回去 后发现一切正常了&lt;br /&gt;接着第二个问题是gmp，fortran依赖它，但是编译这个东西需要c++，而当时在stage1的情况下没有c++编译器，这个鸡啊蛋啊的问题真是麻 烦得很，具体解决办法：先把gcc的USE flag里的fortran关掉，编译，得到一个stage2的gcc，因为它现在已经有c++支持了，然后用gcc-config或者eselect compiler set xxx启用新的gcc，（gentoo说gcc-config马上要被抛弃了，所以还是eselect compiler吧），再用新的gcc可以编译gmp，有了gmp就可以进一步得到fortran enabled的gcc，造物的快感啊！我当时是这么想的，不过过程并没有这么顺利，事实上一旦我用了gcc-4.1.1，emerge的时候就会出现 crash，CPU100%，除非我把进程kill掉，否则它就一直卡在那里，但是退回3xx版本就没有问题，百思不得其解，后来无奈之下重新 emerge了一遍gcc-config，问题自己消失了，奇怪&lt;br /&gt;之后我有了完整的编译器，剩下的问题就都是些散兵游勇了，不足为惧，主要都是一些包的依赖，出错的时候自己稍微看看就都能解决&lt;br /&gt;不过grub的问题倒真是诡异了，不管我怎么弄，它始终是error15，而我手动启动的时候，命令都是跟grub.conf里写得一样的，却能顺利启 动，也换了版本，而且/boot是ext3的，而且配置文件就是以前debian的时候用的，就是改了一下title和kernel，它就是不肯启动，我 服了&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4486625924853730334?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4486625924853730334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4486625924853730334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4486625924853730334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4486625924853730334'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/07/gentoo.html' title='第二次装gentoo'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-5944181599361015527</id><published>2006-06-26T23:13:00.000+08:00</published><updated>2006-08-31T16:31:47.668+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>grub啊</title><content type='html'>问题是解决了，不过总归是莫名其妙的，把kernel后面的那个root=/dev/xxx参数去掉竟然就可以了，什么概念？嗯？&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-5944181599361015527?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/5944181599361015527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=5944181599361015527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5944181599361015527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5944181599361015527'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/06/grub.html' title='grub啊'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4941585235823927397</id><published>2006-06-22T03:09:00.000+08:00</published><updated>2006-08-31T16:26:57.441+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='office'/><title type='text'>openoffice的中文</title><content type='html'>装了一直没怎么用，其实我自己根本就不会想到要用office之类的庞然大物来写什么文档，emacs一个纯文本足矣，毕业论文之前我肯定会把tex搞定嘛，所以……openoffice也只是在考前突击时看看那些垃圾课件了&lt;br /&gt;言归正传，打开老杜同志的课件的时候发现大部分中文都无法显示，而我已经设置了simsun都字体的替换规则，没辙了，把文件传给mm，让她帮我看老杜用的到底是什么变态字体&lt;br /&gt;华文琥珀？华文中宋倒是听说过- -可见老杜的趣味确实不是一般人的水准&lt;br /&gt;然后试着把sthupo和stzhongsong都替换成AR PL New Sung，结果不行&lt;br /&gt;又试着直接写中文，华──文──琥──珀，竟然可以了，这事情真是奇妙了&lt;br /&gt;还有一个，打开文件的时候目录名文件名都显示不了中文，google一番，把Andale Sans UI这个字体替换成系统中已有的中文字体就可以了&lt;br /&gt;ps一下：utf8下的cjk-latex真是罪恶啊- -&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4941585235823927397?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4941585235823927397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4941585235823927397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4941585235823927397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4941585235823927397'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/06/openoffice.html' title='openoffice的中文'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4282663631953618612</id><published>2006-06-21T04:21:00.000+08:00</published><updated>2006-08-31T16:25:48.302+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>最新版本smart-operator</title><content type='html'>&lt;code&gt;(defun smart-insert-operator (op &amp;optional only-back)&lt;br /&gt;  "Automatically insert whitespaces before and after '=', '&gt;=', etc.&lt;br /&gt;Make it look nicer: ' = ', ' &gt;= '.&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;OP is the operator. If optional ONLY-BACK is t, only insert one&lt;br /&gt;whitespace at back. When confused, try C-q."&lt;br /&gt;  (interactive "s")&lt;br /&gt;  (delete-horizontal-space)&lt;br /&gt;  (let ((op-p nil)            ; another op at front?&lt;br /&gt;    (one-char-back nil)        ; have we stepped back one char?&lt;br /&gt;    (fir-sp t)                    ;space before op by default&lt;br /&gt;    (sec-sp t))                  ;space after op by default&lt;br /&gt;    (unless (bolp)                     ;if the point not at the beginning of a line&lt;br /&gt;      (backward-char)&lt;br /&gt;      (setq one-char-back t))&lt;br /&gt;    (setq op-p&lt;br /&gt;      (catch 'return&lt;br /&gt;        (dolist (front smart-operator-alist)&lt;br /&gt;          (when (looking-at front)&lt;br /&gt;        (throw 'return t)))))&lt;br /&gt;    (when (and (or op-p (not (and (bolp) (eolp))))&lt;br /&gt;           one-char-back)&lt;br /&gt;      (forward-char))&lt;br /&gt;    (if (or (comint-within-quotes 0 (point)) (and (or (equal op "/") (equal op "&gt;")) (looking-back "^\\#include.*")))&lt;br /&gt;    ((lambda ()&lt;br /&gt;       (setq fir-sp nil)&lt;br /&gt;       (setq sec-sp nil)&lt;br /&gt;       ()))&lt;br /&gt;      (if (or (and (equal op "&lt; ") (looking-back "^\\#include.*")) (and (equal op "*") (looking-back "int\\|char\\|float\\|double\\|short\\|long\\|signed\\|unsigned\\|void")))&lt;br /&gt;       (setq sec-sp nil)&lt;br /&gt;     (if (or (and (equal op "=") op-p) (and (or (equal op "&lt;") (equal op "&gt;") (equal op "+") (equal op "-") (equal op "|") (equal op "&amp;")) (looking-back op)))&lt;br /&gt;          (setq fir-sp nil)&lt;br /&gt;        ())))&lt;br /&gt;    (if (or only-back (not fir-sp) (bolp))&lt;br /&gt;    (insert op)&lt;br /&gt;      (insert (concat " " op)))&lt;br /&gt;    (delete-horizontal-space)&lt;br /&gt;    (if sec-sp&lt;br /&gt;    (insert " "))))&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;这个版本针对C语言“优化”过了，比如#include之后尖括号老是加空格就比较烦了，还有以前如果先有=再有-就会当成一个运算符，实际上C里没有这么一个运算符，等等&lt;br /&gt;应该还有什么没想到的，到时候再添加&lt;br /&gt;&lt;br /&gt;6月22日：我就知道有什么东西忘记了，娃哈哈，这次这个版本对"-&gt;"特殊处理，两边都没空格&lt;br /&gt;不过代码是真的越写越丑了：（&lt;br /&gt;&lt;code&gt;(defun smart-insert-operator (op &amp;optional only-back)&lt;br /&gt;  "Automatically insert whitespaces before and after '=', '&gt;=', etc.&lt;br /&gt;Make it look nicer: ' = ', ' &gt;= '.&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;OP is the operator. If optional ONLY-BACK is t, only insert one&lt;br /&gt;whitespace at back. When confused, try C-q."&lt;br /&gt;  (interactive "s")&lt;br /&gt;  (delete-horizontal-space)&lt;br /&gt;  (let ((op-p nil)            ; another op at front?&lt;br /&gt;    (one-char-back nil)        ; have we stepped back one char?&lt;br /&gt;    (fir-sp t)                    ;space before op by default&lt;br /&gt;    (sec-sp t))                  ;space after op by default&lt;br /&gt;    (unless (bolp)                     ;if the point not at the beginning of a line&lt;br /&gt;      (backward-char)&lt;br /&gt;      (setq one-char-back t))&lt;br /&gt;    (setq op-p&lt;br /&gt;      (catch 'return&lt;br /&gt;        (dolist (front smart-operator-alist)&lt;br /&gt;          (when (looking-at front)&lt;br /&gt;        (throw 'return t)))))&lt;br /&gt;    (when (and (or op-p (not (and (bolp) (eolp))))&lt;br /&gt;           one-char-back)&lt;br /&gt;      (forward-char))&lt;br /&gt;    (if (or (comint-within-quotes 0 (point)) (and (or (equal op "/") (equal op "&gt;")) (looking-back "^\\#include.*")))&lt;br /&gt;    ((lambda ()&lt;br /&gt;       (setq fir-sp nil)&lt;br /&gt;       (setq sec-sp nil)&lt;br /&gt;       ()))&lt;br /&gt;      (if (or (and (equal op "&lt; ") (looking-back "^\\#include.*")) (and (equal op "*") (looking-back "int\\|char\\|float\\|double\\|short\\|long\\|signed\\|unsigned\\|void")))&lt;br /&gt;       (setq sec-sp nil)&lt;br /&gt;     (if (or (and (equal op "=") op-p) (and (or (equal op "&lt;") (equal op "&gt;") (equal op "+") (equal op "-") (equal op "|") (equal op "&amp;")) (looking-back op)))&lt;br /&gt;          (setq fir-sp nil)&lt;br /&gt;       (if (and (equal op "&gt;") (looking-back "-"))&lt;br /&gt;           ((lambda ()&lt;br /&gt;          (setq fir-sp nil)&lt;br /&gt;          (setq sec-sp nil)&lt;br /&gt;          (backward-char)&lt;br /&gt;          (delete-horizontal-space)&lt;br /&gt;          (forward-char)&lt;br /&gt;          ()))))))&lt;br /&gt;    (if (or only-back (not fir-sp) (bolp))&lt;br /&gt;    (insert op)&lt;br /&gt;      (insert (concat " " op)))&lt;br /&gt;    (delete-horizontal-space)&lt;br /&gt;    (if sec-sp&lt;br /&gt;    (insert " "))))&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4282663631953618612?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4282663631953618612/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4282663631953618612' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4282663631953618612'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4282663631953618612'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/06/smart-operator.html' title='最新版本smart-operator'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1890628903571221271</id><published>2006-06-21T02:23:00.000+08:00</published><updated>2006-08-31T16:25:06.489+08:00</updated><title type='text'>被拒了</title><content type='html'>据说是因为我成绩不好&lt;br /&gt;我的成绩确实是倒数的，那又怎么样？&lt;br /&gt;不说也罢，诅咒这个教育制度&lt;br /&gt;等着吧，我还会回来的&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1890628903571221271?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1890628903571221271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1890628903571221271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1890628903571221271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1890628903571221271'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/06/blog-post_21.html' title='被拒了'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3544113353993047449</id><published>2006-06-06T02:08:00.000+08:00</published><updated>2006-08-31T16:24:16.741+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>xcompmgr&amp;mplayer</title><content type='html'>最近几天没看电影，昨天突然发现mplayer在全屏的时候会有一块黑色快速闪动(xcompmgr启动的情况下)，可以用以下选项来解决&lt;br /&gt;mplayer -vo x11 --zoom video_file&lt;br /&gt;或者在.mplayer/config里加上&lt;br /&gt;vo=x11&lt;br /&gt;zoom=y&lt;br /&gt;也是一样的效果&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3544113353993047449?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3544113353993047449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3544113353993047449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3544113353993047449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3544113353993047449'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/06/xcompmgr.html' title='xcompmgr&amp;mplayer'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3632188001505633545</id><published>2006-06-02T00:52:00.000+08:00</published><updated>2006-08-31T16:22:25.074+08:00</updated><title type='text'>面试结束</title><content type='html'>有保密协议，我什么都不能说&lt;br /&gt;对自己的发挥还算满意，就是太粗心了- -&lt;br /&gt;下来就等结果吧&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3632188001505633545?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3632188001505633545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3632188001505633545' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3632188001505633545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3632188001505633545'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/06/blog-post.html' title='面试结束'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-341537070964509963</id><published>2006-05-31T21:08:00.000+08:00</published><updated>2006-08-31T16:21:15.452+08:00</updated><title type='text'>笔试通过了</title><content type='html'>题就不泄露了，不过难度并没有我想象那么大&lt;br /&gt;明天早上要面试，心情这个激动啊&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-341537070964509963?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/341537070964509963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=341537070964509963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/341537070964509963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/341537070964509963'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/05/blog-post_31.html' title='笔试通过了'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6125210564907527010</id><published>2006-05-31T04:16:00.000+08:00</published><updated>2006-08-31T16:19:41.396+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>X Composite Extension</title><content type='html'>心血来潮，又想玩一下composite了，然后发现一运行xcompmgr就报错。google了几分钟，发现原来是xloadimage搞的鬼，不过 这个倒不是google到的，是我自己发现的，反正我没搜到什么有用的信息。sawfish好像没有自带设置背景图片的工具，就随便找了个，叫 hsetroot，挺好用的，用它代替xloadimage以后，gkrellm和xchat的透明都可以用了，xcompmgr也正常了。&lt;br /&gt;另外，还有个非常非常好的消息，好像那个n卡开了硬件加速后aa字体显示会出问题的bug已经彻底修正了！这下是真他妈爽了。&lt;br /&gt;这里的空间并不大，我就不截图了，有空去哪里找个图片册再贴&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6125210564907527010?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6125210564907527010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6125210564907527010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6125210564907527010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6125210564907527010'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/05/x-composite-extension.html' title='X Composite Extension'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1258412223456884860</id><published>2006-05-31T01:47:00.000+08:00</published><updated>2006-08-31T16:18:57.784+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>又换了...</title><content type='html'>主板换了dfi nf4x，显卡装了coolviva，确实是挺酷的，U换了2500+，体质还可以，默认极限应该是370不到吧，现在是360*7，内存运行在DDR560,比6100+2800+还猛&lt;br /&gt;这块主板有两个缺点，一是没有smart fan的支持，而是CPU温度的传感器有问题&lt;br /&gt;不过网卡倒是没有问题了，再也不用忍受6100那种变态毛病了。&lt;br /&gt;现在super pi 1M位在36s左右，内存潜伏差不多41,读写是4xxx&lt;br /&gt;原来的6100和2800+给mm用了，比她的p4+845强很多了&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1258412223456884860?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1258412223456884860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1258412223456884860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1258412223456884860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1258412223456884860'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/05/blog-post.html' title='又换了...'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7086600204175562558</id><published>2006-05-31T01:36:00.000+08:00</published><updated>2006-08-31T16:18:15.436+08:00</updated><title type='text'>google的实习招聘</title><content type='html'>今天，应该是昨天了，google来招聘实习生。去笔试了一下，挺简单的，但是有个题不会，真郁闷啊。&lt;br /&gt;希望能过笔试&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7086600204175562558?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7086600204175562558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7086600204175562558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7086600204175562558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7086600204175562558'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/05/google.html' title='google的实习招聘'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8811913311089018897</id><published>2006-04-24T01:51:00.000+08:00</published><updated>2006-08-31T16:17:14.315+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash'/><title type='text'>一个小脚本</title><content type='html'>现在换成utf-8环境了，gbk环境下的代码里的汉字全是乱码，30M的代码手动转换肯定要死人的，所以写了个小脚本，可以批量转换编码的&lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;recur ()&lt;br /&gt;{&lt;br /&gt;    cd $1&lt;br /&gt;    for i in *&lt;br /&gt;    do&lt;br /&gt;        if [ -d $i ]&lt;br /&gt;        then&lt;br /&gt;            recur $i&lt;br /&gt;            cd ..&lt;br /&gt;        else&lt;br /&gt;            if [[ $i == *.c ]]&lt;br /&gt;            then&lt;br /&gt;                iconv -f gbk -t utf8 $i&gt;tmp&lt;br /&gt;                mv tmp $i&lt;br /&gt;            else&lt;br /&gt;                continue&lt;br /&gt;            fi&lt;br /&gt;        fi&lt;br /&gt;    done&lt;br /&gt;}&lt;br /&gt;recur $1&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8811913311089018897?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8811913311089018897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8811913311089018897' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8811913311089018897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8811913311089018897'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/04/blog-post_24.html' title='一个小脚本'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-562266996036684990</id><published>2006-04-20T20:52:00.000+08:00</published><updated>2006-08-31T16:16:23.564+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>新平台和新系统</title><content type='html'>又是大半个月没写了，太堕落了&lt;br /&gt;先说说新平台的表现&lt;br /&gt;sp2800+ 和tf6100，uccc512M，oc到了300异步166，效果相当明显啊，比p4和sis651强不知道多少了&lt;br /&gt;然后是gentoo2006 amd64的安装，这个过程真是异常痛苦啊&lt;br /&gt;因为是第一次安装，没有经验，而我对于gentoo的安装也没有充分的心理准备，当时在选make.conf的参数时(第一次用图形界面安装的)，加上了 object C的支持，结果系统自举的时候gcc编译怎么也通不过，机器是快，不过编译gcc还是要大概40分钟的样子，而且总是到最后快结束时出错，我就这样试了 7、8次，都快疯了。然后开始google，最后终于在一个不起眼的角落找到了答案，原来是依赖性没做好，漏了一个叫boehm-gc的包。只要先手动把 这个包emerge了继续就可以了。&lt;br /&gt;系统基本装好，内核编译完毕，重启，我的系统启动了！但是到udev的时候又出错了，不过好歹表明基本系统除内核完应该是没问题的，这次google不到 了，于是上freenode的#gentoo问，经过外国友人的提醒，发现内核没有tmpfs支持，再重新编译，重启，终于成功！&lt;br /&gt;回头想想，就两个问题，但是我花了差不多1个星期才把机器用起来。&lt;br /&gt;gentoo还是很合我的胃口的，比debian的定制性还要强，完毕。&lt;br /&gt;ps：转到sawfish了，这个单独写&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-562266996036684990?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/562266996036684990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=562266996036684990' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/562266996036684990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/562266996036684990'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/04/blog-post.html' title='新平台和新系统'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1646259546211783462</id><published>2006-03-23T01:16:00.000+08:00</published><updated>2006-08-31T16:14:39.001+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>6100和sp2800+入手！</title><content type='html'>6100是小板子，不过做工还是相当好的，也很漂亮&lt;br /&gt;这个sp体质一般，310的外频，凑合了，hoho&lt;br /&gt;正在下gentoo的installCD，体验一下，因为根据我之前的经验，似乎现在gentoo对64bit的支持最好&lt;br /&gt;先记录一下，欲知后事如何，请听下回分解&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1646259546211783462?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1646259546211783462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1646259546211783462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1646259546211783462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1646259546211783462'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/03/6100sp2800.html' title='6100和sp2800+入手！'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1090646265461758534</id><published>2006-03-21T00:09:00.000+08:00</published><updated>2006-08-31T16:13:44.583+08:00</updated><title type='text'>我的生日啊啊啊啊啊</title><content type='html'>一不小心发现过12点了，我的生日就这么到了，哈哈&lt;br /&gt;不过，生日么，都过了这么多了，没必要写那么多废话的，纪念一下，仅此而已&lt;br /&gt;刚才去某人的blog上晃悠了一下，顺便嘲笑之，感觉不错&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1090646265461758534?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1090646265461758534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1090646265461758534' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1090646265461758534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1090646265461758534'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/03/blog-post_21.html' title='我的生日啊啊啊啊啊'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7018030786272161189</id><published>2006-03-20T23:58:00.000+08:00</published><updated>2006-08-31T16:12:55.658+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hardware'/><title type='text'>盘算着升级</title><content type='html'>现在的板子已经严重地制约了整个系统性能的提高了，不过即使是2.4b+865pe也就不过那么回事了吧，于是觉得还是投向k8的怀抱比较划算。&lt;br /&gt;最近的6100势头很猛，据说oc性能跟dfi nf4x不相上下，本来钱又不多，这个应该还是比较合适的，还能暂时省下显卡的钱。本来是想收gz的一套的，6100和sp2500+，那个sp2500 +据说能上380*7，口水……不过我终究还是决定买新的拼人品了，但愿上天能赐我一块极品2500+，嘿嘿&lt;br /&gt;上周学校的d2 bn重新开荒了，终于没有抵制住诱惑，堕落了一把，呵呵。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7018030786272161189?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7018030786272161189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7018030786272161189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7018030786272161189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7018030786272161189'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/03/blog-post_20.html' title='盘算着升级'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3829386845043036003</id><published>2006-03-04T22:47:00.000+08:00</published><updated>2006-08-31T16:11:08.049+08:00</updated><title type='text'>考研</title><content type='html'>昨天mm的考研分数出来 了，没想到这个臭丫头能考这么好，看来我的指导还是有用的啊，嗯~&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3829386845043036003?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3829386845043036003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3829386845043036003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3829386845043036003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3829386845043036003'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/03/blog-post.html' title='考研'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6906374626519172867</id><published>2006-02-22T22:14:00.000+08:00</published><updated>2006-08-31T16:09:51.763+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>提供机制，而不是策略</title><content type='html'>据说unix的设计哲学是：提供机制，而不是策略&lt;br /&gt;第一次看到这句话确实是不明白，因为我并不理解“机制”和“策略”的区别&lt;br /&gt;这两天看ldd，里面倒是很详细地解释了&lt;br /&gt;简单点说，机制就是“能干什么”，而策略是“怎么干”&lt;br /&gt;所以可以这样理解：unix给你提供你需要以之来解决问题的各种功能，但不会告诉你怎么做，那是你的事情&lt;br /&gt;于是，针对一些现象，我又开始忍不住要大放一番“厥词”了，虽然我知道说了也是白说&lt;br /&gt;linux和unix初学者们：&lt;br /&gt;我跟你们一样，也是什么都不懂，并且我越学习就越是发现这一事实是有多么明显，但是有一点我明白了的，那就是，linux/unix提供了机制，但是不会是策略。所以：&lt;br /&gt;在你们遇到问题的时候，先想想unix的设计哲学。&lt;br /&gt;然后想想你手头所有的资源，manual，google，bbs，其中manual是系统提供给你的，如果你想“学会”怎么用linux/unix，那就 先好好利用你所拥有的，而不是一味地“请教”别人，别人没有义务去回答那些已经重复了无数次的问题的。接下去，怎么利用这些资源去解决你所遇到的问题，就 是属于“策略”的范畴了，参照我的理解，那是你的事情。&lt;br /&gt;其实中心思想是：发文前请看置底！！&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6906374626519172867?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6906374626519172867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6906374626519172867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6906374626519172867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6906374626519172867'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/02/blog-post.html' title='提供机制，而不是策略'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-5747286301118691938</id><published>2006-02-22T21:25:00.000+08:00</published><updated>2006-08-31T16:09:06.902+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>用emacs上bbs</title><content type='html'>我一直想着要是在bbs上发文时能像emacs一样编辑，那可太爽了，不过既然bbs不支持emacs的编辑功能，那就用emacs上bbs么&lt;br /&gt;其实很简单，M-x ansi-term，运行后emacs会让你选择程序，默认是bash，然后就会出来一个term，其他的就跟在终端下上bbs一样了&lt;br /&gt;不过发呆时间一长就会掉线，所以可以写个函数防止发呆：&lt;br /&gt;&lt;code&gt;(defvar antiidle)&lt;br /&gt;(defun enable-anti-idle ()&lt;br /&gt;(interactive)&lt;br /&gt;(setq antiidle (run-with-timer 0 180 '(lambda ()&lt;br /&gt;(term-send-up)&lt;br /&gt;(term-send-down)))))&lt;/code&gt;&lt;br /&gt;这个函数让emacs每三分钟向term发送一个“上”和一个“下”，然后把run-with-timer返回的值赋给antiidle&lt;br /&gt;&lt;code&gt;(defun disable-anti-idle ()&lt;br /&gt;(interactive)&lt;br /&gt;(cancel-timer antiidle))&lt;/code&gt;&lt;br /&gt;这个函数把刚才用run-with-timer“注册”的行为注销掉&lt;br /&gt;这样就可以在需要的时候开启或关闭防止发呆功能，当然，设个快捷键会更方便&lt;br /&gt;另外，在连接主机之前在终端下先运行stty rows 24 cols 80效果会更好&lt;br /&gt;连接上主机以后，默认的是term-char-mode，在这个mode下每按一个键就会向终端发送，所以适合于浏览，如果要发文，那么就会出问题，可以 切换到term-line-mode，然后像平时一样编辑，要发送之前再切换回term-char-mode就可以按C-w发文了&lt;br /&gt;term-char-mode绑定到了C-c C-k&lt;br /&gt;term-line-mode绑定到了C-c C-j&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-5747286301118691938?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/5747286301118691938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=5747286301118691938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5747286301118691938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/5747286301118691938'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/02/emacsbbs.html' title='用emacs上bbs'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-2205216844313560639</id><published>2006-02-18T12:13:00.000+08:00</published><updated>2006-08-31T16:08:24.352+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>P4也可以cpufreq！</title><content type='html'>在家试了一下powernow的威力，非常适合我这种24小时不关机的人，能省不少电呢，当然，不开机更省，呵呵&lt;br /&gt;回学校来又开始折腾（我总是倾向于让我的电脑都有同一个环境，这样至少当我分别在家和在学校时，不需要改变我的习惯），于是看到文档里说cpufreq也能用在P4上，那当然要用。&lt;br /&gt;编译内核基本上和athlon64的时候一样，只是cpu换成了P4，对应的cpufreq的模块换成了，具体如下：&lt;br /&gt;&lt;code&gt;[*] CPU Frequency scaling&lt;br /&gt;│ │ [ ] Enable CPUfreq debugging&lt;br /&gt;│ │ &lt; *&gt; CPU frequency translation statistics&lt;br /&gt;│ │ [*] CPU frequency translation statistics details&lt;br /&gt;│ │ Default CPUFreq governor (performance) ---&gt;&lt;br /&gt;│ │ --- 'performance' governor&lt;br /&gt;│ │ 'powersave' governor&lt;br /&gt;│ │ 'userspace' governor for userspace frequency scaling&lt;br /&gt;│ │ 'ondemand' cpufreq policy governor&lt;br /&gt;│ │ &lt;&gt; 'conservative' cpufreq governor&lt;br /&gt;│ │ --- CPUFreq processor drivers&lt;br /&gt;│ │ &lt; *&gt; ACPI Processor P-States driver&lt;br /&gt;│ │ &lt;&gt; AMD Mobile K6-2/K6-3 PowerNow!&lt;br /&gt;│ │ &lt;&gt; AMD Mobile Athlon/Duron PowerNow!&lt;br /&gt;│ │ &lt;&gt; AMD Opteron/Athlon64 PowerNow!&lt;br /&gt;│ │ &lt;&gt; Cyrix MediaGX/NatSemi Geode Suspend Modulation&lt;br /&gt;│ │ &lt;&gt; Intel Enhanced SpeedStep&lt;br /&gt;│ │ &lt;&gt; Intel Speedstep on ICH-M chipsets (ioport interface)&lt;br /&gt;│ │ &lt;&gt; Intel SpeedStep on 440BX/ZX/MX chipsets (SMI interface)&lt;br /&gt;│ │ Intel Pentium 4 clock modulation&lt;br /&gt;│ │ &lt;&gt; nVidia nForce2 FSB changing&lt;br /&gt;│ │ &lt;&gt; Transmeta LongRun&lt;br /&gt;│ │ &lt;&gt; VIA Cyrix III Longhaul&lt;br /&gt;│ │ --- shared options&lt;br /&gt;│ │ [ ] /proc/acpi/processor/../performance interface (deprecated)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;有了支持cpufreq的内核以后基本上就成功一半了&lt;br /&gt;然后安装三个额外的包：&lt;br /&gt;#apt-get install acpid cpufreqd cpufrequtils&lt;br /&gt;这里插一句，据说powernowd也是支持P4的，不过我没试过，谁有兴趣可以试一下&lt;br /&gt;这三个包装好后就有一个完整的环境了，如果图方便的话，重启一下，不过，重启是window$的德性，还是手动吧&lt;br /&gt;其实本来不用手动启动的，因为包的安装脚本会帮我们启动，不过acpid不能在X环境下启动，会提示资源或设备忙，所以可以先退出X，启动acpid以后再进X，当然，如果不用X的话就不用这么麻烦了&lt;br /&gt;接下去就只剩最后一步了，配置一下/etc/cpufreqd.conf&lt;br /&gt;默认的配置似乎是针对笔记本的，什么ac=on，ac=off的&lt;br /&gt;先简单介绍一下cpufreqd.conf&lt;br /&gt;这个文件由一系列的section组成，分别是gerneral，profile和rule&lt;br /&gt;gerneral部份是总的设置，需要改的是把以下两行的注释去掉&lt;br /&gt;&lt;code&gt;# enable_remote=1&lt;br /&gt;# remote_group=root&lt;/code&gt;&lt;br /&gt;不然的话cpufreqd-get和cpufreqd-set就无法工作&lt;br /&gt;然后是profile，这个部份为rule提供一些模板&lt;br /&gt;name是profile的名字，随便你喜欢，可以有空格，不能重复&lt;br /&gt;minfreq是本profile下CPU的最低工作频率，百分数表示&lt;br /&gt;maxfreq以此类推&lt;br /&gt;policy 这个能使用的选项取决于 /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors，cat一下就有 了，而它又取决于刚才编译内核时的几个选项，分别是userspace，ondemand，performance和powersave&lt;br /&gt;other plugin entries放到下面一起说&lt;br /&gt;最后是rule，rule比较复杂一点&lt;br /&gt;name是rule的名字，和profile的name差不多&lt;br /&gt;profile是符合该rule时所使用的profile的name&lt;br /&gt;other plugin entries提供匹配一个rule的机制，我只说几个比较有用的，详细的可以man cpufreqd.conf，acpi_temperature plugin用来匹配CPU的温度，当然这也需要内核的支持，可以参考我前面powernow的文章，比如说当CPU温度高于50度时让CPU稍微休息一 下，就这样匹配：acpi_temperature=50-100,cpu plugin用来匹配CPU的使用率，比如可以用cpu_interval=50-100和刚才的acpi_temperature=50-100一起来 匹配CPU过热，programs plugin可以匹配一个程序，这样就可以在看电影或者编译软件时让CPU以最高频率跑起来，这样写：programs=xxx，有不止一个程序的话用逗 号间隔，基本上这些就够用了，如果还是不明白就对照着默认的配置文件，再看看manual，应该很容易就搞定了&lt;br /&gt;&lt;br /&gt;这些都完成以后，让cpufreqd重启一下：&lt;br /&gt;&lt;code&gt;#/etc/init.d/cpufreqd restart&lt;/code&gt;&lt;br /&gt;可以运行一下cpufreqd-get查看当前的状态，下面是我的结果：&lt;br /&gt;&lt;code&gt;root@huzhou:/home/cxl# cpufreqd-get&lt;br /&gt;socket I'll try to connect: /tmp/cpufreqd-zRGa6x/cpufreqd&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Name (#1): On Demand High *&lt;br /&gt;Governor: ondemand&lt;br /&gt;Min freq: 1499962&lt;br /&gt;Max freq: 2399940&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Name (#2): On Demand Low&lt;br /&gt;Governor: ondemand&lt;br /&gt;Min freq: 899977&lt;br /&gt;Max freq: 1799955&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Name (#3): Performance High&lt;br /&gt;Governor: performance&lt;br /&gt;Min freq: 2399940&lt;br /&gt;Max freq: 2399940&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Name (#4): Performance Low&lt;br /&gt;Governor: performance&lt;br /&gt;Min freq: 1799955&lt;br /&gt;Max freq: 1799955&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Name (#5): Powersave High&lt;br /&gt;Governor: powersave&lt;br /&gt;Min freq: 1799955&lt;br /&gt;Max freq: 1799955&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Name (#6): Powersave Low&lt;br /&gt;Governor: powersave&lt;br /&gt;Min freq: 599985&lt;br /&gt;Max freq: 599985&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;可以再看一下/etc/proc/cpuinfo&lt;br /&gt;&lt;code&gt;root@huzhou:/home/cxl# cat /proc/cpuinfo&lt;br /&gt;processor : 0&lt;br /&gt;vendor_id : GenuineIntel&lt;br /&gt;cpu family : 15&lt;br /&gt;model : 2&lt;br /&gt;model name : Intel(R) Pentium(R) 4 CPU 2.40GHz&lt;br /&gt;stepping : 7&lt;br /&gt;cpu MHz : 1493.971&lt;br /&gt;cache size : 512 KB&lt;br /&gt;fdiv_bug : no&lt;br /&gt;hlt_bug : no&lt;br /&gt;f00f_bug : no&lt;br /&gt;coma_bug : no&lt;br /&gt;fpu : yes&lt;br /&gt;fpu_exception : yes&lt;br /&gt;cpuid level : 2&lt;br /&gt;wp : yes&lt;br /&gt;flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr&lt;br /&gt;bogomips : 4784.88&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;可以看到频率已经降下来了&lt;br /&gt;不过我的sensors显示核心电压并没有下降，目前为止我还不知道是怎么回事：）&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-2205216844313560639?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/2205216844313560639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=2205216844313560639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2205216844313560639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2205216844313560639'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/02/p4cpufreq.html' title='P4也可以cpufreq！'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-6037203775998003063</id><published>2006-02-09T03:00:00.000+08:00</published><updated>2006-08-31T16:07:28.949+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>温度、风扇、电压和cool'n'quiet(athlon64)</title><content type='html'>要在系统中得到主板上各处的温度，风扇转速和电压，必须在内核中有相应的支持，还要有lm-sensors，下面简单介绍一下步骤：&lt;br /&gt;编译内核，在device drivers-&gt;i2c中选上对应的选项&lt;br /&gt;&lt;code&gt;&lt; *&gt; I2C support&lt;br /&gt;I2C device interface&lt;br /&gt;I2C Algorithms ---&gt; //这里面的全选上&lt;br /&gt;I2C Hardware Bus support ---&gt; //这里面的选上对应硬件的模块&lt;br /&gt;Miscellaneous I2C Chip support ---&gt;&lt;br /&gt;[ ] I2C Core debugging messages&lt;br /&gt;[ ] I2C Algorithm debugging messages&lt;br /&gt;[ ] I2C Bus debugging messages&lt;br /&gt;[ ] I2C Chip debugging messages&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;然后是device drivers-&gt;Hardware Monitoring support&lt;br /&gt;这里要先弄清楚自己主板的sensor的芯片，然后选上对应的模块&lt;br /&gt;然后安装lm-sensors，root运行sensors-detect，按照提示一步一步来，如果成功探测到芯片的话，最后按照提示把结果写入 /etc/modules就可以了，然后/etc/init.d/lm-sensors start，重新启动一下gkrellm，就会发现风扇，温度和电压已经可选了，随时监控：）&lt;br /&gt;&lt;br /&gt;接着再说说AMD的cool'n'quiet&lt;br /&gt;cool'n'quiet技术可以根据当前CPU的负载来自动调节CPU的频率，电压以及风扇的转速，电费吃人啊，能省则省啦&lt;br /&gt;当然，这个功能也是需要内核的支持的，在Power management options-&gt;ACPI (Advanced Configuration and Power Interface) Support里选上Processor&lt;br /&gt;CPU Frequency scaling里&lt;br /&gt;&lt;code&gt;[*] CPU Frequency scaling&lt;br /&gt;[ ] Enable CPUfreq debugging&lt;br /&gt;&lt; *&gt; CPU frequency translation statistics&lt;br /&gt;[ ] CPU frequency translation statistics details&lt;br /&gt;Default CPUFreq governor (performance) ---&gt;&lt;br /&gt;--- 'performance' governor&lt;br /&gt;'powersave' governor&lt;br /&gt;'userspace' governor for userspace frequency scaling&lt;br /&gt;'ondemand' cpufreq policy governor&lt;br /&gt;&lt;&gt; Intel Enhanced SpeedStep&lt;br /&gt;&lt;&gt; ACPI Processor P-States driver&lt;br /&gt;--- shared options&lt;br /&gt;[ ] /proc/acpi/processor/../performance interface (deprecated)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;还要在bios里把pownow功能打开&lt;br /&gt;完成后加载上必要的模块，先看一下/proc/cpuinfo&lt;br /&gt;&lt;code&gt;root@huzhou:/home/cxl# cat /proc/cpuinfo&lt;br /&gt;processor : 0&lt;br /&gt;vendor_id : AuthenticAMD&lt;br /&gt;cpu family : 15&lt;br /&gt;model : 47&lt;br /&gt;model name : AMD Athlon(tm) 64 Processor 3000+&lt;br /&gt;stepping : 0&lt;br /&gt;cpu MHz : 2025.046&lt;br /&gt;cache size : 512 KB&lt;br /&gt;fpu : yes&lt;br /&gt;fpu_exception : yes&lt;br /&gt;cpuid level : 1&lt;br /&gt;wp : yes&lt;br /&gt;flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm&lt;br /&gt;bogomips : 4054.34&lt;br /&gt;TLB size : 1024 4K pages&lt;br /&gt;clflush size : 64&lt;br /&gt;cache_alignment : 64&lt;br /&gt;address sizes : 40 bits physical, 48 bits virtual&lt;br /&gt;power management: ts fid vid ttp tm stc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;然后root@huzhou:/home/cxl# echo ondemand&gt;/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor&lt;br /&gt;再看看&lt;br /&gt;&lt;code&gt;root@huzhou:/home/cxl# cat /proc/cpuinfo&lt;br /&gt;processor : 0&lt;br /&gt;vendor_id : AuthenticAMD&lt;br /&gt;cpu family : 15&lt;br /&gt;model : 47&lt;br /&gt;model name : AMD Athlon(tm) 64 Processor 3000+&lt;br /&gt;stepping : 0&lt;br /&gt;cpu MHz : 1125.025&lt;br /&gt;cache size : 512 KB&lt;br /&gt;fpu : yes&lt;br /&gt;fpu_exception : yes&lt;br /&gt;cpuid level : 1&lt;br /&gt;wp : yes&lt;br /&gt;flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm&lt;br /&gt;bogomips : 2252.41&lt;br /&gt;TLB size : 1024 4K pages&lt;br /&gt;clflush size : 64&lt;br /&gt;cache_alignment : 64&lt;br /&gt;address sizes : 40 bits physical, 48 bits virtual&lt;br /&gt;power management: ts fid vid ttp tm stc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;可以看到频率已经从2025降到1125了（我超过频，如果没超频的话，是从1800到1000）&lt;br /&gt;如果这时候有CPU密集型的进程运行，再看频率，会发现又是2025了&lt;br /&gt;&lt;br /&gt;另外，如果发现加载powernow-k8模块时有如下错误的话&lt;br /&gt;powernow-k8: BIOS error - no PSB or ACPI _PSS objects&lt;br /&gt;可以尝试一下升级bios&lt;br /&gt;enjoy it！&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-6037203775998003063?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/6037203775998003063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=6037203775998003063' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6037203775998003063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/6037203775998003063'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/02/coolnquietathlon64.html' title='温度、风扇、电压和cool&apos;n&apos;quiet(athlon64)'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3996150894761039156</id><published>2006-02-03T19:59:00.000+08:00</published><updated>2006-08-31T16:06:36.166+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tool'/><title type='text'>gdb</title><content type='html'>其实我不会用gdb，一直都不会，但是直到上学期做汇编课程设计的时候，实在是没办法了，不用gdb根本就不可能发现问题了，才硬着头皮开始学着用。然后就发现它真的是一个很优秀的调试器。&lt;br /&gt;当然我是在emacs里用的，不过跟shell下用是没什么区别的，如果不去管emacs提供的那些快捷键的话。&lt;br /&gt;如果启动gdb的时候没有指定要调试的程序，那么在启动后可以用file filename来完成这个工作。&lt;br /&gt;然后呢，run就可以运行要调试的程序。哦，还有，如果是用gcc编译的话，加个-g的选择，可以给gdb提供足够的调试信息。&lt;br /&gt;break可以设置断点，我喜欢break 1这样让程序一启动就暂停&lt;br /&gt;until linenum可以让程序运行一直到指定的行号（或指定的行号以后）&lt;br /&gt;list可以显示出源程序以及行号&lt;br /&gt;p，就是print，可以打印出程序中的变量值，这个比较重要，p后可跟一个/F，其中F是输出的格式，比如x是十六进制，d是十进制，o是八进制等等， 还可以打印整个数组，如果有array[3] 这样的声明，那么可以用p *array@3把array的3个元素打印出来&lt;br /&gt;next可以让程序运行一条指令（调试汇编时是机器指令，高级语言时我想应该是一条语句，而在c语言里声明变量之类的语句是不会被next单独执行一次的）&lt;br /&gt;这些是最基本的命令，用法相当复杂，具体可以查看info gdb&lt;br /&gt;调试器在你对于你的程序运行错误没有头绪的时候是很有用处的&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3996150894761039156?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3996150894761039156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3996150894761039156' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3996150894761039156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3996150894761039156'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/02/gdb.html' title='gdb'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-2193673450369363301</id><published>2006-01-25T09:53:00.000+08:00</published><updated>2006-08-31T16:05:08.085+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>继续debian-amd64</title><content type='html'>mplayer也没问题了，编译错误的原因是win32lib无法用于64-bit的机器，而且目前没有64-bit的版本，所以configure的时 候只能去掉win32lib的选项，事实上我并不知道这个lib确切地对应哪些格式的文件，但是没了它至少avi还是能放的，所以，等着吧&lt;br /&gt;另外，我还发现我用的源里没有cmucl，暂时先不管，需要的时候再说&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-2193673450369363301?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/2193673450369363301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=2193673450369363301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2193673450369363301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2193673450369363301'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/01/debian-amd64.html' title='继续debian-amd64'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-7269966607096198016</id><published>2006-01-22T11:40:00.000+08:00</published><updated>2006-08-31T16:04:24.373+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>amd64,debian</title><content type='html'>在学校的时候刻了一张 debian-31r0-amd64-binary-1.iso，拿回来开始装。&lt;br /&gt;安装过程非常顺利，就是64-bit的zhcon好像有问题，启动不了，说是kernel没有fb吧好像是，不过zhcon不是关键，没有也可以将就。要 提一下的是nf4的芯片组的话，网卡会认不出来，那么有两个选择，一是事先从nvidia官方网站下载nf4的驱动，装完基本系统和开发包后直接装驱动， 应该是可以把网卡驱动上的，不过这个方法我没试，事后总结的，我用的是第二个方法，安装过程先不配置网卡，apt也不管，跳过，基本系统好了以后把apt 源设置成光盘，装上编译内核需要的包，直接编译内核，选nforce芯片组的网卡驱动，叫forcedeath，它是nf3的，不过没关系，nf4的网卡 也认，至少在我机器上是这样，当然事先要下载好内核源码。&lt;br /&gt;有了网卡之后就好办了，找个合适的源，继续安装就是了。&lt;br /&gt;不过在家是公网，找这个源着实是费了不少功夫，每次都是先在windows下查半天，然后重启回debian试，ustc的pure64试过，应该是有问题，最后终于找到一个国内的速度相当快的源，sources.list：&lt;br /&gt;&lt;code&gt;deb http://mirror.vmmatrix.net/debian-amd64/debian-pure64/ sid main contrib non-free&lt;br /&gt;deb-src http://mirror.vmmatrix.net/debian-amd64/debian-pure64/ sid main contrib non-free&lt;br /&gt;deb http://debian.okey.net/debian-uo/ sid ustc #marillat rareware&lt;br /&gt;deb-src http://debian.okey.net/debian-uo/ sid ustc #marillat rareware&lt;/code&gt;&lt;br /&gt;上面那个是pure64的，debian.okey.net是ustc的公网镜像，这个源的uo里的ustc有amd64的分支，里面有stardict等好东西：）&lt;br /&gt;其他基本上就没什么好说的了，包肯定不是很全的，如果实在需要的话就只能自己编译了，和32-bit的系统一样。&lt;br /&gt;比如说emacs23就是，我不想装mule，只好下emacs-unicode-2的分支：&lt;br /&gt;&lt;code&gt;cvs -z3 -d:pserver:anonymous@cvs.savannah.gnu.org:/sources/emacs co -r emacs-unicode-2 emacs&lt;/code&gt;&lt;br /&gt;编译的过程也是非常顺利：&lt;br /&gt;&lt;code&gt;mkdir emacsbuild&lt;br /&gt;cd emacsbuild&lt;br /&gt;../emacs/configure --with-x-toolkit=gtk --with-x&lt;/code&gt;&lt;br /&gt;其他选项可以configure --help看，一般装好相应的库后configure自己会找到&lt;br /&gt;&lt;code&gt;make bootstrap&lt;br /&gt;make install&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;编译fvwm倒是有错误，而且编译出来还是没有菜单的透明，不编译也罢，反正是有现成的包的，mplayer一直没通过，不过这个是娱乐工具，暂时没打算马上搞定它，放放再说吧&lt;br /&gt;先到这儿吧，后面还有的&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-7269966607096198016?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/7269966607096198016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=7269966607096198016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7269966607096198016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/7269966607096198016'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/01/amd64debian.html' title='amd64,debian'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8133464095051126300</id><published>2006-01-15T04:35:00.000+08:00</published><updated>2006-08-31T16:02:40.349+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>又是nvidia</title><content type='html'>前天忘了说了，nvidia的驱动，每次重启都要重装一次才能进X，到目前为止的总结：&lt;br /&gt;(我说的是debian下的，其实发行版没试过 )&lt;br /&gt;1.apt-cache show nvidia-glx&lt;br /&gt;看版本号和当前所装的nvidia的驱动版本号是否一致，如果不一致的话很可能就是它搞的鬼&lt;br /&gt;2.再启动过程中是不是有NVIDIA-TLS之类的信息&lt;br /&gt;如果有的话，应该就是问题所在了，这是一个启动过程中自动运行的脚本，它检查有没有nvidia-glx，有的话就会把对应的文件删除，我也不知道它为什么这么干，不过可以暂时把它的权限设成不可执行，就可以就将了，hoho&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8133464095051126300?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8133464095051126300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8133464095051126300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8133464095051126300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8133464095051126300'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/01/nvidia_15.html' title='又是nvidia'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-2898781341946455762</id><published>2006-01-15T04:08:00.000+08:00</published><updated>2006-08-31T16:01:57.973+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tex'/><title type='text'>这次是texlive了</title><content type='html'>debian的tetex包，真是能让人郁闷致死，而在经历了又一次dist-upgrade无法安装之后，我决定投向texlive的怀抱。于是，我又发现其实它们都是一个德行:)（本来就应该都是一个德行么，texlive也是基于tetex的吧）&lt;br /&gt;安装过程没什么好说的，下个iso，mount -o loop texlive2005-inst-20051102.iso，不会有装deb包时的依赖等关系，只管照着提示做就可以了，可以说相当简单。值得提醒的一 点是文档就装英文的就可以了，大部份人不会认识法语德语甚至是越南语吧？这样可以节省硬盘空间。cjk的包也要选上。&lt;br /&gt;然后是配置中文环境。下一个gbkfonts，写个脚本:&lt;br /&gt;#!/bin/bash&lt;br /&gt;gbkfonts path/to/*.ttf(c) whatever_fontname_you_like&lt;br /&gt;...&lt;br /&gt;因为字体一般不只一个，用gbkfonts生成可以让tex认识的字体信息时还比较慢，所以用脚本更好一点。&lt;br /&gt;建一个目录，比如~/gbkfonts，然后在这个目录下执行刚才的脚本，然后你会在当前目录下得到一大堆东西，把这些东西复制到/usr/local/texlive/texmf-local下，基本上就算是完成了。&lt;br /&gt;关键的是，在auctex下，先生成.dvi文件后无法用xdvi来预览，这还真是只让人所想即所得了。于是应该想办法解决它。&lt;br /&gt;网上索了很多资料，包括王垠的方法，一个一个试，无非就是在config.ps里加上p +cjk.map，再不行就是加上绝对路径，或者就是updmap.cfg里也加上Map cjk.map，再不行还是加上绝对路径，然后再运行updmap,texhash等等等等，方法是很多，对我来说却没有一个是有用的，我运行xdvi *.dvi的时候永远是一样的提示，mktexpk: don't know how to create bitmap font for ***，于是我把mktexpk翻出来看（它只是一个脚本），发现系统对于type1字体用的是gsftopk来生成pk字体的，但是似乎gsftopk 并没有找到关于我生成的字体的信息，最终，我cat cjk.map&gt;&gt;psfonts.map后，它终于顺利地找到了字体信息，弄了一天，终于有结果了！&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-2898781341946455762?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/2898781341946455762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=2898781341946455762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2898781341946455762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/2898781341946455762'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/01/texlive.html' title='这次是texlive了'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8241442284646977160</id><published>2006-01-13T11:22:00.000+08:00</published><updated>2006-08-31T16:01:11.885+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>关于nvidia</title><content type='html'>考完试，终于又可以折腾系统了。&lt;br /&gt;今天折腾xorg的composite。前段时间弄了块做工不错的ti4600来玩，顺便就试了下xorg的威力&lt;br /&gt;&lt;code&gt;Section "Device"&lt;br /&gt;Identifier "nVidia Corporation NV25 [GeForce4 Ti 4600]"&lt;br /&gt;Driver "nvidia"&lt;br /&gt;Option "AllowGLXWithComposite" "true" #这行要加，不然glx就用不了了&lt;br /&gt;Option "RenderAccel" "true" #这行打开硬件加速（应该是这个作用吧我猜，因为不打开这项的情况下开了composite会占用较多的cpu资源，打开以后cpu不受任何影响）&lt;br /&gt;Option "AGPFastWrite" "1"&lt;br /&gt;Option "EnablePageFlip" "1"&lt;br /&gt;Option "NvAGP" "1"&lt;br /&gt;Option "CursorShadow" "true" #这几项可有可无&lt;br /&gt;EndSection&lt;/code&gt;&lt;br /&gt;再加上这个setion&lt;br /&gt;&lt;code&gt;Section "Extensions"&lt;br /&gt;Option "Composite" "Enable"&lt;br /&gt;Option "RENDER" "Enable"&lt;br /&gt;EndSection&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;startx后在终端运行xcompmgr -cfF看看效果，炫！再transset num(0-1之间)然后选定一个窗口点击看看效果，酷！&lt;br /&gt;&lt;br /&gt;有两个小小的遗憾&lt;br /&gt;1 composite会和fvwmbuttons收起放出另一个fvwm模块的行为冲突，这个问题比较严重，会导致键盘鼠标失去响应&lt;br /&gt;2 nvidia的驱动和非aa字体冲突，会导致中文显示不出来(simsun)，开了aa后正常，但是中文字体又太难看，后来我把中文的小字体关掉aa，然 后用AR PL ShanHeiSun Uni字体就可以正常显示，不过这个bug很可能不是普遍性的，所以解决办法也不一定在任何情况下都有效&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8241442284646977160?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8241442284646977160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8241442284646977160' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8241442284646977160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8241442284646977160'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2006/01/nvidia.html' title='关于nvidia'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-3037396111945400351</id><published>2005-10-27T01:54:00.000+08:00</published><updated>2006-08-31T15:59:29.195+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='clisp'/><title type='text'>又对common lisp感兴趣了</title><content type='html'>前段时间看了点elisp，改了几个函数让它们符合我的习惯，也初步体会到了fp的魅力&lt;br /&gt;不过elisp只针对于emacs，离开了emacs就不行了，于是想学学common lisp了&lt;br /&gt;今天照着水木的帖子把clisp环境搭了起来，先apt-get install cmucl binfmt-support&lt;br /&gt;然后建个bash脚本：&lt;br /&gt;&lt;code&gt;#!/bin/sh&lt;br /&gt;[ $1 ] &amp;&amp;amp; lisp -quiet -eval "(compile-file "$1")(quit)"&lt;br /&gt;chmod a+x ${1%.lisp}.x86f&lt;/code&gt;&lt;br /&gt;用这个脚本就可以编译.lisp的源程序&lt;br /&gt;还下了几本书，有空好好看看&lt;br /&gt;感觉lisp语言是很有前途的，虽然现在用的人还不算很多&lt;br /&gt;即使不考虑这些，多体验一种编程风格，倒也是可以自娱一下&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-3037396111945400351?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/3037396111945400351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=3037396111945400351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3037396111945400351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/3037396111945400351'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2005/10/common-lisp.html' title='又对common lisp感兴趣了'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-8289815949015425430</id><published>2005-10-26T12:20:00.000+08:00</published><updated>2006-08-31T15:58:29.533+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fvwm'/><title type='text'>模拟鼠标点击</title><content type='html'>fvwmbuttons有一个很好的功能是可以把pager啊buttons啊之类的玩意儿收起来，或者再放出来。&lt;br /&gt;以前照着王垠的说明弄过，但是用fvwm就应该发挥它的优势，老是拿鼠标biajibiaji地点岂不是很郁闷？但是那时候我又不知道怎么可以用键盘来控制被buttons作为panel的模块的收放，后来就去掉了，让它们一直放在桌面上好了。&lt;br /&gt;不过今天又想把桌面变得再简洁点，于是想用键盘来实现上面说的功能。&lt;br /&gt;google了几分钟，在fvwm faq上找到答案了：&lt;br /&gt;FakeClick是用来实现键盘模拟鼠标点击事件的，为此可以定义一个函数&lt;br /&gt;&lt;code&gt;AddToFunc Press_FvwmButtons&lt;br /&gt;+ I SetEnv pointer_x $[pointer.x]&lt;br /&gt;+ I SetEnv pointer_y $[pointer.y]&lt;br /&gt;+ I Next ($1, CirculateHit) WarpToWindow $2 $3&lt;br /&gt;+ I FakeClick depth 1 press $0 release $0&lt;br /&gt;+ I WindowId root WarpToWindow $[pointer_x]p $[pointer_y]p&lt;/code&gt;&lt;br /&gt;这个函数先把当前鼠标指针的位置保存下来，然后移到指定的FvwmButtons，用FakeClick模拟点击事件后再把指针返回到原来的位置&lt;br /&gt;现在举个例子，假如我有一个FvwmButtons叫MainPanel，它把一个FvwmPage作为一个panel，在MainPanel上点击鼠标 就可以把FvwmPage展开或者收起，然后我可以这样调用Press_FvwmButtons函数：Press_FvwmButtons 1 MainPanel 50 50&lt;br /&gt;其中1表示鼠标的左键，MainPanel就是FvwmButtons的名字，50和50是鼠标指针移动到FvwmButtons的位置比例&lt;br /&gt;这样就可以实现模拟鼠标点击，如果再把Press_FvwmButtons绑定到一个快捷键上，就可以实现用键盘来控制panel的展开或收起&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-8289815949015425430?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/8289815949015425430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=8289815949015425430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8289815949015425430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/8289815949015425430'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2005/10/blog-post_26.html' title='模拟鼠标点击'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-1589682569246109531</id><published>2005-10-25T01:53:00.000+08:00</published><updated>2006-08-31T15:57:20.353+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>教训啊</title><content type='html'>这次rm了/var/lib下的东西，应该吸取教训了：&lt;br /&gt;.bashrc:&lt;br /&gt;alias rm='rm -i'&lt;br /&gt;这样每次删除都会问一下，虽然是麻烦点，但是总比误操作强&lt;br /&gt;顺便就解决了一下历史遗留问题：&lt;br /&gt;以前照着网上的资料把bash的提示符弄成彩色的了，有两个好处，第一，在输出一大堆信息的时候，往回翻时可以很方便地找到提示符的位置，这样就知道输出的信息是从哪儿开始的了，第二，当然是好看了。&lt;br /&gt;但是之前在我的工作目录很长的时候，命令会超出一屏的长度而自动换行，这时候问题就出来了，当到第二行后，我用left回到上一行会出现定位的问题，具体 也说不清楚，就是很混乱，根本就不知道现在的光标是在哪个字符上。那时候我还以为这是用ascii控制符带来的必然的副作用。&lt;br /&gt;后来一想，怎么可能，这么优秀的软件不会有这种低级bug的，尤其是它经过了这么多年这么多人的考验。于是又找资料，终于发现应该用\[和\]把ascii控制符括起来，这样就告诉bash在计算光标位置的时候把方括号里的内容忽略掉，就不会出现刚才说的混乱的情况了。&lt;br /&gt;顺便提一下，ascrii控制符这样表达：\033[xx;xxm，xx是数字，代表颜色，以及一些乱七八糟的东西，比如下划线之类的&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-1589682569246109531?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/1589682569246109531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=1589682569246109531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1589682569246109531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/1589682569246109531'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2005/10/blog-post.html' title='教训啊'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-703243932000138747.post-4314130243195067365</id><published>2005-10-25T01:41:00.000+08:00</published><updated>2006-08-31T15:56:31.099+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tex'/><title type='text'>debian的tex包太郁闷了</title><content type='html'>哦，不是包郁闷，是我郁闷。&lt;br /&gt;前两天tetex升级了，我也没想什么就dist-upgrade了，结果……&lt;br /&gt;tetex-bin就总是装不上。可这是debian啊，它装不上我的apt就老是报错，还影响我装别的包，于是前天就想把它弄好。开始在google 搜，然后又去水木看，都没找到有用的东西，最后……在我想看/var/lib下的东西的时候，实在是懒得打目录了，于是up啊up，up到一个有 /var/lib目录的命令，没看就ret了，然后才发现那个命令是rm……&lt;br /&gt;悲剧就这样发生了，无奈。&lt;br /&gt;昨天把/etc备份了一下，/home本来就在一个单独的分区，重装还挺快的，美化也已经轻车熟路了，然后还是装tetex，又装不上，说是无法删除 /var/lib/texmf/web2c/*fmt，没有这个文件目录，我一看，倒还真是没有。那没有就没有，反正你要删掉的，继续装不就得了，白痴不 白痴么。&lt;br /&gt;然后我就戏弄了它一回，在/var/lib/texmf/web2c/下vim了个123fmt内容是123，保存，再装，这个傻x脚本就高高兴兴地把tetex-bin装上了：（&lt;br /&gt;反正我就是觉得这次包的升级有很多问题，后来也是少很多文件，我根据它的提示一个一个地从网上下，后来才搞定的，弄到5点多才睡，郁闷。&lt;br /&gt;有一个倒是要记一下，就是当fmtutil-sys或者updmap-sys提示找不到配置文件的时候，不妨先texhash一下，应该就能找到了&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/703243932000138747-4314130243195067365?l=fvwmer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fvwmer.blogspot.com/feeds/4314130243195067365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=703243932000138747&amp;postID=4314130243195067365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4314130243195067365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/703243932000138747/posts/default/4314130243195067365'/><link rel='alternate' type='text/html' href='http://fvwmer.blogspot.com/2005/10/debiantex.html' title='debian的tex包太郁闷了'/><author><name>fvwmer</name><uri>http://www.blogger.com/profile/16372466664514686494</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
