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

<channel>
	<title>鬼の领地 &#187; 雕虫小技</title>
	<atom:link href="http://blog.upsuper.org/category/%e9%9b%95%e8%99%ab%e5%b0%8f%e6%8a%80/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.upsuper.org</link>
	<description>the place where there are some ghost appearing...</description>
	<lastBuildDate>Wed, 19 Oct 2011 13:21:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>为 Linux 做一把 USB “钥匙”</title>
		<link>http://blog.upsuper.org/make-an-usb-key-for-linux/</link>
		<comments>http://blog.upsuper.org/make-an-usb-key-for-linux/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 12:24:39 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[U盘]]></category>
		<category><![CDATA[验证]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1189</guid>
		<description><![CDATA[我曾经很早以前就在想，能不能将U盘作为登入我系统的验证机制。当时的想法是，这样比较有趣~不过后来发现另外一个重要的用途就是，防止在众目睽睽之下输入密码…… 这个问题提出后，邮件列表里很快就有人告诉我，Linux 已经有一个现成的机制了，这就是 pam_usb。不过我在网上搜了半晌都没搜到相关的中文资料，前几天弄成了，就写出来供大家参考~ 其实来说，是很简单的。首先，当然，要准备一个U盘~（废话），然后安装 pam_usb。在 Ubuntu 下的话，源里就有，可以输入命令 1 sudo apt-get install pamusb-tools 直接安装。当然如果你连终端也懒得打开，可以直接点击这里：安装 pamusb-tools。当然，在后面的步骤中你终归还是要打开终端的，所以还是先开了吧~这个东西目前暂时还没什么图形界面的样子（当然做一个相信也不难）。 另外，Fedora 源里有 pam_usb 包，Arch Linux 似乎在 AUR 里有，在 Gentoo 中似乎是被默认屏蔽的，可以通过下面指令安装： 1 2 echo &#34;sys-auth/pam_usb&#34; &#62;&#62; /etc/portage/package.keywords emerge -av &#34;&#62;=sys-auth/pam_usb-0.4.1&#34; 其他的发行版也可以直接从他们的项目主页下载源码包编译安装~ 安装好了以后，首先插入你作为钥匙的U盘，然后在终端中运行 1 sudo pamusb-conf --add-device MyUSBDevice 其中的 MyUSBDevice 可以任意修改，只是一个标识符而已。接下来根据提示操作即可。如果你的电脑此时连接着超过一个U盘、移动硬盘，或者某个U盘、移动硬盘包含超过一个分区（就像我给U盘分了2个区），就会提示选择安装到哪里。设置完确认保存到配置文件即可。 下面添加认证用户，下面的命令是添加我为认证用户的： 1 sudo pamusb-conf --add-user upsuper 原教程里面写的是添加 root 我认为是没有必要的，添加 sudoer 应该是已经足够了的。这条命令几乎不问什么问题，直接就完成了……这样以后在使用这把钥匙的时候就可以不需要输入相应用户的密码了。 [...]]]></description>
			<content:encoded><![CDATA[<p>我曾经很早以前就在想，能不能将U盘作为登入我系统的验证机制。当时的想法是，这样比较有趣~不过后来发现另外一个重要的用途就是，防止在众目睽睽之下输入密码……</p>
<p>这个<a href="https://groups.google.com/group/shlug/browse_thread/thread/d507a796d11df859/15b0bce269c51f7f">问题提出</a>后，邮件列表里很快就有人告诉我，Linux 已经有一个现成的机制了，这就是 pam_usb。不过我在网上搜了半晌都没搜到相关的中文资料，前几天弄成了，就写出来供大家参考~</p>
<p>其实来说，是很简单的。首先，当然，要准备一个U盘~（废话），然后安装 pam_usb。在 Ubuntu 下的话，源里就有，可以输入命令</p>

<div class="wp_codebox"><table><tr id="p11898"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code8"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> pamusb-tools</pre></td></tr></table></div>

<p>直接安装。当然如果你连终端也懒得打开，可以直接点击这里：<a href="apt:pamusb-tools">安装 pamusb-tools</a>。当然，在后面的步骤中你终归还是要打开终端的，所以还是先开了吧~这个东西目前暂时还没什么图形界面的样子（当然做一个相信也不难）。</p>
<p>另外，Fedora 源里有 pam_usb 包，Arch Linux 似乎在 AUR 里有，在 Gentoo 中似乎是被默认屏蔽的，可以通过下面指令安装：</p>

<div class="wp_codebox"><table><tr id="p11899"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1189code9"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;sys-auth/pam_usb&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>portage<span style="color: #000000; font-weight: bold;">/</span>package.keywords
emerge <span style="color: #660033;">-av</span> <span style="color: #ff0000;">&quot;&gt;=sys-auth/pam_usb-0.4.1&quot;</span></pre></td></tr></table></div>

<p>其他的发行版也可以直接从他们的<a href="http://pamusb.org/">项目主页</a>下载源码包编译安装~</p>
<p>安装好了以后，首先插入你作为钥匙的U盘，然后在终端中运行</p>

<div class="wp_codebox"><table><tr id="p118910"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code10"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pamusb-conf <span style="color: #660033;">--add-device</span> MyUSBDevice</pre></td></tr></table></div>

<p>其中的 MyUSBDevice 可以任意修改，只是一个标识符而已。接下来根据提示操作即可。如果你的电脑此时连接着超过一个U盘、移动硬盘，或者某个U盘、移动硬盘包含超过一个分区（就像我给U盘分了2个区），就会提示选择安装到哪里。设置完确认保存到配置文件即可。</p>
<p>下面添加认证用户，下面的命令是添加我为认证用户的：</p>

<div class="wp_codebox"><table><tr id="p118911"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code11"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> pamusb-conf <span style="color: #660033;">--add-user</span> upsuper</pre></td></tr></table></div>

<p>原教程里面写的是添加 root 我认为是没有必要的，添加 sudoer 应该是已经足够了的。这条命令几乎不问什么问题，直接就完成了……这样以后在使用这把钥匙的时候就可以不需要输入相应用户的密码了。</p>
<p>最后最重要的一步，是编辑认证系统的配置文件。打开 /etc/pam.d/common-auth （对于 Gentoo 来说是 /etc/pam.d/system-auth），将下面这行插入到所有条目的前面：</p>

<div class="wp_codebox"><table><tr id="p118912"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code12"><pre class="text" style="font-family:monospace;">auth    sufficient      pam_usb.so</pre></td></tr></table></div>

<p>现在你的 USB 钥匙已经可以用了！现在，另外再打开一个终端，随便 sudo 点什么，然后你应该不会再看到输入密码的画面，取而代之的是下面的东西：</p>

<div class="wp_codebox"><table><tr id="p118913"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p1189code13"><pre class="text" style="font-family:monospace;">* pam_usb v0.4.2
* Authentication request for user &quot;upsuper&quot; (sudo)
* Device &quot;MyUSBDevice&quot; is connected (good).
* Performing one time pad verification...
* Access granted.</pre></td></tr></table></div>

<p>然后运行成功了！不仅 sudo 可以验证，包括 gksu 和登入框等等都已经可以使用这把钥匙直接略过不需要输入密码了。</p>
<p>现在你已经成功的制作了一个属于自己的 USB 钥匙！<br />
<span id="more-1189"></span><br />
现在我们看看还有什么地方可以继续改进的……</p>
<p>我们注意到，无论我们是否连接了我们的钥匙，以后 sudo 的时候都会出现那些讨厌的提示，怎么办呢……？其实这完全也是可以解决的：打开 /etc/pamusb.conf 文件，我们发现这其实根本就是一个 XML 文件……在里面的 &lt;defaults&gt; 标签中间添加</p>

<div class="wp_codebox"><table><tr id="p118914"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1189code14"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;option</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;quiet&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/option<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>保存后就直接生效了~</p>
<p>除此之外，我们发现在这里，我们的钥匙和原来的密码之间是一个替代的关系，如果你希望利用这个钥匙附加上密码提高安全性的话，可以将上面在 /etc/pam.d/common-auth 里面加入的那行中的 sufficient 改成 required，如果你干脆就不想再用密码了，那就把密码的那些删掉，留下一个 required 的 pam_usb~</p>
<p>话说这还真是强大呐~不过用了这个以后，你这个USB钥匙也得要好好保管鸟~不过其实对我来说最爽的无外乎以后在众目睽睽之下不需要再手动输入密码啦~</p>
<h3>参考资料</h3>
<ul>
<li><a href="http://ubuntuforums.org/showthread.php?t=17571">HOWTO: pam_usb login with USB memory stick &#8211; Ubuntu Forums</a></li>
<li><a href="http://pamusb.org/doc/quickstart">doc:quickstart    [pam_usb]</a></li>
<li><a href="http://pamusb.org/doc/configuration">doc:configuration    [pam_usb]</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/make-an-usb-key-for-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>在 tty 里添加一个开机自启动的任务管理器</title>
		<link>http://blog.upsuper.org/run-top-automatical-in-tty-after-boot/</link>
		<comments>http://blog.upsuper.org/run-top-automatical-in-tty-after-boot/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 02:31:09 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[tty]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1126</guid>
		<description><![CDATA[每当感觉到系统卡的时候，最好的方法无外乎进入 tty，登入，打开一个 top 监视。可是每次到了需要的时候才去开，打开的效率自然不敢恭维。于是便想，每次开机的时候，记起来就跑到 tty 下面去先开起来。不过这件事情总归是麻烦的，于是才有了现在的方案。 既然 tty 那么多，那我们就把他利用一下吧~让他开机自动在某个 tty 里面启动 top 无疑最方便了~ 首先呢，我找到了 Ubuntu 里面 tty 配置存放的地方 /etc/init/ttyX.conf，其中的 X 便是 tty 的编号，我这里选择了 tty6.conf。打开这个文件，结构简单极了，看到里面 10 exec /sbin/getty -8 38400 tty6 就知道，肯定和 getty 有关系。man getty 里面查到可以通过 -l 参数设置登入程序替代 /bin/login。查了一下 man login，发现可以通过 -f username 的方式不进行验证地登入。 于是我就在 /bin 下面新建了一个 autologin 文件（其实理论上放哪里都可以，不过最好要用 root 权限创建，不然可以乱改就不好了），里面写上 1 2 #!/bin/sh /bin/login -f [...]]]></description>
			<content:encoded><![CDATA[<p>每当感觉到系统卡的时候，最好的方法无外乎进入 tty，登入，打开一个 top 监视。可是每次到了需要的时候才去开，打开的效率自然不敢恭维。于是便想，每次开机的时候，记起来就跑到 tty 下面去先开起来。不过这件事情总归是麻烦的，于是才有了现在的方案。</p>
<p>既然 tty 那么多，那我们就把他利用一下吧~让他开机自动在某个 tty 里面启动 top 无疑最方便了~<br />
<span id="more-1126"></span><br />
首先呢，我找到了 Ubuntu 里面 tty 配置存放的地方 /etc/init/ttyX.conf，其中的 X 便是 tty 的编号，我这里选择了 tty6.conf。打开这个文件，结构简单极了，看到里面</p>

<div class="wp_codebox"><table><tr id="p112622"><td class="line_numbers"><pre>10
</pre></td><td class="code" id="p1126code22"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>getty <span style="color: #660033;">-8</span> <span style="color: #000000;">38400</span> tty6</pre></td></tr></table></div>

<p>就知道，肯定和 getty 有关系。man getty 里面查到可以通过 -l 参数设置登入程序替代 /bin/login。查了一下 man login，发现可以通过 -f username 的方式不进行验证地登入。</p>
<p>于是我就在 /bin 下面新建了一个 autologin 文件（其实理论上放哪里都可以，不过最好要用 root 权限创建，不然可以乱改就不好了），里面写上</p>

<div class="wp_codebox"><table><tr id="p112623"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1126code23"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">login</span> <span style="color: #660033;">-f</span> upsuper</pre></td></tr></table></div>

<p>给这个文件加上可执行属性，接着将 /etc/init/tty6.conf 里面刚才那一行改成</p>

<div class="wp_codebox"><table><tr id="p112624"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1126code24"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>getty <span style="color: #660033;">-8</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">'/bin/autologin'</span> <span style="color: #000000;">38400</span> tty6</pre></td></tr></table></div>

<p>重启。</p>
<p>进入 tty6 发现没有效果，还是提示用户名，无语……于是输入了用户名 upsuper，结果发现没有要求密码，直接进入了。我退出登入，再输入 root，发现依然没有要求密码而直接进入了 upsuper 权限。</p>
<p>再查查 man getty，发现那个请求用户名是 getty 输出的，里面提到了 -n 参数，可以消除对用户名的请求，以及 -i 参数，不输出请求前的文字（在我的 Ubuntu 里面就是“Ubuntu 9.10”）。于是上面那行被改成了</p>

<div class="wp_codebox"><table><tr id="p112625"><td class="line_numbers"><pre>10
</pre></td><td class="code" id="p1126code25"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>getty <span style="color: #660033;">-8in</span> <span style="color: #660033;">-l</span> <span style="color: #ff0000;">'/bin/autologin'</span> <span style="color: #000000;">38400</span> tty6</pre></td></tr></table></div>

<p>重新启动，发现已经可以自动进入。</p>
<p>不过我要的不是这个效果~</p>
<p>其实简单地说，我那个要实现也不难，按照现在的情况，就是在 ~/.bashrc 里面加上一行判断的事情了。不过我可不想这样。这样的话如果退出了 top 就会进入命令行。我的想法是，永远不让他进入命令行，这样看过去比较爽~</p>
<p>于是我就倒腾起了 login 程序的 FAKE_SHELL，如果在 autologin 脚本里改变环境变量，根本影响不了 login 程序，无论我改 FAKE_SHELL，还是 SHELL，都没有用，login 仍然义无反顾地进入了 bash……</p>
<p>最后我就想，唉，其实 autologin 脚本就是一正常脚本，只不过在登入的时候以 root 权限运行嘛，那我直接在里面运行 top 不久行了~考虑到权限因素，就是用 su 把权限改一下，不就解决问题了么？</p>
<p>于是最终版的 autologin 就出炉了：</p>

<div class="wp_codebox"><table><tr id="p112626"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p1126code26"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'/usr/bin/top'</span> upsuper</pre></td></tr></table></div>

<p>这个最后效果是什么样的呢？就是 top 以我的用户权限运行，然后点击 q 退出就会重新启动一个 top。这就是我要得效果了~很好很强大~算是合理的利用了一个 tty 了。现在只要点击 Ctrl-Alt-F6 就可以有现成的任务管理器了~</p>
<p>其实根据这个思路，tty 可以做的事情还很多。本来那个什么 -l 啦，-n 什么的，是拿来做自定义登入验证方式的，我觉得这个也大有文章可做~最后再感叹一下，Linux 实在太强大了~</p>
<p><strong>补充：</strong></p>
<p>这篇文章被我投递到了 LinuxTOY 上面，然后下面有人提到使用 htop 代替 top，我试了一下，貌似 htop 的资源占用要比 top 高出许多，因此我最后没有替换。</p>
<p>不过 htop 貌似确实好用很多，如果需要的话，只要安装 htop 后（Ubuntu 源里是有的），然后把 autologin 里面的</p>

<div class="wp_codebox"><table><tr id="p112627"><td class="line_numbers"><pre>2
</pre></td><td class="code" id="p1126code27"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'/usr/bin/top'</span> upsuper</pre></td></tr></table></div>

<p>改成</p>

<div class="wp_codebox"><table><tr id="p112628"><td class="line_numbers"><pre>2
</pre></td><td class="code" id="p1126code28"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'/usr/bin/htop'</span> upsuper</pre></td></tr></table></div>

<p>下面只要进入那个 tty 点 q 退出当前 top，马上就会自动替换为 htop 启动了~</p>
<p>还有就是，本来想写的，但写的时候忘记了。因为昨晚 G*W 非常莫名其妙的把 Google 大规模屏蔽了，于是网上查找相关资料极其不便，于是就使用了 Linux 自己的 man。这几本上也是我第一次完全依靠 man 来解决问题~Linux 的手册也还是很强悍的嘛~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/run-top-automatical-in-tty-after-boot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>升级grub2没写进mbr囧</title>
		<link>http://blog.upsuper.org/update-to-grub2-without-writing-into-mbr/</link>
		<comments>http://blog.upsuper.org/update-to-grub2-without-writing-into-mbr/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 14:35:31 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[mbr]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1124</guid>
		<description><![CDATA[昨天把 grub 升级成了 grub2，然后用原来的 grub 引导一次成功后，我就用 upgrade-from-grub-legacy 升级到了 grub2。当时貌似没有提示什么错误，不过今天启动的时候却不能启动。出现了 grub 提示错误。 囧了，这样看貌似 grub2 没被写进 MBR…… 然后拿出装有 SystemRescueCd 的急救U盘，然后我发现那里面有 grub2-install，非常高兴！不过运行了 grub2-install /dev/sda 后提示没有找到 /boot/grub 接着我把磁盘挂载到了 /mnt/root，用 chroot /mnt/root bash，进去以后用 grub-install 也没用……囧 最后我查了一下 grub2-install 的用法，最后运行 grub2-install &#8211;root-directory=/mnt/root /dev/sda 终于成功了！ 用 grub2 的启动画面还是挺不错的嘛~嗯嗯~]]></description>
			<content:encoded><![CDATA[<p>昨天把 grub 升级成了 grub2，然后用原来的 grub 引导一次成功后，我就用 upgrade-from-grub-legacy 升级到了 grub2。当时貌似没有提示什么错误，不过今天启动的时候却不能启动。出现了 grub 提示错误。</p>
<p>囧了，这样看貌似 grub2 没被写进 MBR……</p>
<p>然后拿出装有 SystemRescueCd 的急救U盘，然后我发现那里面有 grub2-install，非常高兴！不过运行了 grub2-install /dev/sda 后提示没有找到 /boot/grub</p>
<p>接着我把磁盘挂载到了 /mnt/root，用 chroot /mnt/root bash，进去以后用 grub-install 也没用……囧</p>
<p>最后我查了一下 grub2-install 的用法，最后运行 grub2-install &#8211;root-directory=/mnt/root /dev/sda 终于成功了！</p>
<p>用 grub2 的启动画面还是挺不错的嘛~嗯嗯~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/update-to-grub2-without-writing-into-mbr/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>从 Ubuntu 中移除 CNNIC 的证书</title>
		<link>http://blog.upsuper.org/remove-cnnic-cert-from-ubuntu/</link>
		<comments>http://blog.upsuper.org/remove-cnnic-cert-from-ubuntu/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:59:26 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[CNNIC]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[天朝]]></category>
		<category><![CDATA[安全]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=1007</guid>
		<description><![CDATA[有人想问为什么要移除 CNNIC 的证书吗？因为我不信任 CNNIC，就是这样。 网上流传的版本大多是关于 Windows 下的，偶然找到一个 Debian 的，正好抄过来。 首先，执行 1 sudo dpkg-reconfigure ca-certificates 第一个界面直接确定，然后找到 mozilla/Entrust.net_Secure_Server_CA.crt 一列取消它的选择，最后确定。如下图： &#160; 然后，如果你是用 Firefox，就要进入 编辑/首选项/高级/加密，点击“查看证书”，在证书机构里面找到 Entrust.net，将其子项全部删除（特别是 CNNIC 那一项！），接着可以试一下访问 ENUM 实验平台，如果不出意外，已经不能访问了。 如果你是是用 Opera，打开 工具/首选项/高级/安全性，点击“管理证书”，在“证书颁发机构”里选择 CNNIC ROOT，点击查看，去掉“允许连接到是用此证书的网络”前的钩，重启 Opera，如果不出意外 Opera 也不能访问上面那个地址了。 至于 Chromium，似乎本来就没有加，我直接访问是访问不了的。如果遇到可以访问的，可以参考 LinuxCertManagement &#8211; chromium 进行处理。 参考资料： Rex&#039;s blah blah blah &#187; 在 Linux 上移除 CNNIC 憑證 CNNIC，我不信任你！——从“受信任的根证书”里赶走CNNIC &#124; Felix&#039;s Blog]]></description>
			<content:encoded><![CDATA[<p>有人想问为什么要移除 CNNIC 的证书吗？因为我不信任 CNNIC，就是这样。</p>
<p>网上流传的版本大多是关于 Windows 下的，偶然找到一个 Debian 的，正好抄过来。</p>
<p>首先，执行</p>

<div class="wp_codebox"><table><tr id="p100730"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p1007code30"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> dpkg-reconfigure ca-certificates</pre></td></tr></table></div>

<p>第一个界面直接确定，然后找到 mozilla/Entrust.net_Secure_Server_CA.crt 一列取消它的选择，最后确定。如下图：</p>
<div style="text-align:center"><a href="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop-.png"><img src="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop--300x201.png" alt="" title="Screenshot-upsuper@upsuper-desktop: ~" width="300" height="201" class="alignnone size-medium wp-image-1008" /></a>&nbsp;<a href="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop-1.png"><img src="http://blog.upsuper.org/wp-content/uploads/2010/02/Screenshot-upsuper@upsuper-desktop-1-300x201.png" alt="" title="Screenshot-upsuper@upsuper-desktop: ~-1" width="300" height="201" class="alignnone size-medium wp-image-1009" /></a></div>
<p>然后，如果你是用 Firefox，就要进入 编辑/首选项/高级/加密，点击“查看证书”，在证书机构里面找到 Entrust.net，将其子项全部删除（特别是 CNNIC 那一项！），接着可以试一下访问 <a href="https://www.enum.cn/cn/">ENUM 实验平台</a>，如果不出意外，已经不能访问了。</p>
<p>如果你是是用 Opera，打开 工具/首选项/高级/安全性，点击“管理证书”，在“证书颁发机构”里选择 CNNIC ROOT，点击查看，去掉“允许连接到是用此证书的网络”前的钩，重启 Opera，如果不出意外 Opera 也不能访问上面那个地址了。</p>
<p>至于 Chromium，似乎本来就没有加，我直接访问是访问不了的。如果遇到可以访问的，可以参考 <a href="http://code.google.com/p/chromium/wiki/LinuxCertManagement">LinuxCertManagement &#8211; chromium</a> 进行处理。<br />
<span id="more-1007"></span><br />
参考资料：</p>
<ul>
<li><a href="http://people.debian.org.tw/~chihchun/2010/02/02/remove-cnnic-cert-on-linux/">Rex&#039;s blah blah blah &raquo; 在 Linux 上移除 CNNIC 憑證</a></li>
<li><a href="http://felixcat.net/2010/01/throw-out-cnnic/">CNNIC，我不信任你！——从“受信任的根证书”里赶走CNNIC | Felix&#039;s Blog</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/remove-cnnic-cert-from-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>跨编译器的 C 语言 NaN 支持 (纠正)</title>
		<link>http://blog.upsuper.org/nan-support-for-cross-compiler-of-c/</link>
		<comments>http://blog.upsuper.org/nan-support-for-cross-compiler-of-c/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 11:19:59 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[C/C++/C#]]></category>
		<category><![CDATA[VC]]></category>
		<category><![CDATA[兼容性]]></category>
		<category><![CDATA[宏]]></category>
		<category><![CDATA[微软]]></category>
		<category><![CDATA[标准化]]></category>
		<category><![CDATA[编译器]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=933</guid>
		<description><![CDATA[之前的版本犯了一个重大的错误！我错了……没有经过认真的实验就贴出来…… 正文开始前，先看一个式子： 1 x != x 大家觉得，这个东西的返回可能为 true 么？事实上是可能的，只要这个 x 是 NaN，并且这个 C 编译器符合 IEEE 754 的标准。 所谓 NaN，即 Not A Number，不是一个数。这是 IEEE 754 国际浮点数运算标准当中规定的一个特殊值，这个值由于不是一个数，所以有很多奇怪的特性，比如上面这个不等于其本身。 虽然有这么个东西，而且是国际标准，不过我们也知道，这世界上总有那么些公司是不喜欢理会国际标准的，邪恶的 M$ 就是其中之一。而 Visual C++ 6.0 的 C 编译器也就“有幸”成为了少有的不能完全兼容 IEEE 754 的编译器之一。 至此，我们发现一个问题：邪恶的 M$ 的东西中，总是最垃圾的流传的最广，IE6 如此，VC6 也是如此。另外，在此声明一下，这里讲的全部是 C，不是 C++，在 C++ 中另外有一些比较符合标准的方式同时被各个编译器兼容。 OK，回归正题，既然 VC6 的编译器是个渣，可我们有的时候还是不得不让自己的代码与之兼容，于是就有了各种解决办法。 首先明确一下，我们现在需要两样东西，一是一个可以用于赋值的 NaN (在我的程序中作为一个标记值使用)，另一个是一个用于判断一个数是否为 NaN 的函数或宏。基于上面对 NaN [...]]]></description>
			<content:encoded><![CDATA[<p><strong style="color: red;">之前的版本犯了一个重大的错误！我错了……没有经过认真的实验就贴出来……</strong></p>
<p>正文开始前，先看一个式子：</p>

<div class="wp_codebox"><table><tr id="p93338"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p933code38"><pre class="c" style="font-family:monospace;">x <span style="color: #339933;">!=</span> x</pre></td></tr></table></div>

<p>大家觉得，这个东西的返回可能为 true 么？事实上是可能的，只要这个 x 是 NaN，并且这个 C 编译器符合 IEEE 754 的标准。</p>
<p>所谓 NaN，即 Not A Number，不是一个数。这是 IEEE 754 国际浮点数运算标准当中规定的一个特殊值，这个值由于不是一个数，所以有很多奇怪的特性，比如上面这个不等于其本身。</p>
<p>虽然有这么个东西，而且是国际标准，不过我们也知道，这世界上总有那么些公司是不喜欢理会国际标准的，邪恶的 M$ 就是其中之一。而 Visual C++ 6.0 的 C 编译器也就“有幸”成为了少有的不能完全兼容 IEEE 754 的编译器之一。</p>
<p>至此，我们发现一个问题：邪恶的 M$ 的东西中，总是最垃圾的流传的最广，IE6 如此，VC6 也是如此。另外，在此声明一下，这里讲的全部是 C，不是 C++，在 C++ 中另外有一些比较符合标准的方式同时被各个编译器兼容。</p>
<p>OK，回归正题，既然 VC6 的编译器是个渣，可我们有的时候还是不得不让自己的代码与之兼容，于是就有了各种解决办法。<br />
<span id="more-933"></span><br />
首先明确一下，我们现在需要两样东西，一是一个可以用于赋值的 NaN (在我的程序中作为一个标记值使用)，另一个是一个用于判断一个数是否为 NaN 的函数或宏。基于上面对 NaN 的介绍，在一个符合标准的编译器上，我们可以很容易地给出如下宏：</p>

<div class="wp_codebox"><table><tr id="p93339"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p933code39"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define NaN (0.0 / 0.0)</span>
<span style="color: #339933;">#define IsNaN(x) ((x) != (x))</span></pre></td></tr></table></div>

<p>对于上面这样的 NaN 定义，VC6 不同寻常的会发生编译错误：</p>

<div class="wp_codebox"><table><tr id="p93340"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p933code40"><pre class="text" style="font-family:monospace;">error C2124: divide or mod by zero</pre></td></tr></table></div>

<p>可能也有人会问，难道除 0 不应该是错误么？事实上 IEEE 754 里面就是规定 0.0 / 0.0 = NaN。这里我给出一个我个人的理解：学过高等数学的人大约都会知道，一个无穷小除以一个无穷小，他们的极限可能是无穷大或任何实数，而由于浮点数的精度限制，这里的 0 可能不是真的 0，而是一个很小很小极其趋近于 0 的数，类似无穷小，于是有这样的规定吧。再来看看 IsNaN，这个宏就更无敌了，VC6 的编译器会自作聪明的直接把它优化为 false……</p>
<p>那么对于 VC6 我们该怎么办呢？</p>
<p>查阅了许多资料，最后我们在 MSDN 中翻出了一份年代久远的文档：<a href="http://msdn.microsoft.com/en-us/library/aa298428%28VS.60%29.aspx">_isnan</a>。这里的 _isnan 是 VC6 在 float.h 中定义的一个函数，用于校验一个数是否为 NaN。现在的问题就剩下，我们如何生成 NaN，以及如何判断编译器呢？</p>
<p>那么我们来思考一下，除了用零除零，还有什么方法可以生成 NaN 呢？翻看了 <a href="http://www.eecs.berkeley.edu/~wkahan/ieee754status/IEEE754.PDF">IEEE754 标准文档</a>，看到了开平方一个负数也应该是 NaN。这一点应该很好理解，开平方一个负数应该得到一个虚数，而虚数不是一个实数，所以也就 Not a Number 了~于是最后形成了下面一段预处理指令：</p>

<div class="wp_codebox"><table><tr id="p93341"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p933code41"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#ifdef _FPCLASS_SNAN</span>
<span style="color: #339933;">#include &lt;math.h&gt;</span>
<span style="color: #339933;">#define NaN sqrt(-1)</span>
<span style="color: #339933;">#define IsNaN(x) _isnan(x)</span>
<span style="color: #339933;">#else</span>
<span style="color: #339933;">#define NaN (0.0 / 0.0)</span>
<span style="color: #339933;">#define IsNaN(x) ((x) != (x))</span>
<span style="color: #339933;">#endif</span></pre></td></tr></table></div>

<p>虽然调用 sqrt 可能有效率问题，而且额外的需要引用 math 头文件，不过还算几乎完美地解决了 NaN 跨编译器的兼容性问题~事实证明，这段代码可以通过 VC6 的编译器正确地编译并执行。</p>
<p>另外说一点东西，就是如何在 Linux 下用 VC6 的编译器呢？这个问题我想我解决的其实是不完美的，不过也留在这里吧。</p>
<p>首先我下载了一个免安装版的 VC6，然后解压。接着找到了 VC6/VC98/Bin 目录，里面有非常著名的 VC6 编译器的主程序 CL.EXE 以及连接器 LINK.EXE。对于编译器这种纯运算的程序，wine 的兼容性还是比较优美的。不过需要一个额外的 dll 文件支持：mspdb60.dll，这个文件<a href="http://www.dll-files.com/dllindex/dll-files.shtml?mspdb60">很容易载到</a>，解压到 wine 的系统目录 (~/.wine/drive_c/windows/system32) 就可以了。</p>
<p>接下去就是如何编译了……我的方法比较老土，是将待编译的文件复制到编译器目录，然后执行类似下面命令：</p>

<div class="wp_codebox"><table><tr id="p93342"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p933code42"><pre class="bash" style="font-family:monospace;">wine CL.EXE 源文件.c <span style="color: #000000; font-weight: bold;">/</span>I..<span style="color: #000000; font-weight: bold;">/</span>Include <span style="color: #000000; font-weight: bold;">/</span>o可执行文件.exe <span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #000000; font-weight: bold;">/</span>LIBPATH:..<span style="color: #000000; font-weight: bold;">/</span>Lib</pre></td></tr></table></div>

<p>其中“源文件.c”和“可执行文件.exe”是很容易理解的，“/I../Include”是使编译器能知道 include 的文件应该去哪里找，而“/link”表示后面的部分是连接器参数，“/LIBPATH:../Lib”就是表示静态链接库的地址了~</p>
<p>最后再说说如何将 GCC 可以编译的程序移植到 VC6 中。GCC 实现了 C99 标准，但 VC6 因为出现在 1998 年 (怎么正好早一年……不过就算是 99 年出也未必会支持 C99 就是了……)，所以不支持 C99，于是所有的变量必须在函数最前面声明，不能混入代码内部。此外，在 VC6 当中，void 指针是不能进行运算的。还有就是不能用“//”开头的行注释，必须使用块注释。这是我移植过程中遇到的主要麻烦。</p>
<p>事实上，在 GCC 当中，可以验证大多数 C89 的限制，只要在编译的时候用如下语句：</p>

<div class="wp_codebox"><table><tr id="p93343"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p933code43"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gcc</span> <span style="color: #660033;">-ansi</span> <span style="color: #660033;">-pedantic</span> <span style="color: #660033;">-o</span> 可执行文件 源文件.c</pre></td></tr></table></div>

<p>只要把其中所有的 warning 全部消灭掉就可以啦~</p>
<p>当然，最好的方法莫过于在 VC6 的编译器中直接测试了……</p>
<p>最后最后，M$ 实在是……唉……这个世界上不明真相的孩子果然是占大多数的……</p>
<hr />
<p>关于修改的部分：之前的版本错误的使用 _FPCLASS_SNAN 这一校验函数 _fpclass 返回值当作 NaN 来使用。既然查到了这个，这里也顺便说一下这个东西吧。在 VC 的 float.h 库里面有 _fpclass 这个函数，用于检验一个浮点数的类型，可能的返回值都在 float.h 里面，如下：</p>

<div class="wp_codebox"><table><tr id="p93344"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p933code44"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define _FPCLASS_SNAN   0x0001  /* signaling NaN */</span>
<span style="color: #339933;">#define _FPCLASS_QNAN   0x0002  /* quiet NaN */</span>
<span style="color: #339933;">#define _FPCLASS_NINF   0x0004  /* negative infinity */</span>
<span style="color: #339933;">#define _FPCLASS_NN     0x0008  /* negative normal */</span>
<span style="color: #339933;">#define _FPCLASS_ND     0x0010  /* negative denormal */</span>
<span style="color: #339933;">#define _FPCLASS_NZ     0x0020  /* -0 */</span>
<span style="color: #339933;">#define _FPCLASS_PZ     0x0040  /* +0 */</span>
<span style="color: #339933;">#define _FPCLASS_PD     0x0080  /* positive denormal */</span>
<span style="color: #339933;">#define _FPCLASS_PN     0x0100  /* positive normal */</span>
<span style="color: #339933;">#define _FPCLASS_PINF   0x0200  /* positive infinity */</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/nan-support-for-cross-compiler-of-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>两小段 C 的宏</title>
		<link>http://blog.upsuper.org/two-pieces-of-macro-of-c/</link>
		<comments>http://blog.upsuper.org/two-pieces-of-macro-of-c/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 04:21:36 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[C/C++/C#]]></category>
		<category><![CDATA[宏]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=930</guid>
		<description><![CDATA[很久没写 blog 了……大学生活可比高中忙碌多了，哪个混蛋骗我说大学轻松来着……学的东西又难，作业又多，还有学生会活动……啊，我多想回到一中…… 最近忙着帮同学写大项目，用 C。话说，对于让没学过编程的人学 C 实在是一件很残酷的事情，即使我现在写仍然觉得很可怕……不过写着写着，觉得 C 实在是一个很神奇的语言，指针和宏是如此的优美~ 下面贴两个我在写那项目的时候用到的宏： 1 2 3 4 5 6 7 #define EXPAND_SPACE(type, p, num, max) { \ if ((num) + 1 &#62;= (max)) { \ if ((max) &#60; 16384) (max) &#60;&#60;= 1; \ else (max) += 512; \ (p) = (type*)realloc((void*)(p), (max)); \ } \ } 这个是我用来动态扩充空间用的宏，可以非常方便的动态增加需要的空间，这样就不需要为应该预分配多少空间烦恼了~ 1 [...]]]></description>
			<content:encoded><![CDATA[<p>很久没写 blog 了……大学生活可比高中忙碌多了，哪个混蛋骗我说大学轻松来着……学的东西又难，作业又多，还有学生会活动……啊，我多想回到一中……</p>
<p>最近忙着帮同学写大项目，用 C。话说，对于让没学过编程的人学 C 实在是一件很残酷的事情，即使我现在写仍然觉得很可怕……不过写着写着，觉得 C 实在是一个很神奇的语言，指针和宏是如此的优美~</p>
<p>下面贴两个我在写那项目的时候用到的宏：<br />
<span id="more-930"></span></p>

<div class="wp_codebox"><table><tr id="p93047"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p930code47"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define EXPAND_SPACE(type, p, num, max) { \
  if ((num) + 1 &gt;= (max)) { \
    if ((max) &lt; 16384) (max) &lt;&lt;= 1; \
    else (max) += 512; \
    (p) = (type*)realloc((void*)(p), (max)); \
  } \
}</span></pre></td></tr></table></div>

<p>这个是我用来动态扩充空间用的宏，可以非常方便的动态增加需要的空间，这样就不需要为应该预分配多少空间烦恼了~</p>

<div class="wp_codebox"><table><tr id="p93048"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code" id="p930code48"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#define SORT_RESULT(name, type, get, cmp, c1, c2) \
void SortResult_##name(int l, int r, Row **rows, int start) { \
  int i = l, j = r; \
  type m = get(rows[(i+j)/2], start); \
  Row *tmp; \
  \
  do { \
    while ((cmp)(m, get(rows[i], start)) c1 0) ++i; \
    while ((cmp)(m, get(rows[j], start)) c2 0) --j; \
    if (i &lt;= j) { \
      tmp = rows[i], rows[i] = rows[j], rows[j] = tmp; \
      ++i, --j; \
    } \
  } while (i &lt;= j); \
  \
  if (i &lt; r) SortResult_##name(i, r, rows, start); \
  if (l &lt; j) SortResult_##name(l, j, rows, start); \
}</span>
&nbsp;
<span style="color: #339933;">#define SORT_RESULT_CHAR(name, c1, c2) \
  SORT_RESULT(Char##name, char*, GET_CHARS, strcmp, c1, c2)</span>
&nbsp;
<span style="color: #339933;">#define SORT_RESULT_FLOAT(name, c1, c2) \
  SORT_RESULT(Float##name, float, GET_FLOAT, MyNumCmp, c1, c2)</span>
&nbsp;
SORT_RESULT_CHAR <span style="color: #009900;">&#40;</span> Asc<span style="color: #339933;">,</span> <span style="color: #339933;">&gt;,</span> <span style="color: #339933;">&lt;</span><span style="color: #009900;">&#41;</span>
SORT_RESULT_CHAR <span style="color: #009900;">&#40;</span>Desc<span style="color: #339933;">,</span> <span style="color: #339933;">&lt;,</span> <span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span>
SORT_RESULT_FLOAT<span style="color: #009900;">&#40;</span> Asc<span style="color: #339933;">,</span> <span style="color: #339933;">&gt;,</span> <span style="color: #339933;">&lt;</span><span style="color: #009900;">&#41;</span>
SORT_RESULT_FLOAT<span style="color: #009900;">&#40;</span>Desc<span style="color: #339933;">,</span> <span style="color: #339933;">&lt;,</span> <span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>这个很明显是快排~出于效率考虑，我不得不写4个排序……可是我觉得这样非常不好，代码重用性太低了，就写了个宏，就像上面那样~很偷懒吧~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/two-pieces-of-macro-of-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决 Ubuntu 下 TexLive 不能正确安装的问题</title>
		<link>http://blog.upsuper.org/solve-the-problem-that-texlive-cannot-be-installed-properly-in-ubuntu/</link>
		<comments>http://blog.upsuper.org/solve-the-problem-that-texlive-cannot-be-installed-properly-in-ubuntu/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 13:47:09 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=926</guid>
		<description><![CDATA[又想弄 LaTeX 了，OpenOffice.org 和 M$ Office 果然还是有点差距的，还不如用 LaTeX……不是据说还有一个“几乎可视化”的 LaTeX 编辑器？ 不过摆弄 LaTeX 果然还是不容易……真想不通，LaTeX 发展了这么长时间，为何不把这弄简单一点呢，就像 Linux 这样…… 不想下载和摆弄 TexLive 了，直接从 apt 里面安装，结果安装出现了下面错误提示： 1 2 3 4 5 6 7 updmap-sys failed. Output has been stored in /tmp/updmap.jh4rQYNc Please include this file if you report a bug. &#160; Sometimes, not accepting conffile updates in /etc/texmf/updmap.d causes updmap-sys [...]]]></description>
			<content:encoded><![CDATA[<p>又想弄 LaTeX 了，OpenOffice.org 和 M$ Office 果然还是有点差距的，还不如用 LaTeX……不是据说还有一个“几乎可视化”的 LaTeX 编辑器？</p>
<p>不过摆弄 LaTeX 果然还是不容易……真想不通，LaTeX 发展了这么长时间，为何不把这弄简单一点呢，就像 Linux 这样……<br />
<span id="more-926"></span><br />
不想下载和摆弄 TexLive 了，直接从 apt 里面安装，结果安装出现了下面错误提示：</p>

<div class="wp_codebox"><table><tr id="p92650"><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code" id="p926code50"><pre class="text" style="font-family:monospace;">updmap-sys failed. Output has been stored in
/tmp/updmap.jh4rQYNc
Please include this file if you report a bug.
&nbsp;
Sometimes, not accepting conffile updates in /etc/texmf/updmap.d
causes updmap-sys to fail.  Please check for files with extension
.dpkg-dist or .ucf-dist in this directory</pre></td></tr></table></div>

<p>因为是 tex-common 配置的时候出错，后面全部都不能正常安装，囧……</p>
<p>反复用 &#8211;purge 清除配置文件的方式卸载安装了好几遍，问题还是没有解决。最后我就干脆亲自排查 TexLive 的各个配置文件所在的文件夹。TexLive 似乎会用到 /usr/share/texmf、/usr/share/texmf-texlive、/var/lib/texmf 和 /etc/texmf 文件夹。开始我只知道前三个，然后发现 purge 以后就都没了，最后才知道还有个 /etc/texmf。删掉这个文件夹，再次重装，终于成功完成了！</p>
<p>我个人强烈希望能有一个简单一点的类似排版系统，LaTeX 实在太过复杂了……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solve-the-problem-that-texlive-cannot-be-installed-properly-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>解决 Xmarks 不能同步的问题</title>
		<link>http://blog.upsuper.org/fix-the-problem-that-xmarks-cannot-synchronize/</link>
		<comments>http://blog.upsuper.org/fix-the-problem-that-xmarks-cannot-synchronize/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 23:28:48 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Xmarks]]></category>
		<category><![CDATA[大墙]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=899</guid>
		<description><![CDATA[由于我的上网本和家里的台机分居两地，为了省去同步书签的麻烦，就用了那个很有名的插件 Xmarks。可前一段听说 Xmarks 也被墙了，于是点开了 Xmarks，发现果然，最后一次同步是10月18日的事。（由于我平日都是关闭状态栏的） 今天在网上找到一个方法，虽然说目前只是临时方案，不过或许可以撑很长一段时间，因为依我看来，目前的封禁程度已经达到了墙的目的了，而且也已经从单纯域名劫持和关键词过滤发展到对部分 IP 做了封禁处理了…… OK，这个方法还是利用 hosts 文件，看来墙对于任何网站的封禁初期，采用的都是域名劫持的手段。 在 /etc/hosts 最后加入： 1 2 3 4 5 6 7 8 #xmarks 64.147.188.86 www.xmarks.com 64.147.188.92 api.xmarks.com 64.147.188.89 login.xmarks.com 64.147.188.87 sync.xmarks.com 64.147.188.86 static.xmarks.com 64.147.188.86 download.xmarks.com 64.147.188.86 my.xmarks.com 经过实验，其实 64.147.188.86 那个加不加是无所谓的，一来 Xmarks 同步用不到那几个地址，二来那几个地址也已经被 IP 封锁了……最后一步是点开 Xmarks 的设置下的高级，在安全里面选择全部加密。（似乎 Xmarks 已经成了关键词？） 现在可以同步了，只是不能访问网站 _-b 无所谓了，能同步就好…… 参考：简单解决 XMarks 不能同步书签的问题 &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>由于我的上网本和家里的台机分居两地，为了省去同步书签的麻烦，就用了那个很有名的插件 Xmarks。可前一段听说 Xmarks 也被墙了，于是点开了 Xmarks，发现果然，最后一次同步是10月18日的事。（由于我平日都是关闭状态栏的）</p>
<p>今天在网上找到一个方法，虽然说目前只是临时方案，不过或许可以撑很长一段时间，因为依我看来，目前的封禁程度已经达到了墙的目的了，而且也已经从单纯域名劫持和关键词过滤发展到对部分 IP 做了封禁处理了……<br />
<span id="more-899"></span><br />
OK，这个方法还是利用 hosts 文件，看来墙对于任何网站的封禁初期，采用的都是域名劫持的手段。</p>
<p>在 /etc/hosts 最后加入：</p>

<div class="wp_codebox"><table><tr id="p89952"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p899code52"><pre class="text" style="font-family:monospace;">#xmarks
64.147.188.86 www.xmarks.com
64.147.188.92 api.xmarks.com
64.147.188.89 login.xmarks.com
64.147.188.87 sync.xmarks.com
64.147.188.86 static.xmarks.com
64.147.188.86 download.xmarks.com
64.147.188.86 my.xmarks.com</pre></td></tr></table></div>

<p>经过实验，其实 64.147.188.86 那个加不加是无所谓的，一来 Xmarks 同步用不到那几个地址，二来那几个地址也已经被 IP 封锁了……最后一步是点开 Xmarks 的设置下的高级，在安全里面选择全部加密。（似乎 Xmarks 已经成了关键词？）</p>
<p>现在可以同步了，只是不能访问网站 _-b 无所谓了，能同步就好……</p>
<p>参考：<a href="http://www.x-beta.cn/tips/fix-xmarks.html">简单解决 XMarks 不能同步书签的问题 | X-BetA 世纪资讯</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/fix-the-problem-that-xmarks-cannot-synchronize/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>修改代码高亮插件</title>
		<link>http://blog.upsuper.org/modify-code-highlight-plugin/</link>
		<comments>http://blog.upsuper.org/modify-code-highlight-plugin/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 13:55:24 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[博客]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=844</guid>
		<description><![CDATA[我一直在使用 wp-codebox 这个代码高亮插件。这个代码高亮插件似乎很久没有更新了，而且作者的网站也不能访问了（被墙了？），不知道是不是停止维护了？虽然在插件主页上显示这个插件仅支持到 2.5.1，我这个 2.8+ 的 WordPress 也并没有提示不兼容……虽然这个插件似乎对 SEO 有影响，而且可能停止维护，不过我暂时不打算更换插件，大不了我自己维护自己的版本…… 今天就修改了一下……因为昨天发的那文章很多用这个来显示高亮代码，而且最后一个长代码我还使用了自动收缩。可是自动收缩没效果！下载栏也没有显示。今天查一下，发现是插件的功能栏被我关了……启用以后觉得很难看，很厚，而且和我的蓝色主题很不搭调，于是就决定自己修改了。 先是改了 CSS，把那功能栏调好看了些。然后开始改 main.php，把后面失效的帮助链接给删掉了。然后我让代码小等于5行，又不提供文件下载的代码段自动隐藏功能栏，而对于大于70行的代码，如果没有显示声明展开则自动收缩。最后，觉得那个收缩很卡，就让他直接消失好了……查了下插件用的 jQuery，新版本改进了执行效率，而且没有改变插件里面用的那些函数的特性，就直接下下来更新了…… 这里把我修改后的插件也贴出来供大家参考吧：wp-codebox-upsuper.tar.lzma (577.8 KB) 顺便说一声，配的也是最新版的 GeSHi，虽然只更新了一个小小版本……]]></description>
			<content:encoded><![CDATA[<p>我一直在使用 <a href="http://wordpress.org/extend/plugins/wp-codebox/">wp-codebox</a> 这个代码高亮插件。这个代码高亮插件似乎很久没有更新了，而且作者的网站也不能访问了（被墙了？），不知道是不是停止维护了？虽然在插件主页上显示这个插件仅支持到 2.5.1，我这个 2.8+ 的 WordPress 也并没有提示不兼容……虽然这个插件似乎对 SEO 有影响，而且可能停止维护，不过我暂时不打算更换插件，大不了我自己维护自己的版本……</p>
<p>今天就修改了一下……因为<a href="http://blog.upsuper.org/optimize-leap-year-checking-and-other/">昨天发的那文章</a>很多用这个来显示高亮代码，而且最后一个长代码我还使用了自动收缩。可是自动收缩没效果！下载栏也没有显示。今天查一下，发现是插件的功能栏被我关了……启用以后觉得很难看，很厚，而且和我的蓝色主题很不搭调，于是就决定自己修改了。</p>
<p>先是改了 CSS，把那功能栏调好看了些。然后开始改 main.php，把后面失效的帮助链接给删掉了。然后我让代码小等于5行，又不提供文件下载的代码段自动隐藏功能栏，而对于大于70行的代码，如果没有显示声明展开则自动收缩。最后，觉得那个收缩很卡，就让他直接消失好了……查了下插件用的 jQuery，新版本改进了执行效率，而且没有改变插件里面用的那些函数的特性，就直接下下来更新了……</p>
<p>这里把我修改后的插件也贴出来供大家参考吧：<a href="http://down.upsuper.org/wp-codebox-upsuper.tar.lzma">wp-codebox-upsuper.tar.lzma</a> (577.8 KB)</p>
<p>顺便说一声，配的也是最新版的 GeSHi，虽然只更新了一个小小版本……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/modify-code-highlight-plugin/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>初探百度Hi直接打开IE的问题</title>
		<link>http://blog.upsuper.org/explore-baidu-hi-open-ie-directly/</link>
		<comments>http://blog.upsuper.org/explore-baidu-hi-open-ie-directly/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 02:43:38 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[eXeScope]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[百度Hi]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=817</guid>
		<description><![CDATA[据部分人称，百度Hi打开网页都是直接使用IE而非默认浏览器，当然我这里做不了实验……Javran 以为是因为他用的 Chrome 是百度竞争对手开发的而不支持，便托他在百度里面工作的朋友去问了下开发者，结果据说开发者说是直接调用 iexplore.exe 打开网页的 _-b 今天高中时候的贴吧上有一个人在试用了 Chrome 后称“现在终于发现IE有多么LJ了”，然后就提出了同样的问题。于是我就稍微研究了一下~ 拿 eXeScope 打开 BaiduHi.exe 文件（eXeScope 是可以完美 wine 出来的~），没有发现与 iexplore.exe 有关的字符串，有点失望。再看看目录里面如此多的 dll 文件，用 eXeScope 一个一个开过去，发现对于那里的 dll 文件 eXeScope 似乎只能看到版本信息……然后突然想到，我们可以直接去找文件中有没有 iexplore.exe 这个字符串~因为在 Linux 下，这一工作变得格外简单： 1 find -type f -print0 &#124; xargs -0 grep --binary-files=binary -l iexplore.exe 一条命令便足矣，对 Bash 稍有了解的人一定能完全理解这句话的含义~ 下面它输出了两个文件：ImEngine.dll 和 Basement.dll。用 IE 打开很可能就固化在这两个文件里面！用 MadEdit 打开这两个文件，果真发现了 iexplorer.exe。不过不敢乱改，改了也没法实验（印象中百度Hi不能被完美 [...]]]></description>
			<content:encoded><![CDATA[<p>据部分人称，百度Hi打开网页都是直接使用IE而非默认浏览器，当然我这里做不了实验……<a href="http://javran.wordpress.com.cn/">Javran</a> 以为是因为他用的 Chrome 是<a href="http://www.google.com">百度竞争对手</a>开发的而不支持，便托<a href="http://www.felix021.com/blog/">他在百度里面工作的朋友</a>去问了下开发者，结果据说开发者说是直接调用 iexplore.exe 打开网页的 _-b</p>
<p>今天高中时候的贴吧上<a href="http://tieba.baidu.com/f?kz=651151996">有一个人在试用了 Chrome 后称“现在终于发现IE有多么LJ了”</a>，然后就提出了同样的问题。于是我就稍微研究了一下~</p>
<p>拿 eXeScope 打开 BaiduHi.exe 文件（eXeScope 是可以完美 wine 出来的~），没有发现与 iexplore.exe 有关的字符串，有点失望。再看看目录里面如此多的 dll 文件，用 eXeScope 一个一个开过去，发现对于那里的 dll 文件 eXeScope 似乎只能看到版本信息……然后突然想到，我们可以直接去找文件中有没有 iexplore.exe 这个字符串~因为在 Linux 下，这一工作变得格外简单：</p>

<div class="wp_codebox"><table><tr id="p81754"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p817code54"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-type</span> f <span style="color: #660033;">-print0</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-0</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">--binary-files</span>=binary <span style="color: #660033;">-l</span> iexplore.exe</pre></td></tr></table></div>

<p>一条命令便足矣，对 Bash 稍有了解的人一定能完全理解这句话的含义~</p>
<p>下面它输出了两个文件：ImEngine.dll 和 Basement.dll。用 IE 打开很可能就固化在这两个文件里面！用 MadEdit 打开这两个文件，果真发现了 iexplorer.exe。不过不敢乱改，改了也没法实验（印象中百度Hi不能被完美 wine 出来），于是接下去的实验就作罢了。</p>
<p>可是又有人报告百度Hi可以调用疼逊TT打开，我就真不知道是怎么回事了 _-b</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/explore-baidu-hi-open-ie-directly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux 没有不能运行的脚本</title>
		<link>http://blog.upsuper.org/there-is-no-script-that-cannot-run-on-linux/</link>
		<comments>http://blog.upsuper.org/there-is-no-script-that-cannot-run-on-linux/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 14:21:20 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=670</guid>
		<description><![CDATA[很早以前，我就知道，在 Windows 里面我们可以直接运行非二进制文件的 bat/cmd 命令行文件，还有那个 vbs 脚本文件。 到了 Linux，我发现，在这里，每一样都比 Windows 里面先进……虽然不能运行 vbs 或 bat/cmd，但这里有 bash、python、perl、ruby…… 好吧，我承认还是有脚本不行的，但 Linux 下即使 bash 都比 vbs 强大…… 后来知道了 php 也可以……php-cli 模式可以在 Linux 下直接执行 php 脚本。 今天又知道了……原来 JavaScript 脚本也可以直接执行。先是把一个 JavaScript 脚本设置为可执行，但是没法运行。然后到 bash 中找什么命令能执行 JavaScript……我试了一下 javascript 命令，没有，又试了下 js，bash 提示我，在 spidermonkey-bin 包中包含这个命令。联想到刚刚看过一个资料说到 Spidermonkey 是 Firefox 的脚本解析器，我就用 apt 安装了个（今天新加的网易源实在太快了！） 随后，修改了一下脚本，大约是这个样子的： 1 2 #!/usr/bin/js print&#40;&#34;Hello [...]]]></description>
			<content:encoded><![CDATA[<p>很早以前，我就知道，在 Windows 里面我们可以直接运行非二进制文件的 bat/cmd 命令行文件，还有那个 vbs 脚本文件。</p>
<p>到了 Linux，我发现，在这里，每一样都比 Windows 里面先进……虽然不能运行 vbs 或 bat/cmd，但这里有 bash、python、perl、ruby……<br />
好吧，我承认还是有脚本不行的，但 Linux 下即使 bash 都比 vbs 强大……</p>
<p>后来知道了 php 也可以……php-cli 模式可以在 Linux 下直接执行 php 脚本。</p>
<p>今天又知道了……原来 JavaScript 脚本也可以直接执行。先是把一个 JavaScript 脚本设置为可执行，但是没法运行。然后到 bash 中找什么命令能执行 JavaScript……我试了一下 javascript 命令，没有，又试了下 js，bash 提示我，在 spidermonkey-bin 包中包含这个命令。联想到刚刚看过<a href="http://tech.sina.com.cn/s/2008-07-21/1734740604.shtml">一个资料</a>说到 Spidermonkey 是 Firefox 的脚本解析器，我就用 apt 安装了个（今天新加的网易源实在太快了！）</p>
<p>随后，修改了一下脚本，大约是这个样子的：</p>

<div class="wp_codebox"><table><tr id="p67056"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p670code56"><pre class="javascript" style="font-family:monospace;">#<span style="color: #339933;">!/</span>usr<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>js
<span style="color: #000066;">print</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello world!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>执行，在 bash 中输出了 Hello world! 太高兴了！</p>
<p>Linux 下真是没有不能执行的脚本，Windows 永远也比不上……<br />
我就不理解了，这么先进的 Linux 怎么就没什么人用呢？多少功能比 Windows 方便……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/there-is-no-script-that-cannot-run-on-linux/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>惊叹 isset 执行速度之快！</title>
		<link>http://blog.upsuper.org/amazing-speed-of-isset/</link>
		<comments>http://blog.upsuper.org/amazing-speed-of-isset/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 08:57:14 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=664</guid>
		<description><![CDATA[今天无聊做了个小小的测试，结果却出乎我的意料。我对比了 isset 函数和比较运算符的速度，结果竟是 isset 比较快！ 下面是测试代码： 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 header&#40;&#34;Content-Type: text/plain&#34;&#41;; $tests = array&#40;'[size=1]', '[table=1px,solid,black]', '[/table]', '[/a=testit]'&#41;; &#160; for &#40;$i = 0; $i &#60; 10; ++$i&#41; &#123; $st = microtime&#40;true&#41;; for &#40;$j = 0; $j [...]]]></description>
			<content:encoded><![CDATA[<p>今天无聊做了个小小的测试，结果却出乎我的意料。我对比了 isset 函数和比较运算符的速度，结果竟是 isset 比较快！<br />
<span id="more-664"></span><br />
下面是测试代码：</p>

<div class="wp_codebox"><table><tr id="p66460"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p664code60"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-Type: text/plain&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$tests</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'[size=1]'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[table=1px,solid,black]'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[/table]'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'[/a=testit]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$st</span> <span style="color: #339933;">=</span> <span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tests</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$test</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/^\[(?&lt;c&gt;\/)?[A-Za-z]\w*(?(c):(?!)|=[^\]]*)?\]$/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$test</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'='</span><span style="color: #339933;">,</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$test</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$et</span> <span style="color: #339933;">=</span> <span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%.6F</span><span style="color: #000099; font-weight: bold;">\t</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$et</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$st</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$st</span> <span style="color: #339933;">=</span> <span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$j</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$j</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span> <span style="color: #339933;">++</span><span style="color: #000088;">$j</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$tests</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$test</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/^\[(?&lt;c&gt;\/)?([A-Za-z]\w*)(?(c):(?!)|=([^\]]*))?\]$/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$test</span><span style="color: #339933;">,</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$et</span> <span style="color: #339933;">=</span> <span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%.6F</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$et</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$st</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>下面选取了在我机子上和在我的网页服务器上测试的数据，这两台机的操作系统都是 Ubuntu，PHP 都为 5.2.6。我在学校服务器上测试结果与这里有较大出入，疑是 PHP 版本不同的缘故。</p>
<p>下面数据每个前15行为单独跑的数据，后面三行分别为最慢、最快和去掉最大最小值的平均值。</p>
<p>三列分别表示 isset、与变量比大小，与数值比大小。</p>
<p>下面是在我机子上跑的数据：</p>

<div class="wp_codebox"><table><tr id="p66461"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p664code61"><pre class="text" style="font-family:monospace;">0.001914	0.003213	0.003172
0.001762	0.002843	0.003285
0.001810	0.002995	0.003005
0.001736	0.002813	0.002978
0.001803	0.002903	0.003003
0.001814	0.002854	0.003005
0.001822	0.002850	0.003025
0.001809	0.002843	0.003014
0.001806	0.002834	0.003009
0.001790	0.002822	0.003000
0.001764	0.002838	0.002999
0.001766	0.003941	0.003149
0.001785	0.002831	0.003017
0.001794	0.002822	0.003011
0.001769	0.002854	0.003014
&nbsp;
0.001914	0.003941	0.003285
0.001736	0.002813	0.002978
0.001792	0.002885	0.003033</pre></td></tr></table></div>

<p>这个是在我的服务器上跑的数据：</p>

<div class="wp_codebox"><table><tr id="p66462"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p664code62"><pre class="text" style="font-family:monospace;">0.001070	0.001156	0.001107
0.001063	0.001157	0.001108
0.001061	0.001155	0.001127
0.001063	0.001156	0.001106
0.001060	0.001155	0.001105
0.001059	0.001142	0.001145
0.001042	0.001141	0.001111
0.001119	0.001146	0.001133
0.001041	0.001142	0.001104
0.001040	0.001146	0.001153
0.001114	0.001152	0.001105
0.001056	0.001248	0.001111
0.001046	0.001148	0.001111
0.001079	0.001153	0.001103
0.001057	0.001160	0.001112
&nbsp;
0.001119	0.001248	0.001153
0.001040	0.001141	0.001103
0.001062	0.001151	0.001114</pre></td></tr></table></div>

<p>（可以看出我的机子还是比不过那服务器的……不知道配置问题还是 Ubuntu Desktop 和 Server 的差别……）</p>
<p>同时我发现，在我的机上，与数值比大小比与变量比大小还慢，但在服务器上没有出现这种情况（本来就不该……）</p>
<p>神奇的测试结果……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/amazing-speed-of-isset/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL随机的小技巧</title>
		<link>http://blog.upsuper.org/sql-random-order-tip/</link>
		<comments>http://blog.upsuper.org/sql-random-order-tip/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 02:48:08 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[随机]]></category>
		<category><![CDATA[音乐]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=637</guid>
		<description><![CDATA[很早以前就知道，SQL 如果要随机取可以用 ORDER BY rand() 来做（那是在做学校论坛的标题名人名言的时候查到的），这次做的学校征集各时段音乐的平台，为了去掉先提交者在显示位置上的绝对优势，我今天也给他加了个随机。第一次知道，随机排列也可以放第二关键字~ SQL查询语句由昨天的 1 SELECT * FROM `school_music` ORDER BY `type` 变成了 1 SELECT * FROM `school_music` ORDER BY `type`, rand&#40;&#41; 果然在类别内随机成功！ 顺便，这里号召大家支持一下我传的 だんご大家族 ~off vocal ver.~ 做晚自习后的那音乐~要听完，很有感觉地说~ 无损版下载： 完整版：http://www.rayfile.com/zh-cn/files/2aa66517-e538-11dd- 9288-0014221b798a/ 去人声：http://www.rayfile.com/zh-cn/files/2ab65c7a-e538-11dd-bd6a- 0014221b798a/]]></description>
			<content:encoded><![CDATA[<p>很早以前就知道，SQL 如果要随机取可以用 ORDER BY rand() 来做（那是在做学校论坛的标题名人名言的时候查到的），这次做的学校征集各时段音乐的平台，为了去掉先提交者在显示位置上的绝对优势，我今天也给他加了个随机。第一次知道，随机排列也可以放第二关键字~</p>
<p>SQL查询语句由昨天的</p>

<div class="wp_codebox"><table><tr id="p63765"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p637code65"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`school_music`</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">`type`</span></pre></td></tr></table></div>

<p>变成了</p>

<div class="wp_codebox"><table><tr id="p63766"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p637code66"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`school_music`</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #ff0000;">`type`</span><span style="color: #66cc66;">,</span> rand<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></pre></td></tr></table></div>

<p>果然在类别内随机成功！</p>
<p>顺便，这里号召大家支持一下我传的 だんご大家族 ~off vocal ver.~ 做晚自习后的那音乐~要听完，很有感觉地说~</p>
<p>无损版下载：<br />
完整版：<a href="http://www.rayfile.com/zh-cn/files/2aa66517-e538-11dd- 9288-0014221b798a/" target="_blank">http://www.rayfile.com/zh-cn/files/2aa66517-e538-11dd- 9288-0014221b798a/</a><br />
去人声：<a href="http://www.rayfile.com/zh-cn/files/2aa66517-e538-11dd- 9288-0014221b798a/" target="_blank">http://www.rayfile.com/zh-cn/files/2ab65c7a-e538-11dd-bd6a- 0014221b798a/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/sql-random-order-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决 MPlayer 的无法播放</title>
		<link>http://blog.upsuper.org/solution-to-the-mplayer-unable-to-play/</link>
		<comments>http://blog.upsuper.org/solution-to-the-mplayer-unable-to-play/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 11:33:39 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[动画]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=632</guid>
		<description><![CDATA[今天又是一个 rmvb 在 SMPlayer 不能播放，让我很无奈……因为实在无法忍受 RealPlayer 的画质和可操作性，就去寻找解决办法…… 用 MPlayer 打开后，提示“error opening/initializing the selected video_out (-vo) device”，然后在 Ubuntu 论坛上发现一个帖子，根据二楼的说明，将 ~/.mplayer/gui.conf 文件中的 vo_driver 修改为 x11： 2 vo_driver = &#34;x11&#34; 再开就成功了！然后在播 CLANNAD 的第 8 集，也可以了！ RealPlayer，你可以走了~o(∩_∩)o&#8230;哈哈]]></description>
			<content:encoded><![CDATA[<p>今天又是一个 rmvb 在 SMPlayer 不能播放，让我很无奈……因为实在无法忍受 RealPlayer 的画质和可操作性，就去寻找解决办法……</p>
<p>用 MPlayer 打开后，提示“error opening/initializing the selected video_out (-vo) device”，然后在 Ubuntu 论坛上发现一个<a href="http://ubuntuforums.org/showthread.php?t=20039" target="_blank">帖子</a>，根据二楼的说明，将 ~/.mplayer/gui.conf 文件中的 vo_driver 修改为 x11：</p>

<div class="wp_codebox"><table><tr id="p63268"><td class="line_numbers"><pre>2
</pre></td><td class="code" id="p632code68"><pre class="text" style="font-family:monospace;">vo_driver = &quot;x11&quot;</pre></td></tr></table></div>

<p>再开就成功了！然后在播 CLANNAD 的第 8 集，也可以了！</p>
<p>RealPlayer，你可以走了~o(∩_∩)o&#8230;哈哈</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solution-to-the-mplayer-unable-to-play/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 也调 CPU 频率</title>
		<link>http://blog.upsuper.org/ubuntu-also-tune-the-frequency-of-cpu/</link>
		<comments>http://blog.upsuper.org/ubuntu-also-tune-the-frequency-of-cpu/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 08:47:38 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[节能]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=625</guid>
		<description><![CDATA[其实问题是源自想解决 Wine 出的 eMule 及其 Mod 一旦一段时间不使用电脑，速度迅速下降的问题。虽然最终这个问题没解决……不过却弄出了另外一件事情，就是自动调节 CPU 频率。 Ubuntu 下自带了一个叫 powernowd 的东西，可以自动调节 CPU 频率到需要的水平，不过看起来本来我的系统并不知道如何调我的 CPU。我是 Intel Pentium D 的处理器，在网上查到使用powernowd为CPU降降温！这样一篇文章，但它列出的模块列表中并没有 PD CPU 的模块类型……我就直接载了 P4 的…… 首先 1 sudo modprobe p4-clockmod 随后执行 1 sudo powernowd 提示我有两个 CPU 可以变频 1 2 3 4 powernowd: PowerNow Daemon v1.00, (c) 2003-2008 John Clemens powernowd: Found 2 scalable units: -- [...]]]></description>
			<content:encoded><![CDATA[<p>其实问题是源自想解决 Wine 出的 eMule 及其 Mod 一旦一段时间不使用电脑，速度迅速下降的问题。虽然最终这个问题没解决……不过却弄出了另外一件事情，就是自动调节 CPU 频率。</p>
<p>Ubuntu 下自带了一个叫 powernowd 的东西，可以自动调节 CPU 频率到需要的水平，不过看起来本来我的系统并不知道如何调我的 CPU。我是 Intel Pentium D 的处理器，在网上查到<a href="http://hi.baidu.com/pro711/blog/item/aa96c83530db161491ef3965.html" target="_blank">使用powernowd为CPU降降温！</a>这样一篇文章，但它列出的模块列表中并没有 PD CPU 的模块类型……我就直接载了 P4 的……<br />
<span id="more-625"></span><br />
首先</p>

<div class="wp_codebox"><table><tr id="p62573"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p625code73"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> modprobe p4-clockmod</pre></td></tr></table></div>

<p>随后执行</p>

<div class="wp_codebox"><table><tr id="p62574"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p625code74"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> powernowd</pre></td></tr></table></div>

<p>提示我有两个 CPU 可以变频</p>

<div class="wp_codebox"><table><tr id="p62575"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p625code75"><pre class="text" style="font-family:monospace;">powernowd: PowerNow Daemon v1.00, (c) 2003-2008 John Clemens
powernowd: Found 2 scalable units:  -- 1 'CPU' per scalable unit
powernowd:   cpu0: 333Mhz - 2666Mhz (8 steps)
powernowd:   cpu1: 333Mhz - 2666Mhz (8 steps)</pre></td></tr></table></div>

<p>在面板上添加了 CPU 频率监视，发现频率不断变化，说明 powernowd 启动成功了！</p>
<p>接着，在 /etc/modules 文件最后一行加入</p>

<div class="wp_codebox"><table><tr id="p62576"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p625code76"><pre class="text" style="font-family:monospace;">p4-clockmod</pre></td></tr></table></div>

<p>就可以开机自动调节了~</p>
<p>一起动自动调节，瞬间风扇的声音小了下来~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/ubuntu-also-tune-the-frequency-of-cpu/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>令人失望的 RealPlayer 11 for Linux</title>
		<link>http://blog.upsuper.org/disappointing-realplayer-11-for-linux/</link>
		<comments>http://blog.upsuper.org/disappointing-realplayer-11-for-linux/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 03:02:37 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[视频]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=616</guid>
		<description><![CDATA[今天看澄空字幕组 CLANNAD ~After Story~ 第8集的 rmvb 文件出现了些奇特的情况，就是 SMPlayer 不能播放……原因暂未查明。 不过也因此尝试了一下 RealPlayer 这个播放 rmvb 的始祖，但它实在是令人失望。 安装上，Ubuntu 的源并没有这个软件，可能是应为不开源被开源社区排斥了，不过在 Real 的官方网站还是可以很容易地载到 DEB、RPM 或者 BIN 的安装包。速度很快，安装也很方便，在 Ubuntu 下 DEB 的安装大都是全自动化的。不过 RealPlayer 的依赖软件中，似乎有一个不是自动的，需要选择一次，安装的时候可以稍微注意一下。 虽然下载界面是全英文的，不过安装完成后却看到了熟悉的中文界面，还是很高兴的。不过下面就再也高兴不起来了。 播放 rmvb 如果按照原比例看还好，一旦放到全屏，锯齿十分明显，似乎 RealPlayer for Linux 没有对锯齿做任何处理，画质完全比不上 SMPlayer（经测试，这并非片源导致）。同时，在动作较大的部分，RealPlayer 还会出现延迟等现象……似乎 CPU 占用率很高的样子。这只是播放的问题，下面来说操作问题。我把鼠标放到屏幕最下端，竟然没有出现控制条！快捷键不习惯就算了，就连这种最基本的东西都没有……快进后退都要退出全屏才能做…… 没有 Windows 下 RealOne 的华丽界面我也就忍了，但是作为流媒体的老大之一，自己的播放器画质这样，操作性这样，我还能说什么呢？ 当然，还有一点值得肯定，就是还能出 for Linux 版……不像国内某些大公司，光顾着自己开 C2C 赚钱，推出个 IM 都不考虑咱 Linux 用户的……]]></description>
			<content:encoded><![CDATA[<p>今天看澄空字幕组 CLANNAD ~After Story~ 第8集的 rmvb 文件出现了些奇特的情况，就是 SMPlayer 不能播放……原因暂未查明。</p>
<p>不过也因此尝试了一下 RealPlayer 这个播放 rmvb 的始祖，但它实在是令人失望。<br />
<span id="more-616"></span><br />
安装上，Ubuntu 的源并没有这个软件，可能是应为不开源被开源社区排斥了，不过在 Real 的<a href="http://www.real.com/linux" target="_blank">官方网站</a>还是可以很容易地载到 DEB、RPM 或者 BIN 的安装包。速度很快，安装也很方便，在 Ubuntu 下 DEB 的安装大都是全自动化的。不过 RealPlayer 的依赖软件中，似乎有一个不是自动的，需要选择一次，安装的时候可以稍微注意一下。</p>
<p><a href="http://blog.upsuper.org/wp-content/uploads/2008/11/screenshot-realplayer.png"><img src="http://blog.upsuper.org/wp-content/uploads/2008/11/screenshot-realplayer-300x275.png" alt="" title="screenshot-realplayer" width="300" height="275" class="alignright size-medium wp-image-617" /></a>虽然下载界面是全英文的，不过安装完成后却看到了熟悉的中文界面，还是很高兴的。不过下面就再也高兴不起来了。</p>
<p>播放 rmvb 如果按照原比例看还好，一旦放到全屏，锯齿十分明显，似乎 RealPlayer for Linux 没有对锯齿做任何处理，画质完全比不上 SMPlayer（经测试，这并非片源导致）。同时，在动作较大的部分，RealPlayer 还会出现延迟等现象……似乎 CPU 占用率很高的样子。这只是播放的问题，下面来说操作问题。我把鼠标放到屏幕最下端，竟然没有出现控制条！快捷键不习惯就算了，就连这种最基本的东西都没有……快进后退都要退出全屏才能做……</p>
<p>没有 Windows 下 RealOne 的华丽界面我也就忍了，但是作为流媒体的老大之一，自己的播放器画质这样，操作性这样，我还能说什么呢？</p>
<p>当然，还有一点值得肯定，就是还能出 for Linux 版……不像国内某些大公司，光顾着自己开 C2C 赚钱，推出个 IM 都不考虑咱 Linux 用户的……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/disappointing-realplayer-11-for-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>修改 ASCIIMathML.js 适应 Discuz! 6.0</title>
		<link>http://blog.upsuper.org/edit-asciimathml-js-for-discuz-6/</link>
		<comments>http://blog.upsuper.org/edit-asciimathml-js-for-discuz-6/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 03:17:00 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Discuz!]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MathML]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=590</guid>
		<description><![CDATA[前几天，一位大牛 (Mathself) 提议给论坛安装上一个数学插件，并且告诉我参看奥数之家论坛。我经过研究发现，就是一个叫做 ASCIIMathML.js 的文件在起作用，这个文件将类 LaTeX 的公式转换为 MathML。Firefox 提供原声的 MathML 支持，而 IE8 以下的版本需要 MathPlayer 插件支持，Opera 自 9.5 起提供原生的 MathML 支持。 经过研究，首先发现，ASCIIMathML.js 默认不提供 Opera 的支持，对 ASCIIMathML.js先做了点小修改： 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 function AMisMathMLavailable&#40;&#41; &#123; if &#40;navigator.appName.slice&#40;0,8&#41;==&#34;Netscape&#34;&#41; if &#40;navigator.appVersion.slice&#40;0,1&#41;&#62;=&#34;5&#34;&#41; return null; else return AMnoMathMLNote&#40;&#41;; else if &#40;window.opera&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>前几天，一位大牛 (Mathself) 提议给论坛安装上一个数学插件，并且告诉我参看<a href="http://www.aoshoo.com/bbs1/index.asp" target="_blank">奥数之家论坛</a>。我经过研究发现，就是一个叫做 ASCIIMathML.js 的文件在起作用，这个文件将类 LaTeX 的公式转换为 MathML。Firefox 提供原声的 MathML 支持，而 IE8 以下的版本需要 MathPlayer 插件支持，Opera 自 9.5 起提供原生的 MathML 支持。<br />
<span id="more-590"></span><br />
经过研究，首先发现，ASCIIMathML.js 默认不提供 Opera 的支持，对 ASCIIMathML.js先做了点小修改：</p>

<div class="wp_codebox"><table><tr id="p59080"><td class="line_numbers"><pre>75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
</pre></td><td class="code" id="p590code80"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> AMisMathMLavailable<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appName</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">8</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;Netscape&quot;</span><span style="color: #009900;">&#41;</span> 
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appVersion</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;=</span><span style="color: #3366CC;">&quot;5&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">return</span> AMnoMathMLNote<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">opera</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>navigator.<span style="color: #660066;">appName</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #CC0000;">9</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">==</span><span style="color: #3366CC;">&quot;Microsoft&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">var</span> ActiveX <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ActiveXObject<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;MathPlayer.Factory.1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">return</span> AMnoMathMLNote<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">return</span> AMnoMathMLNote<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>不过话说 Opera 对 MathML 的支持实在有限……感觉看起来很囧的说……</p>
<p>把这个弄到服务器以后，我就钻空子注册了一个带公式的用户名。结果 Doggy 瞬间出台规定禁止……我说还不如从代码上禁用……又经过一番研究，发觉只要改 ASCIIMathML.js 的代码就可以了，下面是研究成果：首先是修改 onLoad 直接调用的 generic：</p>

<div class="wp_codebox"><table><tr id="p59081"><td class="line_numbers"><pre>903
904
905
906
</pre></td><td class="code" id="p590code81"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> generic<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  translate<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>那个 true 表示仅转换需要的地方。</p>
<p>然后是修改处理的地方：</p>

<div class="wp_codebox"><table><tr id="p59082"><td class="line_numbers"><pre>861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
</pre></td><td class="code" id="p590code82"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> AMprocessNode<span style="color: #009900;">&#40;</span>n<span style="color: #339933;">,</span> linebreaks<span style="color: #339933;">,</span> spanclassAM<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> frag<span style="color: #339933;">,</span>st<span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>spanclassAM<span style="color: #339933;">!=</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    frag <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>frag.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
      <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>frag<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;t_msgfont&quot;</span><span style="color: #009900;">&#41;</span>
        AMprocessNodeR<span style="color: #009900;">&#40;</span>frag<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>linebreaks<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000066; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
      st <span style="color: #339933;">=</span> n.<span style="color: #660066;">innerHTML</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span>
    <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>st<span style="color: #339933;">==</span><span style="color: #003366; font-weight: bold;">null</span> <span style="color: #339933;">||</span> 
        st.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>AMdelimiter1<span style="color: #009900;">&#41;</span><span style="color: #339933;">!=-</span><span style="color: #CC0000;">1</span> <span style="color: #339933;">||</span> st.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>AMdelimiter2<span style="color: #009900;">&#41;</span><span style="color: #339933;">!=-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> 
      AMprocessNodeR<span style="color: #009900;">&#40;</span>n<span style="color: #339933;">,</span>linebreaks<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>isIE<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">//needed to match size and font of formula to surrounding text</span>
    frag <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'math'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>frag.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> frag<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">update</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>为什么这样改呢……因为在 Discuz! 里面帖子内容都是在 div 标签里……而且这些标签有一个共同特征，那就是有 t_msgfont 这个 class！于是这样改完，就可以仅仅在帖子内容中使用 MathML 了！</p>
<p>我是根据很早以前的 1.4.7 版本改的……虽然据说有很新的版本……2.x 什么的……不想管了……<br />
如果不想自己改的话，直接从这里下载改好的文件：<a href="http://www.fzyz.cn/forum/include/javascript/ASCIIMathML.js">ASCIIMathML.js</a>。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/edit-asciimathml-js-for-discuz-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu 下 Stellarium 星空之旅</title>
		<link>http://blog.upsuper.org/stellarium-star-tour-under-ubuntu/</link>
		<comments>http://blog.upsuper.org/stellarium-star-tour-under-ubuntu/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 05:13:00 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Compiz]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[开源软件]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=581</guid>
		<description><![CDATA[昨天安装了一个叫做 Stellarium 的 3D 星空模拟软件，相当不错，据说数据什么的都是根据天文台观测的真实数据，可以用来学习天文知识什么的……下次晚上拿他来对天上的星星~ 安装还是比较简单的（开始我还跑到它官方网站去下源代码……结果发现 apt 可以安装……白下了……），直接用 apt-get： 1 sudo apt-get install stellarium 包有一点大……不过昨晚用 cn99 的源还是很快就下好了。 安装完有两个小小的问题，首先是文字的问题。因为自动识别为中文却不能显示……所有的中文都是框框……在红联上看到一篇文章介绍 Stellarium，并附了如何解决中文不能显示的问题。我就是用这篇文章的方法解决的，虽然它推荐用宋体，不过我更喜欢文泉驿正黑…… 1 2 3 4 5 cd /usr/share/stellarium/data sudo mv DejaVuSans.ttf DejaVuSans.ttf_backup sudo mv DejaVuSansMono.ttf DejaVuSansMono.ttf_backup sudo ln -sf /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf DejaVuSans.ttf sudo ln -sf /usr/share/fonts/truetype/wqy/wqy-zenhei.ttf DejaVuSansMono.ttf 打开 Stellarium，中文正常。 话说另外一种方法给大家参考一下，就是 Stellarium 官方 Wiki 上的如何在Stellarium中正确显示中文，我就不试了……前面那方法用得很好…… 另一个问题就是开起来就不断闪烁的问题。我一下就猜到是 Compiz 的问题……禁用了 Compiz [...]]]></description>
			<content:encoded><![CDATA[<p>昨天安装了一个叫做 Stellarium 的 3D 星空模拟软件，相当不错，据说数据什么的都是根据天文台观测的真实数据，可以用来学习天文知识什么的……下次晚上拿他来对天上的星星~</p>
<p>安装还是比较简单的（开始我还跑到它<a href="http://www.stellarium.org/zh/" target="_blank">官方网站</a>去下源代码……结果发现 apt 可以安装……白下了……），直接用 apt-get：</p>

<div class="wp_codebox"><table><tr id="p58187"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p581code87"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> stellarium</pre></td></tr></table></div>

<p>包有一点大……不过昨晚用 <a href="http://ubuntu.cn99.com" target="_blank">cn99</a> 的源还是很快就下好了。</p>
<p>安装完有两个小小的问题，首先是文字的问题。因为自动识别为中文却不能显示……所有的中文都是框框……在红联上看到<a href="http://www.linuxdiyf.com/viewarticle.php?id=73537" target="_blank">一篇文章</a>介绍 Stellarium，并附了如何解决中文不能显示的问题。我就是用这篇文章的方法解决的，虽然它推荐用宋体，不过我更喜欢文泉驿正黑……</p>

<div class="wp_codebox"><table><tr id="p58188"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p581code88"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>stellarium<span style="color: #000000; font-weight: bold;">/</span>data
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> DejaVuSans.ttf DejaVuSans.ttf_backup
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mv</span> DejaVuSansMono.ttf DejaVuSansMono.ttf_backup
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>truetype<span style="color: #000000; font-weight: bold;">/</span>wqy<span style="color: #000000; font-weight: bold;">/</span>wqy-zenhei.ttf DejaVuSans.ttf
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>fonts<span style="color: #000000; font-weight: bold;">/</span>truetype<span style="color: #000000; font-weight: bold;">/</span>wqy<span style="color: #000000; font-weight: bold;">/</span>wqy-zenhei.ttf DejaVuSansMono.ttf</pre></td></tr></table></div>

<p>打开 Stellarium，中文正常。</p>
<p>话说另外一种方法给大家参考一下，就是 Stellarium 官方 Wiki 上的<a href="http://www.stellarium.org/wiki/index.php/%E5%A6%82%E4%BD%95%E5%9C%A8Stellarium%E4%B8%AD%E6%AD%A3%E7%A1%AE%E6%98%BE%E7%A4%BA%E4%B8%AD%E6%96%87" target="_blank">如何在Stellarium中正确显示中文</a>，我就不试了……前面那方法用得很好……</p>
<p>另一个问题就是开起来就不断闪烁的问题。我一下就猜到是 Compiz 的问题……禁用了 Compiz 再起动就不闪了……可是当我重新开启 Compiz 时发现原来设置全部没了……不好……在网上找了一下让 Stellarium 和　Compiz 并存的办法……找到了<a href="http://ubuntuforums.org/archive/index.php/t-518227.html" target="_blank">这么一帖</a>，2楼给出了一个方法，6楼给出了个脚本。不过那个脚本似乎有一点点小小的问题，我改了一下，写在这里：</p>

<div class="wp_codebox"><table><tr id="p58189"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p581code89"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># gamestart.sh</span>
<span style="color: #666666; font-style: italic;"># Usage: gamestart application</span>
<span style="color: #666666; font-style: italic;"># turn compiz off for application</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ps</span> <span style="color: #660033;">-A</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;compiz&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #000000; font-weight: bold;">`</span> <span style="color: #660033;">-gt</span> <span style="color: #ff0000;">'0'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
metacity <span style="color: #660033;">--replace</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #007800;">$1</span>
compiz <span style="color: #660033;">--replace</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #007800;">$1</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>把他保存到 /usr/bin/gamestart 文件里，然后设置一下属性：</p>

<div class="wp_codebox"><table><tr id="p58190"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p581code90"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gamestart</pre></td></tr></table></div>

<p>最后在菜单项里修改 Stellarium 的属性，改为 gamestart stellarium。</p>
<p>再启动，所有窗体闪烁了一下，Stellarium 成功正常无闪烁启动！一番遨游后，关掉 Stellarium，所有的窗体又闪烁了一下，Compiz 的效果都还在！高兴~</p>
<p>强烈推荐 Stellarium，很优秀的软件！开源界果然是优秀软件辈出的地方……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/stellarium-star-tour-under-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>解决 Mathematica 与 Composite 并存的问题</title>
		<link>http://blog.upsuper.org/solution-of-running-mathematica-with-composite/</link>
		<comments>http://blog.upsuper.org/solution-of-running-mathematica-with-composite/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 06:12:02 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Mathematica]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=574</guid>
		<description><![CDATA[为了运行 Mathematica，我在原来的一篇日志介绍过，要通过编辑 /etc/X11/xorg.conf 禁用 Composite。但是这样就没有任何效果了，Ubuntu 最华美的东西不能体现出来，有些可惜~但如果不禁用掉，Mathematica 开起来打任何字进去看起来都是一片空白……看着其他人的 Ubuntu 那么漂亮……我想，先恢复 Composite 试试？说不定可以了。 恢复后，打开 Mathematica，输入几个字符，没东西显示……还是那样…… 不甘心……又经过在英文网站的查找，发现了这样一篇帖子（Ubuntu 论坛果然是个好地方）。里面介绍的方法是在运行 Mathematica 的时候在后面加上 -defaultvisual 参数。把 Composite 解禁后，我试了这个参数，果然 Mathematica 可以用了。可是新的问题又出现了，一下出来好几个没用的空白窗口。再看下面的回复，发现还要再调一个配置：进入 Mathematica，点击 Format 菜单里的 Options Inspector，在打开窗口最上面的下拉列表中选择 Global Preferences，在左边的列表中选择 Notebook Options 下的 Window Preferences，再在右边的框中找到 WindowFrame，把它设置为 Generic。这时，Mathematica 闪了一下，没用的窗口全部消失！ 把 -defaultvisual 加入到我放在面板上的启动器中，再运行，除了启动的时候会闪过几个窗口，完全没有问题了！至此，我的 Mathematica 的问题完美解决了！Ubuntu 的华美效果也可以回来了~ 体验了一下 3D 桌面~哈哈~]]></description>
			<content:encoded><![CDATA[<p>为了运行 Mathematica，我在原来的<a href="http://blog.upsuper.org/ubuntu-trip-5-meet-mathematica-again/">一篇日志</a>介绍过，要通过编辑 /etc/X11/xorg.conf 禁用 Composite。但是这样就没有任何效果了，Ubuntu 最华美的东西不能体现出来，有些可惜~但如果不禁用掉，Mathematica 开起来打任何字进去看起来都是一片空白……看着其他人的 Ubuntu 那么漂亮……我想，先恢复 Composite 试试？说不定可以了。</p>
<p>恢复后，打开 Mathematica，输入几个字符，没东西显示……还是那样……</p>
<p>不甘心……又经过在英文网站的查找，发现了<a href="http://ph.ubuntuforums.com/showthread.php?p=4505437" target="_blank">这样一篇帖子</a>（Ubuntu 论坛果然是个好地方）。里面介绍的方法是在运行 Mathematica 的时候在后面加上 -defaultvisual 参数。把 Composite 解禁后，我试了这个参数，果然 Mathematica 可以用了。可是新的问题又出现了，一下出来好几个没用的空白窗口。再看下面的回复，发现还要再调一个配置：进入 Mathematica，点击 Format 菜单里的 Options Inspector，在打开窗口最上面的下拉列表中选择 Global Preferences，在左边的列表中选择 Notebook Options 下的 Window Preferences，再在右边的框中找到 WindowFrame，把它设置为 Generic。这时，Mathematica 闪了一下，没用的窗口全部消失！</p>
<p>把 -defaultvisual 加入到我放在面板上的启动器中，再运行，除了启动的时候会闪过几个窗口，完全没有问题了！至此，我的 Mathematica 的问题完美解决了！Ubuntu 的华美效果也可以回来了~</p>
<p>体验了一下 3D 桌面~哈哈~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solution-of-running-mathematica-with-composite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu下实战切割ape</title>
		<link>http://blog.upsuper.org/actual-combat-spliting-ape-under-ubuntu/</link>
		<comments>http://blog.upsuper.org/actual-combat-spliting-ape-under-ubuntu/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 00:48:56 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[音频]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=283</guid>
		<description><![CDATA[虽然其实并不难，不过还是想写一写，以备以后忘记掉…… 这个其实我从昨晚就开始研究了，不过没研究出个所以然来。不过知道了一件事，那就是如何用 Audacious 播放带 cue 的 ape。似乎要把首选项里音频下的格式检测里的两项全部去掉，而且我根据惯例把 cue 转成了 UTF-8 的。 今天早上找到了这么一篇文章：ubuntu 下基本命令行方式刻录 ape 和 flac 全记录。文章的最后提到切割的方法： 1 cuebreakpoints -i cue CDImage.cue&#124;shnsplit CDImage.ape 我先是试了一下，马上提示没有安装 cuetools，至于 shnsplit，我昨晚就安装好了 shntool，所以没有提示吧。这些都是可以通过 apt 直接安装的，这里也不多说了。安装好以后，再执行，提示： 1 2 3 4 5 6 shnsplit: warning: failed to read data from input file using format: [ape] shnsplit: + you may not have permission to [...]]]></description>
			<content:encoded><![CDATA[<p>虽然其实并不难，不过还是想写一写，以备以后忘记掉……</p>
<p>这个其实我从昨晚就开始研究了，不过没研究出个所以然来。不过知道了一件事，那就是如何用 Audacious 播放带 cue 的 ape。似乎要把首选项里音频下的格式检测里的两项全部去掉，而且我根据惯例把 cue 转成了 UTF-8 的。<br />
<span id="more-283"></span><br />
今天早上找到了这么一篇文章：<a href="http://hi.baidu.com/tomshi/blog/item/365d09fa9cbef19758ee9052.html" target="_blank">ubuntu 下基本命令行方式刻录 ape 和 flac 全记录</a>。文章的最后提到切割的方法：</p>

<div class="wp_codebox"><table><tr id="p28394"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p283code94"><pre class="bash" style="font-family:monospace;">cuebreakpoints <span style="color: #660033;">-i</span> cue CDImage.cue<span style="color: #000000; font-weight: bold;">|</span>shnsplit CDImage.ape</pre></td></tr></table></div>

<p>我先是试了一下，马上提示没有安装 cuetools，至于 shnsplit，我昨晚就安装好了 shntool，所以没有提示吧。这些都是可以通过 apt 直接安装的，这里也不多说了。安装好以后，再执行，提示：</p>

<div class="wp_codebox"><table><tr id="p28395"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p283code95"><pre class="text" style="font-family:monospace;">shnsplit: warning: failed to read data from input file using format: [ape]
shnsplit:          + you may not have permission to read file: [CDImage.ape]
shnsplit:          + arguments may be incorrect for decoder: [mac]
shnsplit:          + verify that the decoder is installed and in your PATH
shnsplit:          + this file may be unsupported, truncated or corrupt
shnsplit: error: cannot continue due to error(s) shown above</pre></td></tr></table></div>

<p>怎么这么麻烦……又去找那个解码器，试了半天才发现源上根本没有那些玩意……最后在 Ubuntu 中文论坛上的一个帖子里发现了几个解码器：<a href="http://forum.ubuntu.org.cn/viewtopic.php?t=19211">[分享] monkeys-audio package</a>。下载下三个解码器后，要先安装 libmac2 和  libmac-dev 最后安装 monkeys-audio，不然好像依赖关系不能满足。这个安装就很简单了咯，直接双击就可以了。</p>
<p>接下去终于可以用上面的命令分割了，只不过分割成的文件都是形如 split-track??.wav 的样子，又是不带标签的 wav，看得我很不爽……因为这意味着我要一个一个加标签改文件名！</p>
<p>不过不小心又在<a href="http://hi.baidu.com/onleadzzwen/blog/item/437960d5593cf9c051da4b80.html" target="_blank">这个帖子</a>看到了一种方法，很高兴，就把刚才生成的 wav 全部被我删掉了。</p>
<p>现在好了，只要用下面这个命令：</p>

<div class="wp_codebox"><table><tr id="p28396"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p283code96"><pre class="bash" style="font-family:monospace;">shntool <span style="color: #c20cb9; font-weight: bold;">split</span> <span style="color: #660033;">-f</span> CDImage.cue <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'%n.%t'</span> <span style="color: #660033;">-o</span> wav CDImage.ape</pre></td></tr></table></div>

<p>就可以直接把分割后的文件按照 cue 中的轨道信息写文件名了！原文中 -o 后面是 flac，不过我反正最后要转成 aac，而 shntool 又不支持 aac，干脆转成 wav，一会儿用 audio-convert-mod 转的时候还不用解码。稍微注意一下，因为我一开始用的就是 UTF-8 的 cue，如果遇到奇怪的问题可以先试试把 cue 转成 UTF-8 的，因为网络上的貌似大多是 GB2313 的。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/actual-combat-spliting-ape-under-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>安装Audio-convert-mod</title>
		<link>http://blog.upsuper.org/installation-of-audio-convert-mod/</link>
		<comments>http://blog.upsuper.org/installation-of-audio-convert-mod/#comments</comments>
		<pubDate>Thu, 17 Jul 2008 14:30:06 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[音乐]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=158</guid>
		<description><![CDATA[今天下了 CLANNAD 的原声碟，想要转换格式进入我的音乐收藏。因为废掉了 Windows，在 Ubuntu 下也需要找一个好的转换软件代替。在网上查找了一番，发现一个很方便的东西 Audio-convert-mod，不过安装它不是那么一帆风顺的。 首先，从官方网站下载了源码包，因为没有提供 deb 包……然后解压后，在里面运行 1 2 3 sudo ./configure --prefix=/usr sudo make sudo make install 安装完成（我本来是没有用 sudo 和那个 &#8211;prefix 参数的，结果怎么弄都弄不清楚）。 在 bash 中执行 audio-convert-mod 提示： 1 python: can't open file '/usr/share/local/share/audio-convert-mod/acm-runapp.pyw': [Errno 2] No such file or directory 经过调查，发现 acm-runapp.pyw 出现在 /usr/share/audio-convert-mod 里，而根本不存在 /usr/share/local 这个目录……于是我就突发奇想，把 /usr 链接到 /usr/share/local 上，结果就可以了： [...]]]></description>
			<content:encoded><![CDATA[<p>今天下了 CLANNAD 的原声碟，想要转换格式进入我的音乐收藏。因为废掉了 Windows，在 Ubuntu 下也需要找一个好的转换软件代替。在网上查找了一番，发现一个很方便的东西 Audio-convert-mod，不过安装它不是那么一帆风顺的。</p>
<p>首先，从<a href="http://www.diffingo.com/content/view/13/47/lang,en/" target="_blank">官方网站</a>下载了源码包，因为没有提供 deb 包……然后解压后，在里面运行</p>

<div class="wp_codebox"><table><tr id="p158100"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p158code100"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> .<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>安装完成（我本来是没有用 sudo 和那个 &#8211;prefix 参数的，结果怎么弄都弄不清楚）。</p>
<p>在 bash 中执行 audio-convert-mod 提示：</p>

<div class="wp_codebox"><table><tr id="p158101"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p158code101"><pre class="text" style="font-family:monospace;">python: can't open file '/usr/share/local/share/audio-convert-mod/acm-runapp.pyw': [Errno 2] No such file or directory</pre></td></tr></table></div>

<p>经过调查，发现 acm-runapp.pyw 出现在 /usr/share/audio-convert-mod 里，而根本不存在 /usr/share/local 这个目录……于是我就突发奇想，把 /usr 链接到 /usr/share/local 上，结果就可以了：</p>

<div class="wp_codebox"><table><tr id="p158102"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p158code102"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></pre></td></tr></table></div>

<p>唉……有些东西还真是麻烦……</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/installation-of-audio-convert-mod/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>可怕的病毒——记昨晚为我弟的笔记本杀毒</title>
		<link>http://blog.upsuper.org/terrible-virus-for-my-cousin-last-night-notebook-antivirus/</link>
		<comments>http://blog.upsuper.org/terrible-virus-for-my-cousin-last-night-notebook-antivirus/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 12:22:16 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[病毒]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=128</guid>
		<description><![CDATA[昨天还在公共汽车上，我弟就打电话给我，叫我晚上去他家。去他家倒是方便，我回家吃个饭就去了。 去那边，电脑启动起来，进入桌面，看起来一切正常。突然，弹出一个窗口，好像是那个系统关键服务出错了，询问是否关闭或者调试。不一会儿，跟多类似的窗口弹出来。我赶快重启电脑，进入安全模式。安全模式里，就没有那么多奇怪的问题了。然后我用命令提示符进入各个盘，发现了 autorun.inf 文件自动运行一个 bat 文件。打开那个 bat 文件，发现应该是一个可执行文件……在各个盘清除了 autorun.inf 文件，随后采用我经典的预防法：建立 autorun.inf 文件夹，再在里面随便新建一个文件，然后将 autorun.inf 加系统加隐藏加只读。发现我弟的分区都是 NTFS 的，便加了一层，就是权限设置。我将这个文件夹继承的读写权限全部删掉，然后在里面建立了一个新项目 Everyone，权限全部调为禁止。然后试着删除，发现不能删除了。自动运行预防成功！ 接着，跑到他家另一台机上下载了一个 360安全卫士，个人觉得这个软件应该还是比较值得信任吧。随后在安全模式下进行了一次扫描，发现 160+ 个病毒 orz……点击清理，然后提示说是否上传以供分析，我竟然点了“是”，结果等了半天没反应……大家记住病毒太多的时候不要让他上传…… 重启进入电脑，可以正常进去了，不过 360安全卫士 不能启动。我在其安装目录下将其扩展名改为 .scr，正常启动。扫描，清除，打补丁，终于清掉了！这年头病毒已经开始 anti-anti-virus 了……不过杀毒软件也会 anti-anti-anti-virus！ 话说今天早上还帮罗少的移动银盘也清了一下病毒，然后用上面的 autorun.inf 预防法。 不过想想觉得，如果有一天病毒也会利用 NTFS 的权限设置，然后新建一个用户，保护掉自己的文件，然后再把这个用户删掉……那不是普通方法就没用了么……那只能用越过系统直接接触硬盘底层的（什么软件我忘了）……还是 Linux 好！]]></description>
			<content:encoded><![CDATA[<p>昨天还在公共汽车上，我弟就打电话给我，叫我晚上去他家。去他家倒是方便，我回家吃个饭就去了。</p>
<p>去那边，电脑启动起来，进入桌面，看起来一切正常。突然，弹出一个窗口，好像是那个系统关键服务出错了，询问是否关闭或者调试。不一会儿，跟多类似的窗口弹出来。我赶快重启电脑，进入安全模式。安全模式里，就没有那么多奇怪的问题了。然后我用命令提示符进入各个盘，发现了 autorun.inf 文件自动运行一个 bat 文件。打开那个 bat 文件，发现应该是一个可执行文件……在各个盘清除了 autorun.inf 文件，随后采用我经典的预防法：建立 autorun.inf 文件夹，再在里面随便新建一个文件，然后将 autorun.inf 加系统加隐藏加只读。发现我弟的分区都是 NTFS 的，便加了一层，就是权限设置。我将这个文件夹继承的读写权限全部删掉，然后在里面建立了一个新项目 Everyone，权限全部调为禁止。然后试着删除，发现不能删除了。自动运行预防成功！</p>
<p>接着，跑到他家另一台机上下载了一个 360安全卫士，个人觉得这个软件应该还是比较值得信任吧。随后在安全模式下进行了一次扫描，发现 160+ 个病毒 orz……点击清理，然后提示说是否上传以供分析，我竟然点了“是”，结果等了半天没反应……大家记住病毒太多的时候不要让他上传……</p>
<p>重启进入电脑，可以正常进去了，不过 360安全卫士 不能启动。我在其安装目录下将其扩展名改为 .scr，正常启动。扫描，清除，打补丁，终于清掉了！这年头病毒已经开始 anti-anti-virus 了……不过杀毒软件也会 anti-anti-anti-virus！</p>
<p>话说今天早上还帮罗少的移动银盘也清了一下病毒，然后用上面的 autorun.inf 预防法。</p>
<p>不过想想觉得，如果有一天病毒也会利用 NTFS 的权限设置，然后新建一个用户，保护掉自己的文件，然后再把这个用户删掉……那不是普通方法就没用了么……那只能用越过系统直接接触硬盘底层的（什么软件我忘了）……还是 Linux 好！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/terrible-virus-for-my-cousin-last-night-notebook-antivirus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>解决aMule不起动的问题</title>
		<link>http://blog.upsuper.org/solve-the-problem-that-cannot-run-amule/</link>
		<comments>http://blog.upsuper.org/solve-the-problem-that-cannot-run-amule/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 12:37:09 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[下载]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=127</guid>
		<description><![CDATA[今天想继续昨天昨天用 aMule 下载的东西（话说昨天下载的速度好快，可以和迅雷媲美了！），结果运行不起来！用终端输入“amule”提示 Initialising aMule Checking if there is an instance already running&#8230; There is an instance of aMule already running Raising current running instance. 但是无论是系统监视器还是 ps 都找不到 aMule 已经运行的影子……在网上发现一篇和我经历类似的帖子，其中的 6 楼介绍说，aMule 有使用自己的锁文件（lock file），只要删掉就可以了。这个锁文件是“~/.aMule/muleLock”，如果遇到这样的情况只要直接删除这个文件就可以了！]]></description>
			<content:encoded><![CDATA[<p>今天想继续昨天昨天用 aMule 下载的东西（话说昨天下载的速度好快，可以和迅雷媲美了！），结果运行不起来！用终端输入“amule”提示</p>
<blockquote><p>
Initialising aMule<br />
Checking if there is an instance already running&#8230;<br />
There is an instance of aMule already running<br />
Raising current running instance.
</p></blockquote>
<p>但是无论是系统监视器还是 ps 都找不到 aMule 已经运行的影子……在网上发现一篇<a href="http://ubuntuforums.org/showthread.php?t=257081" target="_blank">和我经历类似的帖子</a>，其中的 6 楼介绍说，aMule 有使用自己的锁文件（lock file），只要删掉就可以了。这个锁文件是“~/.aMule/muleLock”，如果遇到这样的情况只要直接删除这个文件就可以了！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/solve-the-problem-that-cannot-run-amule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>创建个个人Wiki</title>
		<link>http://blog.upsuper.org/create-a-personal-wiki/</link>
		<comments>http://blog.upsuper.org/create-a-personal-wiki/#comments</comments>
		<pubDate>Sat, 03 May 2008 07:27:58 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[高亮]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=85</guid>
		<description><![CDATA[其实是昨天晚上就传上去了，没时间说罢了。昨晚把Wiki的首页做好了，顺便修整了一下相关的URL Rewrite。另外还研究了一下双站公用的GeSHi代码高亮系统。 我的Wordpress安装了一个WP-Codebox插件使用了GeSHi，而我用的Wiki系统——DokuWiki也有带GeSHi，又因为我对一些代码高亮有特别的要求，所以就把我上次改造过得GeSHi放到一个比较公共的目录里面，然后让两个全部指过去。 在WP-Codebox中只要修改wp-codebox.php： 28 include_once&#40;ABSPATH.&#34;./../include/geshi/geshi.php&#34;&#41;; #include_once(&#34;geshi/geshi.php&#34;); 而DokuWiki里面则要修改3处，都在inc/parserutils.php里： 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 if &#40;@file_exists&#40;$cache&#41; &#38;&#38; !$_REQUEST&#91;'purge'&#93; &#38;&#38; &#40;filemtime&#40;$cache&#41; &#62; filemtime&#40;DOKU_INC . './../include/geshi/geshi.php'&#41;&#41;&#41; &#123; &#160; $highlighted_code = io_readFile&#40;$cache, false&#41;; @touch&#40;$cache&#41;; &#160; &#125; else &#123; &#160; require_once&#40;DOKU_INC . './../include/geshi/geshi.php'&#41;; &#160; $geshi = new GeSHi&#40;$code, strtolower&#40;$language&#41;, DOKU_INC [...]]]></description>
			<content:encoded><![CDATA[<p>其实是昨天晚上就传上去了，没时间说罢了。昨晚把Wiki的<a href="http://wiki.upsuper.org/首页">首页</a>做好了，顺便修整了一下相关的URL Rewrite。另外还研究了一下双站公用的GeSHi代码高亮系统。</p>
<p>我的Wordpress安装了一个WP-Codebox插件使用了GeSHi，而我用的Wiki系统——DokuWiki也有带GeSHi，又因为我对一些代码高亮有特别的要求，所以就把我上次改造过得GeSHi放到一个比较公共的目录里面，然后让两个全部指过去。<br />
<span id="more-85"></span><br />
在WP-Codebox中只要修改wp-codebox.php：</p>

<div class="wp_codebox"><table><tr id="p85105"><td class="line_numbers"><pre>28
</pre></td><td class="code" id="p85code105"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span>ABSPATH<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;./../include/geshi/geshi.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">#include_once(&quot;geshi/geshi.php&quot;);</span></pre></td></tr></table></div>

<p>而DokuWiki里面则要修改3处，都在inc/parserutils.php里：</p>

<div class="wp_codebox"><table><tr id="p85106"><td class="line_numbers"><pre>642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
</pre></td><td class="code" id="p85code106"><pre class="php" style="font-family:monospace;">  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'purge'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">&amp;&amp;</span>
     <span style="color: #009900;">&#40;</span><span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span>DOKU_INC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'./../include/geshi/geshi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000088;">$highlighted_code</span> <span style="color: #339933;">=</span> io_readFile<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #339933;">@</span><span style="color: #990000;">touch</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>DOKU_INC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'./../include/geshi/geshi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000088;">$geshi</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> GeSHi<span style="color: #009900;">&#40;</span><span style="color: #000088;">$code</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$language</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> DOKU_INC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'./../include/geshi/geshi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_encoding</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'utf-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">enable_classes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_header_type</span><span style="color: #009900;">&#40;</span>GESHI_HEADER_PRE<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">set_link_target</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$conf</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'target'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'extern'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>于是就把两个归拢了，这样以后只要改一个GeSHi就可以了。改天把GeSHi加一点功能，支持一下VS2005.NET对于C#的高亮语法，呵呵~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/create-a-personal-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>通过了w3c认证</title>
		<link>http://blog.upsuper.org/certification-by-the-w3c/</link>
		<comments>http://blog.upsuper.org/certification-by-the-w3c/#comments</comments>
		<pubDate>Fri, 02 May 2008 13:21:30 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[My Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=84</guid>
		<description><![CDATA[今天给我的博客做了w3c认证。记得上次连Firefox里那个Web Developement的CSS测试都过不了，查一下，发现是wp-codebox插件里的一个用于IE Fix的代码Firefox不能正常识别，于是就在主CSS文件中去掉了这段，另建了一个叫ie-fix.css的文件，里面写上那个代码，再在wp-codebox的代码输出CSS引用的地方加上&#60;!&#8211;[if IE]&#62;&#8230;&#60;![endif]&#8211;&#62;，就通过了。 今天在w3c那边测，CSS是一次通过，不过有一些颜色使用上的警告，说有些颜色和背景色一致什么的……不过XHTML的测试就没那么好了，貌似错了8个地方，查一下发现又是wp-codebox！ 如果用wp-codebox的朋友，想要过w3c测试，就要改两个地方，都在其main.php文件中（下面两个都是修改后的）： 135 $output .=&#34;id=\&#34;l{$post-&#62;ID}{$codeid}\&#34;&#62;&#34;; 142 $output .= &#34;&#60;td class=\&#34;code\&#34; id=\&#34;code{$post-&#62;ID}{$codeid}\&#34;&#62;&#34;; 现在反正是通过了，通过的标志就在侧栏的Support里面。还是蛮开心的~]]></description>
			<content:encoded><![CDATA[<p>今天给我的博客做了w3c认证。记得上次连Firefox里那个Web Developement的CSS测试都过不了，查一下，发现是wp-codebox插件里的一个用于IE Fix的代码Firefox不能正常识别，于是就在主CSS文件中去掉了这段，另建了一个叫ie-fix.css的文件，里面写上那个代码，再在wp-codebox的代码输出CSS引用的地方加上&lt;!&#8211;[if IE]&gt;&#8230;&lt;![endif]&#8211;&gt;，就通过了。</p>
<p>今天在w3c那边测，CSS是一次通过，不过有一些颜色使用上的警告，说有些颜色和背景色一致什么的……不过XHTML的测试就没那么好了，貌似错了8个地方，查一下发现又是wp-codebox！<br />
<span id="more-84"></span><br />
如果用wp-codebox的朋友，想要过w3c测试，就要改两个地方，都在其main.php文件中（下面两个都是修改后的）：</p>

<div class="wp_codebox"><table><tr id="p84109"><td class="line_numbers"><pre>135
</pre></td><td class="code" id="p84code109"><pre class="php" style="font-family:monospace;">	<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;id=<span style="color: #000099; font-weight: bold;">\&quot;</span>l<span style="color: #006699; font-weight: bold;">{$post-&gt;ID}</span><span style="color: #006699; font-weight: bold;">{$codeid}</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<div class="wp_codebox"><table><tr id="p84110"><td class="line_numbers"><pre>142
</pre></td><td class="code" id="p84code110"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;td class=<span style="color: #000099; font-weight: bold;">\&quot;</span>code<span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span>code<span style="color: #006699; font-weight: bold;">{$post-&gt;ID}</span><span style="color: #006699; font-weight: bold;">{$codeid}</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&quot;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>现在反正是通过了，通过的标志就在侧栏的Support里面。还是蛮开心的~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/certification-by-the-w3c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>今天汉化了个小插件</title>
		<link>http://blog.upsuper.org/today-translate-a-small-plugin/</link>
		<comments>http://blog.upsuper.org/today-translate-a-small-plugin/#comments</comments>
		<pubDate>Fri, 02 May 2008 05:48:58 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[翻译]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=83</guid>
		<description><![CDATA[今天算是找到了WP-Sticky插件支持WordPress 2.5的版本了，虽然还是Beta版。然后小小地汉化了一下，顺便体验一下是那些po和mo文件是如何制作出来的。经过汉化的版本可以在这里下载：wp-sticky.zip (14.9KB) 顺便也来说说怎么制作的。 其实我原来就知道po文件怎么做，因为就是文本文件嘛，直接用EditPlus编辑逐条翻译就可以了。可是mo文件就不懂了，因为看过去是二进制文件。于是就到网上找了一下相关的资料，发现一个软件叫poEdit，可以很方便的进行比照翻译，而且保存时会自动编译生成对应的mo文件，我就下了一个过来。想要的人可以到在这里下载：http://www.poedit.net/download.php，只不过最终要到SourceForge.net的网站上去，对于国内的人来说速度实在慢的惊人…… 接下来就简单了，在菜单里点击用pot文件创建，找到那个翻译模板，就翻译开来~翻译完以后一保存，果然有了mo文件！接下来就是把它放到插件目录里去了。 问题是放进去插件却不识别。经过认真的考察其他插件的方法，我发现文件的名字是很重要的，比如这个插件“wp-sticky”的语言文件要命名为“wp-sticky-语言.mo/po”的格式，而且这里的语言如果是中文还必须写成“zh_CN”，所以这两个文件最后叫做“wp-sticky-zh_CN.mo”和“wp-sticky-zh_CN.po”存进去，终于可以识别出来了！ 最后说一下，本人英语水平有限，如果发现翻译有不妥的希望能告诉我，谢谢！]]></description>
			<content:encoded><![CDATA[<p>今天算是找到了WP-Sticky插件支持WordPress 2.5的版本了，虽然还是Beta版。然后小小地汉化了一下，顺便体验一下是那些po和mo文件是如何制作出来的。经过汉化的版本可以在这里下载：<a href="http://down.upsuper.org/wp-sticky.zip">wp-sticky.zip</a> (14.9KB)</p>
<p>顺便也来说说怎么制作的。</p>
<p><span id="more-83"></span></p>
<p>其实我原来就知道po文件怎么做，因为就是文本文件嘛，直接用EditPlus编辑逐条翻译就可以了。可是mo文件就不懂了，因为看过去是二进制文件。于是就到网上找了一下相关的资料，发现一个软件叫<a href="http://www.poedit.net" target="_blank">poEdit</a>，可以很方便的进行比照翻译，而且保存时会自动编译生成对应的mo文件，我就下了一个过来。想要的人可以到在这里下载：<a href="http://www.poedit.net/download.php" target="_blank">http://www.poedit.net/download.php</a>，只不过最终要到SourceForge.net的网站上去，对于国内的人来说速度实在慢的惊人……</p>
<p>接下来就简单了，在菜单里点击用pot文件创建，找到那个翻译模板，就翻译开来~翻译完以后一保存，果然有了mo文件！接下来就是把它放到插件目录里去了。</p>
<p>问题是放进去插件却不识别。经过认真的考察其他插件的方法，我发现文件的名字是很重要的，比如这个插件“wp-sticky”的语言文件要命名为“wp-sticky-语言.mo/po”的格式，而且这里的语言如果是中文还必须写成“zh_CN”，所以这两个文件最后叫做“wp-sticky-zh_CN.mo”和“wp-sticky-zh_CN.po”存进去，终于可以识别出来了！</p>
<p>最后说一下，本人英语水平有限，如果发现翻译有不妥的希望能告诉我，谢谢！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/today-translate-a-small-plugin/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>尝尝ftp</title>
		<link>http://blog.upsuper.org/try-ftp/</link>
		<comments>http://blog.upsuper.org/try-ftp/#comments</comments>
		<pubDate>Thu, 01 May 2008 12:16:23 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[ftp]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=37</guid>
		<description><![CDATA[我这里说的ftp当然不是通常用的方式连接，而是尝试了一下当年命令提示符下的ftp。 今天不在自己家，要传一些东西什么到服务器上，结果发现IE7不能打开ftp，不知为何。但急着要用，也不想再去下载软件了，就直接打开cmd输入ftp。 个人感觉开始不会用，但用着用着也觉得不会差哈~ 进入ftp以后就是一个“ftp&#62;”，然后输入open，出现“To ”，然后输入我主页的ftp主机，接着些许等待后就出现了“User ”的提示，马上就会出现“Password: ”输入后便重新看到了“ftp&#62;”提示符。 命令很多和dos很像，比如“dir”列举当前目录的文件列表，“cd”修改当前目录等。下载文件就用“get”命令，按照提示输入欲下载的文件名和保存的位置，很快就下载好了。至于上传就是用“put”命令，和“get”基本一样，就是先输本地的地址，再输远程的罢了。 不过，“get”和“put”都只支持单文件，于是我们发现了“mget”和“mput”这两个命令，可以批量传输。 另外要注意的一点是，默认的传输方式是ascii模式，一定要记得先用“binary”命令将传输方式变为二进制传输，不然传输可能造成不可预料的后果！其他的命令大家可以慢慢去探索，只要输入“help”就可以看到帮助了~]]></description>
			<content:encoded><![CDATA[<p>我这里说的ftp当然不是通常用的方式连接，而是尝试了一下当年命令提示符下的ftp。</p>
<p>今天不在自己家，要传一些东西什么到服务器上，结果发现IE7不能打开ftp，不知为何。但急着要用，也不想再去下载软件了，就直接打开cmd输入ftp。</p>
<p>个人感觉开始不会用，但用着用着也觉得不会差哈~</p>
<p>进入ftp以后就是一个“ftp&gt;”，然后输入open，出现“To ”，然后输入我主页的ftp主机，接着些许等待后就出现了“User ”的提示，马上就会出现“Password: ”输入后便重新看到了“ftp&gt;”提示符。</p>
<p>命令很多和dos很像，比如“dir”列举当前目录的文件列表，“cd”修改当前目录等。下载文件就用“get”命令，按照提示输入欲下载的文件名和保存的位置，很快就下载好了。至于上传就是用“put”命令，和“get”基本一样，就是先输本地的地址，再输远程的罢了。</p>
<p>不过，“get”和“put”都只支持单文件，于是我们发现了“mget”和“mput”这两个命令，可以批量传输。</p>
<p>另外要注意的一点是，默认的传输方式是ascii模式，一定要记得先用“binary”命令将传输方式变为二进制传输，不然传输可能造成不可预料的后果！其他的命令大家可以慢慢去探索，只要输入“help”就可以看到帮助了~</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/try-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>下载PHP文件</title>
		<link>http://blog.upsuper.org/download-php-file/</link>
		<comments>http://blog.upsuper.org/download-php-file/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 12:40:00 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=33</guid>
		<description><![CDATA[今天把一个PHP文件放到下载目录去，但是会自动解析。于是就查了各种资料如何阻止Apache解析指定目录的PHP，但是查到的几种方法都不行，似乎是因为服务器的原因？httpd.conf的权限自然不是在我的。 我就换了一种想法，用URL Rewrite试试？把php文件改名后编写了一个.htaccess，把所有.php的文件rewrite到.php_file上去，终于成功实现了！ 那个.htaccess代码： 1 2 3 RewriteEngine on RewriteBase / RewriteRule ^(.*)\.php$ $1\.php_file 另外，也把找到的其他方法给大家参考，都是通过编写.htaccess文件： 第一种是通过重定义php的MIMI-TYPE： 1 AddType text/html .php 第二种是通过关闭PHP引擎，这是PHP手册上所写的方法： 1 php_flag engine off 还有一种是直接禁止对一切PHP的访问： 1 2 3 4 &#60;Files ~ &#34;.php&#34;&#62; Order allow, deny Deny from all &#60;/Files&#62;]]></description>
			<content:encoded><![CDATA[<p>今天把一个PHP文件放到下载目录去，但是会自动解析。于是就查了各种资料如何阻止Apache解析指定目录的PHP，但是查到的几种方法都不行，似乎是因为服务器的原因？httpd.conf的权限自然不是在我的。</p>
<p>我就换了一种想法，用URL Rewrite试试？把php文件改名后编写了一个.htaccess，把所有.php的文件rewrite到.php_file上去，终于成功实现了！<br />
<span id="more-33"></span><br />
那个.htaccess代码：</p>

<div class="wp_codebox"><table><tr id="p33115"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p33code115"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">RewriteEngine</span>	<span style="color: #0000ff;">on</span>
<span style="color: #00007f;">RewriteBase</span>	/
<span style="color: #00007f;">RewriteRule</span>	^(.*)\.php$	$<span style="color: #ff0000;">1</span>\.php_file</pre></td></tr></table></div>

<p>另外，也把找到的其他方法给大家参考，都是通过编写.htaccess文件：</p>
<p>第一种是通过重定义php的MIMI-TYPE：</p>

<div class="wp_codebox"><table><tr id="p33116"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p33code116"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">AddType</span> text/html .php</pre></td></tr></table></div>

<p>第二种是通过关闭PHP引擎，这是PHP手册上所写的方法：</p>

<div class="wp_codebox"><table><tr id="p33117"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p33code117"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">php_flag</span> engine <span style="color: #0000ff;">off</span></pre></td></tr></table></div>

<p>还有一种是直接禁止对一切PHP的访问：</p>

<div class="wp_codebox"><table><tr id="p33118"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p33code118"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">Files</span>  ~  <span style="color: #7f007f;">&quot;.php&quot;</span>&gt;
	<span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>, <span style="color: #00007f;">deny</span>
	<span style="color: #00007f;">Deny</span> from <span style="color: #0000ff;">all</span>
&lt;/<span style="color: #000000; font-weight:bold;">Files</span>&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/download-php-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>终于把宠物中心装好了</title>
		<link>http://blog.upsuper.org/installed-pet-cente/</link>
		<comments>http://blog.upsuper.org/installed-pet-cente/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 11:37:35 +0000</pubDate>
		<dc:creator>upsuper</dc:creator>
				<category><![CDATA[雕虫小技]]></category>
		<category><![CDATA[Discuz!]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[插件]]></category>

		<guid isPermaLink="false">http://blog.upsuper.org/?p=9</guid>
		<description><![CDATA[在大家的强烈支持下，我把DZ论坛的无心宠物中心插件装好了。 为了装这个宠物中心，我把include/db_mysql.class.php都改了，如果大家在安装后发现宠物中心不能启动，并且提示找不到query_first，那么查找 1 2 3 function affected_rows&#40;&#41; &#123; return mysql_affected_rows&#40;$this-&#62;link&#41;; &#125; 前面加上： 1 2 3 function query_first&#40;$sql&#41; &#123; return $this-&#62;fetch_array&#40;$this-&#62;query&#40;$sql&#41;&#41;; &#125; 我曾经试图修改插件的文件，结果发现，这个插件用这个文件用得太多了，干脆改论坛的核心文件了。]]></description>
			<content:encoded><![CDATA[<p>在大家的强烈支持下，我把DZ论坛的无心宠物中心插件装好了。</p>
<p>为了装这个宠物中心，我把<em>include/db_mysql.class.php</em>都改了，如果大家在安装后发现宠物中心不能启动，并且提示找不到<em>query_first</em>，那么查找</p>

<div class="wp_codebox"><table><tr id="p9121"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p9code121"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> affected_rows<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">mysql_affected_rows</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>前面加上：</p>

<div class="wp_codebox"><table><tr id="p9122"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p9code122"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> query_first<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>我曾经试图修改插件的文件，结果发现，这个插件用这个文件用得太多了，干脆改论坛的核心文件了。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.upsuper.org/installed-pet-cente/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

