<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>suchasplus::blog</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/" />
    <link rel="self" type="application/atom+xml" href="http://blog.suchasplus.com/atom.xml" />
    <id>tag:blog.suchasplus.com,2010-07-11://3</id>
    <updated>2012-04-16T14:12:17Z</updated>
    <subtitle>There are Pretenders among us. Genius with the ability to become anyone they wanna to be.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 5.02</generator>

<entry>
    <title>关于4.12断网的两则消息来源</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2012/04/412-china-internet-network-down.html" />
    <id>tag:blog.suchasplus.com,2012://3.304</id>

    <published>2012-04-16T14:08:45Z</published>
    <updated>2012-04-16T14:12:17Z</updated>

    <summary><![CDATA[ 为了确证这点, 我对通讯过程做了抓包, 但是结果出乎我的意料. 问题并不出现在ssh握手的时候, 而是tcp第二步的syn-ack回包彻底消失. 这表明封锁并不针对ssh协议, 而是tcp协议栈! &nbsp;2012年4月12日断网的技术记录(需翻牆) &nbsp; 但中国的问题很奇怪，中国联通和中国电信的HTTP流量停滞，但非HTTP流量通过不同的端口继续流动，如Skype通话，电子邮件发送和DNS查询的流量没有中止。CloudFlare CEO和联合创始人Matthew Prince说，非HTTP流量正常意味着网络故障很有可能是过滤导致的。该公司的一位匿名工程师认为可能是防火墙操作失误，本来是过滤部分内容，结果却不小心过滤了整个互联网。 CDN供应商认为断网可能是操作失误 (英文原文)...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="gfw" label="gfw" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="断网" label="断网" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span data-scayt_word="为了确证这点" data-scaytid="1">为了确证这点</span>, <span data-scayt_word="我对通讯过程做了抓包" data-scaytid="2">我对通讯过程做了抓包</span>, <span data-scayt_word="但是结果出乎我的意料" data-scaytid="3">但是结果出乎我的意料</span>. <span data-scayt_word="问题并不出现在ssh握手的时候" data-scaytid="4">问题并不出现在ssh握手的时候</span>, <span data-scayt_word="而是tcp第二步的syn-ack回包彻底消失" data-scaytid="5">而是tcp第二步的syn-ack回包彻底消失</span>. <span data-scayt_word="这表明封锁并不针对ssh协议" data-scaytid="6">这表明封锁并不针对ssh协议</span>, <span data-scayt_word="而是tcp协议栈" data-scaytid="7">而是tcp协议栈</span>! <a href="http://shell909090.com/blog/2012/04/2012%E5%B9%B44%E6%9C%8812%E6%97%A5%E6%96%AD%E7%BD%91%E7%9A%84%E6%8A%80%E6%9C%AF%E8%AE%B0%E5%BD%95/">&nbsp;<span data-scayt_word="2012年4月12日断网的技术记录" data-scaytid="30">2012年4月12日断网的技术记录</span></a>(需翻牆)</p>
<p>
	&nbsp;</p>
<div>
	<span data-scayt_word="但中国的问题很奇怪，中国联通和中国电信的HTTP流量停滞，但非HTTP流量通过不同的端口继续流动，如Skype通话，电子邮件发送和DNS查询的流量没有中止。CloudFlare" data-scaytid="47">但中国的问题很奇怪，中国联通和中国电信的HTTP流量停滞，但非HTTP流量通过不同的端口继续流动，如Skype通话，电子邮件发送和DNS查询的流量没有中止。CloudFlare</span> <span data-scayt_word="CEO和联合创始人Matthew" data-scaytid="48">CEO和联合创始人Matthew</span> <span data-scayt_word="Prince说，非HTTP流量正常意味着网络故障很有可能是过滤导致的。该公司的一位匿名工程师认为可能是防火墙操作失误，本来是过滤部分内容，结果却不小心过滤了整个互联网。" data-scaytid="49">Prince说，非HTTP流量正常意味着网络故障很有可能是过滤导致的。该公司的一位匿名工程师认为可能是防火墙操作失误，本来是过滤部分内容，结果却不小心过滤了整个互联网。</span></div>
<div>
	<a href="http://internet.solidot.org/article.pl?sid=12/04/16/0346200"><span data-scayt_word="CDN供应商认为断网可能是操作失误" data-scaytid="50">CDN供应商认为断网可能是操作失误</span></a> (<a href="http://blogs.wsj.com/chinarealtime/2012/04/13/new-clarity-on-china-internet-outage/"><span data-scayt_word="英文原文" data-scaytid="51">英文原文</span></a>)</div>
]]>
        
    </content>
</entry>

<entry>
    <title>sony NWZ W252音乐传输软件下载</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/12/sony-nwz-w252.html" />
    <id>tag:blog.suchasplus.com,2011://3.303</id>

    <published>2011-12-17T17:34:25Z</published>
    <updated>2011-12-17T17:37:35Z</updated>

    <summary><![CDATA[ SONY NWZ-W252随机光盘找不到了，不想使用WMP11来管理MP3，sonystyle上关于w252页面也没有下载，Google后得知软件名字叫content&nbsp;transfer. W252 sony大陆官网下载地址:&nbsp;http://service.sony.com.cn/AUDIO/Download/28569.htm...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="sony" label="sony" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	SONY <span data-scayt_word="NWZ-W252随机光盘找不到了，不想使用WMP11来管理MP3，sonystyle上关于w252页面也没有下载，Google后得知软件名字叫content" data-scaytid="25">NWZ-W252随机光盘找不到了，不想使用WMP11来管理MP3，sonystyle上关于w252页面也没有下载，Google后得知软件名字叫content</span>&nbsp;transfer.</p>
<p>
	<span data-scayt_word="W252" data-scaytid="23">W252</span> <span data-scayt_word="sony大陆官网下载地址" data-scaytid="22">sony大陆官网下载地址</span>:&nbsp;<a href="http://service.sony.com.cn/AUDIO/Download/28569.htm">http://service.sony.com.cn/AUDIO/Download/28569.htm</a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>lucid安装scribe手记</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/11/ubuntu-lucid-compile-scribe-howto.html" />
    <id>tag:blog.suchasplus.com,2011://3.302</id>

    <published>2011-11-21T17:04:21Z</published>
    <updated>2011-11-21T17:09:02Z</updated>

    <summary><![CDATA[ &nbsp; 首先apt-get install必须的依赖 apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev 在thrift.apache.org上下载0.7.0版本的thrift ./configure --with-ruby=no make make install 然后cd contrib/fb303 ./bootstrap.sh make make install 安装fb303是必须的，否则scribe无法编译 scribe是从git上获取的 安装步骤同fb303 &nbsp; 编译好scribe之后，运行src/scribed examples/example1.conf，能正常运行即为编译成功 如果遇到src/scribed: error while loading shared...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="facebook" label="facebook" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="scribe" label="scribe" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="thrift" label="thrift" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	<span data-scayt_word="首先apt-get" data-scaytid="61">首先apt-get</span> <span data-scayt_word="install必须的依赖" data-scaytid="62">install必须的依赖</span></div>
<div>
	apt-get install <span data-scayt_word="libboost-dev" data-scaytid="65">libboost-dev</span> <span data-scayt_word="libboost-test-dev" data-scaytid="66">libboost-test-dev</span> <span data-scayt_word="libboost-program-options-dev" data-scaytid="67">libboost-program-options-dev</span> <span data-scayt_word="libevent-dev" data-scaytid="68">libevent-dev</span> <span data-scayt_word="automake" data-scaytid="69">automake</span> <span data-scayt_word="libtool" data-scaytid="70">libtool</span> flex bison <span data-scayt_word="pkg-config" data-scaytid="71">pkg-config</span> g++ <span data-scayt_word="libssl-dev" data-scaytid="72">libssl-dev</span></div>
<div>
	<span data-scayt_word="在thrift.apache.org上下载0.7.0版本的thrift" data-scaytid="73">在thrift.apache.org上下载0.7.0版本的thrift</span></div>
<div>
	./configure --with-ruby=no</div>
<div>
	make</div>
<div>
	make install</div>
<div>
	<span data-scayt_word="然后cd" data-scaytid="74">然后cd</span> <span data-scayt_word="contrib" data-scaytid="75">contrib</span>/<span data-scayt_word="fb303" data-scaytid="76">fb303</span></div>
<div>
	./<span data-scayt_word="bootstrap.sh" data-scaytid="77">bootstrap.sh</span></div>
<div>
	make</div>
<div>
	make install</div>
<div>
	<strong><span data-scayt_word="安装fb303是必须的，否则scribe无法编译" data-scaytid="78">安装fb303是必须的，否则scribe无法编译</span></strong></div>
<div>
	<span data-scayt_word="scribe是从git上获取的" data-scaytid="79">scribe是从git上获取的</span></div>
<div>
	<span data-scayt_word="安装步骤同fb303" data-scaytid="233">安装步骤同fb303</span></div>
<div>
	&nbsp;</div>
<div>
	<span data-scayt_word="编译好scribe之后，运行src" data-scaytid="110">编译好scribe之后，运行src</span>/scribed examples/<span data-scayt_word="example1.conf，能正常运行即为编译成功" data-scaytid="196">example1.conf，能正常运行即为编译成功</span></div>
<div>
	<span data-scayt_word="如果遇到src" data-scaytid="168">如果遇到src</span>/scribed: error while loading shared libraries: <span data-scayt_word="libthrift.so.0" data-scaytid="166">libthrift.so.0</span>: cannot open shared object file: No such file or <span data-scayt_word="directorycuw错误，将" data-scaytid="248">directorycuw错误，将</span>/<span data-scayt_word="usr" data-scaytid="249">usr</span>/local/lib/<span data-scayt_word="libthrift.so.0" data-scaytid="238">libthrift.so.0</span> <span data-scayt_word="append到" data-scaytid="250">append到</span>/etc/<span data-scayt_word="ld.so.conf并执行ldconfig即可" data-scaytid="239">ld.so.conf并执行ldconfig即可</span></div>
<div>
	&nbsp;</div>
<div>
	<span data-scayt_word="之前安装失败" data-scaytid="81">之前安装失败</span>, <span data-scayt_word="google半天收到不少误导...结果发现把thrift" data-scaytid="82">google半天收到不少误导...结果发现把thrift</span> &amp;&amp; <span data-scayt_word="fb303" data-scaytid="83">fb303</span> &amp;&amp; <span data-scayt_word="scribe的文件中apache" data-scaytid="84">scribe的文件中apache</span>::<span data-scayt_word="thrift和namespace" data-scaytid="85">thrift和namespace</span> <span data-scayt_word="apache都替换成facebook" data-scaytid="87">apache都替换成facebook</span>::<span data-scayt_word="thrift和namespace" data-scaytid="86">thrift和namespace</span> <span data-scayt_word="facebook也能编译...仔细看了下才知道要先安装fb303" data-scaytid="88">facebook也能编译...仔细看了下才知道要先安装fb303</span></div>
]]>
        <![CDATA[<p>
	<span data-scayt_word="参考文章" data-scaytid="29">参考文章</span>:</p>
<p>
	<a href="http://slaytanic.blog.51cto.com/2057708/716580">http://<span data-scayt_word="slaytanic.blog.51cto.com" data-scaytid="31">slaytanic.blog.51cto.com</span>/2057708/716580</a></p>
<p>
	<a href="http://slaytanic.blog.51cto.com/2057708/714280">http://<span data-scayt_word="slaytanic.blog.51cto.com" data-scaytid="35">slaytanic.blog.51cto.com</span>/2057708/714280</a></p>
<p>
	<a href="http://zhoubo.sinaapp.com/?p=740">http://<span data-scayt_word="zhoubo.sinaapp.com" data-scaytid="48">zhoubo.sinaapp.com</span>/?p=740</a></p>
<p>
	<a href="http://blog.csdn.net/emili/article/details/6190927">http://<span data-scayt_word="blog.csdn.net" data-scaytid="42">blog.csdn.net</span>/<span data-scayt_word="emili" data-scaytid="43">emili</span>/article/details/6190927</a></p>
<p>
	<a href="http://hi.baidu.com/phps/blog/item/e515d2ca003de95ff31fe793.html">http://<span data-scayt_word="hi.baidu.com" data-scaytid="58">hi.baidu.com</span>/<span data-scayt_word="phps" data-scaytid="60">phps</span>/blog/item/<span data-scayt_word="e515d2ca003de95ff31fe793.html" data-scaytid="59">e515d2ca003de95ff31fe793.html</span></a></p>
]]>
    </content>
</entry>

<entry>
    <title>gow(alternative to cygwin)的几个bug</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/11/bugs-of-gows-alternative-to-cygwin.html" />
    <id>tag:blog.suchasplus.com,2011://3.301</id>

    <published>2011-11-10T10:01:17Z</published>
    <updated>2011-11-10T10:03:53Z</updated>

    <summary><![CDATA[ 一直在每个windows机器上都安装了一份gow ( The lightweight alernative to cygwin), 但是在使用中遇到了几个bug &nbsp; wget wget在设定二进制下载的情况，仍然会导致NSIS的部分文件下载出错，导致执行NSIS运行时报错 因为必须在cli下运行，使用lftp 4.23版本替代了wget进行FTP下载操作 cp 非常诡异的问题，cp -r在某些特定目录下执行拷贝操作时，会丢失某个大写文字开头的文件， 更改cwd就没有这个问题 使用xcopy解决这个问题...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cp" label="cp" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gow" label="gow" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wget" label="wget" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xcopy" label="xcopy" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span data-scayt_word="一直在每个windows机器上都安装了一份gow" data-scaytid="1">一直在每个windows机器上都安装了一份<a href="https://github.com/bmatzelle/gow/wiki/">gow</a></span> ( The lightweight <span data-scayt_word="alernative" data-scaytid="2">alernative</span> to <span data-scayt_word="cygwin" data-scaytid="3">cygwin</span>), <span data-scayt_word="但是在使用中遇到了几个bug" data-scaytid="4">但是在使用中遇到了几个bug</span></p>
<p>
	&nbsp;</p>
<div>
	<strong><span data-scayt_word="wget" data-scaytid="13">wget</span></strong></div>
<div>
	<span data-scayt_word="wget在设定二进制下载的情况，仍然会导致NSIS的部分文件下载出错，导致执行NSIS运行时报错" data-scaytid="15">wget在设定二进制下载的情况，仍然会导致NSIS的部分文件下载出错，导致执行NSIS运行时报错</span></div>
<div>
	<span data-scayt_word="因为必须在cli下运行，使用lftp" data-scaytid="18">因为必须在cli下运行，使用lftp</span> <span data-scayt_word="4.23版本替代了wget进行FTP下载操作" data-scaytid="16">4.23版本替代了wget进行FTP下载操作</span></div>
<div>
	<strong><span data-scayt_word="cp" data-scaytid="21">cp</span></strong></div>
<div>
	<span data-scayt_word="非常诡异的问题，cp" data-scaytid="23">非常诡异的问题，cp</span> <span data-scayt_word="-r在某些特定目录下执行拷贝操作时，会丢失某个大写文字开头的文件，" data-scaytid="24">-r在某些特定目录下执行拷贝操作时，会丢失某个大写文字开头的文件，</span> <span data-scayt_word="更改cwd就没有这个问题" data-scaytid="25">更改cwd就没有这个问题</span></div>
<div>
	<span data-scayt_word="使用xcopy解决这个问题" data-scaytid="29">使用xcopy解决这个问题</span></div>
]]>
        
    </content>
</entry>

<entry>
    <title>新网国际域名过期删除策略</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/10/xinnet-International-domain-name-expired-deletion-policy.html" />
    <id>tag:blog.suchasplus.com,2011://3.300</id>

    <published>2011-10-21T05:52:52Z</published>
    <updated>2011-10-21T05:56:13Z</updated>

    <summary><![CDATA[ &nbsp; 0-13D内, 正常访问, 可以续费 14-40D内, NS被更改为dnsX.expirenotification.com, 域名被domain parking, 显示到期时间为Expiration Date + 1 Year 40-75D内, status为redemptionPeriod &gt;75D 删除 &nbsp; &nbsp; 某域名还有35天才能购买... still waiting &nbsp; referer...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="psn" label="psn" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="psnchina" label="psnchina" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	<span data-scayt_word="0-13D内" data-scaytid="2">0-13D内</span>, <span data-scayt_word="正常访问" data-scaytid="3">正常访问</span>, <span data-scayt_word="可以续费" data-scaytid="4">可以续费</span></div>
<div>
	<span data-scayt_word="14-40D内" data-scaytid="5">14-40D内</span>, <span data-scayt_word="NS被更改为dnsX.expirenotification.com" data-scaytid="1">NS被更改为dnsX.expirenotification.com</span>, <span data-scayt_word="域名被domain" data-scaytid="7">域名被domain</span> parking, <span data-scayt_word="显示到期时间为Expiration" data-scaytid="8">显示到期时间为Expiration</span> Date + 1 Year</div>
<div>
	<span data-scayt_word="40-75D内" data-scaytid="10">40-75D内</span>, <span data-scayt_word="status为redemptionPeriod" data-scaytid="11">status为redemptionPeriod</span></div>
<div>
	&gt;<span data-scayt_word="75D" data-scaytid="13">75D</span> <span data-scayt_word="删除" data-scaytid="14">删除</span></div>
<div>
	&nbsp;</div>
<div>
	&nbsp;</div>
<div>
	<span data-scayt_word="某域名还有35天才能购买" data-scaytid="9">某域名还有35天才能购买</span>... still waiting</div>
<div>
	&nbsp;</div>
<div>
	<a href="http://www.ancool.com/dnscomcn.htm"><span data-scayt_word="referer" data-scaytid="30">referer</span></a></div>
]]>
        
    </content>
</entry>

<entry>
    <title>php使用imagek时segment fault</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/09/segment-fault-when-using-imagick-via-php.html" />
    <id>tag:blog.suchasplus.com,2011://3.299</id>

    <published>2011-09-08T22:56:29Z</published>
    <updated>2011-09-08T22:58:40Z</updated>

    <summary><![CDATA[ &nbsp; 在ubuntu 10.04.2 LTS 64bit下使用apt安装的imagemagick和php/imagick, 在处理图片的时候会segment fault退出。 strace显示是处理完毕munmap出现的segment fault... 处理方式是显式设定OMP_NUM_THREADS=1, 是imagemagick使用的libgomp seg faulting。 openmp的committee说openMP在与其他线程模型一块工作时行为未定义... 所以想正常的用，要么编译的时候disable掉openmp, 要么显式export OMP_NUM_THREADS=1, 因为没有一个能在运行时关掉openmp的方法 悲催的是--disable-openmp选项由于经常link失败, 而imagemagick也没有针对这个问题提供2个版本的编译脚本...so...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="imagemagick" label="Imagemagick" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="segmentfault" label="segmentfault" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	<span data-scayt_word="在ubuntu" data-scaytid="121">在ubuntu</span> 10.04.2 <span data-scayt_word="LTS" data-scaytid="122">LTS</span> <span data-scayt_word="64bit下使用apt安装的imagemagick和php" data-scaytid="123">64bit下使用apt安装的imagemagick和php</span>/<span data-scayt_word="imagick" data-scaytid="124">imagick</span>, <span data-scayt_word="在处理图片的时候会segment" data-scaytid="125">在处理图片的时候会segment</span> <span data-scayt_word="fault退出。" data-scaytid="126">fault退出。</span></div>
<div>
	<span data-scayt_word="strace显示是处理完毕munmap出现的segment" data-scaytid="127">strace显示是处理完毕munmap出现的segment</span> fault...</div>
<div>
	<span data-scayt_word="处理方式是显式设定OMP_NUM_THREADS" data-scaytid="128">处理方式是显式设定OMP_NUM_THREADS</span>=1, <span data-scayt_word="是imagemagick使用的libgomp" data-scaytid="129">是imagemagick使用的libgomp</span> <span data-scayt_word="seg" data-scaytid="130">seg</span> <span data-scayt_word="faulting。" data-scaytid="131">faulting。</span></div>
<div>
	<span data-scayt_word="openmp的committee说openMP在与其他线程模型一块工作时行为未定义" data-scaytid="132">openmp的committee说openMP在与其他线程模型一块工作时行为未定义</span>...</div>
<div>
	<span data-scayt_word="所以想正常的用，要么编译的时候disable掉openmp" data-scaytid="133">所以想正常的用，要么编译的时候disable掉openmp</span>, <span data-scayt_word="要么显式export" data-scaytid="134">要么显式export</span> <span data-scayt_word="OMP_NUM_THREADS" data-scaytid="135">OMP_NUM_THREADS</span>=1, <span data-scayt_word="因为没有一个能在运行时关掉openmp的方法" data-scaytid="136">因为没有一个能在运行时关掉openmp的方法</span></div>
<div>
	<span data-scayt_word="悲催的是--disable-openmp选项由于经常link失败" data-scaytid="137">悲催的是--disable-openmp选项由于经常link失败</span>, <span data-scayt_word="而imagemagick也没有针对这个问题提供2个版本的编译脚本...so" data-scaytid="138">而imagemagick也没有针对这个问题提供2个版本的编译脚本...so</span></div>]]>
        <![CDATA[<p>
	&nbsp;</p>
<div>
	<span data-scayt_word="参考" data-scaytid="48" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">参考</span>:</div>
<div>
	http://<span data-scayt_word="www.imagemagick.org" data-scaytid="2" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">www.imagemagick.org</span>/discourse-server/<span data-scayt_word="viewtopic.php" data-scaytid="4" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">viewtopic.php</span>?f=3&amp;t=16453</div>
<div>
	http://<span data-scayt_word="gcc.gnu.org" data-scaytid="7" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">gcc.gnu.org</span>/<span data-scayt_word="onlinedocs" data-scaytid="49" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">onlinedocs</span>/<span data-scayt_word="libgomp" data-scaytid="51" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">libgomp</span>/<span data-scayt_word="omp_005fget_005fnum_005fthreads.html" data-scaytid="9" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">omp_005fget_005fnum_005fthreads.html</span></div>
<div>
	http://<span data-scayt_word="gcc.gnu.org" data-scaytid="8" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">gcc.gnu.org</span>/<span data-scayt_word="onlinedocs" data-scaytid="50" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">onlinedocs</span>/<span data-scayt_word="libgomp" data-scaytid="52" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">libgomp</span>/<span data-scayt_word="OMP_005fNUM_005fTHREADS.html" data-scaytid="10" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">OMP_005fNUM_005fTHREADS.html</span></div>
<div>
	http://<span data-scayt_word="www.imagemagick.org" data-scaytid="3" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">www.imagemagick.org</span>/discourse-server/<span data-scayt_word="viewtopic.php" data-scaytid="5" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">viewtopic.php</span>?f=1&amp;t=14953</div>
<div>
	http://<span data-scayt_word="download.oracle.com" data-scaytid="11" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">download.oracle.com</span>/docs/cd/<span data-scayt_word="E19205-01" data-scaytid="53" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">E19205-01</span>/821-0387/<span data-scayt_word="bjadz" data-scaytid="54" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">bjadz</span>/<span data-scayt_word="index.html" data-scaytid="12" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">index.html</span></div>
<div>
	http://<span data-scayt_word="twpug.net" data-scaytid="13" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">twpug.net</span>/modules/<span data-scayt_word="newbb" data-scaytid="118">newbb</span>/<span data-scayt_word="viewtopic.php" data-scaytid="6" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">viewtopic.php</span>?post_id=22102</div>
<div>
	http://<span data-scayt_word="www.h2z.org" data-scaytid="14" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">www.h2z.org</span>/<span data-scayt_word="read.php" data-scaytid="15" style="padding-bottom: 0px !important; background-image: url(data:image/gif;base64,R0lGODlhBAADAIABAP8NDQAAACH5BAEAAAEALAAAAAAEAAMAAAIFRB5mGQUAOw==) !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; text-decoration: none !important; white-space: nowrap !important; background-position: 50% 100%; background-repeat: repeat no-repeat !important; ">read.php</span>?48</div>
]]>
    </content>
</entry>

<entry>
    <title>为什么php不支持原始类型检查</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/08/why-primitive-type-hint-is-not-support-by-php.html" />
    <id>tag:blog.suchasplus.com,2011://3.298</id>

    <published>2011-08-01T08:20:28Z</published>
    <updated>2011-08-01T08:30:31Z</updated>

    <summary><![CDATA[ Type Hints can only be of the&nbsp;object&nbsp;and&nbsp;array&nbsp;(since PHP 5.1) type. Traditional type hinting with&nbsp;int&nbsp;and&nbsp;string&nbsp;isn&#39;t supported.&nbsp;referer We will not provide typehints for primitive types as PHP has automatic typeconversion for them Also we are not adding any checks for primitive...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="philosophy" label="philosophy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="typehint" label="type hint" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	Type Hints can only be of the&nbsp;<span class="type"><a class="type object" href="http://www.php.net/manual/en/language.types.object.php" style="color: rgb(0, 0, 153); background-color: transparent; ">object</a></span>&nbsp;and&nbsp;<span class="type"><a class="type array" href="http://www.php.net/manual/en/language.types.array.php" style="color: rgb(0, 0, 153); background-color: transparent; ">array</a></span>&nbsp;(since PHP 5.1) type. Traditional type hinting with&nbsp;<span class="type"><a class="type int" href="http://www.php.net/manual/en/language.types.integer.php" style="color: rgb(0, 0, 153); background-color: transparent; "><span data-scayt_word="int" data-scaytid="3">int</span></a></span>&nbsp;and&nbsp;<span class="type"><a class="type string" href="http://www.php.net/manual/en/language.types.string.php" style="color: rgb(0, 0, 153); background-color: transparent; ">string</a></span>&nbsp;isn&#39;t supported.&nbsp;<a href="http://php.net/manual/en/language.oop5.typehinting.php"><span data-scayt_word="referer" data-scaytid="4">referer</span></a></p>
<div style="font-family: Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
	<pre class="note" style="font-family: monospace; font-size: medium; width: 65em; margin-left: 10px; white-space: pre-wrap; ">
	We will not provide <span data-scayt_word="typehints" data-scaytid="5">typehints</span> for primitive types as PHP has automatic 
<span data-scayt_word="typeconversion" data-scaytid="6">typeconversion</span> for them Also we are not adding any checks for primitive 
types since that would either slow down the compile step or would 
require new keywords. (<a href="https://bugs.php.net/bug.php?id=29508">by <span data-scayt_word="helly@php.net" data-scaytid="1">helly@php.net</span></a>)
</pre>
</div>
<p>
	user <span data-scayt_word="comment里面提供了利用set_error_handler解决php对int" data-scaytid="7">comment里面提供了利用set_error_handler解决php对int</span>/<span data-scayt_word="string类型type" data-scaytid="25">string类型type</span> <span data-scayt_word="hint报fatal" data-scaytid="17">hint报fatal</span> <span data-scayt_word="error的方法" data-scaytid="10">error的<a href="http://www.php.net/manual/en/language.oop5.typehinting.php#83442">方法</a></span>, <span data-scayt_word="但是set_error_handler..这个合适吗？" data-scaytid="2">但是set_error_handler..这个合适吗？</span>&nbsp;<span data-scayt_word="罢了，php" data-scaytid="11">罢了，php</span> type <span data-scayt_word="hint不支持interface" data-scaytid="12">hint不支持interface</span>, <span data-scayt_word="却支持数组，quick" data-scaytid="13">却支持数组，quick</span> and dirty, <span data-scayt_word="这或许就是php" data-scaytid="14">这或许就是php</span> <span data-scayt_word="philosophy吧" data-scaytid="15">philosophy吧</span></p>
]]>
        
    </content>
</entry>

<entry>
    <title>movable type安装无觅Howto</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/07/movabletype-install-wumii-howto.html" />
    <id>tag:blog.suchasplus.com,2011://3.297</id>

    <published>2011-07-26T17:39:54Z</published>
    <updated>2011-07-26T17:57:08Z</updated>

    <summary><![CDATA[ 按照无觅官方movable Type安装说明, 在后台的Design-&gt;Templates，Archive Templates列表中点击名为Entry的模板文件, 在&lt;$mt:EntryBody$&gt;后面添加无觅的部分代码即可。但是这样会导致在显示含有Extended的文章(即包含EntryMore)的时候，无觅的插件会显示在BODY和EXTENDED中间，而不是全文的最后。 所以无觅的movable Type标准安装说明应该修改为: 4. 在编辑域中找到&lt;$mt:EntryBody$&gt;，并在其后添加如下代码： &lt;mt:If tag=&quot;EntryMore&quot;&gt; &lt;mt:Else&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div&nbsp;class=&quot;wumii-hook&quot;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;wurl&quot;&nbsp;value=&quot;&lt;$mt:EntryPermalink$&gt;&quot;&nbsp;/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&lt;input&nbsp;type=&quot;hidden&quot;&nbsp;name=&quot;wtitle&quot;&nbsp;value=&quot;&lt;$mt:EntryTitle encode_html=&quot;1&quot;$&gt;&quot;&nbsp;/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt; &nbsp; &nbsp; &nbsp; &nbsp;...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="notes" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="wumii" label="wumii" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="无觅" label="无觅" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span data-scayt_word="按照无觅官方movable" data-scaytid="7">按照<a href="http://www.wumii.com">无觅</a>官方movable</span> <span data-scayt_word="Type安装说明" data-scaytid="8">Type<a href="http://www.wumii.com/widget/getWidget.htm">安装说明</a></span>, <span data-scayt_word="在后台的Design" data-scaytid="120">在后台的Design</span>-&gt;<span data-scayt_word="Templates，Archive" data-scaytid="10">Templates，Archive</span> <span data-scayt_word="Templates列表中点击名为Entry的模板文件" data-scaytid="11">Templates列表中点击名为Entry的模板文件</span>, 在&lt;$<span data-scayt_word="mt" data-scaytid="12">mt</span>:<span data-scayt_word="EntryBody" data-scaytid="30">EntryBody</span>$&gt;<span data-scayt_word="后面添加无觅的部分代码即可。但是这样会导致在显示含有Extended的文章" data-scaytid="32">后面添加无觅的部分代码即可。但是这样会导致在显示含有Extended的文章</span>(<span data-scayt_word="即包含EntryMore" data-scaytid="33">即包含EntryMore</span>)<span data-scayt_word="的时候，无觅的插件会显示在BODY和EXTENDED中间，而不是全文的最后。" data-scaytid="34">的时候，无觅的插件会显示在BODY和EXTENDED中间，而不是全文的最后。</span></p>
<p>
	<span data-scayt_word="所以无觅的movable" data-scaytid="35">所以无觅的movable</span> <span data-scayt_word="Type标准安装说明应该修改为" data-scaytid="36">Type标准安装说明应该修改为</span>:</p>
<p>
	4. <span data-scayt_word="在编辑域中找到" data-scaytid="37">在编辑域中找到</span><code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(234, 234, 234); padding-top: 1px; padding-right: 3px; padding-bottom: 1px; padding-left: 3px; margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 1px; font-size: 11px; font-family: Consolas, Monaco, Courier, monospace; background-position: initial initial; background-repeat: initial initial; ">&lt;$<span data-scayt_word="mt" data-scaytid="13">mt</span>:<span data-scayt_word="EntryBody" data-scaytid="31">EntryBody</span>$&gt;</code><span data-scayt_word="，并在其后添加如下代码：" data-scaytid="38">，并在其后添加如下代码：</span></p>
<p>
	<span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;<span data-scayt_word="mt" data-scaytid="14">mt</span>:If tag=&quot;<span data-scayt_word="EntryMore" data-scaytid="40">EntryMore</span>&quot;&gt;</span><br />
	<span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;<span data-scayt_word="mt" data-scaytid="15">mt</span>:Else&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">div&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">class</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;<span data-scayt_word="wumii-hook" data-scaytid="42">wumii-hook</span>&quot;</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">input&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">type</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;hidden&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">name</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;<span data-scayt_word="wurl" data-scaytid="44">wurl</span>&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">value</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;&lt;$<span data-scayt_word="mt" data-scaytid="16">mt</span>:<span data-scayt_word="EntryPermalink" data-scaytid="46">EntryPermalink</span>$&gt;&quot;&nbsp;</span><span class="xml-punctuation" style="color: black; ">/&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">input&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">type</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;hidden&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">name</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;<span data-scayt_word="wtitle" data-scaytid="48">wtitle</span>&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">value</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;&lt;$<span data-scayt_word="mt" data-scaytid="17">mt</span>:<span data-scayt_word="EntryTitle" data-scaytid="50">EntryTitle</span> encode_html=&quot;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">1</span><span class="xml-attribute xml-error" style="color: rgb(170, 0, 187); ">&quot;$&gt;&quot;&nbsp;</span><span class="xml-punctuation" style="color: black; ">/&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">div</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">span&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">style</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;display: none;&quot;</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;<span data-scayt_word="mt" data-scaytid="18">mt</span>:<span data-scayt_word="EntryTags" data-scaytid="52">EntryTags</span>&gt;</span><span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">a&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); "><span data-scayt_word="rel" data-scaytid="56">rel</span></span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;tag&quot;</span><span class="xml-punctuation" style="color: black; ">&gt;</span><span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;$<span data-scayt_word="mt" data-scaytid="19">mt</span>:<span data-scayt_word="TagName" data-scaytid="59">TagName</span>$&gt;</span><span class="xml-punctuation" style="color: black; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">a</span><span class="xml-punctuation" style="color: black; ">&gt;</span><span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;/<span data-scayt_word="mt" data-scaytid="20">mt</span>:<span data-scayt_word="EntryTags" data-scaytid="53">EntryTags</span>&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">span</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">script</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</span><span class="js-keyword" style="color: rgb(119, 0, 136); "><span data-scayt_word="var" data-scaytid="61">var</span>&nbsp;</span><span class="js-variable" style="color: black; "><span data-scayt_word="wumiiSitePrefix" data-scaytid="63">wumiiSitePrefix</span>&nbsp;</span><span class="js-operator" style="color: rgb(102, 102, 102); ">=&nbsp;</span><span class="js-string" style="color: rgb(170, 34, 34); ">&quot;&lt;$<span data-scayt_word="mt" data-scaytid="21">mt</span>:<span data-scayt_word="BlogURL" data-scaytid="65">BlogURL</span>$&gt;&quot;</span><span class="js-punctuation" style="color: rgb(102, 102, 102); ">;</span><br />
	<span class="xml-punctuation" style="color: black; ">&nbsp; &nbsp; &nbsp; &nbsp; &lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">script</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;/<span data-scayt_word="mt" data-scaytid="22">mt</span>:If&gt;</span></p>
<p>
	<span data-scayt_word="5.在编辑域中找到" data-scaytid="3">5.在编辑域中找到</span><code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(234, 234, 234); padding-top: 1px; padding-right: 3px; padding-bottom: 1px; padding-left: 3px; margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 1px; font-size: 11px; font-family: Consolas, Monaco, Courier, monospace; background-position: initial initial; background-repeat: initial initial; ">&lt;$<span data-scayt_word="mt" data-scaytid="23">mt</span>:<span data-scayt_word="EntryMore" data-scaytid="41">EntryMore</span>$&gt;</code><span data-scayt_word="，并在其后添加如下代码：" data-scaytid="39">，并在其后添加如下代码：</span></p>
<p>
	<span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">div&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">class</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;<span data-scayt_word="wumii-hook" data-scaytid="43">wumii-hook</span>&quot;</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp;&nbsp;</span><span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">input&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">type</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;hidden&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">name</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;<span data-scayt_word="wurl" data-scaytid="45">wurl</span>&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">value</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;&lt;$<span data-scayt_word="mt" data-scaytid="24">mt</span>:<span data-scayt_word="EntryPermalink" data-scaytid="47">EntryPermalink</span>$&gt;&quot;&nbsp;</span><span class="xml-punctuation" style="color: black; ">/&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp;&nbsp;</span><span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">input&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">type</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;hidden&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">name</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;<span data-scayt_word="wtitle" data-scaytid="49">wtitle</span>&quot;&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">value</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;&lt;$<span data-scayt_word="mt" data-scaytid="25">mt</span>:<span data-scayt_word="EntryTitle" data-scaytid="51">EntryTitle</span> encode_html=&quot;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">1</span><span class="xml-attribute xml-error" style="color: rgb(170, 0, 187); ">&quot;$&gt;&quot;&nbsp;</span><span class="xml-punctuation" style="color: black; ">/&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">div</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">span&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); ">style</span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;display: none;&quot;</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp;&nbsp;</span><span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;<span data-scayt_word="mt" data-scaytid="26">mt</span>:<span data-scayt_word="EntryTags" data-scaytid="54">EntryTags</span>&gt;</span><span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">a&nbsp;</span><span class="xml-attname" style="color: rgb(0, 0, 255); "><span data-scayt_word="rel" data-scaytid="57">rel</span></span><span class="xml-punctuation" style="color: black; ">=</span><span class="xml-attribute" style="color: rgb(34, 136, 17); ">&quot;tag&quot;</span><span class="xml-punctuation" style="color: black; ">&gt;</span><span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;$<span data-scayt_word="mt" data-scaytid="27">mt</span>:<span data-scayt_word="TagName" data-scaytid="60">TagName</span>$&gt;</span><span class="xml-punctuation" style="color: black; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">a</span><span class="xml-punctuation" style="color: black; ">&gt;</span><span class="mt-tag" style="color: rgb(170, 119, 0); ">&lt;/<span data-scayt_word="mt" data-scaytid="28">mt</span>:<span data-scayt_word="EntryTags" data-scaytid="55">EntryTags</span>&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">span</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="xml-punctuation" style="color: black; ">&lt;</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">script</span><span class="xml-punctuation" style="color: black; ">&gt;</span><br />
	<span class="whitespace">&nbsp; &nbsp;&nbsp;</span><span class="js-keyword" style="color: rgb(119, 0, 136); "><span data-scayt_word="var" data-scaytid="62">var</span>&nbsp;</span><span class="js-variable" style="color: black; "><span data-scayt_word="wumiiSitePrefix" data-scaytid="64">wumiiSitePrefix</span>&nbsp;</span><span class="js-operator" style="color: rgb(102, 102, 102); ">=&nbsp;</span><span class="js-string" style="color: rgb(170, 34, 34); ">&quot;&lt;$<span data-scayt_word="mt" data-scaytid="29">mt</span>:<span data-scayt_word="BlogURL" data-scaytid="66">BlogURL</span>$&gt;&quot;</span><span class="js-punctuation" style="color: rgb(102, 102, 102); ">;</span><br />
	<span class="xml-punctuation" style="color: black; ">&lt;/</span><span class="xml-tagname" style="color: rgb(170, 0, 187); ">script</span><span class="xml-punctuation" style="color: black; ">&gt;</span></p>
<p>
	<span data-scayt_word="6.继续在此文件中找到" data-scaytid="4">6.继续在此文件中找到</span><code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(234, 234, 234); padding-top: 1px; padding-right: 3px; padding-bottom: 1px; padding-left: 3px; margin-top: 0px; margin-right: 1px; margin-bottom: 0px; margin-left: 1px; font-size: 11px; font-family: Consolas, Monaco, Courier, monospace; background-position: initial initial; background-repeat: initial initial; ">&lt;/body&gt; &nbsp;</code>..&nbsp;<span data-scayt_word="下略" data-scaytid="67">下略</span></p>
]]>
        <![CDATA[<p>
	<span data-scayt_word="参考文章" data-scaytid="193">参考文章</span>:</p>
<p>
	<a href="https://github.com/movabletype/Documentation/wiki/Category%3ATemplate-Tag-Recipes"><span data-scayt_word="movabletype" data-scaytid="194">movabletype</span>&nbsp;Category:Template Tag Recipes</a></p>
<p>
	<a href="http://www.movabletype.org/documentation/appendices/tags/if.html">&lt;<span data-scayt_word="mt" data-scaytid="183">mt</span>:If&gt;</a></p>
<p>
	<a href="http://www.movabletype.org/documentation/appendices/tags/entrybody.html">&lt;$<span data-scayt_word="mt" data-scaytid="184">mt</span>:<span data-scayt_word="EntryBody" data-scaytid="186">EntryBody</span>$&gt;</a></p>
<div>
	<a href="http://www.movabletype.org/documentation/appendices/tags/entrymore.html">&lt;$<span data-scayt_word="mt" data-scaytid="185">mt</span>:<span data-scayt_word="EntryMore" data-scaytid="187">EntryMore</span>$&gt;</a></div>
]]>
    </content>
</entry>

<entry>
    <title>dokuwiki的noindex和nofollow疑问</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/07/why-dokuwiki-has-noindex-and-nofollow.html" />
    <id>tag:blog.suchasplus.com,2011://3.296</id>

    <published>2011-07-12T18:00:16Z</published>
    <updated>2011-07-12T18:07:49Z</updated>

    <summary><![CDATA[ dokuwiki的页面很多都是&lt;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;/&gt; 默认设置下，在页面修改5天后才会改成index和follow When creating/modifying a page allow search engines to index it after this time (in seconds). This works by adding &lt;meta name=&ldquo;robots&rdquo; content=&ldquo;noindex,nofollow&rdquo; /&gt; in the output if the specified time hasn&#39;t elapsed. 参考链接: doku&nbsp;config:indexdelay doku...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="doku" label="doku" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dokuwiki" label="dokuwiki" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span data-scayt_word="dokuwiki的页面很多都是" data-scaytid="9">dokuwiki的页面很多都是</span>&lt;meta <span class="webkit-html-attribute-name">name</span>=&quot;<span class="webkit-html-attribute-value">robots</span>&quot; <span class="webkit-html-attribute-name">content</span>=&quot;<span class="webkit-html-attribute-value"><span data-scayt_word="noindex" data-scaytid="12">noindex</span>,<span data-scayt_word="nofollow" data-scaytid="13">nofollow</span></span>&quot;/&gt;</p>
<p>
	<span data-scayt_word="默认设置下，在页面修改5天后才会改成index和follow" data-scaytid="22">默认设置下，在页面修改5天后才会改成index和follow</span></p>
<p>
	When creating/modifying a page allow search engines to index it after this time (in seconds). This works by adding &lt;meta name=&ldquo;robots&rdquo; content=<span data-scayt_word=""noindex" data-scaytid="27">&ldquo;noindex</span>,<span data-scayt_word="nofollow"" data-scaytid="28">nofollow&rdquo;</span> /&gt; in the output if the specified time hasn&#39;t elapsed.</p>
<p>
	<span data-scayt_word="参考链接" data-scaytid="31">参考链接</span>:</p>
<p>
	<a href="http://www.dokuwiki.org/config:indexdelay"><span data-scayt_word="doku" data-scaytid="54">doku</span>&nbsp;<span data-scayt_word="config" data-scaytid="64">config</span>:<span data-scayt_word="indexdelay" data-scaytid="78">indexdelay</span></a></p>
<p>
	<a href="http://www.dokuwiki.org/config:relnofollow"><span data-scayt_word="doku" data-scaytid="52">doku</span> <span data-scayt_word="config" data-scaytid="50">config</span>:<span data-scayt_word="relnofollow" data-scaytid="49">relnofollow</span></a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>关于Readability</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/07/readability.html" />
    <id>tag:blog.suchasplus.com,2011://3.295</id>

    <published>2011-07-03T19:14:56Z</published>
    <updated>2011-07-03T19:25:56Z</updated>

    <summary><![CDATA[ 全文Feed的终极解决方案 appspot-python&nbsp;readability fivefilters PHP Port of Arc90&prime;s Readability Content Extraction at FiveFilters.org PHP 版本的 READABILITY 库 readability.com Python Readability decruft arc90s readability in python...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="readability" label="readability" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<ul>
	<li>
		<a href="http://www.ruanyifeng.com/blog/2010/04/the_solution_of_full_text_feed.html">全文Feed的终极解决方案</a></li>
	<li>
		<a href="http://andrewtrusty.appspot.com/readability/">appspot-python&nbsp;readability</a></li>
	<li>
		<a href="https://launchpad.net/fivefilters">fivefilters</a></li>
	<li>
		<a href="http://www.keyvan.net/2010/08/php-readability/">PHP Port of Arc90&prime;s Readability</a></li>
	<li>
		<a href="http://www.keyvan.net/2011/03/content-extraction/">Content Extraction at FiveFilters.org</a></li>
	<li>
		<a href="http://www.gracecode.com/archives/3061/">PHP 版本的 READABILITY 库</a></li>
	<li>
		<a href="http://www.readability.com/ ">readability.com</a></li>
	<li>
		<a href="http://www.pythonclub.org/modules/readability">Python Readability</a></li>
	<li>
		<a href="http://www.minvolai.com/blog/decruft-arc90s-readability-in-python/">decruft arc90s readability in python</a></li>
</ul>
]]>
        
    </content>
</entry>

<entry>
    <title>国家名称  双字母代码表</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/06/ two-letter-country-codes-define.html" />
    <id>tag:blog.suchasplus.com,2011://3.294</id>

    <published>2011-06-22T09:20:41Z</published>
    <updated>2011-06-22T09:24:07Z</updated>

    <summary><![CDATA[ All user request have an&nbsp;X-AppEngine-Country&nbsp;header which contains the&nbsp;ISO-3166-1 alpha-2&nbsp;country code for the user, based on the IP address of the client request. (from GAE ReleaseNotes) ISO 3166-1 alpha-2&nbsp;codes&nbsp;are two-letter&nbsp;country codes&nbsp;defined in&nbsp;ISO 3166-1, part of the&nbsp;ISO 3166&nbsp;standard&nbsp;published by the&nbsp;International Organization...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="gae" label="gae" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iso" label="iso" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	All user request have an&nbsp;<tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">X-AppEngine-Country</tt>&nbsp;header which contains the&nbsp;<tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">ISO-3166-1 alpha-2</tt><strong>&nbsp;country code</strong> for the user, based on the IP address of the client request. (from <a href="http://code.google.com/p/googleappengine/wiki/SdkReleaseNotes">GAE ReleaseNotes</a>)</p>
<p>
	<b>ISO 3166-1 alpha-2</b>&nbsp;<a href="http://en.wikipedia.org/wiki/Code" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="Code">codes</a>&nbsp;are two-letter&nbsp;<a href="http://en.wikipedia.org/wiki/Country_code" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="Country code">country codes</a>&nbsp;defined in&nbsp;<a href="http://en.wikipedia.org/wiki/ISO_3166-1" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="ISO 3166-1">ISO 3166-1</a>, part of the&nbsp;<a href="http://en.wikipedia.org/wiki/ISO_3166" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="ISO 3166">ISO 3166</a>&nbsp;<a href="http://en.wikipedia.org/wiki/Standardization" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="Standardization">standard</a>&nbsp;published by the&nbsp;<a href="http://en.wikipedia.org/wiki/International_Organization_for_Standardization" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="International Organization for Standardization">International Organization for Standardization</a>&nbsp;(ISO), to represent&nbsp;<a href="http://en.wikipedia.org/wiki/Country" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="Country">countries</a>,&nbsp;<a href="http://en.wikipedia.org/wiki/Dependent_territory" style="text-decoration: none; color: rgb(6, 69, 173); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: initial initial; background-repeat: initial initial; " title="Dependent territory">dependent territories</a>, and special areas of geographical interest.&nbsp;</p>
<p>
	ISO 3166-1&nbsp;<a href="http://zh.wikipedia.org/zh-cn/ISO_3166-1">http://zh.wikipedia.org/zh-cn/ISO_3166-1</a><br />
	ISO 3166-1 alpha-2&nbsp;<a href="http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2">http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2</a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>LinuxQQ在Ubuntu 11.04 natty下安装失败</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/06/linuxqq-install-failed-in-ubuntu-11.04-natty-error-in-Version-string-v1.0.2-beta1-version-number-does-not-start-with-digit.html" />
    <id>tag:blog.suchasplus.com,2011://3.293</id>

    <published>2011-06-09T16:28:34Z</published>
    <updated>2011-06-10T06:35:35Z</updated>

    <summary><![CDATA[ &nbsp; LinuxQQ在Ubuntu 11.04 natty下安装失败 QQ@Linux实在很令人怨念啊!!! 好几年不更新了, 连他娘的macQQ都比linuxqq好用, 这回ubuntu natty下连qq都装不上了, dpkg报错 dpkg: warning: parsing file &#39;/var/lib/dpkg/available&#39; near line 9896 package &#39;linuxqq&#39;: &nbsp;error in Version string &#39;v1.0.2-beta1&#39;: version number does not start with digit dpkg: error processing linuxqq_v1.0.2-beta1_i386.deb (--install): &nbsp;parsing file...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="natty" label="natty" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="qq" label="qq" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	LinuxQQ在Ubuntu 11.04 natty下安装失败</div>
<div>
	QQ@Linux实在很令人怨念啊!!!</div>
<div>
	好几年不更新了, 连他娘的macQQ都比linuxqq好用, 这回ubuntu natty下连qq都装不上了, dpkg报错</div>
<div>
	dpkg: warning: parsing file &#39;/var/lib/dpkg/available&#39; near line 9896 package &#39;linuxqq&#39;:</div>
<div>
	&nbsp;error in Version string &#39;v1.0.2-beta1&#39;: <span style="color:#ff0000;"><strong>version number does not start with digit</strong></span></div>
<div>
	dpkg: error processing linuxqq_v1.0.2-beta1_i386.deb (--install):</div>
<div>
	&nbsp;parsing file &#39;/var/lib/dpkg/tmp.ci/control&#39; near line 7 package &#39;linuxqq&#39;:</div>
<div>
	&nbsp;error in Version string &#39;v1.0.2-beta1&#39;: version number does not start with digit</div>
<div>
	Errors were encountered while processing:</div>
<div>
	&nbsp;linuxqq_v1.0.2-beta1_i386.deb</div>
<div>
	&nbsp;</div>
<div>
	解包修改control文件之后就搞定了, 这里先提供fixed版本，明天抱怨去...</div>
<div>
	原版LinuxQQ下载地址: <a href="http://im.qq.com/qq/linux/download.shtml">http://im.qq.com/qq/linux/download.shtml</a></div>
<div>
	version fixed: <a href="http://blog.suchasplus.com/downloads/linuxqq_v1.0.2-beta1-version-fixed_i386.deb">http://blog.suchasplus.com/downloads/linuxqq_v1.0.2-beta1-version-fixed_i386.deb</a></div>
]]>
        <![CDATA[<p>
	&nbsp;</p>
<div>
	<br class="Apple-interchange-newline" />
	&nbsp;</div>
<div>
	原版:&nbsp;md5sum&nbsp;linuxqq_v1.0.2-beta1_i386.deb</div>
<div>
	e269697840f53a8ea8306e600fbd4ed7&nbsp;&nbsp;linuxqq_v1.0.2-beta1_i386.deb</div>
<div>
	version&nbsp;fixed版本:&nbsp;md5sum&nbsp;<a href="http://blog.suchasplus.com/downloads/linuxqq_v1.0.2-beta1-version-fixed_i386.deb">linuxqq_v1.0.2-beta1-version-fixed_i386.deb</a></div>
<div>
	9a8c9c67bf5eb203c4c43c66d5f906c3&nbsp;&nbsp;linuxqq_v1.0.2-beta1-version-fixed_i386.deb</div>
<div>
	&nbsp;</div>
<div>
	curl -I <a href="http://blog.suchasplus.com/downloads/linuxqq_v1.0.2-beta1-version-fixed_i386.deb">http://blog.suchasplus.com/downloads/linuxqq_v1.0.2-beta1-version-fixed_i386.deb</a></div>
<div>
	HTTP/1.1 200 OK</div>
<div>
	Date: Thu, 09 Jun 2011 16:34:30 GMT</div>
<div>
	Server: Apache/2.2.8 (Ubuntu)&nbsp;mod_ssl/2.2.8&nbsp;OpenSSL/0.9.8g</div>
<div>
	Last-Modified: Thu, 09 Jun 2011 16:24:55 GMT</div>
<div>
	ETag: &quot;3bfe-4cb736-4a549e4b363c0&quot;</div>
<div>
	Accept-Ranges: bytes</div>
<div>
	Content-Length: 5027638</div>
<div>
	Content-Type: application/x-debian-package</div>
<div>
	&nbsp;</div>
<div>
	参考文章:</div>
<div>
	<a href="http://blog.solrex.org/articles/packaging-2-deb.html">应用程序打包技术之二（DEB篇）</a></div>
]]>
    </content>
</entry>

<entry>
    <title>mysql单表多timestamp的current_timestamp设置问题</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/06/there-can-be-only-one-TIMESTAMP-column-with-CURRENT-TIMESTAMP-in-DEFAULT-or-ON-UPDATE-clause.html" />
    <id>tag:blog.suchasplus.com,2011://3.292</id>

    <published>2011-06-09T15:21:36Z</published>
    <updated>2011-06-09T15:31:24Z</updated>

    <summary> 一个表中出现多个timestamp并设置其中一个为current_timestamp的时候经常会遇到 #1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause 原因是当你给一个timestamp设置为on update current_timestamp的时候，其他的timestamp字段需要显式设定default值 但是如果你有两个timestamp字段，但是只把第一个设定为current_timestamp而第二个没有设定默认值，mysql也能成功建表, 但是反过来就不行...参见这里 参考文章: Why there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mysql" label="mysql" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	一个表中出现多个timestamp并设置其中一个为current_timestamp的时候经常会遇到</p>
<p>
	#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause</p>
<p>
	原因是当你给一个timestamp设置为on update current_timestamp的时候，其他的timestamp字段需要显式设定default值</p>
<p>
	但是如果你有两个timestamp字段，但是只把第一个设定为current_timestamp而第二个没有设定默认值，mysql也能成功建表, 但是反过来就不行...参见<a href="http://lists.mysql.com/internals/34916">这里</a></p>
<p>
	参考文章:</p>
<p>
	<a href="http://stackoverflow.com/questions/4489548/why-there-can-be-only-one-timestamp-column-with-current-timestamp-in-default-clau">Why there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT clause?</a></p>
<p>
	<a href="http://www.yayu.org/look.php?id=144">MySQL的timestamp类型自动更新问题</a></p>
<p>
	<a href="http://dev.mysql.com/doc/refman/5.1/en/timestamp.html">mysqldoc - timestamp</a></p>
]]>
        <![CDATA[<p>
	eg:</p>
<p>
	&nbsp;</p>
<div>
	CREATE TABLE `users` (</div>
<div>
	&nbsp; `iUId` int(10) unsigned NOT NULL AUTO_INCREMENT,</div>
<div>
	&nbsp; `szUsername` varchar(45) NOT NULL,</div>
<div>
	&nbsp; `szEmail` varchar(60) DEFAULT NULL,</div>
<div>
	&nbsp; `szPassword` varchar(64) NOT NULL, &nbsp;</div>
<div>
	&nbsp; `szInsertTime` timestamp NOT NULL DEFAULT 0,</div>
<div>
	&nbsp; `szLastModTime` timestamp ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,</div>
<div>
	&nbsp; `iStatus` int(11) NOT NULL DEFAULT &#39;0&#39;,</div>
<div>
	&nbsp; PRIMARY KEY (`iUId`)</div>
<div>
	) ENGINE=InnoDB DEFAULT CHARSET=utf8;</div>
]]>
    </content>
</entry>

<entry>
    <title>ubuntu cli下screenshot测试</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/06/screenshot-in-ubuntu-cli.html" />
    <id>tag:blog.suchasplus.com,2011://3.291</id>

    <published>2011-06-08T18:25:56Z</published>
    <updated>2011-06-08T18:51:20Z</updated>

    <summary><![CDATA[ 这几天需要在没有desktop的cli下做网站截图，google了一圈， 基本都是采用xvfb作为虚拟x-server来显示， 然后利用firefox/chrome或者qt-webkit类软件来实现截图 firefox/chrome类相对来说麻烦一下，但是通过安装flashplugin, 可以显示flash, 但是一般都需要imagemagick来实现边框移除 qt-webkit类的，比较方便，但是好像flash都无法正常显示, 这点在grab大陆站点的时候尤其郁闷 不过最方便的还是 apt-get install xvfb&nbsp;xfonts-wqy; fontconfig-voodoo -f -s zh_CN之后直接用python来截屏。 示例(ubuntu&nbsp;8.04 LTS server x64上测试): firefox&nbsp;with flash screenshot/thumb webkit2png screenshot 参考链接: 一个python版的开源web截图工具:python-webkit2png python-webkit2png xvfb制作网页截图 screenshot server 在 Linux 上架設 Screenshot Service linux下命令实现网络截图 How to...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="screenshot" label="screenshot" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xvfb" label="xvfb" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span class="Apple-style-span" style="white-space: nowrap;">这几天需要在没有desktop的cli下做网站截图，google了一圈，</span></p>
<p>
	<span class="Apple-style-span" style="white-space: nowrap;">基本都是采用xvfb作为虚拟x-server来显示，</span></p>
<p>
	<span class="Apple-style-span" style="white-space: nowrap;">然后利用firefox/chrome或者qt-webkit类软件来实现截图</span></p>
<p>
	firefox/chrome类相对来说麻烦一下，但是通过安装flashplugin, 可以显示flash, 但是一般都需要imagemagick来实现边框移除</p>
<p>
	qt-webkit类的，比较方便，但是好像flash都无法正常显示, 这点在grab大陆站点的时候尤其郁闷</p>
<p>
	不过最方便的还是</p>
<p>
	apt-get install xvfb&nbsp;xfonts-wqy; fontconfig-voodoo -f -s zh_CN之后直接用python来截屏。</p>
<p>
	示例(ubuntu&nbsp;8.04 LTS server x64上测试):</p>
<p>
	firefox&nbsp;with flash <a href="http://blog.suchasplus.com/downloads/images/screenshot-example-firefox-sohu-com.jpg">screenshot</a>/<a href="http://blog.suchasplus.com/downloads/images/screenshot-example-thumb-firefox-sohu-com.jpg">thumb</a></p>
<p>
	webkit2png <a href="http://blog.suchasplus.com/downloads/images/screenshot-example-blog-suchasplus-com.png">screenshot</a></p>
<p>
	参考链接:</p>
<p>
	<a href="http://bluehua.org/2010/07/23/1397.html">一个python版的开源web截图工具:python-webkit2png</a></p>
<p>
	<a href="https://github.com/AdamN/python-webkit2png/"><span class="Apple-style-span" style="white-space: nowrap;">python-webkit2png</span></a></p>
<p>
	<a href="http://www.mcncc.com/read-htm-tid-56356.html">xvfb制作网页截图</a></p>
<p>
	<a href="http://rafal.zelazko.info/2009/08/21/screenshot-server/">screenshot server</a></p>
<p>
	<a href="http://blog.xdite.net/?p=765">在 Linux 上架設 Screenshot Service</a></p>
<p>
	<a href="http://www.ys250.com/2011/01/28/linux_html2image_xvfb_cutycap/">linux下命令实现网络截图</a></p>
<p>
	<a href="http://www.mobitechie.com/browser/how-to-run-chrome-browser-windowless-using-xvfb/">How to run chrome browser windowless using xvfb</a></p>
<p>
	<a href="http://www.semicomplete.com/blog/geekery/xvfb-firefox.html">xvfb+firefox</a></p>
<p>
	<a href="http://blog.saymoon.com/2009/11/take-snapshot-in-linux-command-line/">linux命令行抓取网页快照-（xvfb+CutyCapt）</a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>linux kernel io scheduler memo</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/05/linux-kernel-io-scheduler-memo.html" />
    <id>tag:blog.suchasplus.com,2011://3.290</id>

    <published>2011-05-21T16:29:19Z</published>
    <updated>2011-05-21T16:35:03Z</updated>

    <summary><![CDATA[ Choosing an I/O Scheduler for Red Hat&reg; Enterprise Linux&reg; 4 and the 2.6 Kernel 2.6内核的四种io调度算法 异步IO一定更好吗？ 续：异步IO一定更好吗？...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="io" label="io" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="kernel" label="kernel" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="scheduler" label="scheduler" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<a href="http://www.redhat.com/magazine/008jun05/features/schedulers/">Choosing an I/O Scheduler for Red Hat&reg; Enterprise Linux&reg; 4 and the 2.6 Kernel</a></p>
<p>
	<a href="http://blogold.chinaunix.net/u2/86696/showart_2072113.html">2.6内核的四种io调度算法</a></p>
<p>
	<a href="http://cnodejs.org/blog/?p=611">异步IO一定更好吗？</a></p>
<p>
	<a href="http://cnodejs.org/blog/?p=1015">续：异步IO一定更好吗？</a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>maven编译quartz缺少jms-1.1.jar</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/05/can-not-download-jms-1.1-jar-when-compile-quartz-using-maven-2.html" />
    <id>tag:blog.suchasplus.com,2011://3.289</id>

    <published>2011-05-14T19:44:20Z</published>
    <updated>2011-05-14T20:01:39Z</updated>

    <summary><![CDATA[ quartz的full distribution里面没有附带src的jar, 只得自己编译 mvn编译的时候提示找不到jms-1.1.jar Google的结果显示原因是: Often users are confronted with the need to build against JARs provide by Sun like the&nbsp;JavaMail&nbsp;JAR, or the&nbsp;Activation&nbsp;JAR and users have found these JARs not present in central repository resulting in a broken build....]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="java" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="jboss" label="jboss" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="maven" label="maven" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="quartz" label="quartz" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	quartz的full distribution里面没有附带src的jar, 只得自己编译<br />
	mvn编译的时候提示找不到jms-1.1.jar<br />
	Google的结果显示原因是:</p>
<p>
	<em>Often users are confronted with the need to build against JARs provide by Sun like the&nbsp;<a class="externalLink" href="http://java.sun.com/products/javamail/" style="text-decoration: none; color: rgb(68, 119, 170); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 0px; background-position: initial initial; background-repeat: initial initial; ">JavaMail</a>&nbsp;JAR, or the&nbsp;<a class="externalLink" href="http://java.sun.com/products/javabeans/jaf/downloads/index.html" style="text-decoration: none; color: rgb(68, 119, 170); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; padding-right: 0px; background-position: initial initial; background-repeat: initial initial; ">Activation</a>&nbsp;JAR and users have found these JARs not present in central repository resulting in a broken build. Unfortunately most of these artifacts fall under Sun&#39;s Binary License which disallows us from distributing them from Ibiblio.</em></p>
<p>
	解决方案也就是自己添加相应的<span class="Apple-style-span" style="white-space: normal; ">repository</span><span class="Apple-style-span" style="white-space: normal; ">, 在自己的POM文件或者settings.xml中添加</span></p>
<p>
	&nbsp;</p>
<div>
	<div>
		<em>&nbsp;&nbsp; &nbsp;&lt;repositories&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;repository&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;Java.net Repository for Maven&lt;/name&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;layout&gt;default&lt;/layout&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/repository&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;repository&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;id&gt;maven2-repository.jboss.org&lt;/id&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;Jboss Repository for Maven&lt;/name&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;url&gt;http://repository.jboss.org/maven2/&lt;/url&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;layout&gt;default&lt;/layout&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/repository&gt;</em></div>
	<div>
		<em>&nbsp;&nbsp; &nbsp;&lt;/repositories&gt;</em></div>
	<div>
		&nbsp;</div>
	<div>
		参考文章:<br />
		<a href="http://forums.terracotta.org/forums/posts/list/4837.page">quartz: mvn install fails for 1.8.4</a><br />
		<a href="http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html">maven:&nbsp;Coping with Sun JARs</a></div>
	<div>
		<a href="http://maven.apache.org/settings.html#Repositories">maven:&nbsp;Settings Reference</a></div>
	<div>
		<a href="http://www.robyoung.me.uk/2010/02/stop-maven-complaining-about-javaxjmsjms1-1jms-1-1-jar-cannot-read-zip-file/">Rob Young: Stop Maven Complaining about javax/jms/jms/1.1/jms-1.1.jar; cannot read zip file</a></div>
	<div>
		<a href="https://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException">maven:&nbsp;DependencyResolutionException</a></div>
	<div>
		&nbsp;</div>
	<div>
		ps1: maven官网说新建个<a href="http://download.java.net/maven/2/">java.net</a><a href="http://download.java.net/maven/2/"> </a><a href="http://download.java.net/maven/2/">repository</a>条目即可, 但是java.net的maven仓库已经没有jms了 =,= 还是<a href="http://repository.jboss.org/maven2/">jboss</a>的repository比较给力</div>
	<div>
		ps2: 顺带提供编译好的<a href="http://blog.suchasplus.com/downloads/quartz-2.0.1-sources.jar">quartz-2.0.1-src</a><a href="http://blog.suchasplus.com/downloads/quartz-2.0.1-sources.jar">.jar</a></div>
</div>
]]>
        
    </content>
</entry>

<entry>
    <title>几个paste工具站点</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/05/paste-sites.html" />
    <id>tag:blog.suchasplus.com,2011://3.288</id>

    <published>2011-05-13T06:55:04Z</published>
    <updated>2011-05-13T07:10:49Z</updated>

    <summary><![CDATA[ pastie pastebin notepad.im&nbsp;(powered by fredwang&nbsp;&amp;&amp; neowang) simplenoteapp droplr (mac专用) 不过不公开的话, 还是evernote好用... &nbsp;...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="闲谈" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="droplr" label="droplr" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="fredwang" label="fredwang" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="neowang" label="neowang" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="notepadim" label="notepad.im" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="paste" label="paste" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<a href="http://pastie.org">pastie</a><br />
	<a href="http://pastebin.com/">pastebin</a><br />
	<a href="http://notepad.im">notepad.im</a>&nbsp;(powered by <a href="http://dtapp.cn">fredwang</a>&nbsp;&amp;&amp; <a href="http://blog.sosolabs.com">neowang</a>)<br />
	<a href="http://simplenoteapp.com/">simplenoteapp</a><br />
	<a href="http://droplr.com/hello">droplr</a> (mac专用)</p>
<p>
	不过不公开的话, 还是<a href="http://www.evernote.com/">evernote</a>好用...<br />
	<br />
	<br />
	&nbsp;</p>
]]>
        
    </content>
</entry>

<entry>
    <title>JDK终于有直接下载地址了</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/04/jdk-direct-download-link-published.html" />
    <id>tag:blog.suchasplus.com,2011://3.287</id>

    <published>2011-04-25T12:29:28Z</published>
    <updated>2011-04-25T12:38:21Z</updated>

    <summary><![CDATA[ &nbsp; 纯抱怨, 以前的Sun(Oracle) JDK在下载的时候，要点击一堆Agreement才能在浏览器里面单线程下载，拖到迅雷离线里面也很难下载，只能等80MB在chrome里面一点点单线程拖下载 今天JDK6U25发布, 打开oracle网站, 赫然发现Oracle已经提供了JDK直接下载地址，Terminal下axel -n 10 一把，速度很给力啊 &nbsp; [100%] &nbsp;.......... .......... .......... .......... .......... &nbsp;[4494.4KB/s] Downloaded 81.1 megabytes in 18 seconds. (4485.71 KB/s) 顺带bs一下电信通, 居然无法连接download.oracle.com的80...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="java" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="java" label="java" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jdk" label="jdk" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="oracle" label="oracle" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sun" label="sun" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	纯抱怨, 以前的Sun(Oracle) <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK</a>在下载的时候，要点击一堆Agreement才能在浏览器里面单线程下载，拖到迅雷离线里面也很难下载，只能等80MB在chrome里面一点点单线程拖下载</div>
<div>
	今天JDK6U25发布, 打开oracle网站, 赫然发现Oracle已经提供了<a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html">JDK直接下载地址</a>，Terminal下axel -n 10 一把，速度很给力啊</div>
<div>
	<div>
		&nbsp;</div>
	<div>
		[100%] &nbsp;.......... .......... .......... .......... .......... &nbsp;[4494.4KB/s]</div>
</div>
<div>
	Downloaded 81.1 megabytes in 18 seconds. (4485.71 KB/s)</div>
<div>
	顺带bs一下电信通, 居然无法连接download.oracle.com的80</div>
]]>
        
    </content>
</entry>

<entry>
    <title>数据库字段复用的基本原理与示例</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/04/basic-principles-of-database-fields-reusage.html" />
    <id>tag:blog.suchasplus.com,2011://3.286</id>

    <published>2011-04-14T12:38:02Z</published>
    <updated>2011-04-14T12:40:52Z</updated>

    <summary><![CDATA[ &nbsp; 一、逻辑代数基础： &nbsp; 1，数字用二进制表示，所有可能出现的数只有0和1两个。 2，基本运算只有&ldquo;与&rdquo;、&ldquo;或&rdquo;、&ldquo;非&rdquo;三种。 &nbsp; 与运算定义为：（用 &amp; 表示与运算） &nbsp; 0 &amp; 0 = 0&nbsp; 0 &amp; 1 = 0 1 &amp; 0 = 0 1 &amp; 1 = 1 &nbsp; 可以简单理解为：只要有一个0，结果就是0，和乘法类似。 &nbsp; 或运算定义为：（用 | 表示与运算） &nbsp; 0 |...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mysql" label="mysql" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	一、逻辑代数基础：</div>
<div>
	&nbsp;</div>
<div>
	1，数字用二进制表示，所有可能出现的数只有0和1两个。</div>
<div>
	2，基本运算只有&ldquo;与&rdquo;、&ldquo;或&rdquo;、&ldquo;非&rdquo;三种。</div>
<div>
	&nbsp;</div>
<div>
	与运算定义为：（用 &amp; 表示与运算）</div>
<div>
	&nbsp;</div>
<div>
	0 &amp; 0 = 0&nbsp;</div>
<div>
	0 &amp; 1 = 0</div>
<div>
	1 &amp; 0 = 0</div>
<div>
	1 &amp; 1 = 1</div>
<div>
	&nbsp;</div>
<div>
	可以简单理解为：只要有一个0，结果就是0，和乘法类似。</div>
<div>
	&nbsp;</div>
<div>
	或运算定义为：（用 | 表示与运算）</div>
<div>
	&nbsp;</div>
<div>
	0 | 0 = 0&nbsp;</div>
<div>
	0 | 1 = 1</div>
<div>
	1 | 0 = 1</div>
<div>
	1 | 1 = 1</div>
<div>
	&nbsp;</div>
<div>
	可以简单理解为：只要有一个1，结果就是1，和加法类似。</div>
<div>
	&nbsp;</div>
<div>
	二、逻辑运算示例：</div>
<div>
	&nbsp;</div>
<div>
	01111010101010101111111111111111 &amp; 1100000 = 1100000</div>
<div>
	&nbsp;</div>
<div>
	一般可以理解为：</div>
<div>
	&nbsp;</div>
<div>
	如果要获取一个数字某N位的数值，只需要将这个数字与2的N-1次方（掩码）进行与运算即可。</div>
]]>
        <![CDATA[<p>
	&nbsp;</p>
<div>
	三、数据库字段定义：</div>
<div>
	&nbsp;</div>
<div>
	以数据表 binary_sample为例：</div>
<div>
	&nbsp;</div>
<div>
	create table binary_sample(</div>
<div>
	uid int unsigned not null,</div>
<div>
	status int unsigned not null default 0,</div>
<div>
	primary key(uid),</div>
<div>
	key i_s(status)</div>
<div>
	)engine=innodb;</div>
<div>
	&nbsp;</div>
<div>
	status字段定义：</div>
<div>
	&nbsp;</div>
<div>
	status字段数据类型为32bit的整数，为了尽可能的存储多个属性，我们将其进行如下定义：</div>
<div>
	以下所有&ldquo;位&rdquo;的描述顺序按照从低到高（从右到左）顺序表示。</div>
<div>
	&nbsp;</div>
<div>
	0-2位表示用户注册状态：</div>
<div>
	&nbsp;</div>
<div>
	000 表示新注册未被批准</div>
<div>
	001 表示注册被批准</div>
<div>
	010 表示位高级用户</div>
<div>
	011 表示管理员</div>
<div>
	100 表示超级管理员</div>
<div>
	101 保留</div>
<div>
	110 保留</div>
<div>
	111 掩码</div>
<div>
	&nbsp;</div>
<div>
	3-5位用户性别：</div>
<div>
	&nbsp;</div>
<div>
	000 表示性别不确定</div>
<div>
	001 表示性别为男</div>
<div>
	010 表示性别为女</div>
<div>
	011 保留</div>
<div>
	100 保留</div>
<div>
	101 保留</div>
<div>
	110 保留</div>
<div>
	111 掩码</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 男用户 则：</div>
<div>
	select * from binary_sample where status &amp; b&#39;111000&#39; = b&#39;001000&#39;;</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 管理员用户 则：</div>
<div>
	select * from binary_sample where status &amp; b&#39;111&#39; = b&#39;011&#39;;</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 男管理员用户 则：</div>
<div>
	select * from binary_sample where status &amp; b&#39;111111&#39; = b&#39;001011&#39;;</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 非 新注册未被批准用户 则：</div>
<div>
	&nbsp;</div>
<div>
	select * from binary_sample where status &amp; b&#39;111&#39; != b&#39;000&#39;;</div>
<div>
	&nbsp;</div>
<div>
	&nbsp;</div>
<div>
	四，使用PHP程序进行此类计算：</div>
<div>
	&nbsp;</div>
<div>
	&nbsp;</div>
<div>
	define(&quot;USER_NEW&quot;,0);<span class="Apple-tab-span" style="white-space:pre"> </span>//000</div>
<div>
	define(&quot;USER_NORMAL&quot;,1);<span class="Apple-tab-span" style="white-space:pre"> </span>//001</div>
<div>
	define(&quot;USER_ADVANCE&quot;,2);<span class="Apple-tab-span" style="white-space:pre"> </span>//010</div>
<div>
	define(&quot;USER_MANAGE&quot;,3);<span class="Apple-tab-span" style="white-space:pre"> </span>//011</div>
<div>
	define(&quot;USER_SUPER&quot;,4);<span class="Apple-tab-span" style="white-space:pre"> </span>//100</div>
<div>
	define(&quot;USER_MASK&quot;,7);<span class="Apple-tab-span" style="white-space:pre"> </span>//111</div>
<div>
	&nbsp;</div>
<div>
	define(&quot;GENDER_UNKNOWN&quot;,0);<span class="Apple-tab-span" style="white-space:pre"> </span>// 000000</div>
<div>
	define(&quot;GENDER_MALE&quot;,8);<span class="Apple-tab-span" style="white-space:pre"> </span>// 001000</div>
<div>
	define(&quot;GENDER_FEMALE&quot;,9);<span class="Apple-tab-span" style="white-space:pre"> </span>// 010000</div>
<div>
	define(&quot;GENDER_MASK&quot;,56); <span class="Apple-tab-span" style="white-space:pre"> </span>// 111000</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 男用户 则：</div>
<div>
	$status=GENDER_MALE;</div>
<div>
	$mask=GENDER_MASK;</div>
<div>
	$sql=&quot;select * from binary_sample where status &amp; ${mask}&#39; = ${status}&quot;;</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 管理员用户 则：</div>
<div>
	$status=USER_MANAGE;</div>
<div>
	$mask=USER_MASK;</div>
<div>
	$sql=&quot;select * from binary_sample where status &amp; ${mask}&#39; = ${status}&quot;;</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 男管理员用户 则：</div>
<div>
	$status=GENDER_MALE &amp; USER_MANAGE;</div>
<div>
	$mask = GENDER_MASK &amp; GENDER_MASK;</div>
<div>
	$sql=&quot;select * from binary_sample where status &amp; ${mask}&#39; = ${status}&quot;;</div>
<div>
	&nbsp;</div>
<div>
	如果我们要查询所有 非 新注册未被批准用户 则：</div>
<div>
	$status = USER_NEW;</div>
<div>
	$mask = USER_MASK;</div>
<div>
	$sql=&quot;select * from binary_sample where status &amp; ${mask} != ${status}&quot;;</div>
<div>
	&nbsp;</div>
<div>
	依此类推，只要定义好每个值的含义，查询基本上就定了。</div>]]>
    </content>
</entry>

<entry>
    <title>全他妈三产啊</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/04/san-chan.html" />
    <id>tag:blog.suchasplus.com,2011://3.285</id>

    <published>2011-04-13T05:43:09Z</published>
    <updated>2011-04-13T07:24:42Z</updated>

    <summary><![CDATA[ 前情提要: 北京大幅调高停车费 停车管理员因收费屡被打骂 该交就交, 交不起别开, 但是路边收费的那些人, 在非收费路段收费(占道停车), 只收费不干活...上网Google了一下收费人的背景(绝大部分来自xcar)... 公联安达 &lt;=&nbsp;海淀交支 公联顺达 &lt;= 公路局 海安停车 &lt;=&nbsp;海淀公安分局 京安停车 &lt;=&nbsp;交管局...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="闲谈" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="停车" label="停车" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="公安" label="公安" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	前情提要: <a href="http://news.163.com/11/0413/01/71G0P66O00014AED.html">北京大幅调高停车费 停车管理员因收费屡被打骂</a></p>
<p>
	该交就交, 交不起别开, 但是路边收费的那些人, 在非收费路段收费(占道停车), 只收费不干活...上网Google了一下收费人的背景(绝大部分来自xcar)...</p>
<div>
	公联安达 &lt;=&nbsp;海淀交支</div>
<div>
	公联顺达 &lt;= 公路局</div>
<div>
	海安停车<span class="Apple-tab-span" style="white-space:pre"> </span>&lt;=&nbsp;海淀公安分局</div>
<div>
	京安停车<span class="Apple-tab-span" style="white-space:pre"> </span>&lt;=&nbsp;交管局</div>
]]>
        <![CDATA[<p>
	收汽车停车费之外, 中关村家乐福门口还有挂着海安牌照的人收自行车停车费用, 同样是没有收费牌照, &nbsp;不按照标准价格收费...基本是2倍价格，&nbsp;旁边就是城管和警察的，从来不管。<br />
	问之，答曰他们每月向海安公司交钱，换来一个海安的挂牌，进行收费。</p>
<p>
	<a href="http://www.hdzx.gov.cn/web/hdzx/wyfc/5617.htm">海安董事长风采</a></p>
<p>
	在苏州街地铁口停自行车，取车的时候非要收我一块钱，问之按照收费标准应该是三毛，<br />
	答曰按照标准，每个地铁口应该每月补贴每人(看管员)1200元，<br />
	每个停车点配置三个人，这个补贴是市政府的补贴。<br />
	但是地铁公司把这些钱全部截留，然后按照每人每月上缴200元标准进行招标.....</p>
]]>
    </content>
</entry>

<entry>
    <title>面向站长和网站管理员的Web缓存加速指南[翻译]</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/04/caching-tutorial.html" />
    <id>tag:blog.suchasplus.com,2011://3.284</id>

    <published>2011-04-05T16:07:05Z</published>
    <updated>2011-04-05T16:14:38Z</updated>

    <summary><![CDATA[ &nbsp; 原文（英文）地址：&nbsp;http://www.mnot.net/cache_docs/&nbsp; 版权声明：署名-非商业性使用-禁止演绎 2.0 这是一篇知识性的文档，主要目的是为了让Web缓存相关概念更容易被开发者理解并应用于实际的应用环境中。为了简要起见，某些实现方面的细节被简化或省略了。如果你更关心细节实现则完全不必耐心看完本文，后面参考文档和更多深入阅读部分可能是你更需要的内容。 什么是Web缓存，为什么要使用它？ 缓存的类型： 浏览器缓存； 代理服务器缓存； Web缓存无害吗？为什么要鼓励缓存？ Web缓存如何工作： 如何控制（控制不）缓存： HTML Meta标签 vs. HTTP头信息； Pragma HTTP头信息（为什么不起作用）； 使用Expires（过期时间）HTTP头信息控制保鲜期； Cache-Control（缓存控制） HTTP头信息； 校验参数和校验； 创建利于缓存网站的窍门； 编写利于缓存的脚本； 常见问题解答； 缓存机制的实现：Web服务器端配置； 缓存机制的实现：服务器端脚本； 参考文档和深入阅读； 关于本文档；...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cache" label="cache" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="缓存" label="缓存" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<p style="margin-top: 10px; margin-bottom: 10px; ">
	原文（英文）地址：&nbsp;<a href="http://www.mnot.net/cache_docs/" style="text-decoration: underline; color: rgb(49, 101, 206); ">http://www.mnot.net/cache_docs/</a>&nbsp; 版权声明：<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh" style="text-decoration: underline; color: rgb(49, 101, 206); ">署名-非商业性使用-禁止演绎</a><a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh" style="text-decoration: underline; color: rgb(49, 101, 206); "> 2.0</a></p>
<p style="margin-top: 10px; margin-bottom: 10px; ">
	这是一篇知识性的文档，主要目的是为了让Web缓存相关概念更容易被开发者理解并应用于实际的应用环境中。为了简要起见，某些实现方面的细节被简化或省略了。如果你更关心细节实现则完全不必耐心看完本文，后面参考文档和更多深入阅读部分可能是你更需要的内容。</p>
<ol style="margin-top: 10px; margin-bottom: 10px; ">
	<li>
		什么是Web缓存，为什么要使用它？</li>
	<li>
		缓存的类型：
		<ol style="margin-top: 10px; margin-bottom: 10px; ">
			<li>
				浏览器缓存；</li>
			<li>
				代理服务器缓存；</li>
		</ol>
	</li>
	<li>
		Web缓存无害吗？为什么要鼓励缓存？</li>
	<li>
		Web缓存如何工作：</li>
	<li>
		如何控制（控制不）缓存：
		<ol style="margin-top: 10px; margin-bottom: 10px; ">
			<li>
				HTML Meta标签 vs. HTTP头信息；</li>
			<li>
				Pragma HTTP头信息（为什么不起作用）；</li>
			<li>
				使用Expires（过期时间）HTTP头信息控制保鲜期；</li>
			<li>
				Cache-Control（缓存控制） HTTP头信息；</li>
			<li>
				校验参数和校验；</li>
		</ol>
	</li>
	<li>
		创建利于缓存网站的窍门；</li>
	<li>
		编写利于缓存的脚本；</li>
	<li>
		常见问题解答；</li>
	<li>
		缓存机制的实现：Web服务器端配置；</li>
	<li>
		缓存机制的实现：服务器端脚本；</li>
	<li>
		参考文档和深入阅读；</li>
	<li>
		关于本文档；</li>
</ol>
]]>
        <![CDATA[<p>
	<span class="Apple-style-span" style="font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; font-size: 14px; ">什么是Web缓存，为什么要使用它？</span></p>
<div class="entry-more" id="more" style="clear: both; ">
	Web缓存位于Web服务器之间（1个或多个，内容源服务器）和客户端之间（1个或多个）：缓存会根据进来的请求保存输出内容的副本，例如html页面， 图片，文件（统称为副本），然后，当下一个请求来到的时候：如果是相同的URL，缓存直接使用副本响应访问请求，而不是向源服务器再次发送请求。<br />
	<br />
	使用缓存主要有2大理由：<br />
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			<strong>减少相应延迟</strong>：因为请求从缓存服务器（离客户端更近）而不是源服务器被相应，这个过程耗时更少，让web服务器看上去相应更快；</li>
		<li>
			<strong>减少网络带宽消耗</strong>：当副本被重用时会减低客户端的带宽消耗；客户可以节省带宽费用，控制带宽的需求的增长并更易于管理。</li>
	</ul>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		<span style="font-weight: bold; ">缓存的类型</span></h3>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		浏览器缓存</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		对于新一代的Web浏览器来说（例如：IE，Firefox）：一般都能在设置对话框中发现关于缓存的设置，通过在你的电脑上僻处一块硬盘空间用于存储你已经看过的网站的副本。浏览器缓存根据非常简单的规则进行工作：在同一个会话过程中（在当前浏览器没有被关闭之前）会检查一次并确定缓存的副本足够新。这个缓存对于用户点击&ldquo;后退&rdquo;或者点击刚访问过的链接特别有用，如果你浏览过程中访问到同一个图片，这些图片可以从浏览器缓存中调出而即时显现。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		代理服务器缓存</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Web代理服务器使用同样的缓存原理，只是规模更大。代理服务器群为成百上千用户服务使用同样的机制；大公司和ISP经常在他们的防火墙上架设代理缓存或者单独的缓存设备；</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		由于带路服务器缓存并非客户端或者源服务器的一部分，而是位于原网络之外，请求必须路由到他们才能起作用。一个方法是手工设置你的浏览器：告诉浏览器使用 那个代理，另外一个是通过中间服务器：这个中间服务器处理所有的web请求，并将请求转发到后台网络，而用户不必配置代理，甚至不必知道代理的存在；</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		代理服务器缓存：是一个共享缓存，不只为一个用户服务，经常为大量用户使用，因此在减少相应时间和带宽使用方面很有效：因为同一个副本会被重用多次。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		网关缓存</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		也被称为反向代理缓存或间接代理缓存，网关缓存也是一个中间服务器，和内网管理员部署缓存用于节省带宽不同：网关缓存一般是网站管理员自己部署：让他们的网站更容易扩展并获得更好的性能；<br />
		请求有几种方法被路由到网关缓存服务器上：其中典型的是让用一台或多台负载均衡服务器从客户端看上去是源服务器；<br />
		<br />
		网络内容发布商&nbsp; (Content delivery networks CDNs)分布网关缓存到整个（或部分）互联网上，并出售缓存服务给需要的网站，<a href="http://www.speedera.com/" style="text-decoration: underline; color: rgb(49, 101, 206); ">Speedera</a>和<a href="http://www.akamai.com/" style="text-decoration: underline; color: rgb(49, 101, 206); ">Akamai</a>就是典型的网络内容发布商(下文简称CDN)。<br />
		<br />
		本问主要关注于浏览器和代理缓存，当然，有些信息对于网关缓存也同样有效；</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Web缓存无害吗？为什么要鼓励缓存？</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Web缓存在互联网上最容易被误解的技术之一：网站管理员经常怕对网站失去控制，由于代理缓存会&ldquo;隐藏&rdquo;他们的用户，让他们感觉难以监控谁在使用他们的网站。<br />
		不幸的是：就算不考虑Web缓存，互联网上也有很多网站使用非常多的参数以便管理员精确地跟踪用户如何使用他们的网站；如果这类问题也是你关心的，本文将告诉你如何获得精确的统计而不必将网站设计的非常缓存不友好。<br />
		另外一个抱怨是缓存会给用户过期或失效的数据；无论如何：本文可以告诉你怎样配置你的服务器来控制你的内容将被如何缓存。<br />
		<br />
		CDN是另外一个有趣的方向，和其他代理缓存不同：CDN的网关缓存为希望被缓存的网站服务，没有以上顾虑。即使你使用了CDN，你也要考虑后续的代理服务器缓存和浏览器缓存问题。</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		另外一方面：如果良好地规划了你的网站，缓存会有助于网站服务更快，并节省服务器负载和互联网的链接请求。这个改善是显著的：一个难以缓存的网站可能需要几秒去载入页面，而对比有缓存的网站页面几乎是即时显现：用户更喜欢速度快的网站并更经常的访问；</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		这样想：很多大型互联网公司为全世界服务器群投入上百万资金，为的就是让用户访问尽可能快，客户端缓存也是这个目的，只不过更靠近用户一端，而且最好的一点是你甚至根本不用为此付费。</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		事实上，无论你是否喜欢，代理服务器和浏览器都回启用缓存。如果你没有配置网站正确的缓存，他们会按照缺省或者缓存管理员的策略进行缓存。<br />
		&nbsp;</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		缓存如何工作</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		所有的缓存都用一套规则来帮助他们决定什么时候使用缓存中的副本提供服务（假设有副本可用的情况下）；一些规则在协议中有定义（HTTP协议1.0和1.1），一些规则由缓存的管理员设置（浏览器的用户或者代理服务器的管理员）；<br />
		一般说来：遵循以下基本的规则（不必担心，你不必知道所有的细节，细节将随后说明）</p>
	<ol style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			如果响应头信息：告诉缓存器不要保留缓存，缓存器就不会缓存相应内容；</li>
		<li>
			如果请求信息是需要认证或者安全加密的，相应内容也不会被缓存；</li>
		<li>
			如果在回应中不存在校验器（ETag或者Last-Modified头信息），缓存服务器会认为缺乏直接的更新度信息，内容将会被认为不可缓存。</li>
		<li>
			一个缓存的副本如果含有以下信息：内容将会被认为是足够新的
			<ul style="margin-top: 10px; margin-bottom: 10px; ">
				<li>
					含有完整的过期时间和寿命控制头信息，并且内容仍在保鲜期内；</li>
				<li>
					浏览器已经使用过缓存副本，并且在一个会话中已经检查过内容的新鲜度；</li>
				<li>
					缓存代理服务器近期内已经使用过缓存副本，并且内容的最后更新时间在上次使用期之前；</li>
				<li>
					够新的副本将直接从缓存中送出，而不会向源服务器发送请求；</li>
			</ul>
		</li>
		<li>
			如果缓存的副本已经太旧了，缓存服务器将向源服务器发出请求校验请求，用于确定是否可以继续使用当前拷贝继续服务；</li>
	</ol>
	总之：<strong><em>新鲜度</em></strong>和<strong>校验</strong>是确定内容是否可用的最重要途径：
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		&nbsp;</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		如果副本足够新，从缓存中提取就立刻能用了；<br />
		而经缓存器校验后发现副本的原件没有变化，系统也会避免将副本内容从源服务器整个重新传输一遍。<br />
		&nbsp;</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		如何控制（控制不）缓存</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		有很多工具可以帮助设计师和网站管理员调整缓存服务器对待网站的方式，这也许需要你亲自下手对服务器的配置进行一些调整，但绝对值得；了解如何使用这些工具请参考后面的实现章节；</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		HTML meta标签和HTTP 头信息</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		HTML的编写者会在文档的&lt;HEAD&gt;区域中加入描述文档的各种属性，这些META标签常常被用于标记文档不可以被缓存或者标记多长时间后过期；<br />
		META标签使用很简单：但是效率并不高，因为只有几种浏览器会遵循这个标记（那些真正会&ldquo;读懂&rdquo;HTML的浏览器），没有一种缓存代理服务器能遵循这个 规则（因为它们几乎完全不解析文档中HTML内容）；有事会在Web页面中增加：Pragma: no-cache这个META标记，如果要让页面保持刷新，这个标签其实完全没有必要。<br />
		如果你的网站托管在ISP机房中，并且机房可能不给你权限去控制HTTP的头信息（如：Expires和Cache-Control），大声控诉：这些机制对于你的工作来说是必须的；<br />
		另外一方面： HTTP头信息可以让你对浏览器和代理服务器如何处理你的副本进行更多的控制。他们在HTML代码中是看不见的，一般由Web服务器自动生成。但是，根据 你使用的服务，你可以在某种程度上进行控制。在下文中：你将看到一些有趣的HTTP头信息，和如何在你的站点上应用部署这些特性。<br />
		<br />
		HTTP头信息发送在HTML代码之前，只有被浏览器和一些中间缓存能看到，一个典型的HTTP 1.1协议返回的头信息看上去像这样：</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">HTTP/1.1 200 OK</span><br />
		<span style="font-style: italic; ">Date: Fri, 30 Oct 1998 13:19:41 GMT</span><br />
		<span style="font-style: italic; ">Server: Apache/1.3.3 (Unix)</span><br />
		<span style="font-style: italic; ">Cache-Control: max-age=3600, must-revalidate</span><br />
		<span style="font-style: italic; ">Expires: Fri, 30 Oct 1998 14:19:41 GMT</span><br />
		<span style="font-style: italic; ">Last-Modified: Mon, 29 Jun 1998 02:28:12 GMT</span><br />
		<span style="font-style: italic; ">ETag: &quot;3e86-410-3596fbbc&quot;</span><br />
		<span style="font-style: italic; ">Content-Length: 1040</span><br />
		<span style="font-style: italic; ">Content-Type: text/html</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		<br />
		在头信息空一行后是HTML代码的输出，关于如何设置HTTP头信息请参考实现章节；</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Pragma HTTP头信息 (为什么它不起作用)</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		很多人认为在HTTP头信息中设置了Pragma: no-cache后会让内容无法被缓存。但事实并非如此：HTTP的规范中，响应型头信息没有任何关于Pragma属性的说明，而讨论了的是请求型头信息 Pragma属性（头信息也由浏览器发送给服务器），虽然少数集中缓存服务器会遵循这个头信息，但大部分不会。用了Pragma也不起什么作用，要用就使 用下列头信息：</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		使用Expires（过期时间）HTTP头信息来控制保鲜期</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Expires（过期时间） 属性是HTTP控制缓存的基本手段，这个属性告诉缓存器：相关副本在多长时间内是新鲜的。过了这个时间，缓存器就会向源服务器发送请求，检查文档是否被修改。几乎所有的缓存服务器都支持Expires（过期时间）属性；<br />
		<br />
		大部分Web服务器支持你用几种方式设置Expires属性；一般的：可以设计一个绝对时间间隔：基于客户最后查看副本的时间（最后访问时间）或者根据服务器上文档最后被修改的时间；</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Expires头信息：对于设置静态图片文件（例如导航栏和图片按钮）可缓存特别有用；因为这些图片修改很少，你可以给它们设置一个特别长的过期时间，这会使你的网站对用户变得相应非常快；他们对于控制有规律改变的网页也很有用，例如：你每天早上6点更新新闻页，你可以设置副本的过期时间也是这个时间，这样缓存 服务器就知道什么时候去取一个更新版本，而不必让用户去按浏览器的&ldquo;刷新&rdquo;按钮。</p>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		过期时间头信息属性值<strong>只能</strong>是HTTP格式的日期时间，其他的都会被解析成当前时间&ldquo;之前&rdquo;，副本会过期，记住：HTTP的日期时间必须是格林威治时间（GMT），而不是本地时间。举例：</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">Expires: Fri, 30 Oct 1998 14:19:41 GMT</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		所以使用过期时间属性一定要确认你的Web服务器时间设置正确，一个途径是通过网络时间同步协议（Network Time Protocol NTP），和你的系统管理员那里你可以了解更多细节。<br />
		虽然过期时间属性非常有用，但是它还是有些局限，首先：是牵扯到了日期，这样Web服务器的时间和缓存服务器的时间必须是同步的，如果有些不同步，要么是应该缓存的内容提前过期了，要么是过期结果没及时更新。<br />
		还有一个过期时间设置的问题也不容忽视：如果你设置的过期时间是一个固定的时间，如果你返回内容的时候又没有连带更新下次过期的时间，那么之后所有访问请求都会被发送给源Web服务器，反而增加了负载和响应时间；</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Cache-Control（缓存控制） HTTP头信息</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		HTTP 1.1介绍了另外一组头信息属性：Cache-Control响应头信息，让网站的发布者可以更全面的控制他们的内容，并定位过期时间的限制。<br />
		有用的 Cache-Control响应头信息包括：</p>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			<strong>max-age</strong>=[秒] &mdash; 执行缓存被认为是最新的最长时间。类似于过期时间，这个参数是基于请求时间的相对时间间隔，而不是绝对过期时间，[秒]是一个数字，单位是秒：从请求时间开始到过期时间之间的秒数。</li>
		<li>
			<strong>s-maxage</strong>=[秒] &mdash; 类似于max-age属性，除了他应用于共享（如：代理服务器）缓存</li>
		<li>
			<strong>public&nbsp;</strong>&mdash; 标记认证内容也可以被缓存，一般来说： 经过HTTP认证才能访问的内容，输出是自动不可以缓存的；</li>
		<li>
			<strong>no-cache</strong>&nbsp;&mdash; 强制每次请求直接发送给源服务器，而不经过本地缓存版本的校验。这对于需要确认认证应用很有用（可以和public结合使用），或者严格要求使用最新数据的应用（不惜牺牲使用缓存的所有好处）；</li>
		<li>
			<strong>no-store</strong>&nbsp;&mdash; 强制缓存在任何情况下都不要保留任何副本</li>
		<li>
			<strong>must-revalidate</strong>&nbsp;&mdash; 告诉缓存必须遵循所有你给予副本的新鲜度的，HTTP允许缓存在某些特定情况下返回过期数据，指定了这个属性，你高速缓存，你希望严格的遵循你的规则。</li>
		<li>
			<strong>proxy-revalidate</strong>&nbsp;&mdash; 和 must-revalidate类似，除了他只对缓存代理服务器起作用</li>
	</ul>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		举例:</p>
	<div style="margin-left: 40px; font-style: italic; ">
		Cache-Control: max-age=3600, must-revalidate</div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		如果你计划试用Cache-Control属性，你应该看一下这篇HTTP文档，详见参考和深入阅读；<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		校验参数和校验</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		在Web缓存如何工作： 我们说过：校验是当副本已经修改后，服务器和缓存之间的通讯机制；使用这个机制：缓存服务器可以避免副本实际上仍然足够新的情况下重复下载整个原件。<br />
		校验参数非常重要，如果1个不存在，并且没有任何信息说明保鲜期（Expires或Cache-Control）的情况下，缓存将不会存储任何副本；<br />
		最常见的校验参数是文档的最后修改时间，通过最后Last-Modified头信息可以，当一份缓存包含Last-Modified信息，他基于此信息，通过添加一个If-Modified-Since请求参数，向服务器查询：这个副本从上次查看后是否被修改了。<br />
		HTTP 1.1介绍了另外一个校验参数： ETag，服务器是服务器生成的唯一标识符ETag，每次副本的标签都会变化。由于服务器控制了ETag如何生成，缓存服务器可以通过If-None-Match请求的返回没变则当前副本和原件完全一致。<br />
		所有的缓存服务器都使用Last-Modified时间来确定副本是否够新，而ETag校验正变得越来越流行；<br />
		所有新一代的Web服务器都对静态内容（如：文件）自动生成ETag和Last-Modified头信息，而你不必做任何设置。但是，服务器对于动态内容（例如：CGI,ASP或数据库生成的网站）并不知道如何生成这些信息，参考一下编写利于缓存的脚本章节；<br />
		&nbsp;</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		创建利于缓存网站的窍门</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		除了使用新鲜度信息和校验，你还有很多方法使你的网站缓存友好。</p>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			<strong>保持URL稳定</strong>： 这是缓存的金科玉律，如果你给在不同的页面上，给不同用户或者从不同的站点上提供相同的内容，应该使用相同的URL，这是使你的网站缓存友好最简单，也是 最高效的方法。例如：如果你在页面上使用 &quot;/index.html&quot; 做为引用，那么就一直用这个地址；</li>
		<li>
			<strong>使用一个共用的库</strong>存放每页都引用的图片和其他页面元素；</li>
		<li>
			<strong>对于不经常改变的图片/</strong><strong>页面启用缓存</strong>，并使用Cache-Control: max-age属性设置一个较长的过期时间；</li>
		<li>
			<strong>对于定期更新的内容</strong>设置一个缓存服务器可识别的max-age属性或过期时间；</li>
		<li>
			<strong>如果数据源（特别是下载文件）变更，修改名称</strong>，这样：你可以让其很长时间不过期，并且保证服务的是正确的版本；而链接到下载文件的页面是一个需要设置较短过期时间的页面。</li>
		<li>
			<strong>万不得已不要改变文件</strong>，否则你会提供一个非常新的Last-Modified日期；例如：当你更新了网站，不要复制整个网站的所有文件，只上传你修改的文件。</li>
		<li>
			<strong>只在必要的时候使用Cookie</strong>，cookie是非常难被缓存的，而且在大多数情况下是不必要的，如果使用cookie，控制在动态网页上；</li>
		<li>
			<strong>减少试用SSL</strong>，加密的页面不会被任何共享缓存服务器缓存，只在必要的时候使用，并且在SSL页面上减少图片的使用；</li>
		<li>
			<strong>使用可缓存性评估引擎</strong>，这对于你实践本文的很多概念都很有帮助；</li>
	</ul>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		编写利于缓存的脚本</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		脚本缺省不会返回校验参数（返回Last-Modified或ETag头信息）或其他新鲜度信息（Expires或Cache-Control），有些动态脚本的确是动态内容（每次相应内容都不一样），但是更多（搜索引擎，数据库引擎网站）网站还是能从缓存友好中获益的。<br />
		一般说来，如果脚本生成的输出在未来一段时间（几分钟或者几天）都是可重复复制的，那么就是可缓存的。如果脚本输出内容只随URL变化而变化，也是可缓存的；但如果输出会根据cookie，认证信息或者其他外部条件变化，则还是不可缓存的。</p>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			最利于缓存的脚本就是将内容改变时导出成静态文件，Web服务器可以将其当作另外一个网页并生成和试用校验参数，让一些都变得更简单，只需要写入文件即可，这样最后修改时间也有了；</li>
		<li>
			另外一个让脚本可缓存的方法是对一段时间内能保持较新的内容设置一个相对寿命的头信息，虽然通过Expires头信息也可以实现，但更容易的是用Cache-Control: max-age属性，它会让首次请求后一段时间内缓存保持新鲜；</li>
		<li>
			如果以上做法你都做不到，你可以让脚本生成一个校验属性，并对 If-Modified-Since 和/或If-None-Match请求作出反应，这些属性可以从解析HTTP头信息得到，并对符合条件的内容返回304 Not Modified（内容未改变），可惜的是，这种做法比不上前2种高效；</li>
	</ul>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		其他窍门：</p>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			尽量避免使用POST，除非万不得已，POST模式的返回内容不会被大部分缓存服务器保存，如果你发送内容通过URL和查询（通过GET模式）的内容可以缓存下来供以后使用；</li>
		<li>
			不要在URL中加入针对每个用户的识别信息：除非内容是针对每个用户不同的；</li>
		<li>
			不要统计一个用户来自一个地址的所有请求，因为缓存常常是一起工作的；</li>
		<li>
			生成并返回Content-Length头信息，如果方便的话，这个属性让你的脚本在可持续链接模式时：客户端可以通过一个TCP/IP链接同时请求多个副本，而不是为每次请求单独建立链接，这样你的网站相应会快很多；</li>
	</ul>
	具体定义请参考实现章节。
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		常见问题解答</h3>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		让网站变得可缓存的要点是什么？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		好的策略是确定那些内容最热门，大量的复制（特别是图片）并针对这些内容先部署缓存。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		如何让页面通过缓存达到最快相应？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		缓存最好的副本是那些可以长时间保持新鲜的内容；基于校验虽然有助于加快相应，但是它不得不和源服务器联系一次去检查内容是否够新，如果缓存服务器上就知道内容是新的，内容就可以直接相应返回了。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我理解缓存是好的，但是我不得不统计多少人访问了我的网站！</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		如果你必须知道每次页面访问的，选择【一】个页面上的小元素，或者页面本身，通过适当的头信息让其不可缓存，例如： 可以在每个页面上部署一个1x1像素的透明图片。Referer头信息会有包含这个图片的每个页面信息；<br />
		明确一点：这个并不会给你一个关于你用户精确度很高的统计，而且这对互联网和你的用户这都不太好，消耗了额外的带宽，强迫用户去访问无法缓存的内容。了解更多信息，参考访问统计资料。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我如何能看到HTTP头信息的内容？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		很多浏览器在页面属性或类似界面中可以让你看到Expires 和Last-Modified信息；如果有的话：你会找到页面信息的菜单和页面相关的文件（如图片），并且包含他们的详细信息；<br />
		看到完整的头信息，你可以用telnet手工连接到Web服务器；<br />
		为此：你可能需要用一个字段指定端口（缺省是80），或者链接到www.example.com:80 或者 www.example.com 80(注意是空格)，更多设置请参考一下telnet客户端的文档；<br />
		打开网站链接：请求一个查看链接，如果你想看到http://www.example.com/foo.html 连接到www.example.com的80端口后，键入：</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">GET /foo.html HTTP/1.1 [回车]</span><br />
		<span style="font-style: italic; ">GET /foo.html HTTP/1.1 [return]</span><br />
		<span style="font-style: italic; ">Host: www.example.com [回车][回车]&nbsp;</span><br />
		<span style="font-style: italic; ">Host: www.example.com [return][return]</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		在[回车]处按键盘的回车键；在最后，要按2次回车，然后，就会输出头信息及完整页面，如果只想看头信息，将GET换成HEAD。<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我的页面是密码保护的，代理缓存服务器如何处理他们？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		缺省的，网页被HTTP认证保护的都是私密内容，它们不会被任何共享缓存保留。但是，你可以通过设置Cache-Control: public让认证页面可缓存，HTTP 1.1标准兼容的缓存服务器会认出它们可缓存。<br />
		如果你认为这些可缓存的页面，但是需要每个用户认证后才能看，可以组合使用Cache-Control: public和no-cache头信息，高速缓存必须在提供副本之前，将将新客户的认证信息提交给源服务器。设置就是这样：</p>
	<blockquote style="margin-top: 10px; margin-bottom: 10px; ">
		<em>Cache-Control: public, no-cache</em></blockquote>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		无论如何：这是减少认证请求的最好方法，例如： 你的图片是不机密的，将它们部署在另外一个目录，并对此配置服务器不强制认证。这样，那些图片会缺省都缓存。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我们是否要担心用户通过cache访问我的站点？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		代理服务器上SSL页面不会被缓存（不推荐被缓存），所以你不必为此担心。但是，由于缓存保存了非SSL请求和从他们抓取的URL，你要意识到没有安全保护的网站，可能被不道德的管理员可能搜集用户隐私，特别是通过URL。<br />
		实际上，位于服务器和客户端之间的管理员可以搜集这类信息。特别是通过CGI脚本在通过URL传递用户名和密码的时候会有很大问题；这对泄露用户名和密码是一个很大的漏洞；<br />
		如果你初步懂得互联网的安全机制，你不会对缓存服务器有任何。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我在寻找一个包含在Web发布系统解决方案，那些是比较有缓存意识的系统？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		这很难说，一般说来系统越复杂越难缓存。最差就是全动态发布并不提供校验参数；你无发缓存任何内容。可以向系统提供商的技术人员了解一下，并参考后面的实现说明。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我的图片设置了1个月后过期，但是我现在需要现在更新。</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		过期时间是绕不过去的，除非缓存（浏览器或者代理服务器）空间不足才会删除副本，缓存副本在过期之间会被一直使用。<br />
		最好的办法是改变它们的链接，这样，新的副本将会从源服务器上重新下载。记住：引用它们的页面本身也会被缓存。因此，使用静态图片和类似内容是很容易缓存的，而引用他们的HTML页面则要保持非常更新；<br />
		如果你希望对指定的缓存服务器重新载入一个副本，你可以强制使用&ldquo;刷新&rdquo;（在FireFox中在reload的时候按住shift键：就会有前面提到恶Pragma: no-cache头信息发出）。或者你可以让缓存的管理员从他们的界面中删除相应内容；</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我运行一个Web托管服务，如何让我的用户发布缓存友好的网页？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		如果你使用apahe，可以考虑允许他们使用.htaccess文件并提供相应的文档；<br />
		另外一方面： 你也可以考虑在各种虚拟主机上建立各种缓存策略。例如： 你可以设置一个目录 /cache-1m 专门用于存放访问1个月的访问，另外一个 /no-cache目录则被用提供不可存储副本的服务。<br />
		无论如何：对于大量用户访问还是应该用缓存。对于大网站，这方面的节约很明显（带宽和服务器负载）；</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		我标记了一些网页是可缓存的，但是浏览器仍然每次发送请求给服务。如何强制他们保存副本？</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		缓存服务器并不会总保存副本并重用副本；他们只是在特定情况下会不保存并使用副本。所有的缓存服务器都回基于文件的大小，类型（例如：图片 页面），或者服务器空间的剩余来确定如何缓存。你的页面相比更热门或者更大的文件相比，并不值得缓存。<br />
		所以有些缓存服务器允许管理员根据文件类型确定缓存副本的优先级，允许某些副本被永久缓存并长期有效；</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		缓存机制的实现 - Web服务器端配置</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		一般说来，应该选择最新版本的Web服务器程序来部署。不仅因为它们包含更多利于缓存的功能，新版本往往在性能和安全性方面都有很多的改善。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Apache HTTP服务器</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Apache有些可选的模块来包含这些头信息： 包括Expires和Cache-Control。 这些模块在1.2版本以上都支持；<br />
		这些模块需要和apache一起编译；虽然他们已经包含在发布版本中，但缺省并没有启用。为了确定相应模块已经被启用：找到httpd程序并运行httpd -l 它会列出可用的模块，我们需要用的模块是mod_expires和mod_headers</p>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			如果这些模块不可用，你需要联系管理员，重新编译并包含这些模块。这些模块有时候通过配置文件中把注释掉的配置启用，或者在编译的时候增加-enable -module=expires和-enable-module=headers选项（在apache 1.3和以上版本）。 参考Apache发布版中的INSTALL文件；</li>
	</ul>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Apache一旦启用了相应的模块，你就可以在.htaccess文件或者在服务器的access.conf文件中通过mod_expires设置副本什 么时候过期。你可设置过期从访问时间或文件修改时间开始计算，并且应用到某种文件类型上或缺省设置，参考<a href="http://httpd.apache.org/docs/1.3/mod/mod_expires.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">模块的文档</a>获得更多信息，或者遇到问题的时候向你身边的apache专家讨教。<br />
		应用Cache-Control头信息，你需要使用mod_headers,它将允许你设置任意的HTTP头信息，参考<a href="http://httpd.apache.org/docs/1.3/mod/mod_headers.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">mod_headers的文档</a>可以获得更多资料；<br />
		这里有个例子说明如何使用头信息：</p>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			.htaccess文件允许web发布者使用命令只在配置文件中用到的命令。他影响到所在目录及其子目录；问一下你的服务器管理员确认这个功能是否启用了。&nbsp;</li>
	</ul>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">### 启用 mod_expires</span><br />
		<span style="font-style: italic; ">ExpiresActive On</span><br />
		<span style="font-style: italic; ">### 设置 .gif 在被访问过后1个月过期。</span><br />
		<span style="font-style: italic; ">ExpiresByType image/gif A2592000</span><br />
		<span style="font-style: italic; ">### 其他文件设置为最后修改时间1天后过期</span><br />
		<span style="font-style: italic; ">### (用了另外的语法)</span><br />
		<span style="font-style: italic; ">ExpiresDefault &quot;modification plus 1 day&quot;</span><br />
		<span style="font-style: italic; ">### 在index.html文件应用 Cache-Control头属性</span><br />
		<span style="font-style: italic; ">&lt;Files index.html&gt;</span><br />
		<span style="font-style: italic; ">Header append Cache-Control &quot;public, must-revalidate&quot;</span><br />
		<span style="font-style: italic; ">&lt;/Files&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
	<ul style="margin-top: 10px; margin-bottom: 10px; ">
		<li>
			注意： 在适当情况下mod_expires会自动计算并插入Cache-Control:max-age 头信息</li>
	</ul>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Apache 2.0的配置和1.3类似，更多信息可以参考2.0的<a href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">mod_expires</a>和<a href="http://httpd.apache.org/docs/2.2/mod/mod_headers.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">mod_headers文档</a>；<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Microsoft IIS服务器</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Microsoft的IIS可以非常容易的设置头信息，注意：这只针对IIS 4.0服务器，并且只能在NT服务器上运行。<br />
		为网站的一个区域设置头信息，先要到管理员工具界面中，然后设置属性。选择HTTP Header选单，你会看到2个有趣的区域：启用内容过期和定制HTTP头信息。头一个设置会自动配置，第二个可以用于设置Cache-Control头信息；<br />
		设置asp页面的头信息可以参考后面的ASP章节，也可以通过ISAPI模块设置头信息，细节请参考MSDN。<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Netscape/iPlanet企业服务器</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		3.6版本以后，Netscape/iPlanet已经不能设置Expires头信息了，他从3.0版本开始支持HTTP 1.1的功能。这意味着HTTP 1.1的缓存（代理服务器/浏览器）优势都可以通过你对Cache-Control设置来获得。<br />
		使用Cache-Control头信息，在管理服务器上选择内容管理|缓存设置目录。然后：使用资源选择器，选择你希望设置头信息的目录。设置完头信息后，点击&ldquo;OK&rdquo;。更多信息请参考<a href="http://developer.netscape.com/docs/manuals/enterprise/admnunix/content.htm#1006282" style="text-decoration: underline; color: rgb(49, 101, 206); ">Netscape/iPlanet企业服务器的手册</a>。<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		缓存机制的实现：服务器端脚本</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		需要注意的一点是：也许服务器设置HTTP头信息比脚本语言更容易，但是两者你都应该使用。<br />
		因为服务器端的脚本主要是为了动态内容，他本身不产生可缓存的文件页面，即使内容实际是可以缓存的。如果你的内容经常改变，但是不是每次页面请求都改变， 考虑设置一个Cache-Control: max-age头信息；大部分用户会在短时间内多次访问同一页面。例如： 用户点击&ldquo;后退&rdquo;按钮，即使没有新内容，他们仍然要再次从服务器下载内容查看。<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		CGI程序</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		CGI脚本是生成内容最流行的方式之一，你可以很容易在发送内容之前的扩展HTTP头信息；大部分CGI实现都需要你写 Content-Type头信息，例如这个Perl脚本：</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">#!/usr/bin/perl</span><br />
		<span style="font-style: italic; ">print &quot;Content-type: text/html\n&quot;;</span><br />
		<span style="font-style: italic; ">print &quot;Expires: Thu, 29 Oct 1998 17:04:19 GMT\n&quot;;</span><br />
		<span style="font-style: italic; ">print &quot;\n&quot;;</span><br />
		<span style="font-style: italic; ">### 后面是内容体...</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		由于都是文本，你可以很容易通过内置函数生成Expires和其他日期相关的头信息。如果你使用Cache-Control: max-age;会更简单；</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">print &quot;Cache-Control: max-age=600\n&quot;;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		这样脚本可以在被请求后缓存10分钟；这样用户如果按&ldquo;后退&rdquo;按钮，他们不会重新提交请求；<br />
		CGI的规范同时也允许客户端发送头信息，每个头信息都有一个&lsquo;HTTP_&rsquo;的前缀；这样如果一个客户端发送一个If-Modified-Since请求，就是这样的：</p>
	<div style="margin-left: 40px; font-style: italic; ">
		HTTP_IF_MODIFIED_SINCE = Fri, 30 Oct 1998 14:19:41 GMT&nbsp;</div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		<br />
		参考一下<a href="http://www.mnot.net/cgi_buffer/" style="text-decoration: underline; color: rgb(49, 101, 206); ">cgi_buffer</a>库，一个自动处理ETag的生成和校验的库，生成Content-Length属性和对内容进行gzip压缩。在Python脚本中也只需加入一行；<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		服务器端包含 Server Side Includes</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		SSI（经常使用.shtml扩展名）是网站发布者最早可以生成动态内容的方案。通过在页面中设置特别的标记，也成为一种嵌入HTML的脚本；<br />
		大部分SSI的实现无法设置校验器，于是无法缓存。但是Apache可以通过对特定文件的组执行权限设置实现允许用户设置那种SSI可以被缓存；结合XbitHack调整整个目录。更多文档请参考<a href="http://httpd.apache.org/docs/1.3/mod/mod_include.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">mod_include文档</a>。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		PHP</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		PHP是一个内建在web服务器中的服务器端脚本语言，当做为HTML嵌入式脚本，很像SSI，但是有更多的选项，PHP可以在各种Web服务器上设置为CGI模式运行，或者做为Apache的模块；<br />
		缺省PHP生成副本没有设置校验器，于是也无法缓存，但是开发者可以通过Header()函数来生成HTTP的头信息；<br />
		例如：以下代码会生成一个Cache-Control头信息，并设置为3天以后过期的Expires头信息；</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">&lt;?php</span><br />
		<span style="font-style: italic; ">&nbsp;Header(&quot;Cache-Control: must-revalidate&quot;);</span><br />
		<br />
		<span style="font-style: italic; ">&nbsp;$offset = 60 * 60 * 24 * 3;</span><br />
		<span style="font-style: italic; ">&nbsp;$ExpStr = &quot;Expires: &quot; . gmdate(&quot;D, d M Y H:i:s&quot;, time() + $offset) . &quot; GMT&quot;;</span><br />
		<span style="font-style: italic; ">&nbsp;Header($ExpStr);</span><br />
		<span style="font-style: italic; ">?&gt;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		记住： Header()的输出必须先于所有其他HTML的输出；<br />
		正如你看到的：你可以手工创建HTTP日期；PHP没有为你提供专门的函数（新版本已经让这个越来越容易了，请参考PHP的<a href="http://php.net/date" style="text-decoration: underline; color: rgb(49, 101, 206); ">日期相关函数文档</a>），当然，最简单的还是设置Cache-Control: max-age头信息，而且对于大部分情况都比较适用；<br />
		更多信息，请参考<a href="http://www.php.net/manual/function.header.php3" style="text-decoration: underline; color: rgb(49, 101, 206); ">header相关的文档</a>；<br />
		也请参考一下<a href="http://www.mnot.net/cgi_buffer/" style="text-decoration: underline; color: rgb(49, 101, 206); ">cgi_buffer</a>库，自动处理ETag的生成和校验，Content-Length生成和内容的gzip压缩，PHP脚本只需包含1行代码；</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		Cold Fusion</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		<a href="http://www.adobe.com/products/coldfusion/" style="text-decoration: underline; color: rgb(49, 101, 206); ">Cold Fusion</a>是Macromedia的商业服务器端脚本引擎，并且支持多种Windows平台，Linux平台和多种Unix平台。Cold Fusion通过CFHEADER标记设置HTTP头信息相对容易。可惜的是：以下的Expires头信息的设置有些容易误导；</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">&lt;CFHEADER NAME=&quot;Expires&quot; VALUE=&quot;#Now()#&quot;&gt;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		它并不像你想像的那样工作，因为时间（本例中为请求发起的时间）并不会被转换成一个符合HTTP时间，而且打印出副本的Cold fusion的日期/时间对象，大部分客户端会忽略或者将其转换成1970年1月1日。<br />
		但是：Cold Fusion另外提供了一套日期格式化函数， GetHttpTimeSTring. 结合DateAdd函数，就很容易设置过期时间了，这里我们设置一个Header声明副本在1个月以后过期；</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">&lt;cfheader name=&quot;Expires&quot; value=&quot;#GetHttpTimeString(DateAdd(&#39;m&#39;, 1, Now()))#&quot;&gt;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		你也可以使用CFHEADER标签来设置Cache-Control: max-age等其他头信息；<br />
		记住：Web服务器也会将头信息设置转给Cold Fusion(做为CGI运行的时候)，检查你的服务器设置并确定你是否可以利用服务器设置代替Cold Fusion。&nbsp;<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		ASP和ASP.NET</h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		在asp中设置HTTP头信息是：确认Response方法先于HTML内容输出前被调用，或者使用 Response.Buffer暂存输出；同样的：注意某些版本的IIS缺省设置会输出Cache-Control: private 头信息，必须声明成public才能被共享缓存服务器缓存。<br />
		IIS的ASP和其他web服务器都允许你设置HTTP头信息，例如： 设置过期时间，你可以设置Response对象的属性；</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">&lt;% Response.Expires=1440 %&gt;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		设置请求的副本在输出的指定分钟后过期，类似的：也可以设置绝对的过期时间（确认你的HTTP日期格式正确）</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">&lt;% Response.ExpiresAbsolute=#May 31,1996 13:30:15 GMT# %&gt;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Cache-Control头信息可以这样设置：</p>
	<div style="margin-left: 40px; font-style: italic; ">
		&lt;% Response.CacheControl=&quot;public&quot; %&gt;</div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		在ASP.NET中，Response.Expires 已经不推荐使用了，正确的方法是通过Response.Cache设置Cache相关的头信息；</p>
	<div style="margin-left: 40px; ">
		<span style="font-style: italic; ">Response.Cache.SetExpires ( DateTime.Now.AddMinutes ( 60 ) ) ;</span><br />
		<span style="font-style: italic; ">Response.Cache.SetCacheability ( HttpCacheability.Public ) ;</span></div>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		参考<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconaspoutputcache.asp" style="text-decoration: underline; color: rgb(49, 101, 206); ">MSDN文档</a>可以找到更多相关新年系；<br />
		&nbsp;</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		参考文档和深入阅读</h3>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		<a href="http://www.ietf.org/rfc/rfc2616.txt" style="text-decoration: underline; color: rgb(49, 101, 206); " target="_blank">HTTP 1.1 规范定义</a></h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		HTTP 1.1的规范有大量的扩展用于页面缓存，以及权威的接口实现指南，参考章节：13, 14.9, 14.21, 以及 14.25.<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		<a href="http://www.web-caching.com/" style="text-decoration: underline; color: rgb(49, 101, 206); " target="_blank">Web-Caching.com</a></h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		非常精彩的介绍缓存相关概念，并介绍其他在线资源。</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		<a href="http://www.goldmark.org/netrants/webstats/" style="text-decoration: underline; color: rgb(49, 101, 206); " target="_blank">关于非连续性访问统计</a></h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		Jeff Goldberg内容丰富的演说告诉你为什么不应该过度依赖访问统计和计数器；<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		<a href="http://www.mnot.net/cacheability/" style="text-decoration: underline; color: rgb(49, 101, 206); ">可缓存性检测引擎</a></h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		可缓存的引擎设计，检测网页并确定其如何与Web缓存服务器交互， 这个引擎配合这篇指南是一个很好的调试工具，<br />
		&nbsp;</p>
	<h4 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		<a href="http://www.mnot.net/cgi_buffer/" style="text-decoration: underline; color: rgb(49, 101, 206); ">cgi_buffer库</a></h4>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		包含库：用于CGI模式运行的Perl/Python/PHP脚本，自动处理ETag生成/校验，Content-Length生成和内容压缩。正确地。 Python版本也被用作其他大量的CGI脚本。<br />
		&nbsp;</p>
	<h3 style="font-weight: normal; margin-top: 10px; margin-bottom: 10px; font-family: 'trebuchet ms', verdana, helvetica, arial, sans-serif; ">
		关于本文档</h3>
	<p style="margin-top: 10px; margin-bottom: 10px; ">
		本文版权属于Mark Nottingham &lt;<a href="mailto:mnot@pobox.com" style="text-decoration: underline; color: rgb(49, 101, 206); ">mnot@pobox.com</a>&gt;，本作品遵循<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh" style="text-decoration: underline; color: rgb(49, 101, 206); ">创作共用版权</a>。<br />
		如果你镜像本文，请通过以上邮件告知，这样你可以在更新时被通知；<br />
		所有的商标属于其所有人。<br />
		虽然作者确信内容在发布时的正确性，但不保证其应用或引申应用的正确性，如有误传，错误或其他需要澄清的问题请尽快告知作者；<br />
		本文最新版本可以从&nbsp;<a href="http://www.mnot.net/cache_docs/" style="text-decoration: underline; color: rgb(49, 101, 206); ">http://www.mnot.net/cache_docs/</a>&nbsp;获得；<br />
		翻译版本包括：&nbsp;<a href="http://www.jakpsatweb.cz/clanky/caching-tutorial-czech-translation.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">捷克语版</a>，<a href="http://www.mnot.net/cache_docs/index.fr.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">法语版</a>和<a href="http://www.chedong.com/tech/cache_docs.html" style="text-decoration: underline; color: rgb(49, 101, 206); ">中文版</a>。<br />
		版本： 1.81 - 2007年3月16日<br />
		<a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.zh" style="text-decoration: underline; color: rgb(49, 101, 206); ">创作共用版权声明</a><br />
		翻译：&nbsp;<a href="http://www.chedong.com/tech/" style="text-decoration: underline; color: rgb(49, 101, 206); ">车东</a>&nbsp;2007年9月6日</p>
</div>
]]>
    </content>
</entry>

<entry>
    <title>职业病</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/04/occupational-disease.html" />
    <id>tag:blog.suchasplus.com,2011://3.283</id>

    <published>2011-04-01T09:09:13Z</published>
    <updated>2011-04-01T09:14:40Z</updated>

    <summary><![CDATA[ 前公司的英文缩写是TVie, 结果到现在打creative这种单词的时候还会不由自主的打成creatvie 在写了小半年Google Web Toolkit之后, 我已经有很大几率把get打成gwt了 经常在任意文本前加&nbsp;// 这种更是不胜枚举 =,=...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="闲谈" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="职业病" label="职业病" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span class="Apple-style-span" style="white-space: nowrap;">前公司的英文缩写是TVie, 结果到现在打crea<span style="color:#ff0000;"><strong>tive</strong></span>这种单词的时候还会不由自主的打成crea<span style="color:#ff0000;"><strong>tvie</strong></span></span></p>
<p>
	在写了小半年Google Web Toolkit之后, 我已经有很大几率把get打成gwt了</p>
<p>
	经常在任意文本前加&nbsp;// 这种更是不胜枚举 =,=</p>
]]>
        
    </content>
</entry>

<entry>
    <title>[ZZ]HMAC及基于密码的身份认证协议的一些杂谈</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/03/HMAC-and-Password-based-authentication-protocol-memo.html" />
    <id>tag:blog.suchasplus.com,2011://3.282</id>

    <published>2011-03-28T03:35:01Z</published>
    <updated>2011-03-28T03:44:49Z</updated>

    <summary><![CDATA[ 以前设计API时参考OAUTH针对原有的认证做了改进, &nbsp;使用了HMAC和OTP等, &nbsp;但是明显木有下文那么详细的理解和介绍, &nbsp;转来膜拜一下。 from&nbsp;Changming的blog&nbsp;by&nbsp;snnn119@gmail.com 原文地址:&nbsp;https://www.sunchangming.com/blog/post/3684.form &nbsp; 昨天有个朋友给我打电话，询问网络协议设计中的安全性问题。他在做一套C/S结构的应用软件，有以下需求&nbsp; 1、Client在与Server建立连接后，首先需要进行身份认证，只有身份认证通过后，才允许发送其它数据。&nbsp; 2、身份认证过程应当尽可能高效、安全。这里的安全不仅指防窃听防重放等，还包括防止服务器被DDos。&nbsp; 3、身份认证过程之后，所有的消息交互必须加密，并且传输中要防止被篡改。 反正我要发给他的东西也没什么私密的，就干脆写这里了。&nbsp; 在信息安全领域，数据的保密性和完整性是两个不同的目标。&nbsp; 要达到保密性，选择合适的加密算法对数据加密即可。总的来说，加密算法分为对称加密和不对称加密。对称加密就是加密和解密采用同样的密钥同样的算法，不是对称加密算法的就是不对称加密算法。典型的对称加密算法有：DES\2DES\3DES、IDEA、AES、RC4\RC5\RC6、BLOWFISH、TWOFISH。不对称加密算法有：RSA、DSA。由于不对称加密解密要比对称的复杂且慢，所以一般来说密钥交换阶段可能会采用不对称加密，而通信数据加密主要还是用对称加密。 加密算法未必能同时保证数据完整。&nbsp; 下面举个例子说明这个问题：假如设计一种简单的查表加密算法，将0-255重新排列得到数组unsigned char seckey[255]。将原文的每个字节作为下标去seckey里查得到密文。这是一种有效的加密算法，但是不能保证数据完整性。例如将密文截去几个字节，接收方是不知道有人动了手脚的。 出于程序员的思维，为了保证数据完整性，最简单的方法就是加个checksum呗。例如CRC32或者奇偶校验位这样的技术。但是从安全需求来说这样做也不行，因为奇偶校验位也可能被篡改啊。所以需要专业点的东西，Message Authentication Codes(MAC)就是为了完整性而设计的。MAC由两个算法组成，签名和校验。假设为Sign(k,x)和Ver(k,x)，其中k是共享密钥，x是待签名的数据。传输数据时将原始数据(x)和签名（Sign(k,x)的结果）一起发送，接收方用Ver(k,x)函数验证完整性。所以这两个函数应满足Ver(k,Sign(k,x))=true。 假设用E(k,x)表示加密函数，Sign(k&#39;,x)表示签名函数,保密性和完整性我都想要，那么就存在一个问题，先签名还是先加密？&nbsp; 1、先加密后签名：令y=E(k,x)，t=Sign(k&#39;,y)，然后发送(y,t)。实际例子：IPSec。&nbsp; 2、先签名后加密：令t=Sign(k&#39;,x)，y=E(k,t)。然后发送y。实际例子：SSL。&nbsp; 3、各算各的。令y=E(k,x)，t=Sign(k&#39;,x)，然后发送(y,t)。实际例子：SSH。 这3者的优劣，在10年前已经有人分析过了，http://eprint.iacr.org/2001/045。 第3种肯定是最不安全的，因为如果t相同那么x可能相同，假如x只取很有限的几个值，那么通过大量嗅探很容易猜出来原文。而第二种依赖于具体的加密/Hash算法的选择。按我理解，简单来说就是第一种最好。 MAC只是理论，需要具体的算法给大家用。由于Hash函数的不可逆性，人们很自然的就想到了用Hash函数做MAC。常见的通用Hash函数有：MD5（128位）、RIPEMD-160（160位）、SHA-1（160位）。Hash函数不同于DES之类的，它没有密钥这个概念。于是就想，把密钥和原文直接混在一起然后hash，例如：Sign(k,x)=Hash(CONCAT(k,x))。其中CONCAT是字符串连接函数。但是目前主流的Hash算法都不是为了这种目的设计的，即便不知道k也很容易在x后面再追加一些东西依然能通过Ver。以SHA1为例，在某些特殊情况下，在知道SHA1(CONCAT(secret,message))和rogue的情况下很容易算出SHA1(CONCAT(secret,message,rogue))。这里的特殊情况是指CONCAT(secret,message)的长度恰好是SHA1算法的block size的整数倍。 反过来，Sign(k,x)=Hash(CONCAT(x,k))，也有类似的缺陷。92年的时候G. Tsudik发表了一篇论文&ldquo;Message authentication with one-&nbsp; way hash functions&rdquo;专门讲述这个问题，可惜我已不在学校，没有电子期刊库，下不到这篇论文。 不是说用Hash函数做MAC不行，而是说需要稍微复杂一点的构造。于是诞生了HMAC（Keyed-Hashing for...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="notes" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="hmac" label="hmac" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="oauth" label="oauth" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="otp" label="otp" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	以前设计API时参考OAUTH针对原有的认证做了改进, &nbsp;使用了HMAC和OTP等, &nbsp;但是明显木有下文那么详细的理解和介绍, &nbsp;转来膜拜一下。</p>
<p>
	<span class="entry-source-title-parent">from&nbsp;<a class="entry-source-title" href="https://www.google.com/reader/view/feed/https%3A%2F%2Fwww.sunchangming.com%2Fblog%2F%3Ffeed%3Drss2" style="color: rgb(34, 68, 187); text-decoration: none; " target="_blank">Changming的blog</a></span>&nbsp;<span class="entry-author-parent">by&nbsp;<span class="entry-author-name">snnn119@gmail.com</span></span></p>
<p>
	原文地址:&nbsp;<a href="https://www.sunchangming.com/blog/post/3684.form">https://www.sunchangming.com/blog/post/3684.form</a></p>
<p>
	&nbsp;</p>
<p>
	<font face="宋体">昨天有个朋友给我打电话，询问网络协议设计中的安全性问题。他在做一套C/S结构的应用软件，有以下需求&nbsp;<br />
	1、Client在与Server建立连接后，首先需要进行身份认证，只有身份认证通过后，才允许发送其它数据。&nbsp;<br />
	2、身份认证过程应当尽可能高效、安全。这里的安全不仅指防窃听防重放等，还包括防止服务器被DDos。&nbsp;<br />
	3、身份认证过程之后，所有的消息交互必须加密，并且传输中要防止被篡改。</font></p>
<p>
	<font face="宋体">反正我要发给他的东西也没什么私密的，就干脆写这里了。&nbsp;<br />
	在信息安全领域，数据的保密性和完整性是两个不同的目标。&nbsp;<br />
	要达到保密性，选择合适的加密算法对数据加密即可。总的来说，加密算法分为对称加密和不对称加密。对称加密就是加密和解密采用同样的密钥同样的算法，不是对称加密算法的就是不对称加密算法。典型的对称加密算法有：DES\2DES\3DES、IDEA、AES、RC4\RC5\RC6、BLOWFISH、TWOFISH。不对称加密算法有：RSA、DSA。由于不对称加密解密要比对称的复杂且慢，所以一般来说密钥交换阶段可能会采用不对称加密，而通信数据加密主要还是用对称加密。</font></p>
<p>
	<font face="宋体">加密算法未必能同时保证数据完整。&nbsp;<br />
	下面举个例子说明这个问题：假如设计一种简单的查表加密算法，将0-255重新排列得到数组unsigned char seckey[255]。将原文的每个字节作为下标去seckey里查得到密文。这是一种有效的加密算法，但是不能保证数据完整性。例如将密文截去几个字节，接收方是不知道有人动了手脚的。</font></p>
<p>
	<font face="宋体">出于程序员的思维，为了保证数据完整性，最简单的方法就是加个checksum呗。例如CRC32或者奇偶校验位这样的技术。但是从安全需求来说这样做也不行，因为奇偶校验位也可能被篡改啊。所以需要专业点的东西，Message Authentication Codes(MAC)就是为了完整性而设计的。MAC由两个算法组成，签名和校验。假设为Sign(k,x)和Ver(k,x)，其中k是共享密钥，x是待签名的数据。传输数据时将原始数据(x)和签名（Sign(k,x)的结果）一起发送，接收方用Ver(k,x)函数验证完整性。所以这两个函数应满足Ver(k,Sign(k,x))=true。</font></p>
<p>
	<font face="宋体">假设用E(k,x)表示加密函数，Sign(k&#39;,x)表示签名函数,保密性和完整性我都想要，那么就存在一个问题，先签名还是先加密？&nbsp;<br />
	1、先加密后签名：令y=E(k,x)，t=Sign(k&#39;,y)，然后发送(y,t)。实际例子：IPSec。&nbsp;<br />
	2、先签名后加密：令t=Sign(k&#39;,x)，y=E(k,t)。然后发送y。实际例子：SSL。&nbsp;<br />
	3、各算各的。令y=E(k,x)，t=Sign(k&#39;,x)，然后发送(y,t)。实际例子：SSH。</font></p>
<p>
	<font face="宋体">这3者的优劣，在10年前已经有人分析过了，</font><font face="宋体"><a href="http://eprint.iacr.org/2001/045" style="color: rgb(34, 68, 187); " target="_blank">http</a></font><font face="宋体"><a href="http://eprint.iacr.org/2001/045" style="color: rgb(34, 68, 187); " target="_blank">://eprint.iacr.org/2001/045</a>。 第3种肯定是最不安全的，因为如果t相同那么x可能相同，假如x只取很有限的几个值，那么通过大量嗅探很容易猜出来原文。而第二种依赖于具体的加密/Hash算法的选择。按我理解，简单来说就是第一种最好。</font></p>
<p>
	<font face="宋体">MAC只是理论，需要具体的算法给大家用。由于Hash函数的不可逆性，人们很自然的就想到了用Hash函数做MAC。常见的通用Hash函数有：MD5（128位）、RIPEMD-160（160位）、SHA-1（160位）。Hash函数不同于DES之类的，它没有密钥这个概念。于是就想，把密钥和原文直接混在一起然后hash，例如：Sign(k,x)=Hash(CONCAT(k,x))。其中CONCAT是字符串连接函数。但是目前主流的Hash算法都不是为了这种目的设计的，即便不知道k也很容易在x后面再追加一些东西依然能通过Ver。以SHA1为例，在某些特殊情况下，在知道SHA1(CONCAT(secret,message))和rogue的情况下很容易算出SHA1(CONCAT(secret,message,rogue))。这里的特殊情况是指CONCAT(secret,message)的长度恰好是SHA1算法的block size的整数倍。 反过来，Sign(k,x)=Hash(CONCAT(x,k))，也有类似的缺陷。92年的时候G. Tsudik发表了一篇论文&ldquo;Message authentication with one-&nbsp;<br />
	way hash functions&rdquo;专门讲述这个问题，可惜我已不在学校，没有电子期刊库，下不到这篇论文。</font></p>
<p>
	<font face="宋体">不是说用Hash函数做MAC不行，而是说需要稍微复杂一点的构造。于是诞生了HMAC（Keyed-Hashing for Message Authentication）算法。HMAC是一个很通用的标准，rfc 2104，ANSI9.71，FIPS PUB 198都是对它的定义。HMAC的公式很简单:HMAC(k,m)=Hash(CONCAT((k XOR opad) , Hash(CONCAT(k XOR ipad),m)))。其中k是密钥,m是需要被签名的消息。ipad/opad是标准中定义好的2个常量。HMAC的特色是它不依赖于特定的Hash算法，也没有对Hash算法提出特殊的要求，即，如果HMAC-SHA1没缺陷但是HMAC-MD5有缺陷，那么一定是MD5作为一个通用的Hash算法是有缺陷的。</font></p>
<p>
	<br />
	<font face="宋体">我朋友的这些问题，可以分成两个问题：&nbsp;<br />
	1、如何进行身份认证（身份认证的问题）&nbsp;<br />
	2、如何产生一个对称密钥以用于后续数据的加密（密钥交换的问题）</font></p>
<p>
	<font face="宋体">先说身份认证，最简单的方式就是明文认证：&nbsp;<br />
	1、C-&gt;S: 用户名，密码（明文）&nbsp;<br />
	2、S-&gt;C: 成功或者失败。&nbsp;<br />
	SMTP中的LOGIN/PLAIN就属于这种模式。LOGIN是用户名和密码分两次发送，PLAIN是放一起一次发送。缺陷：密码被窃听后直接重放即可。但是如果信道是安全的，如ssl,那么这么做也不存在问题。PPP中的PAP就是这种模式。</font></p>
<p>
	<font face="宋体">对于明文验证的一种改进是挑战应答认证协议（CHAP）：CHAP是一类协议的统称。典型应用是Point-to-Point Protocol中，在网络连接建立后，服务器需要以密码的方式验证客户端的身份。&nbsp;<br />
	通常来说，CHAP协议有4种消息：&nbsp;<br />
	1、Challenge&nbsp;<br />
	2、Response&nbsp;<br />
	3、Success&nbsp;<br />
	4、Failure</font></p>
<p>
	<font face="宋体">交互顺序是: （S代表服务器，C代表客户端）&nbsp;<br />
	1、S-&gt;C: Challenge&nbsp;<br />
	2、C-&gt;S: Response&nbsp;<br />
	3、S-&gt;C: Success/Failure</font></p>
<p>
	<font face="宋体">Challenge通常是一个随机数，Response是f(password,Challenge)得到的。窃听者只能拿到一个一次性的东西。将HMAC应用到CHAP上，可得到这样的协议：&nbsp;<br />
	1、S-&gt;C: 一串随机数r&nbsp;<br />
	2、C-&gt;S: username,hmac(password,r)&nbsp;<br />
	3、S-&gt;C: Success/Failure</font></p>
<p>
	<font face="宋体">实际例子：SMTP认证过程中的CRAM-MD5方式。HMAC CHAP基于这样一个假设，在不知道key的情况无法对r生成正确的MAC。但是这种协议有这么几个缺点：&nbsp;<br />
	1、服务器必须存password的明文。&nbsp;<br />
	2、无法抵挡中间人攻击。&nbsp;<br />
	3、易被窃听后使用字典攻击猜出密码。&nbsp;<br />
	4、客户端不能验证服务器。客户端无法知道服务器是不是真的知道它的密码。</font></p>
<p>
	<font face="宋体">对于中间人攻击，举个例子：在C和S之间加一个Proxy，刚开始它只作单纯的转发，在身份认证成功后立即断开C和P之间的连接。一般来说，C肯定会再去登录S。那么P就要想办法让C登录不上。因为它要把网络一直把持着也比较难，所P就去疯狂的用错误的密码登录。按照一般的设计思路，为防止在线字典攻击，如果密码输入次数错误太多，那么该IP就在一段时间内不得登录。如果P和C在同一个网吧，oh yeah，得手了。然后呢？玩过网游你就知道，盗号者虽然不能把这个账号占为己有（因为拿到的只是一个一次性的密码），但是他可以上去把该角色的所有物品扒光、删除角色、解散帮派或是利用社会工程学进行更大规模的诈骗。所以为防止在线字典攻击，应采用人机识别和运营监控的方式，封IP应该只封短暂的几十秒即可。</font></p>
<p>
	<font face="宋体">针对以上所说的缺点，微软发明了MS-CHAPv2（rfc2759），用于PPP连接中的身份验证：&nbsp;<br />
	首先，服务器不存储原始密码，服务器存储的是密码的hash值。服务器和客户端共享的秘密不是原始的明文密码，而是MD4(plain password)，下面把这个记做Kcs。&nbsp;<br />
	1、S-&gt;C:&nbsp; 16字节的随机数r1&nbsp;<br />
	2、C-&gt;S： 16字节的随机数r2,24字节的NT-Response。&nbsp;<br />
	Client首先生成16字节的随机数r2，然后计算SHA1(CONCAT(r2,r1,username))，然后将散列后的结果的前8个字节用Kcs做对称加密，得到一个24字节的结果（记做NT-Response），将其和r2一起发给服务器。这里对称加密的方式是这样：由于Kcs是MD4得到的，所以是16个字节，给它后面补上5个0，于是就是21个字节，分成3段，就得到3个7字节，作为DES的3个key，然后拿这3个key使用DES算法分别对SHA1(CONCAT(r2,r1,username))的结果加密，于是得到3*8=24个字节的答复。</font></p>
<p>
	<font face="宋体">3、S-&gt;C: Success/Failure&nbsp;<br />
	Success包里面有一个20字节的auth_string（HEX编码后以ASCII传输，前面加上&ldquo;S=&rdquo;作为前缀，所以实际传输的是42个字节）。它是由r1、r2、NTResponse、username、password合起来生成的:SHA1(CONCAT(SHA1(CONCAT(MD4(Kcs),NTResponse,Magic1)),SHA1(CONCAT(r2,r1,username))的前8个字节,Magic2))。其中Magic1、Magic2是两个字符串常量，前者是&ldquo;Magic server to client signing constant&rdquo;，后者是&ldquo;Pad to make it do more than one iteration&rdquo;。</font></p>
<p>
	<font face="宋体">通过以上描述，你可以看出MS-CHAPv2简直是一个从头烂到脚的协议，我怀疑这是微软的工程师在睡觉的时候想出来的，或者那人跟Big Bang中的penny是大学校友。首先，r1、r2、username都是明文传输的，拿出来算个SHA1意义何在？其次，算完之后截断到8个字节又是为何？最后，那套山寨版的3次DES算法更是搞笑至极。还有，虽然不用存储密码的原文了，但是密码的原文在身份认证过程中完全用不到，这不就是搞了个变量替换吗？最后那个Success包，更是复杂的莫名其妙，我只看懂了那两个magic是啥意思，我是第一次看见有人拿human language作加密算法中的magic number（江苏联创这种山寨公司的山寨产品除外）。针对MS-CHAPv2的种种毛病，微软并没有推出MS-CHAPv3的计划，而是继续就这么用着吧。</font></p>
<p>
	<font face="宋体">另外一个CHAP的例子就是MySQL。&nbsp;<br />
	1、S-&gt;C: public_seed&nbsp;<br />
	2、C-&gt;S: username, reply&nbsp;<br />
	3、S-&gt;C: Ok or error</font></p>
<p>
	<font face="宋体">对于4.1及以后版本，public_seed是随机生的20个可打印的ASCII字符，4.1之前的版本是8字节。&nbsp;<br />
	4.1之前的协议，客户端这么计算reply:&nbsp;<br />
	storedhash=hash(password)&nbsp;<br />
	reply=scramble_323(storedhash,public_seed);&nbsp;<br />
	4.1之后的协议，客户端这么计算reply:&nbsp;<br />
	passphrase=sha1(password)&nbsp;<br />
	storedhash=sha1(passphrase)&nbsp;<br />
	reply=xor(passphrase, sha1(public_seed,storedhash)&nbsp;<br />
	其中storedhash即是服务器存在数据库中的hash过的密码。</font></p>
<p>
	<font face="宋体">4.1版除了把public_seed和storedhash从8字节增加到20字节外，一个明显的改进就是，4.1以前的版本，即便客户端不知道原始密码，知道storedhash，一样可以通过身份验证。出于这个原因，选择什么样的hash函数，对于安全性几乎已经无关紧要，因为没有人关心原文是什么，所以焦点在于scramble_323做了什么。scramble_323是mysql自己发明的一套算法，难以用文字简短描述，代码实现在sql/password.c中，很短。网上有关于scramble_323的分析，结论就是它很弱，通过嗅探多次之后很快就能算出storedhash。</font></p>
<p>
	<font face="宋体">目前看来，在&quot;服务器必须存password的明文&quot;这个问题上，新版的mysql认证协议是对HMAC CHAP的很不错的改进。</font></p>
<p>
	<font face="宋体">另外一个值得关注的协议就是RFC2945，魔兽世界用的就是这个协议。</font></p>
<p>
	<font face="宋体">我觉得网游公司在协议安全上还是得多下点功夫，首先，盗号已经是玩家流失的主要原因之一。其次，搞一套自己的认证协议、加密算法，然后把它和反外挂结合起来，会加大制作外挂的难度。例如把HMAC所用的hash函数混淆后放到反外挂驱动的sys文件中，哪怕混淆后效率比以前慢10倍我也不在乎，反正就登录的时候才执行那么一次。时不时的换一下算法，足以让他们叫苦不迭。</font></p>
<p>
	<font face="宋体">未必非要自己从头去设计一套算法。拿MAC来说吧，前面通过对SHA1(CONCAT(secret,message))的分析可以看出，虽然它有问题，但是不致命，因为用户的密码一般也不长啊，而且message的长度是server控制的，完全可以绕开那个问题。于是在它上面可以搞点变种继续用，比如把字符串连接之后先按固定的规则shuffle一下再SHA1。再比如HMAC，那两个PAD的选择，其实挺随意的。你想想看，混淆后的代码那么长那么乱，里面就藏2个字节的常量让他去找，我靠，我就不信他唰的一下就碰见了。就算你能找到，那两个数字，我一周换一次总行吧？</font></p>
<p>
	<font face="宋体">但是无论如何，从协议角度避免不了木马。但是至少不会出现像网易那么二的事情，用了硬件OTP卡还被盗号，然后被玩家怀疑有内鬼。唉，明明就是你协议设计就有问题嘛。</font></p>
]]>
        
    </content>
</entry>

<entry>
    <title>[ZZ]为什么python标准库没有实现链表</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/03/why-python-Standard-library-does-not-implement-the-list.html" />
    <id>tag:blog.suchasplus.com,2011://3.281</id>

    <published>2011-03-23T04:43:14Z</published>
    <updated>2011-03-23T04:45:47Z</updated>

    <summary><![CDATA[ &nbsp; 发信人: draculalord ( 嗯？), 信区: Python 标 题: 也谈链表及其他Re: python标准库貌似没有实现链表？ 发信站: 水木社区 (Mon Mar 21 18:49:46 2011), 转信 实际上刚开始学习一些高级语言的时候我也有同样的疑问，而且即使有链表对应物的语言，链表常常也很少被实际使用。 如果是在国外听数据结构的课，老师一般会警告你这只是一个理论概念，实际应用应该实际考察，在通常情况下链表不是一个很好的结构。 通常链表会作为一个很好的反例，告诉大家脱离实际硬件环境来谈论所谓算法复杂度是没有任何意义的。 这是因为，链表已经不适合当今的计算机硬件发展。当今的计算机硬件对内存是否连续更为敏感，而链表恰恰会破坏这种顺序读取。 由于locality很差所以常常造成page fault和cache miss 这也是为什么大多数教师不再推荐使用链表的原因。而且现今的硬件内存拷贝实际相当迅速。 并且python的list算法不是通常的单项表，也不是通常的数组。 具体可以看这里：http://wiki.python.org/moin/TimeComplexity 在List末尾append/pop都是O(1)的， 如果要在头部或者中部插入是O(n),任何破坏连续性的操作都会被要求realloc,所以任何此类操作都是O(n) 但是当今的常用硬件，使用C写的链表和python的list，在insert的时候只有n&gt;50000才让链表比list快那么一点点。 这还没有考虑其他实际操作的复杂度。加上前面说的破坏locality,导致链表完全没有吸引力。在对象特别多的时候通常我们直接抽象它为数据库，也不要去想什么链表了。 在需要用到linked list特性的地方，比如常常需要从头部append或者pop 这时候有python的deque. (这里我记错了，特此更正，deque如果做insert还是会导致内存拷贝/移动，这里面的关键思想就是目前硬件的内存拷贝相当快，不是相当长的东西都可以接受) deque也不是通常的简单数据结构，它是经过认真权衡过后得到的一种混合式数据结构。 他是一个链式块结构，每个块包含62个对象，以此来平衡对locality的优化和对push,...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="python" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="python" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="数据结构" label="数据结构" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<p>
	发信人: draculalord ( 嗯？), 信区: Python<br />
	标 题: 也谈链表及其他Re: python标准库貌似没有实现链表？<br />
	发信站: 水木社区 (Mon Mar 21 18:49:46 2011), 转信</p>
<p>
	实际上刚开始学习一些高级语言的时候我也有同样的疑问，而且即使有链表对应物的语言，链表常常也很少被实际使用。<br />
	如果是在国外听数据结构的课，老师一般会警告你这只是一个理论概念，实际应用应该实际考察，在通常情况下链表不是一个很好的结构。<br />
	通常链表会作为一个很好的反例，告诉大家脱离实际硬件环境来谈论所谓算法复杂度是没有任何意义的。<br />
	这是因为，链表已经不适合当今的计算机硬件发展。当今的计算机硬件对内存是否连续更为敏感，而链表恰恰会破坏这种顺序读取。<br />
	由于locality很差所以常常造成page fault和cache miss<br />
	这也是为什么大多数教师不再推荐使用链表的原因。而且现今的硬件内存拷贝实际相当迅速。<br />
	并且python的list算法不是通常的单项表，也不是通常的数组。<br />
	具体可以看这里：<a href="http://wiki.python.org/moin/TimeComplexity" style="color: rgb(34, 68, 187); " target="_blank">http</a><a href="http://wiki.python.org/moin/TimeComplexity" style="color: rgb(34, 68, 187); " target="_blank">://wiki.python.org/moin/TimeComplexity</a><br />
	在List末尾append/pop都是O(1)的，<br />
	如果要在头部或者中部插入是O(n),任何破坏连续性的操作都会被要求realloc,所以任何此类操作都是O(n)<br />
	但是当今的常用硬件，使用C写的链表和python的list，在insert的时候只有n&gt;50000才让链表比list快那么一点点。<br />
	这还没有考虑其他实际操作的复杂度。加上前面说的破坏locality,导致链表完全没有吸引力。在对象特别多的时候通常我们直接抽象它为数据库，也不要去想什么链表了。</p>
<p>
	在需要用到linked list特性的地方，比如常常需要从头部append或者pop<br />
	这时候有python的deque. (这里我记错了，特此更正，deque如果做insert还是会导致内存拷贝/移动，这里面的关键思想就是目前硬件的内存拷贝相当快，不是相当长的东西都可以接受)<br />
	deque也不是通常的简单数据结构，它是经过认真权衡过后得到的一种混合式数据结构。<br />
	他是一个链式块结构，每个块包含62个对象，以此来平衡对locality的优化和对push, pop的优化。有人问为啥是62个而不是其他数：那是因为deque是个双向链表，一个节点64个指针，一个指向前一个指向后，剩下就是62个指针用来指向对象</p>
<p>
	要做到对insert到中间的优化是用btree和array结合的办法，有个第三方包blist<br />
	但是我估计很少有应用会真正用到这个。insert是O(log n)<br />
	<a href="http://pypi.python.org/pypi/blist/" style="color: rgb(34, 68, 187); " target="_blank">http://pypi.python.org/pypi/blist/</a></p>
<p>
	其实python是大师设计的语言，他们来决定底层具体的数据结构，作为一般人，你没有必要去质疑大师们精心设计的东西。<br />
	如果你真的对性能有很大要求，python也许并不适合你，python不是作为纯粹针对高性能计算诞生的东西，<br />
	他是一种胶水语言，它只对常见的List长度，常用的算法结构进行优化。他希望达到的目的是把现实的应用抽象出来，让使用者不用关心具体的数据结构和算法。<br />
	pythonic是一种面向大众的编程态度</p>
<p>
	如果你要用它来做其他事情，可以看看有没有你需要的第三方模块,或者可以用C来实现自己的一个模块，python本来就是C写的，所以这实际上也一点不困难。<br />
	比如python里面没有一个数据结构是能用来很好表示数值运算中使用的大型矩阵或者数组的，这时候就诞生了第三方包：numpy</p>
]]>
        
    </content>
</entry>

<entry>
    <title>商家刷卡成本</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2011/03/credit-card-costs.html" />
    <id>tag:blog.suchasplus.com,2011://3.280</id>

    <published>2011-03-05T20:07:50Z</published>
    <updated>2011-03-05T20:09:37Z</updated>

    <summary> via newsmth 1%，银联0.1%，发卡行0.7%，pos行0.2% 电话费另附......</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="银联" label="银联" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="刷卡" label="刷卡" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	via newsmth</p>
<p>
	1%，银联0.1%，发卡行0.7%，pos行0.2%</p>
<p>
	电话费另附...</p>
]]>
        
    </content>
</entry>

<entry>
    <title>报道即遮蔽</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/11/cover-is-cover.html" />
    <id>tag:blog.suchasplus.com,2010://3.276</id>

    <published>2010-11-18T10:06:14Z</published>
    <updated>2010-11-18T10:15:07Z</updated>

    <summary><![CDATA[ &nbsp; 南方周末专栏出了一篇很给力的文章，从最近风头正劲的CCAV芮成钢大叔事件入手，讲述了&quot;报道即遮蔽&quot;这条新闻业界的说法。 恰好上几天gtalk好友在GoogleReader上分享了牛博国际(需翻墙)上柴静写的一篇文章 &mdash;&mdash; &quot;中国大堵车刚刚开始&quot;, &nbsp;今天很意外的在sohu头条上看到&quot;中国大规模堵车刚开始 专家建议开征拥堵费&quot;。 耐心的重新读了一遍，看到最后才发现，sohu的和谐版(转载自新华网, 新华网转载自重庆晚报)少了点东西。 原文如下, 和谐版少了标红字体: &ldquo;为什么他们在深刻地反思，而我们现在还在走这条路？&rdquo; &nbsp; &ldquo;很少有人愿意总结失败的教训，所以失败教训的案例书到迄今为止，世界上都没有一本，我总是期待，我说如果什么时候写出教训这个案例集，可能对大家反思理性化有好处。&rdquo; &nbsp; &ldquo;你们的工作不就是提供给决策者依据吗？&rdquo; &nbsp; 他想了想，说，&ldquo;咱们是行政长官负责制。&rdquo;...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="闲谈" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ccav" label="ccav" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="芮成钢" label="芮成钢" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="报道即遮蔽" label="报道即遮蔽" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="新华网" label="新华网" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	&nbsp;</p>
<div>
	<a href="http://www.infzm.com/z.shtml">南方周末专栏</a>出了一篇很给力的文章，从最近风头正劲的<a href="http://hlj.rednet.cn/c/2010/11/16/2113254.htm">CCAV芮成钢</a>大叔事件入手，讲述了&quot;<a href="http://fangkc.z.infzm.com/2010/11/16/covering-news/">报道即遮蔽</a>&quot;这条新闻业界的说法。</div>
<div>
	恰好上几天gtalk好友在GoogleReader上分享了<a href="http://www.bullogger.com/blogs/chjguancha/archives/368766.aspx">牛博国际</a>(需翻墙)上柴静写的一篇文章 &mdash;&mdash; &quot;<a href="http://www.bullogger.com/blogs/chjguancha/archives/368766.aspx">中国大堵车刚刚开始</a>&quot;, &nbsp;今天很意外的在sohu头条上看到&quot;中国大规模堵车刚开始 专家建议开征拥堵费&quot;。</div>
<div>
	耐心的重新读了一遍，看到最后才发现，sohu的<a href="http://news.sohu.com/20101118/n277730101_1.shtml">和谐版</a>(转载自<a href="http://news.xinhuanet.com/2010-11/18/c_12790039.htm">新华网</a>, 新华网转载自重庆晚报)少了点东西。</div>
<div>
	<span style="color:#4b0082;"><strong>原文如下, 和谐版少了标红字体:</strong></span></div>
<div>
	&ldquo;为什么他们在深刻地反思，而我们现在还在走这条路？&rdquo;</div>
<div>
	&nbsp;</div>
<div>
	&ldquo;很少有人愿意总结失败的教训，所以失败教训的案例书到迄今为止，世界上都没有一本，我总是期待，我说如果什么时候写出教训这个案例集，可能对大家反思理性化有好处。&rdquo;</div>
<div>
	&nbsp;</div>
<div>
	<strong><span style="color:#ff0000;">&ldquo;你们的工作不就是提供给决策者依据吗？&rdquo;</span></strong></div>
<div>
	&nbsp;</div>
<div>
	<strong><span style="color:#ff0000;">他想了想，说，&ldquo;咱们是行政长官负责制。&rdquo;</span></strong></div>
]]>
        
    </content>
</entry>

<entry>
    <title>ubuntu10.04解决GAE的python2.5依赖</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/11/resolve-gae-python25-dep-on-ubuntu-1004.html" />
    <id>tag:blog.suchasplus.com,2010://3.275</id>

    <published>2010-11-02T16:59:49Z</published>
    <updated>2010-11-02T17:26:25Z</updated>

    <summary><![CDATA[ GAE需要python2.5支持，而ubuntu从10.04开始就只支持python version &gt;= 2.6了, 所以只能自个去编译python2.5了 ---------- ubuntu10.04已经默认安装了python2.6 sudo apt-get install libssl-dev libsqlite3-dev sqlite3 &nbsp;Python 自带的sqlite3模块只是sqlite的一个接口，包含实现部分, 需要先安装sqlite3再编译python,否则会找不到模块 下载python2.5源码, 解压缩 vim /Path/to/Python-2.5/Modules/Setup.dist 将如下行修改为(去掉开头的#号): 204:# Socket module helper for SSL support; you must comment out the other 205:# socket line above, and...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="python" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="gae" label="gae" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="googleappengine" label="googleappengine" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="python" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	GAE需要python2.5支持，而ubuntu从10.04开始就只支持python version &gt;= 2.6了, 所以只能自个去编译python2.5了</p>
<p>
	----------</p>
<p>
	ubuntu10.04已经默认安装了python2.6</p>
<p>
	sudo <strong>apt-get install libssl-dev libsqlite3-dev sqlite3</strong></p>
<p>
	<span _fck_bookmark="1" style="display: none;">&nbsp;</span><span style="color: rgb(0, 0, 205);">Python 自带的sqlite3模块只是sqlite的一个接口，包含实现部分, 需要先安装sqlite3再编译python,否则会找不到模块</span></p>
<p>
	下载python2.5源码, 解压缩</p>
<p>
	<strong>vim</strong> /Path/to/Python-2.5/<strong>Modules/Setup.dist</strong></p>
<p>
	将如下行修改为(去掉开头的#号):</p>
<p>
	204:# Socket module helper for SSL support; you must comment out the other<br />
	205:# socket line above, and possibly edit the SSL variable:<br />
	<strong>206:SSL=/usr/local/ssl<br />
	207:<i>ssl </i>ssl.c<br />
	208: -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl<br />
	209: -L$(SSL)/lib -lssl -lcrypto </strong></p>
<p>
	保存退出 =&gt;<strong> ./configure</strong> =&gt; <strong>make</strong>&nbsp; =&gt; <strong>make altinstall</strong></p>
<p>
	&nbsp;</p>
<p>
	去http://pypi.python.org/pypi/ssl/1.15下载ssl-<em>version</em>.tar.gz并安装</p>
<p>
	去http://www.pythonware.com/products/pil/下载Imageing-<em>version</em>.tar.gz并安装</p>
<p>
	以上两条命令都是python2.5 setup.py install</p>
<p>
	&nbsp;</p>
<p>
	安装easy_install:</p>
<p>
	wget http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg</p>
<p>
	sh setuptools-0.6c11-py2.5.egg</p>
<p>
	安装gae所需的django</p>
<p>
	<code class="bash plain">easy_install-2.5 django==1.1.1</code></p>
<p>
	&nbsp;</p>
<p>
	<code class="bash plain">==========================</code></p>
<p>
	<code class="bash plain">到此就安装完毕了</code></p>
<p>
	执行<strong>python2.5</strong><strong> /usr/local/lib/python2.5/test/test_socket_ssl.py</strong> 进行socket ssl测试</p>
<p>
	正常的话会打印出:</p>
<p>
	test_rude_shutdown ...<br />
	test_basic ...<br />
	test_timeout ...</p>
<p>
	执行python2.5并import sqlite3 ，无错则sqlite3正常</p>
<p>
	---------------------------------------</p>
<p>
	ubuntu 10.10应该也可以如此安装，但是10.04是LTS, 没有去测试10.10</p>
<p>
	&nbsp;</p>
<p>
	参考文章:</p>
<p>
	<a href="http://groups.google.com/group/google-appengine-python/browse_thread/thread/78334a1a13316c77/0a377f81d171f858">GAE Python SDK on ubuntu 10.10 - SSL, Sqlite problems </a></p>
<p>
	<a href="http://code.google.com/p/relat/wiki/python25">relat - python25</a></p>
<p>
	<a href="http://www.boris.co/2010/10/python-25-in-ubuntu-maverick.html">Run GAE SDK for Python and Django on Ubuntu Maverick</a></p>
<p>
	<a href="http://www.pythonclub.org/python-files/sqlite">Python SQLite 编程</a></p>
<p>
	<a href="http://www.mirecle.com/2009/08/17/ubuntu-install-python2-5-4-support-for-ssl.html">ubuntu下安装python2.5.4支持ssl</a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>MacOSX下清空dns缓存</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/09/how-to-flush-dns-cache-in-macosx.html" />
    <id>tag:blog.suchasplus.com,2010://3.273</id>

    <published>2010-09-29T16:35:58Z</published>
    <updated>2010-11-18T10:17:35Z</updated>

    <summary> MacOSX下清空DNS缓存: dscacheutil -flushcache 10.5之前貌似是lookupd, 但是10.5之后用dscacheutil替换了lookupd...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="macosx" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="dns" label="dns" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="macosx" label="macosx" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	<span style="font-size: 14px;">MacOSX下清空DNS缓存: <span style="color: rgb(255, 0, 0);"><strong><tt>dscacheutil -flushcache</tt></strong></span></span></p>
<p>
	<span style="font-size: 14px;"><tt>10.5之前貌似是lookupd, 但是10.5之后用dscacheutil替换了lookupd</tt></span></p>
]]>
        
    </content>
</entry>

<entry>
    <title>wget镜像命令</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/09/wget-mirror-cmdline.html" />
    <id>tag:blog.suchasplus.com,2010://3.272</id>

    <published>2010-09-27T13:17:18Z</published>
    <updated>2010-09-29T15:27:10Z</updated>

    <summary><![CDATA[ wget精确镜像指令 wget &ndash;domains=blog.suchasplus.com -m -nH http://blog.suchasplus.com 不过常用的还是这个:&nbsp; wget -r -p -np -k -c -q -b http://code.google.com/appengine/...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wget" label="wget" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	wget精确镜像指令</p>
<p>
	wget &ndash;domains=blog.suchasplus.com -m -nH http://blog.suchasplus.com<br />
	<br />
	不过常用的还是这个:&nbsp;<br />
	wget -r -p -np -k -c -q -b http://code.google.com/appengine/</p>
]]>
        
    </content>
</entry>

<entry>
    <title>伟大的战斗就要开始了么?</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/09/360-pk-tencent.html" />
    <id>tag:blog.suchasplus.com,2010://3.271</id>

    <published>2010-09-27T13:08:08Z</published>
    <updated>2010-09-28T08:31:05Z</updated>

    <summary><![CDATA[ 前情提要:&nbsp;无耻的微软notepad.exe！ Now:&nbsp; 开始了? 360浏览器涉嫌借色情网站推广遭公安立案调查...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="360" label="360" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tencent" label="tencent" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	前情提要:&nbsp;<a href="http://blog.est.im/archives/2944">无耻的微软notepad.exe</a>！</p>
<p>
	Now:&nbsp;<img alt="360vsTencent.png" class="mt-image-center" height="468" src="http://blog.suchasplus.com/2010/09/27/360vsTencent.png" style="text-align: center; display: block; margin: 0 auto 20px;" width="373" /></p>
<p>
	开始了? <a href="http://tech.qq.com/a/20100928/000368.htm">360浏览器涉嫌借色情网站推广遭公安立案调查</a></p>
]]>
        
    </content>
</entry>

<entry>
    <title>wget/curl测试gzip</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/09/using-wget-curl-testing-gzip-conf.html" />
    <id>tag:blog.suchasplus.com,2010://3.270</id>

    <published>2010-09-05T17:14:03Z</published>
    <updated>2010-09-05T17:16:22Z</updated>

    <summary><![CDATA[ Apache启用gzip/deflate或者Nginx启用gzip之后 用wget测试的话需要加上--header=&quot;accept-encoding:gzip&quot; 用curl则加上--compressed 浪费了20分钟在这选项上,milk 关于gzip和deflate有两篇文章(1和2), 作者应该是一个人，明显是从1毛跳去了性浪......]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="apache" label="apache" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="curl" label="curl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="deflate" label="deflate" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gzip" label="gzip" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nginx" label="nginx" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wget" label="wget" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	Apache启用gzip/deflate或者Nginx启用gzip之后<br />
	用wget测试的话需要加上--header=&quot;accept-encoding:gzip&quot;<br />
	用curl则加上--compressed<br />
	浪费了20分钟在这选项上,milk<br />
	<br />
	关于gzip和deflate有两篇文章(<a href="http://blog.fulin.org/2009/01/deflate_and_gzip.html">1</a>和<a href="http://blog.developers.api.sina.com.cn/?p=266">2</a>), 作者应该是一个人，明显是从1毛跳去了性浪...</p>
]]>
        
    </content>
</entry>

<entry>
    <title>无奈的百度</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/07/helpless-baidu.html" />
    <id>tag:blog.suchasplus.com,2010://3.268</id>

    <published>2010-07-25T19:38:56Z</published>
    <updated>2010-07-25T20:08:08Z</updated>

    <summary> 最近央视又曝光了百度，很没有新意的那种。网上还有一堆中华网军事论坛级别的人在评论。 尽管平时搜索正经的东西用Google, 乱七八糟的用baidu, 但是说实话，我认为，百度算是大陆互联网公司里面最有料的公司之一。而被央视批判，百度真是冤到不能自理, 躺着也中枪。 其实，在google.cn和ccp相互博弈妥协的这个时间点上，作为ccp广电头号喉舌的ccav，摆出一副公正的样子，或者说避免受到指责说他们是在狭隘的民族主义基础之上支持中文搜索引擎百度, 这才是他们想表现的。而pk百度，是当代包青天的best show。 btw: 凤巢的种种不足或者所谓百度战略调整, 我始终认为我没资格评论战略层面上百度的决定, 师兄说了, 别学donews那帮二混子。 ref: Who Won In Google&#39;s Showdown With China?...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="百度" label="百度" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	最近央视<a href="http://news.163.com/10/0724/15/6CCB2KD5000146BC.html">又</a>曝光了百度，很没有新意的那种。网上还有一堆中华网军事论坛级别的人在<a href="http://www.xjp.cc/2010-log/07/baidu-thick-black.html">评论</a>。<br />
	尽管平时搜索正经的东西用Google, 乱七八糟的用baidu, 但是说实话，我认为，百度算是大陆互联网公司里面最有料的公司之一。而被央视批判，百度真是冤到不能自理, 躺着也中枪。<br />
	<br />
	其实，在google.cn和ccp相互博弈妥协的这个时间点上，作为ccp广电头号喉舌的ccav，摆出一副公正的样子，或者说<span style="font-size: small;">避免受到指责说他们是在狭隘的民族主义基础之上支持中文搜索引擎百度</span>, 这才是他们想表现的。而pk百度，是当代包青天的best show。<br />
	<br />
	btw: 凤巢的种种<a href="http://semwatch.org/2010/06/black-hat-ppc">不足</a>或者所谓百度战略调整, 我始终认为我没资格评论战略层面上百度的决定, <a href="http://www.zhangliang.org/">师兄</a>说了, 别学donews那帮二混子。<br />
	<br />
	ref: <a href="http://www.businessinsider.com/google-in-china-win-lose-or-draw-2010-7">Who Won In Google&#39;s Showdown With China?</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>根据pid查看进程elf文件所在cwd</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/07/get-elf-folder-by-pwdx.html" />
    <id>tag:blog.suchasplus.com,2010://3.267</id>

    <published>2010-07-25T19:10:39Z</published>
    <updated>2010-07-28T19:10:15Z</updated>

    <summary><![CDATA[ 通常都是进入/proc/{$pid}目录之后查看cwd和exe(eg), 其实直接pwdx $pid就能打印出该elf所在的cwd. 恩 备忘, 感谢feuvan的指正 &nbsp;...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bash" label="bash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="elf" label="elf" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="proc" label="proc" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	通常都是进入/proc/{$pid}目录之后查看cwd和exe(<a href="http://blog.csdn.net/jccz_zys/archive/2006/12/11/1438215.aspx" target="_blank">eg</a>), 其实直接pwdx $pid就能打印出该elf所在的cwd.<br />
	恩 备忘, 感谢<a href="http://blog.feuvan.net/">feuvan</a>的指正<br />
	&nbsp;</p>
]]>
        
    </content>
</entry>

<entry>
    <title>php多层数组和对象的转换</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/07/multi-dimensional-array-and-object-convertion-in-php.html" />
    <id>tag:blog.suchasplus.com,2010://3.266</id>

    <published>2010-07-10T18:03:25Z</published>
    <updated>2010-07-11T19:03:17Z</updated>

    <summary><![CDATA[ 多层数组和对象转化的用途很简单，便于处理WebService中多层数组和对象的转化 简单的(array)和(object)只能处理单层的数据，对于多层的数组和对象转换则无能为力。 通过json_decode(json_encode($object)可以将对象一次性转换为数组，但是object中遇到非utf-8编码的非ascii字符则会出现问题，比如gbk的中文，何况json_encode和decode的性能也值得疑虑。 下面上代码： &nbsp; &lt;?php &nbsp; function objectToArray($d) { if (is_object($d)) { // Gets the properties of the given object // with get_object_vars function $d = get_object_vars($d); } &nbsp; if (is_array($d)) { /* * Return array converted to...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="php" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="array" label="array" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="multidimensional" label="multi-dimensional" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="object" label="object" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	多层数组和对象转化的用途很简单，便于处理WebService中多层数组和对象的转化<br />
	简单的(array)和(object)只能处理单层的数据，对于多层的数组和对象转换则无能为力。<br />
	通过json_decode(json_encode($object)可以将对象一次性转换为数组，但是object中遇到非utf-8编码的非ascii字符则会出现问题，比如gbk的中文，何况json_encode和decode的性能也值得疑虑。</p>
<p>
	下面上代码：</p>
<hr />
<p>
	&nbsp;</p>
<div>
	<pre class="php" style="font-family: monospace">
	<span style="color: rgb(0,0,0); font-weight: bold">&lt;?php</span>
&nbsp;
	<span style="color: rgb(0,0,0); font-weight: bold">function</span> objectToArray<span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span> <span style="color: rgb(0,153,0)">{</span>
		<span style="color: rgb(177,177,0)">if</span> <span style="color: rgb(0,153,0)">(</span><span style="color: rgb(153,0,0)">is_object</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(0,153,0)">)</span> <span style="color: rgb(0,153,0)">{</span>
			<span style="font-style: italic; color: rgb(102,102,102)">// Gets the properties of the given object</span>
			<span style="font-style: italic; color: rgb(102,102,102)">// with get_object_vars function</span>
			<span style="color: rgb(0,0,136)">$d</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(153,0,0)">get_object_vars</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
		<span style="color: rgb(0,153,0)">}</span>
&nbsp;
		<span style="color: rgb(177,177,0)">if</span> <span style="color: rgb(0,153,0)">(</span><span style="color: rgb(153,0,0)">is_array</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(0,153,0)">)</span> <span style="color: rgb(0,153,0)">{</span>
			<span style="font-style: italic; color: rgb(102,102,102)">/*
			* Return array converted to object
			* Using __FUNCTION__ (Magic constant)
			* for recursive call
			*/</span>
			<span style="color: rgb(177,177,0)">return</span> <span style="color: rgb(153,0,0)">array_map</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,153,0); font-weight: bold">__FUNCTION__</span><span style="color: rgb(51,153,51)">,</span> <span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
		<span style="color: rgb(0,153,0)">}</span>
		<span style="color: rgb(177,177,0)">else</span> <span style="color: rgb(0,153,0)">{</span>
			<span style="font-style: italic; color: rgb(102,102,102)">// Return array</span>
			<span style="color: rgb(177,177,0)">return</span> <span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(51,153,51)">;</span>
		<span style="color: rgb(0,153,0)">}</span>
	<span style="color: rgb(0,153,0)">}</span>
&nbsp;
	<span style="color: rgb(0,0,0); font-weight: bold">function</span> arrayToObject<span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span> <span style="color: rgb(0,153,0)">{</span>
		<span style="color: rgb(177,177,0)">if</span> <span style="color: rgb(0,153,0)">(</span><span style="color: rgb(153,0,0)">is_array</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(0,153,0)">)</span> <span style="color: rgb(0,153,0)">{</span>
			<span style="font-style: italic; color: rgb(102,102,102)">/*
			* Return array converted to object
			* Using __FUNCTION__ (Magic constant)
			* for recursive call
			*/</span>
			<span style="color: rgb(177,177,0)">return</span> <span style="color: rgb(0,153,0)">(</span>object<span style="color: rgb(0,153,0)">)</span> <span style="color: rgb(153,0,0)">array_map</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,153,0); font-weight: bold">__FUNCTION__</span><span style="color: rgb(51,153,51)">,</span> <span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
		<span style="color: rgb(0,153,0)">}</span>
		<span style="color: rgb(177,177,0)">else</span> <span style="color: rgb(0,153,0)">{</span>
			<span style="font-style: italic; color: rgb(102,102,102)">// Return object</span>
			<span style="color: rgb(177,177,0)">return</span> <span style="color: rgb(0,0,136)">$d</span><span style="color: rgb(51,153,51)">;</span>
		<span style="color: rgb(0,153,0)">}</span>
	<span style="color: rgb(0,153,0)">}</span>

	<span style="font-style: italic; color: rgb(102,102,102)">// Useage:</span>
	<span style="font-style: italic; color: rgb(102,102,102)">// Create new stdClass Object </span>	
        <span style="color: rgb(0,0,136)">$init</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,0); font-weight: bold">new</span> stdClass<span style="color: rgb(51,153,51)">;</span>
	<span style="font-style: italic; color: rgb(102,102,102)">// Add some test data</span>
	<span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">foo</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,255)">&quot;Test data&quot;</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">bar</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,0); font-weight: bold">new</span> stdClass<span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">bar</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">baaz</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,255)">&quot;Testing&quot;</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">bar</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">fooz</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,0); font-weight: bold">new</span> stdClass<span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">bar</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">fooz</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">baz</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,255)">&quot;Testing again&quot;</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(51,153,51)">-&gt;</span><span style="color: rgb(0,64,0)">foox</span> <span style="color: rgb(51,153,51)">=</span> <span style="color: rgb(0,0,255)">&quot;Just test&quot;</span><span style="color: rgb(51,153,51)">;</span>
&nbsp;
	<span style="font-style: italic; color: rgb(102,102,102)">// Convert array to object and then object back to array</span>
	<span style="color: rgb(0,0,136)">$array</span> <span style="color: rgb(51,153,51)">=</span> objectToArray<span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(0,0,136)">$object</span> <span style="color: rgb(51,153,51)">=</span> arrayToObject<span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$array</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
&nbsp;
	<span style="font-style: italic; color: rgb(102,102,102)">// Print objects and array</span>
	<span style="color: rgb(153,0,0)">print_r</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$init</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(177,177,0)">echo</span> <span style="color: rgb(0,0,255)">&quot;<span style="color: rgb(0,0,153); font-weight: bold">\n</span>&quot;</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(153,0,0)">print_r</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$array</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(177,177,0)">echo</span> <span style="color: rgb(0,0,255)">&quot;<span style="color: rgb(0,0,153); font-weight: bold">\n</span>&quot;</span><span style="color: rgb(51,153,51)">;</span>
	<span style="color: rgb(153,0,0)">print_r</span><span style="color: rgb(0,153,0)">(</span><span style="color: rgb(0,0,136)">$object</span><span style="color: rgb(0,153,0)">)</span><span style="color: rgb(51,153,51)">;</span>
?&gt;</pre>
</div>]]>
        
    </content>
</entry>

<entry>
    <title>PSN神作: mushroom war蘑菇战争奖杯列表</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/07/mushroom-war-all-trophies-in-chinese.html" />
    <id>tag:blog.suchasplus.com,2010://3.265</id>

    <published>2010-07-03T22:29:08Z</published>
    <updated>2010-07-04T19:02:17Z</updated>

    <summary>最近很迷mushroom war(蘑菇战争)这个PSN游戏，发现有几个隐藏奖杯，搜索了一下，还没有人发中文版奖杯列表Theorist (理论家:铜杯)Complete all Tutorials完成所有教程btw:结束第15关可以拿到完成此奖杯Lieutenant(中尉:铜杯)Complete 25% of Campaign Mode完成25%的战役模式Colonel(上校:铜杯)Complete 50% of Campaign Mode完成50%的战役模式General(将军:铜杯)Complete 75% of Campaign Mode完成75%的战役模式Extirpator(根除:铜杯)Complete Campaign Mode in 60 minutes or less在不超过60分钟的时间内完成战役模式Vanquisher(征服者:铜杯)Complete Campaign Mode完成战役模式Napoleon(拿破仑:银杯)Complete Campaign Mode on Hard difficulty level完成困难难度的战役模式Gatherer(收集者:铜杯)Gain 9 different rewards in Campaign Mode在战役模式中拿到(所有)9个不同的奖励btw: 第一个也是最难拿到的warlord, 要求是win...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="mushroomwar" label="mushroom war" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="playstation" label="playstation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="psn" label="psn" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sony" label="sony" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>最近很迷<a target="_blank" href="http://www.creatstudio.com/games/mushroom-wars.php">mushroom war</a>(蘑菇战争)这个<a href="http://asia.playstation.com/hk/chs/psn">PSN</a>游戏，发现有几个隐藏奖杯，搜索了一下，还没有人发中文版奖杯列表</p><p>Theorist (理论家:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete all Tutorials<br />完成所有教程<br />btw:结束第15关可以拿到完成此奖杯</p><p>Lieutenant(中尉:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete 25% of Campaign Mode<br />完成25%的战役模式</p><p>Colonel(上校:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete 50% of Campaign Mode<br />完成50%的战役模式</p><p>General(将军:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete 75% of Campaign Mode<br />完成75%的战役模式</p><p>Extirpator(根除:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete Campaign Mode in 60 minutes or less<br />在不超过60分钟的时间内完成战役模式</p><p>Vanquisher(征服者:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete Campaign Mode<br />完成战役模式</p><p>Napoleon(拿破仑:<span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(255, 0, 0);"><span><span><span><span>银杯</span></span></span></span></span></span>)<br />Complete Campaign Mode on Hard difficulty level<br />完成困难难度的战役模式</p><p>Gatherer(收集者:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Gain 9 different rewards in Campaign Mode<br />在战役模式中拿到(所有)9个不同的奖励<br />btw: 第一个也是最难拿到的warlord, 要求是win by a landslide. 要拿到这个最方便是在单人campaign第4关Telminham, 选择中低难度，开局将所有兵倾泻到地方基地，占领后立刻即刻马上把手里所有的兵(2个建筑中)送到敌人刚占领的地方，搞定。</p><p>Collector(收藏家:<span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(255, 0, 0);"><span><span><span><span>银杯</span></span></span></span></span></span>)<br />Gain 200 rewards in Campaign Mode<br />在战役模式中拿到200个奖励<br />btw:单一地图重复获得不累计，只计算campaign下的总数</p><p>Amateur(业余爱好者:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Complete Skirmish on Normal or higher difficulty level<br />在一般或高难度下完成遭遇战</p><p>Ace(高手:<span style="background-color: rgb(255, 255, 255);"><span style="color: rgb(255, 0, 0);"><span><span><span><span>银杯</span></span></span></span></span></span>)<br />Complete Skirmish on Hard difficulty level<br />在困难难度下完成遭遇战</p><p>Torch-bearer(火炬手:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Keep 5th morale level for 25 sec in Single Player<br />单人模式中，保持5级(最高级)士气25秒<br />btw: hard模式下被电脑多冲几次就ok了,很难刻意拿到</p><p>Escapee(逃亡者:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />In Single Player capture enemy&rsquo;s village after all own buildings were lost<br />在单人模式下，当敌人占领了全部建筑后)抢夺敌人(至少一个)建筑物<br />btw:hard模式下很容易被拿到此奖杯</p><p>Midas(迈达斯:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Upgrade the village to the 5th level in Single Player<br />单人战役中将建筑物升级到第5级<br />btw: 单一4级建筑内充满1000个单位，即可升级到第5级主城，需要消耗1000兵(你没看错...), midas是传说中的弗里吉亚国王</p><p>Encourager(鼓励者:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Send a surge containing 1000 units in Single Player<br />单人战役中送出一拨超过1000单位的攻击<br />btw:一 波攻击超过1000个兵，即单一建筑中要存放1000兵以上并全部攻击一个敌方建筑.</p><p>Aggressor(侵略者:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Capture 2000 buildings in Single Player<br />单人战役中累计占领2000个建筑物</p><p>Blighter(可恶的家伙:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Kill your 32000 units in Single Player<br />单人战役中累计被杀掉32000个单位<br />btw:此数量累计计算，多玩几局就ok了</p><p>Comrade(同志:<span style="color: rgb(153, 51, 0);">铜杯</span>)<br />Play 100 Local Multiplayer Matches<br />玩100局本地多人对战<br />btw:restart了的不算，只计算结束的。跟老婆一块玩的注意了，不要欺人太甚，免得你们的老婆不断的restart...</p><p>reference: mushroom <a href="http://www.allps3trophies.com/psn-games/mushroom-wars-trophies.html">ps3t</a><br />&nbsp;</p>]]>
        
    </content>
</entry>

<entry>
    <title>给Dabr加上了https</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/06/add-dabr-with-https.html" />
    <id>tag:blog.suchasplus.com,2010://3.264</id>

    <published>2010-06-20T19:35:34Z</published>
    <updated>2010-06-21T03:20:18Z</updated>

    <summary><![CDATA[鉴于近来若干私密型twitter api和dabr等被封，给自己的dabr加上了https,&nbsp; 这样就比较放心多了证书信息:E = suchasplus@gmail.comCN = d.suchasplus.comOU = suchasplusO = suchasplus.comL = BeijingST = BeijingC = CNhttp强制跳转https, curl -k可以访问curl访问https报错:curl: (77) error setting certificate verify locations:&nbsp; CAfile: /etc/ssl/certs/ca-certificates.crt&nbsp; CApath: none则apt-get install ca-certificates...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="NeverMind" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="curl" label="curl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dabr" label="dabr" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="https" label="https" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ssl" label="ssl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="suchasplus" label="suchasplus" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>鉴于近来若干私密型twitter api和dabr等被封，给自己的dabr加上了https,&nbsp; 这样就比较放心多了<br />证书信息:<br />E = suchasplus@gmail.com<br />CN = d.suchasplus.com<br />OU = suchasplus<br />O = suchasplus.com<br />L = Beijing<br />ST = Beijing<br />C = CN</p><p>http强制跳转https, curl -k可以访问<br />curl访问https报错:<br />curl: (77) error setting certificate verify locations:<br />&nbsp; CAfile: /etc/ssl/certs/ca-certificates.crt<br />&nbsp; CApath: none<br />则<b>apt-get install ca-certificates</b></p>]]>
        
    </content>
</entry>

<entry>
    <title>Palm Treo650和Office2010同步问题</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/06/palm-treo-outlook-2010-conduits.html" />
    <id>tag:blog.suchasplus.com,2010://3.263</id>

    <published>2010-06-14T15:02:58Z</published>
    <updated>2010-06-14T15:12:10Z</updated>

    <summary>服役近4年的Treo650即将老去，踌躇与换Palm Centro还是别的啥...首先导出数据win7 + office14(2010)palm desktop 6.22同步报错, 提示outllook版本不符合查资料后发现改outlook.exe即可用HexEdit修改outllook.exe将14.0.0替换成12.0.0，保存即可如果是Office2007的话，这里是补丁包下载地址注: office 2010 beta版测试通过，据说RTM版无法使用此方法参考文章: http://www.treo8.com/bbs/thread-156723-1-1.html...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="centro" label="centro" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="palm" label="palm" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="treo" label="treo" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="treo650" label="treo650" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>服役近4年的Treo650即将老去，踌躇与换Palm Centro还是别的啥...首先导出数据<br />win7 + office14(2010)<br />palm desktop 6.22同步报错, 提示outllook版本不符合<br />查资料后发现改outlook.exe即可<br />用HexEdit修改outllook.exe将14.0.0替换成12.0.0，保存即可<br />如果是Office2007的话，<a href="http://palmone.r3h.net/downloads.palm.com/palmoutlook2007conduits.zip">这里</a>是补丁包下载地址<br /><br />注: office 2010 beta版测试通过，据说RTM版无法使用此方法<br /><br />参考文章: <a href="http://www.treo8.com/bbs/thread-156723-1-1.html">http://www.treo8.com/bbs/thread-156723-1-1.html</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>WordPress模板</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/06/wordpress-themes-of-epuber.html" />
    <id>tag:blog.suchasplus.com,2010://3.261</id>

    <published>2010-06-02T08:45:52Z</published>
    <updated>2010-06-02T08:51:08Z</updated>

    <summary><![CDATA[著名的epuber原来用的是这个模板... http://seo.redevolution.com/?wptheme=redevo_newsblue相关链接:http://bbs.wopus.org/thread-325-1-5.htmlhttp://bbs.wopus.org/thread-264-1-1.htmlhttp://www.redevolution.com/&nbsp;...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="Entertainment" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="themes" label="themes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wordpress" label="wordpress" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>著名的epuber原来用的是这个模板... http://seo.redevolution.com/?wptheme=redevo_newsblue</p><p>相关链接:</p><p>http://bbs.wopus.org/thread-325-1-5.html<br />http://bbs.wopus.org/thread-264-1-1.html<br />http://www.redevolution.com/</p><p>&nbsp;</p>]]>
        
    </content>
</entry>

<entry>
    <title>解决php soap wsdl error一例</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/05/php-soap-wsdl-error-solution.html" />
    <id>tag:blog.suchasplus.com,2010://3.260</id>

    <published>2010-05-25T03:16:16Z</published>
    <updated>2010-05-25T03:23:42Z</updated>

    <summary><![CDATA[备忘,查了半天:客户在访问我提供的WebService(预定义,即WSDL模式)的时候，在Linux服务器上运行example的时候是ok的，但是在他的windows开发机上运行失败。报了俩错: WARNING是I/O warning : failed to load external entity, FATAL ERROR是: Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:Couldn't load from 'somewhere' in somefileStack trace: #0 somefile: SoapClient->SoapClient('https://tg.qq.c...', Array) #1 {main} thrown in somefile on line&nbsp;官方文档说requirements是GNOME Xml Library, 就是libxml必须高于2.5.4但是实际上WSDL的SoapClient还必须加载cURL模块，如果服务端是https,则还需要加载openssl模块在windows下就是需要php_curl.dll和php_openssl.dll,...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="curl" label="curl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="openssl" label="openssl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="soap" label="soap" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="wsdl" label="wsdl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>备忘,查了半天:<br />客户在访问我提供的WebService(预定义,即WSDL模式)的时候，在Linux服务器上运行example的时候是ok的，但是在他的windows开发机上运行失败。<br />报了俩错: <br />WARNING是I/O warning : failed to load external entity, <br />FATAL ERROR是: Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:Couldn't load from 'somewhere' in somefileStack trace: #0 somefile: SoapClient->SoapClient('https://tg.qq.c...', Array) #1 {main} thrown in somefile on line&nbsp;<br /><br />官方文档说requirements是GNOME Xml Library, 就是libxml必须高于2.5.4<br />但是实际上WSDL的SoapClient还必须加载cURL模块，如果服务端是https,则还需要加载openssl模块<br />在windows下就是需要php_curl.dll和php_openssl.dll, curl同时依赖于libeay32.dll, ssleay32.dll, openssl依赖于libeay32.dll</p>]]>
        
    </content>
</entry>

<entry>
    <title>天才与大众之间的百年战争</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/05/apple-go-away.html" />
    <id>tag:blog.suchasplus.com,2010://3.259</id>

    <published>2010-05-23T03:22:40Z</published>
    <updated>2010-05-23T03:25:37Z</updated>

    <summary><![CDATA[Google I/O 2010 第二天 （5月20日）的主题演讲上，Google 工程副总裁 Vic Gundotra 的一段话。他在回顾当年 Google 为什么要开发 Android 平台的时候说到：&ldquo;If Google did not act, we face a draconian future. A future where One Man, One Company, One Device, One Carrier, will be our only choice. That&rsquo;s a...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="android" label="Android" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="google" label="Google" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>Google I/O 2010 第二天 （5月20日）的主题演讲上，Google 工程副总裁 Vic Gundotra 的一段话。他在回顾当年 Google 为什么要开发 Android 平台的时候说到：</p><p>&ldquo;If Google did not act, we face a draconian future. A future where One Man, One Company, One Device, One Carrier, will be our only choice. That&rsquo;s a future we don&rsquo;t want. So if you believe in openness, if you believe in choice, if you believe in innovation from everyone, then welcome to Android. &ldquo;<br /><br />「如果 Google 不行动起来，那我们都将面临一个残酷的未来：一个人、一家公司、一款设备、一个运营商将是我们唯一的选择。（现场掌声雷动）那不是我们想要的未来。如果你相信开放、相信选择、相信来自每个人的创新，欢迎使用 Android。」<br />&nbsp;</p><p>来源: <a href="http://apple4.us/2010/05/google-vs-appl.html">Apple4us</a></p><p>&nbsp;</p>]]>
        
    </content>
</entry>

<entry>
    <title>accesslog中好玩的一些东西</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/05/funny-in-accesslog.html" />
    <id>tag:blog.suchasplus.com,2010://3.258</id>

    <published>2010-05-22T16:54:50Z</published>
    <updated>2010-05-23T00:39:32Z</updated>

    <summary><![CDATA[闲的无聊看自己的access log, 发现几条好玩的记录:61.143.61.81 - - [18/May/2010:04:37:04 +0800] &quot;GET /cert/bazs.cert HTTP/1.0&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;222.81.81.128 - - [21/May/2010:13:26:05 +0800] &quot;GET /cert/bazs.cert HTTP/1.0&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;202.101.104.125 - - [22/May/2010:07:46:02 +0800] &quot;GET /cert/bazs.cert HTTP/1.0&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;cert/bazs.cert 是宫刑部的爬虫么?============华丽的分割线============63.220.4.250 - - [23/May/2010:00:20:51...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="accesslog" label="accesslog" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="apache" label="apache" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linode" label="linode" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>闲的无聊看自己的access log, 发现几条好玩的记录:</p><p><a href="http://www.ip138.com/ips8.asp?ip=61.143.61.81&amp;action=2">61.143.61.81</a> - - [18/May/2010:04:37:04 +0800] &quot;GET /cert/bazs.cert HTTP/1.0&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;<br /><a href="http://www.ip138.com/ips8.asp?ip=222.81.81.128&amp;action=2">222.81.81.128</a> - - [21/May/2010:13:26:05 +0800] &quot;GET /cert/bazs.cert HTTP/1.0&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;<br /><a href="http://www.ip138.com/ips8.asp?ip=202.101.104.125&amp;action=2">202.101.104.125</a> - - [22/May/2010:07:46:02 +0800] &quot;GET /cert/bazs.cert HTTP/1.0&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;<br /><br />cert/bazs.cert 是宫刑部的爬虫么?<br /><br />============华丽的分割线============<br /><br /><a href="http://www.ip138.com/ips.asp?ip=63.220.4.250&amp;action=2">63.220.4.250</a> - - [23/May/2010:00:20:51 +0800] &quot;GET /include/dialog/zhmnselect_soft_post.php HTTP/1.1&quot; 404 237 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />63.220.4.250 - - [23/May/2010:00:20:51 +0800] &quot;GET /include/dialog/select_soft_post.php HTTP/1.1&quot; 404 233 &quot;-&quot; &quot;Mozilla/4.0&quot;<br /><br />select_soft_post.php 是dedeCMS5.5中的文件, 貌似是有个页面变量未初始化的bug...</p><p>============终于是个大陆的爬虫了============</p><p><a href="http://www.ip138.com/ips.asp?ip=218.65.59.6&amp;action=2">218.65.59.6</a> - - [23/May/2010:04:17:17 +0800] &quot;GET /pgjxupfile.htm HTTP/1.1&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:18 +0800] &quot;GET /upfile.htm HTTP/1.1&quot; 404 208 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:18 +0800] &quot;GET /upfile.htm HTTP/1.1&quot; 404 208 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:18 +0800] &quot;GET /cvqwupfile_adpic.asp HTTP/1.1&quot; 404 218 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:19 +0800] &quot;GET /upfile_adpic.asp HTTP/1.1&quot; 404 214 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:19 +0800] &quot;GET /upfile_adpic.asp HTTP/1.1&quot; 404 214 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:19 +0800] &quot;GET /edyzupfile_article.asp HTTP/1.1&quot; 404 220 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:20 +0800] &quot;GET /upfile_article.asp HTTP/1.1&quot; 404 216 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:20 +0800] &quot;GET /upfile_article.asp HTTP/1.1&quot; 404 216 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:20 +0800] &quot;GET /uzafupfile_flash.asp HTTP/1.1&quot; 404 218 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:21 +0800] &quot;GET /upfile_flash.asp HTTP/1.1&quot; 404 214 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:21 +0800] &quot;GET /upfile_flash.asp HTTP/1.1&quot; 404 214 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:21 +0800] &quot;GET /ewpqupfile_photo.asp HTTP/1.1&quot; 404 218 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:22 +0800] &quot;GET /upfile_photo.asp HTTP/1.1&quot; 404 214 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:22 +0800] &quot;GET /upfile_photo.asp HTTP/1.1&quot; 404 214 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:22 +0800] &quot;GET /nrdrupfile_soft.asp HTTP/1.1&quot; 404 217 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:23 +0800] &quot;GET /upfile_soft.asp HTTP/1.1&quot; 404 213 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:23 +0800] &quot;GET /upfile_soft.asp HTTP/1.1&quot; 404 213 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:23 +0800] &quot;GET /kypxupload.asp HTTP/1.1&quot; 404 212 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:24 +0800] &quot;GET /upload.asp HTTP/1.1&quot; 404 208 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:24 +0800] &quot;GET /upload.asp HTTP/1.1&quot; 404 208 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:24 +0800] &quot;GET /axwwupload_Dialog.asp HTTP/1.1&quot; 404 219 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />218.65.59.6 - - [23/May/2010:04:17:25 +0800] &quot;GET /upload_Dialog.asp HTTP/1.1&quot; 404 215 &quot;-&quot; &quot;Mozilla/4.0&quot;<br />&nbsp;</p>]]>
        
    </content>
</entry>

<entry>
    <title>CCTV和中共，你们能再不要脸点么</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/05/fuck-cctv-and-ccp.html" />
    <id>tag:blog.suchasplus.com,2010://3.257</id>

    <published>2010-05-18T02:30:30Z</published>
    <updated>2010-05-18T02:35:22Z</updated>

    <summary><![CDATA[前情提要:焦点访谈：警惕互联网地图泄密&nbsp;月光博客的作者说:关于当天的一些细节 5月6日上午，深圳市规划和国土资源委员会打电话要我过去调查一下情况，去了后发现有记者在录影，我问他们是什么单位的，不回答，问其他人摄影是为什么，答曰记录问询过程，在问询中，他们说我的网站涉嫌有包含&ldquo;中国国家军事机密&rdquo;的Google Earth地标文件，要求我进行自查，删除我网站上所有的&ldquo;国家军事机密&rdquo;，并给我开了一份行政处罚告知书给我，要罚款5000元。之后一个女记者还问了我几个问题，自始至终，这些采访我的人都没有透露他们是中央电视台焦点访谈栏目的，我要是知道这一点，肯定会拒绝采访的，因为这摆明了是要陷害谷歌地图。 在CCAV的解说中，我从一个70后变成了80后，关注IT的科技博客变成了军事发烧友博客，每天不足30个人访问的论坛变成军事爱好者经常访问的网络社区。 总而言之，我被CCAV的人给耍了。关于月光论坛的一些说明&nbsp;继续黑，黑你妈逼！...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="google" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ccav" label="CCAV" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cctv" label="CCTV" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="中国共产党" label="中国共产党" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>前情提要:<br /><a href="http://www.cnbeta.com/articles/111331.htm">焦点访谈：警惕互联网地图泄密&nbsp;</a></p><p>月光博客的作者说:<br /><br /><span style="color:#333333;"><b><a href="http://www.google.com/buzz/williamlone/h4VfCPqLQAW/关于当天的一些细节-5月6日上">关于当天的一些细节</a> <br /><br />5月6日上午，深圳市规划和国土资源委员会打电话要我过去调查一下情况，去了后发现有记者在录影，我问他们是什么单位的，不回答，问其他人摄影是为什么，答曰记录问询过程，在问询中，他们说我的网站涉嫌有包含&ldquo;中国国家军事机密&rdquo;的Google Earth地标文件，要求我进行自查，删除我网站上所有的&ldquo;国家军事机密&rdquo;，并给我开了一份行政处罚告知书给我，要罚款5000元。之后一个女记者还问了我几个问题，自始至终，这些采访我的人都没有透露他们是中央电视台焦点访谈栏目的，我要是知道这一点，肯定会拒绝采访的，因为这摆明了是要陷害谷歌地图。 <br /><br />在CCAV的解说中，我从一个70后变成了80后，关注IT的科技博客变成了军事发烧友博客，每天不足30个人访问的论坛变成军事爱好者经常访问的网络社区。 <br /><br />总而言之，我被CCAV的人给耍了。<br /><br /></b></span><a href="http://www.williamlong.info/archives/2180.html">关于月光论坛的一些说明</a><br />&nbsp;</p><p>继续黑，黑你妈逼！</p>]]>
        
    </content>
</entry>

<entry>
    <title>perl lib安装备忘</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/05/perl-lib.html" />
    <id>tag:blog.suchasplus.com,2010://3.256</id>

    <published>2010-05-16T19:37:31Z</published>
    <updated>2010-05-16T19:58:34Z</updated>

    <summary>CPAN安装说明: http://www.cpan.org/modules/INSTALL.htmlperl -MCPAN -e shellperl -MCPAN -e &apos;install DBD::mysql&apos;正常安装不成功就force install DBD::mysql或者干脆在apt-get上装也可以Crypt::DSA有好几个版本，经常用的是Benjamin Trott版的，apt装的貌似是另外的版本。 Benjamin Trott版本的Crypt::DSA，直接用2006版的0.14就可以，新版的话可能不认. 或者干脆扔到movabletype的extlib里面去...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
    <category term="cpan" label="CPAN" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>CPAN安装说明: http://www.cpan.org/modules/INSTALL.html<br />perl -MCPAN -e shell<br />perl -MCPAN -e 'install DBD::mysql'<br />正常安装不成功就force install DBD::mysql<br />或者干脆在apt-get上装也可以<br />Crypt::DSA有好几个版本，经常用的是<a href="http://search.cpan.org/~btrott/Crypt-DSA/">Benjamin Trott</a>版的，apt装的貌似是另外的版本。 <br />Benjamin Trott版本的Crypt::DSA，直接用2006版的0.14就可以，新版的话可能不认. 或者干脆扔到movabletype的extlib里面去</p>]]>
        
    </content>
</entry>

<entry>
    <title>ubuntu找不到default locale</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/03/fix-ubuntu-default-locale.html" />
    <id>tag:blog.suchasplus.com,2010://2.236</id>

    <published>2010-03-19T02:39:26Z</published>
    <updated>2010-03-19T02:44:09Z</updated>

    <summary><![CDATA[ubuntu支持的locales都列在/usr/share/i18n/SUPPORTED把自己需要grep出来放在 /var/lib/locales/supported.d/下面就可以了locale-gen&nbsp; --purge重新生成locale(清除掉/usr/lib/locale/下的原有locale文件)...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="notes" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="locale" label="locale" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ubuntu" label="ubuntu" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>ubuntu支持的locales都列在/usr/share/i18n/SUPPORTED<br /><b>把自己需要grep出来放在</b> /var/lib/locales/supported.d/下面就可以了</p><p>locale-gen&nbsp; --purge重新生成locale(清除掉/usr/lib/locale/下的原有locale文件)</p>]]>
        
    </content>
</entry>

<entry>
    <title>广视通达越来越出名了</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/03/post-22.html" />
    <id>tag:blog.suchasplus.com,2010://2.235</id>

    <published>2010-03-06T10:18:03Z</published>
    <updated>2010-10-19T15:23:50Z</updated>

    <summary> 广视通达越来越出名了...详情请戳这里 真正的广视通达请戳这里, 查看背后控制人请戳这里 == update: 以上信息已经过期...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="不懂" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="null" label="NULL" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>
	广视通达越来越出名了...详情请戳<a href="http://www.gshtx201098.com/">这里</a><br />
	真正的广视通达请戳<a href="http://www.unioncast.net">这里</a>, 查看背后控制人请戳<a href="http://www.boentel.com/">这里</a></p>
<p>
	==</p>
<p>
	update: 以上信息已经过期</p>
]]>
        
    </content>
</entry>

<entry>
    <title>global-htags安装备忘</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/02/global-htags-install-memo.html" />
    <id>tag:blog.suchasplus.com,2010://2.234</id>

    <published>2010-02-23T17:37:35Z</published>
    <updated>2010-02-23T18:03:32Z</updated>

    <summary><![CDATA[os: ubuntu 9.04htags: 5.6.1 (apt-get install global)运行global-htags(manual)生成html文件时，提示缺少文件htags:&nbsp;skeleton&nbsp;file&nbsp;'/usr/share/gtags/global.cgi.tmpl'&nbsp;not&nbsp;found.除了global.cgi.tmpl之外，还缺少bless.sh.tmpl和style.css, 这三个文件没有打包。详细地址参见: http://cvs.savannah.gnu.org/viewvc/global/global/htags/而gtags本身已经废弃了，所以需要创建gtags目录mkdir -p /usr/share/gtags/wget http://cvs.savannah.gnu.org/viewvc/*checkout*/global/global/htags/global.cgi.tmpl.inwget http://cvs.savannah.gnu.org/viewvc/*checkout*/global/global/htags/bless.sh.tmplwget http://cvs.savannah.gnu.org/viewvc/*checkout*/global/global/htags/style.css懒得下载的话，自行编译也可以 -_-#!==========分割线==========htags页面搜索提示500 International Error在Apache2的ErrorLog提示Premature End of Script Headers， 解决办法是:将HTML/cgi-bin/global.cgi第一行的 #! @PERL@ 改成 #!/usr/bin/perl如果搜索时提示Error: Tag file (GTAGS) not found. 需要检查GPATH, GRTAGS, GSYMS, GTAGS四个文件是否在HTML的同级目录==========分割线==========遗憾的是: htags在php方面只支持php4, 未表明支持php5, 似乎是对php的oo没有支持==========分割线==========...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="LAMP" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="global" label="global" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gnu" label="gnu" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gtags" label="gtags" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="htags" label="htags" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vim" label="vim" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>os: ubuntu 9.04<br />htags: 5.6.1 (apt-get install global)</p><p><b>运行</b><a href="http://www.gnu.org/software/global/global.html"><b>global-htags</b></a><b>(</b><a href="http://www.gnu.org/software/global/manual/global.html"><b>manual</b></a><b>)生成html文件时，提示缺少文件</b></p><p>htags:&nbsp;skeleton&nbsp;file&nbsp;'/usr/share/gtags/global.cgi.tmpl'&nbsp;not&nbsp;found.</p><p>除了global.cgi.tmpl之外，还缺少bless.sh.tmpl和style.css, 这三个文件没有打包。<br />详细地址参见: <a href="http://cvs.savannah.gnu.org/viewvc/global/global/htags/">http://cvs.savannah.gnu.org/viewvc/global/global/htags/</a><br />而gtags本身已经废弃了，所以需要创建gtags目录<br />mkdir -p /usr/share/gtags/<br />wget http://cvs.savannah.gnu.org/viewvc/*checkout*/global/global/htags/global.cgi.tmpl.in<br />wget http://cvs.savannah.gnu.org/viewvc/*checkout*/global/global/htags/bless.sh.tmpl<br />wget http://cvs.savannah.gnu.org/viewvc/*checkout*/global/global/htags/style.css<br /><br />懒得下载的话，自行编译也可以 -_-#!</p><p>==========分割线==========</p><p><b>htags页面搜索提示500 International Error</b></p><p>在Apache2的ErrorLog提示Premature End of Script Headers， 解决办法是:<br />将HTML/cgi-bin/global.cgi第一行的 #! @PERL@ 改成 #!/usr/bin/perl<br /><br />如果搜索时提示Error: Tag file (GTAGS) not found. 需要检查GPATH, GRTAGS, GSYMS, GTAGS四个文件是否在HTML的同级目录<br /><br />==========分割线==========<br /><br />遗憾的是: htags在php方面只支持php4, 未表明支持php5, 似乎是对php的oo没有支持<br /><br />==========分割线==========</p>]]>
        <![CDATA[<p>参考资料:<br /><a href="http://blog.yellowback.net/archives/34-20060526.html">global-5.0のインストール</a><br /><a href="http://d.hatena.ne.jp/sdkt4a/20071222/1200243222">Debian etchで/usr/bin/gctagsが見つからない</a><br /><a href="http://www.epandada.com/2009/04/premature-end-of-script-headers/">该死的Premature end of script headers</a></p>]]>
    </content>
</entry>

<entry>
    <title>如何删除CNNIC的ROOTCA</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/01/revoke-cnnic-root-ca.html" />
    <id>tag:blog.suchasplus.com,2010://2.233</id>

    <published>2010-01-27T14:15:39Z</published>
    <updated>2010-02-02T15:47:42Z</updated>

    <summary><![CDATA[CNNIC的罪行罄竹难书， 我就不扯淡了。1. 打开Firefox,&nbsp; 工具-&gt;选项-&gt;高级-&gt;加密-&gt;查看证书-&gt;(证书管理器)证书机构导出并删除Entrust.net Secure Server Certification Authority和CNNIC SSL2. 开始-&gt;运行&gt; certmgr.msc展开Trusted Root Certification Authorities -&gt; Certificates导出并删除(右键All Task)CNNIC ROOT3.展开Untrusted Certificates, 导入以上三个证书好了，打开https://www.enum.cn/，IE提示This organization's certificate has been revoked或者Firefox提示此连接是不受信任的即可。...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cnnic" label="cnnic" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="firefox" label="firefox" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="security" label="security" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>CNNIC的罪行罄竹难书， 我就不扯淡了。<br />1. 打开Firefox,&nbsp; 工具-&gt;选项-&gt;高级-&gt;加密-&gt;查看证书-&gt;(证书管理器)证书机构<br />导出并删除Entrust.net Secure Server Certification Authority和CNNIC SSL<br />2. 开始-&gt;运行&gt; certmgr.msc<br />展开Trusted Root Certification Authorities -&gt; Certificates<br />导出并删除(右键All Task)CNNIC ROOT<br />3.展开Untrusted Certificates, 导入以上三个证书</p><p>好了，打开https://www.enum.cn/，IE提示<u>This organization's certificate has been revoked</u>或者Firefox提示<u>此连接是不受信任的</u>即可。</p>]]>
        <![CDATA[<p>&nbsp;好吧... 杯具的<a href="https://reg.163.com/logins.jsp">163</a>, 不过会删除CNNIC CA的人基本都在Gmail吧, 另外据说ChinaMobile也杯具了</p>]]>
    </content>
</entry>

<entry>
    <title>so, who&apos;s next?</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/01/so-who-is-next.html" />
    <id>tag:blog.suchasplus.com,2010://2.232</id>

    <published>2010-01-21T17:44:43Z</published>
    <updated>2010-01-21T17:48:31Z</updated>

    <summary>赛维安讯/速能数码 http://www.soooner.com/about.html世纪鼎点 http://www.sjdd.com.cn/index.htm清流讯 http://www.streamocean.com/index_cn.html...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cdn" label="cdn" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flv" label="flv" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>赛维安讯/速能数码 <a href="http://www.soooner.com/about.html">http://www.soooner.com/about.html</a><br />世纪鼎点 <a href="http://www.sjdd.com.cn/index.htm">http://www.sjdd.com.cn/index.htm</a><br />清流讯 <a href="http://www.streamocean.com/index_cn.html">http://www.streamocean.com/index_cn.html</a></p>]]>
        
    </content>
</entry>

<entry>
    <title>由CNMD想到的</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/01/cnmd-or-ctmd.html" />
    <id>tag:blog.suchasplus.com,2010://2.231</id>

    <published>2010-01-12T18:48:39Z</published>
    <updated>2010-01-12T19:09:41Z</updated>

    <summary>惊闻圡共搞出了CNMD, 看英文网友评论, 发现一个熟悉的名字Brown.The Clinton administration (Ron Brown) approved the sale of a General Dynamics missle production facility in Ohio to the Chinese. They packaged it up lock, stock and barrel (and blueprints) and put it on a train to San...</summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="闲谈" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cnmd" label="cnmd" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nmd" label="nmd" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sina" label="sina" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="websphere" label="websphere" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="商务部长" label="商务部长" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="布朗" label="布朗" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p><a target="_blank" href="http://news.xinhuanet.com/world/2010-01/11/content_12792321.htm">惊闻</a>圡共搞出了CNMD, 看英文网友<a href="http://blog.china.com//u/060604/863/201001/5718465.html">评论</a>, 发现一个熟悉的名字Brown.<br /><br /><span style="color: rgb(153, 153, 153);">The Clinton administration (<span style="color: rgb(153, 51, 102);">Ron Brown</span>) approved the sale of a General Dynamics missle production facility in Ohio to the Chinese. They packaged it up lock, stock and barrel (and blueprints) and put it on a train to San Diego and on a ship to China. Ron Brown was called to testify before congress how and why it was approved (his son was a registered lobbyist for the Chinese). In a very convenient coincidence, the plane carrying Brown crashed on its way home for him to testify.This reportedly gave the Chinese a twenty-five year jump start on guidance systems.</span></p><p>刚开始学习英语, 布朗是个很熟悉的名字，当时迷恋航空知识，在新闻版面发现米国商务部长布朗乘坐的飞机失事的消息。一直以来都是非洲友邦和三哥天天掉高级官员的飞机(鳖国只有满载研究人员的平衡木)，从来没听说米国掉高级别的飞机, 人家连直升机都敢让总统坐...</p><p>搜索了一下, 看到了<a href="http://news.sina.com.cn/w/172524.html">NB</a>的文章, 敢情这是圡共无牌大卡车的又一翻版啊!</p><p>============</p><p>这都多少年前的文章了..sina还保存着了, 连N年前的<a href="http://websphere.sina.com.cn/">websphere专题</a>都保留着 ，这才是一个真正的技术公司。尽管现在后端还是一堆apache, 但是绝对不影响真正的技术能力，运维的本质在于稳定，而不是尝试一坨又一坨的新技术新名词，运维细节才是根本。</p>]]>
        
    </content>
</entry>

<entry>
    <title>DNS相关RFC传送门</title>
    <link rel="alternate" type="text/html" href="http://blog.suchasplus.com/2010/01/dns-related-rfc.html" />
    <id>tag:blog.suchasplus.com,2010://2.227</id>

    <published>2010-01-05T18:07:04Z</published>
    <updated>2010-01-05T18:10:44Z</updated>

    <summary><![CDATA[&nbsp;DNS实际上是个很复杂的玩意，基础协议么... 最终还是看rfc吧RFC 5730 (Extensible Provisioning Protocol)RFC 5731 (Domain Name Mapping)RFC 5732 (Host Mapping)RFC 5733 (Contact Mapping)RFC 5734 (Transport Over TCP)RFC 3735 (Guidelines for Extending EPP)RFC 3915 (Domain Registry Grace Period Mapping)RFC 4310 (Domain Name System (DNS) Security Extensions Mapping)&nbsp;...]]></summary>
    <author>
        <name>suchasplus</name>
        <uri>http://blog.suchasplus.com</uri>
    </author>
    
        <category term="互联网" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="dns" label="dns" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dnssec" label="dnssec" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rfc" label="rfc" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blog.suchasplus.com/">
        <![CDATA[<p>&nbsp;</p><p>DNS实际上是个很复杂的玩意，基础协议么... 最终还是看rfc吧</p><p><a href="http://www.ietf.org/rfc/rfc5730.txt">RFC 5730</a> (Extensible Provisioning Protocol)<br /><a href="http://www.ietf.org/rfc/rfc5731.txt">RFC 5731</a> (Domain Name Mapping)<br /><a href="http://www.ietf.org/rfc/rfc5732.txt">RFC 5732</a> (Host Mapping)<br /><a href="http://www.ietf.org/rfc/rfc5733.txt">RFC 5733</a> (Contact Mapping)<br /><a href="http://www.ietf.org/rfc/rfc5734.txt">RFC 5734</a> (Transport Over TCP)<br /><a href="http://www.ietf.org/rfc/rfc3735.txt">RFC 3735</a> (Guidelines for Extending EPP)<br /><a href="http://www.ietf.org/rfc/rfc3915.txt">RFC 3915</a> (Domain Registry Grace Period Mapping)<br /><a href="http://www.ietf.org/rfc/rfc4310.txt">RFC 4310</a> (Domain Name System (DNS) Security Extensions Mapping)<br />&nbsp;</p>]]>
        
    </content>
</entry>

</feed>

