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

<channel>
	<title>无叶的天空 &#187; IT</title>
	<atom:link href="http://nonleaf.net/tag/it/feed" rel="self" type="application/rss+xml" />
	<link>http://nonleaf.net</link>
	<description>[NonLeaf.Net] nothing but life</description>
	<lastBuildDate>Wed, 15 Feb 2012 15:23:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Empty Google Friend Connect Bar in WordPress</title>
		<link>http://nonleaf.net/710.html</link>
		<comments>http://nonleaf.net/710.html#comments</comments>
		<pubDate>Sat, 31 Oct 2009 00:29:50 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[所谓学术]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=710</guid>
		<description><![CDATA[[English] It confused me a lot. Now I found the reason, in short, there is some conflict between Google Friend Connect (GFC) and prototype.js (some plugins of WP used this JS lib). Workaround - add the code below just before &#8230; <a href="http://nonleaf.net/710.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>[English]<br />
It confused me a lot. Now I found the reason, in short, there is some conflict between Google Friend Connect (GFC) and prototype.js (some plugins of WP used this JS lib).<br />
Workaround - add the code below just before the generated gadget code.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script&gt;
window.JSON = {
 parse: function(st){
   return st.evalJSON();
 },
 stringify: function(obj){
   return Object.toJSON(obj);
 }
};
&lt;/script&gt;
</pre>
<p>For more detail, see <a href="http://www.google.com/support/forum/p/friendconnect/thread?tid=1d074167910de4d8&#038;hl=en">this</a>.</p>
<p>[Chinese]<br />
发现Google Friend Connect (GFC) 小工具在Wordpress显示空白的解决办法，希望对别人有用。<br />
GFC的JS代码和prototype.js相冲突（很多WP插件使用这个JS库），解决办法：在生成的gadget代码前加入以下代码即可。</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script&gt;
window.JSON = {
 parse: function(st){
   return st.evalJSON();
 },
 stringify: function(obj){
   return Object.toJSON(obj);
 }
};
&lt;/script&gt;
</pre>
<p>详情：看<a href="http://www.google.com/support/forum/p/friendconnect/thread?tid=1d074167910de4d8&#038;hl=en">这里</a>。
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/431.html" rel="bookmark" title="三月 9, 2008">[转载]遗失的美好</a></li>
<li><a href="http://nonleaf.net/380.html" rel="bookmark" title="十一月 7, 2007">上当了</a></li>
<li><a href="http://nonleaf.net/229.html" rel="bookmark" title="十月 22, 2006">最近很忙</a></li>
<li><a href="http://nonleaf.net/200.html" rel="bookmark" title="八月 27, 2006">购物一天</a></li>
<li><a href="http://nonleaf.net/245.html" rel="bookmark" title="十一月 12, 2006">再看《孽子》</a></li>
</ul>
<p><!-- Random Posts took 15.243 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/710.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>网站开始测试</title>
		<link>http://nonleaf.net/609.html</link>
		<comments>http://nonleaf.net/609.html#comments</comments>
		<pubDate>Sat, 14 Feb 2009 15:02:15 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[那些日子]]></category>
		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://nonleaf.net/wordpress/?p=609</guid>
		<description><![CDATA[互助网站（见这篇日志）在我的百忙中建起来了。 目前在UCHome/DZ的代码基础上，增加了学校、专业查询功能，开发了博客圈功能（还在建设中），并修正了N个bug。 本来打算用邀请码内测，后来觉得有点麻烦。反正这个blog的访问量不大，看到这篇博的，都去注册一个玩玩吧，多提意见。 使用邀请码，请留言或联系我获得邀请码。 另外征集网站的名字，包括中文名和域名，homotale这个似乎不大好。 http://homotale.net 网站审核中，耐心等吧... 国内的网络管制啊... 具体见这里。 随机文章: 昨天去听十佳了 gmail缩略图变色初步调查 感受身边的逝去 放假 Prague]]></description>
			<content:encoded><![CDATA[<p>互助网站（见<a href="413.html">这篇日志</a>）在我的百忙中建起来了。</p>
<p>目前在UCHome/DZ的代码基础上，增加了学校、专业查询功能，开发了博客圈功能（还在建设中），并修正了N个bug。</p>
<p><del datetime="2009-03-13T12:10:24+00:00"><del datetime="2009-02-21T14:52:10+00:00">本来打算用邀请码内测，后来觉得有点麻烦。反正这个blog的访问量不大，看到这篇博的，都去注册一个玩玩吧，多提意见。</del><br />
使用邀请码，请留言或联系我获得邀请码。<br />
另外征集网站的名字，包括中文名和域名，homotale这个似乎不大好。<br />
<a href="http://homotale.net" target="_blank">http://homotale.net</a></del><br />
<del datetime="2009-11-23T14:28:19+00:00">网站审核中，耐心等吧... 国内的网络管制啊...</del><br />
具体见<a href="http://nonleaf.net/geemoo">这里</a>。
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/878.html" rel="bookmark" title="五月 12, 2010">再见时光</a></li>
<li><a href="http://nonleaf.net/89.html" rel="bookmark" title="五月 19, 2006">期末加油</a></li>
<li><a href="http://nonleaf.net/460.html" rel="bookmark" title="七月 9, 2008">四年，其实是场梦</a></li>
<li><a href="http://nonleaf.net/171.html" rel="bookmark" title="八月 3, 2006">写了个比较满意的程序</a></li>
<li><a href="http://nonleaf.net/97.html" rel="bookmark" title="五月 24, 2006">看帖，胡感乱慨</a></li>
</ul>
<p><!-- Random Posts took 14.089 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/609.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>概率问题</title>
		<link>http://nonleaf.net/443.html</link>
		<comments>http://nonleaf.net/443.html#comments</comments>
		<pubDate>Fri, 11 Apr 2008 14:39:17 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[所谓学术]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[数学]]></category>
		<category><![CDATA[游戏]]></category>

		<guid isPermaLink="false">http://nonleaf.net/wordpress/443.html</guid>
		<description><![CDATA[看到一个有趣的概率题，分享一下。 有这样一个游戏，在三扇关闭的门中，奖品藏在其中的一个后面，其余的门后面都是假的奖品。参加游戏的观众从三扇门中选择一个，并站在这个门的前面。主持人(知道奖品藏在哪里)打开其他两扇门中的一个，向该观众显示一个假的奖品，并且问他足否想改变其最初的选择。问：为了使选中奖品的概率达到最大，这位观众应该坚持最初的选择，还是选择另外一扇门，还是这两者根本没有区别？ 不要google噢，大家回复发表观点哈。 随机文章: Smoke3D 1.0 released 回家 厦门 Gotland 神作《人教英语》]]></description>
			<content:encoded><![CDATA[<p>看到一个有趣的概率题，分享一下。</p>
<blockquote><p>有这样一个游戏，在三扇关闭的门中，奖品藏在其中的一个后面，其余的门后面都是假的奖品。参加游戏的观众从三扇门中选择一个，并站在这个门的前面。主持人(知道奖品藏在哪里)打开其他两扇门中的一个，向该观众显示一个假的奖品，并且问他足否想改变其最初的选择。问：为了使选中奖品的概率达到最大，这位观众应该坚持最初的选择，还是选择另外一扇门，还是这两者根本没有区别？</p></blockquote>
<p>不要google噢，大家回复发表观点哈。
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/110.html" rel="bookmark" title="六月 10, 2006">后天考数理统计</a></li>
<li><a href="http://nonleaf.net/277.html" rel="bookmark" title="一月 24, 2007">推荐一个blog--涅幼</a></li>
<li><a href="http://nonleaf.net/888.html" rel="bookmark" title="五月 21, 2010">有些爱情只是一瞬</a></li>
<li><a href="http://nonleaf.net/35.html" rel="bookmark" title="三月 28, 2006">谁说情似烟火 岁月像河流</a></li>
<li><a href="http://nonleaf.net/656.html" rel="bookmark" title="五月 2, 2009">贴首歌</a></li>
</ul>
<p><!-- Random Posts took 15.260 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/443.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>blog搬家</title>
		<link>http://nonleaf.net/420.html</link>
		<comments>http://nonleaf.net/420.html#comments</comments>
		<pubDate>Thu, 21 Feb 2008 09:35:21 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[blog公告]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[工作]]></category>

		<guid isPermaLink="false">http://nonleaf.net/wordpress/?p=420</guid>
		<description><![CDATA[蓄谋已久的blog搬家行动胜利完成！ 请大家使用新域名[http://nonleaf.net]，原来域名目前仍旧可以访问，会自动转向新域名。 本以为很轻松的搬家工作，还是遇到了不少困难，大概清楚了从域名解析到Apache mod_rewrite。 问题记录如下，以飨后人： 1.将备份的数据库用文本编辑器打开，将原来的URL批量替换为新的，然后导入新数据库。随后发现wordpress的侧边拦没法载入，报错总是在wp-includes/widgets.php里面的一些语句。Google未果，研究发现问题出在数据库上，有些表（如wp_options）的文本数据有类似这样的格式：s:6:"string"，6表明后面的string的长度，我没仔细看代码，估计这么做是为了快速定位，但是如果string里面含有URL，都被我批量替换掉了，替换前后长度必然不相等，所以造成wp读出奇怪的数据down掉。 解决办法： 自己写个程序改一下备份的数据库文件，将s后面的数字数出来替换。或者对原来数据库只改关键地方--wp_options表里option_name='siteurl'的那一行，其余的通过在旧服务器上写.htaccess重定向解决，前提是原来服务器apache有mod_rewrite。 编辑旧服务器的wordpress目录下的.htaccess文件—— Options +FollowSymLinks RewriteEngine on RewriteRule ^(.*)$ http://nonleaf.net/wordpress/$1 [L,R=301] 2.cPanel暂时不支持域名绑定在深层目录下，但是这个对于一个虚拟主机多个人共享是需要的。可以通过mod_rewrite达到目的（写.htaccess）。 解决办法： 例如要从test.nonleaf.net对应到到主机的根目录(/home/user/public_html/)下的一个深层目录/home/user/public_html/nonleaf/test/。 首先在域名商那里将test添加如A记录，IP指向主机（当然你也可以添加CNAME），同时将这个域名加入到cPanel的域名中，让主机能接受来自这个域名的请求。然后在public_html下面创建.htaccess文件—— Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/nonleaf/test/.*$ [NC] #防止反复rewrite造成死循环 RewriteCond %{HTTP_HOST} ^test.nonleaf.net$ [NC] #识别出test.nonleaf.net域名 RewriteRule ^(.*)$ nonleaf/test/$1 [L,NC] #rewrite到子目录 &#8230; <a href="http://nonleaf.net/420.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>蓄谋已久的blog搬家行动胜利完成！<br />
请大家使用新域名[<a href="http://nonleaf.net">http://nonleaf.net</a>]，原来域名目前仍旧可以访问，会自动转向新域名。</p>
<p>本以为很轻松的搬家工作，还是遇到了不少困难，大概清楚了从域名解析到Apache mod_rewrite。</p>
<p>问题记录如下，以飨后人：</p>
<p>1.将备份的数据库用文本编辑器打开，将原来的URL批量替换为新的，然后导入新数据库。随后发现wordpress的侧边拦没法载入，报错总是在wp-includes/widgets.php里面的一些语句。Google未果，研究发现问题出在数据库上，有些表（如wp_options）的文本数据有类似这样的格式：s:6:"string"，6表明后面的string的长度，我没仔细看代码，估计这么做是为了快速定位，但是如果string里面含有URL，都被我批量替换掉了，替换前后长度必然不相等，所以造成wp读出奇怪的数据down掉。</p>
<p>解决办法：<br />
自己写个程序改一下备份的数据库文件，将s后面的数字数出来替换。或者对原来数据库只改关键地方--wp_options表里option_name='siteurl'的那一行，其余的通过在旧服务器上写.htaccess重定向解决，前提是原来服务器apache有mod_rewrite。<br />
编辑旧服务器的wordpress目录下的.htaccess文件——<br />
<code>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteRule ^(.*)$ http://nonleaf.net/wordpress/$1 [L,R=301]</code></p>
<p>2.cPanel暂时不支持域名绑定在深层目录下，但是这个对于一个虚拟主机多个人共享是需要的。可以通过mod_rewrite达到目的（写.htaccess）。</p>
<p>解决办法：<br />
例如要从test.nonleaf.net对应到到主机的根目录(/home/user/public_html/)下的一个深层目录/home/user/public_html/nonleaf/test/。<br />
首先在域名商那里将test添加如A记录，IP指向主机（当然你也可以添加CNAME），同时将这个域名加入到cPanel的域名中，让主机能接受来自这个域名的请求。然后在public_html下面创建.htaccess文件——<br />
<code>Options +FollowSymLinks<br />
RewriteEngine on<br />
RewriteCond %{REQUEST_URI} !^/nonleaf/test/.*$ [NC] #防止反复rewrite造成死循环<br />
RewriteCond %{HTTP_HOST} ^test.nonleaf.net$ [NC] #识别出test.nonleaf.net域名<br />
RewriteRule ^(.*)$ nonleaf/test/$1 [L,NC] #rewrite到子目录</code></p>
<p>当然，如果在test目录下的.htaccess中还有rewrite，需要考虑加上RewriteBase。总之mod_rewrite的功能很好很强大，可是实现机制有些复杂，要多看manual才行。
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/392.html" rel="bookmark" title="十二月 29, 2007">游泳</a></li>
<li><a href="http://nonleaf.net/154.html" rel="bookmark" title="七月 22, 2006">突破封锁的Torpark</a></li>
<li><a href="http://nonleaf.net/977.html" rel="bookmark" title="三月 3, 2011">一去不返</a></li>
<li><a href="http://nonleaf.net/22.html" rel="bookmark" title="三月 19, 2006">一个DoubleNode的爱情</a></li>
<li><a href="http://nonleaf.net/289.html" rel="bookmark" title="二月 11, 2007">Pan's Labyrinth</a></li>
</ul>
<p><!-- Random Posts took 13.928 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/420.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>流水帐</title>
		<link>http://nonleaf.net/409.html</link>
		<comments>http://nonleaf.net/409.html#comments</comments>
		<pubDate>Sun, 03 Feb 2008 08:43:06 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[那些日子]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[朋友]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=409</guid>
		<description><![CDATA[总说一个人在学校无聊，回到家里却也不知道该干什么，毕设程序懒得写，英语单词懒得看。唯一有意义的就是老妈刚退休没几天，我算是在家陪她舒缓一下失落情绪。 新年了，给我的blog换了个theme，清新绿色，感谢underone发布的G7_v2，上个theme也是他的作品，用wordpress的不妨试试。另外，推荐大家试试google reader，以后看blog不用到处点了，哪个更新了都一目了然。 update 20080205: 点这里看google reader使用方法。 近期重大新闻有两个。 一是微软收购雅虎，高于市价62%的，雅虎的股东应该乐疯了吧，再不通过没道理啦。可见微软也疯了，被google折磨的。只是这收购的好坏也未知，就像HP收康柏后CEO下台，AMD吞了ATI后巨亏... 二是whest更新了blog。强烈谴责那些开通又N年不写blog的人，我都不知道要看什么啦！pat一下师傅，徒弟支持你哈。其实前一阵我也很depress。同学一个个走了，不大的宿舍却显得空空荡荡，孤独无孔不入，心都有些扭曲了。晚上无端的，好多往事一股脑涌上来，收都收不住，也说了一些傻话，听的不要太在意哈。特别要向snowyu道歉，我的态度很不好，是因为我怕那个小孩把我的好朋友抢走了... 随机文章: 小裤裤调查~ [转载]对央视经济半小时关于北大医院新闻的感想 blog隐私保护 虎年 考试结束]]></description>
			<content:encoded><![CDATA[<p>总说一个人在学校无聊，回到家里却也不知道该干什么，毕设程序懒得写，英语单词懒得看。唯一有意义的就是老妈刚退休没几天，我算是在家陪她舒缓一下失落情绪。</p>
<p>新年了，给我的blog换了个theme，清新绿色，感谢<a href="http://www.underone.com/" target="_blank">underone</a>发布的G7_v2，上个theme也是他的作品，用wordpress的不妨试试。另外，推荐大家试试<a href="http://www.google.com/reader/" target="_blank">google reader</a>，以后看blog不用到处点了，哪个更新了都一目了然。</p>
<p><strong>update 20080205</strong>: <a href="http://aboutrss.cn/2007/02/21/google-reader/" target="_blank">点这里</a>看google reader使用方法。</p>
<p>近期重大新闻有两个。<br />
一是微软收购雅虎，高于市价62%的，雅虎的股东应该乐疯了吧，再不通过没道理啦。可见微软也疯了，被google折磨的。只是这收购的好坏也未知，就像HP收康柏后CEO下台，AMD吞了ATI后巨亏...</p>
<p>二是<a href="http://whest.blog.sohu.com/" target="_blank">whest</a>更新了blog。强烈谴责那些开通又N年不写blog的人，我都不知道要看什么啦！pat一下师傅，徒弟支持你哈。其实前一阵我也很depress。同学一个个走了，不大的宿舍却显得空空荡荡，孤独无孔不入，心都有些扭曲了。晚上无端的，好多往事一股脑涌上来，收都收不住，也说了一些傻话，听的不要太在意哈。特别要向snowyu道歉，我的态度很不好，是因为我怕那个小孩把我的好朋友抢走了...</p>
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/63.html" rel="bookmark" title="四月 28, 2006">偶尔的休息</a></li>
<li><a href="http://nonleaf.net/282.html" rel="bookmark" title="二月 6, 2007">Apollo 13</a></li>
<li><a href="http://nonleaf.net/173.html" rel="bookmark" title="八月 4, 2006">吸取教训</a></li>
<li><a href="http://nonleaf.net/436.html" rel="bookmark" title="三月 15, 2008">[转载]理想主义者林毅夫的四次抉择</a></li>
<li><a href="http://nonleaf.net/153.html" rel="bookmark" title="七月 22, 2006">好久没更新了</a></li>
</ul>
<p><!-- Random Posts took 13.051 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/409.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>OS</title>
		<link>http://nonleaf.net/393.html</link>
		<comments>http://nonleaf.net/393.html#comments</comments>
		<pubDate>Mon, 31 Dec 2007 02:51:43 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[花花世界]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=393</guid>
		<description><![CDATA[What OS stands for? The question occurred to me when I viewed Coolnicsky's blog (Long time no update!). I knew OS meant "旁白、独白" in Chinese but I never thougut about where the abbreviation came from. As people saying "Acknowlege what &#8230; <a href="http://nonleaf.net/393.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>What OS stands for? The question occurred to me when I viewed Coolnicsky's blog (Long time no update!). I knew OS meant "旁白、独白" in Chinese but I never thougut about where the abbreviation came from. As people saying "Acknowlege what is known as known, and GOOGLE what is not!", I G it and the answer is "Off Screen", not what I guessed like Outside Sound or Oral XXX...</p>
<p>OS also means Operating System such as Windows, Linux, Mac OS...<br />
Others:<br />
P.S.=postscript<br />
O.S.T.=Original Soundtrack
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/348.html" rel="bookmark" title="七月 18, 2007">WaterSurface 2.0 released</a></li>
<li><a href="http://nonleaf.net/370.html" rel="bookmark" title="九月 26, 2007">[转载]P=?NP</a></li>
<li><a href="http://nonleaf.net/77.html" rel="bookmark" title="五月 12, 2006">天津之行</a></li>
<li><a href="http://nonleaf.net/182.html" rel="bookmark" title="八月 9, 2006">2008奥运会体育图标发布</a></li>
<li><a href="http://nonleaf.net/319.html" rel="bookmark" title="四月 25, 2007">WaterSurface v1.5 released</a></li>
</ul>
<p><!-- Random Posts took 12.889 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/393.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>gmail缩略图变色初步调查</title>
		<link>http://nonleaf.net/210.html</link>
		<comments>http://nonleaf.net/210.html#comments</comments>
		<pubDate>Mon, 04 Sep 2006 10:53:37 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[所谓学术]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[调查]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=210</guid>
		<description><![CDATA[在narkau的MSN里面提到，Gmail图片附件预览图会变色？奉命调查一下~ 原帖在http://www.gseeker.com/50226711/eeaeiegmailceaeeeaeeie_40941.php 实验情况是这样，必须下载那幅特定的jpg图像，添加到gmail的附件中，预览时图片的缩略图就是橙色，而原图是蓝色。 原图压缩包HFlogo.rar，请解压后实验。 调查过程如下： 开始我认为是jpeg图像的exif部分有个橙色的缩略图，gmail就直接用了这个缩略图（相关参阅《名不副实: 制作一张神奇的图片》）。于是我用Exifer提取了这幅图像的exif缩略图，发现就是蓝色的。而且exif的缩略图和gmail生成的缩略图分辨率不同，可以排除这个假设。 问题集中到这个文件上来，猛然发现这个小幅的logo虽然是jpg格式，竟然有600K之大！动手将其另存为bmp才500K...这个就十分诡异了，而且这幅图再另存jpg也不会有变色的情况（另存后就质量调到最高也不会超过200K）。我开始怀疑是有人故意制造了这幅图。 细致分析图像，原图的蓝色RGB编码#0041FF，缩略图橙色编码在#FE4100附近（缩略图由于压缩比的问题，颜色不是那么单一）。很容易发现R值(red)和B(blue)值似乎发生交换。是不是编码的问题呢？可是jpg不使用RGB编码，而是YUV12，但也不能排除的UV值对调的可能。索性查阅一下jpg的编码规则（JPEG 简易文档V2.14），然后对照那个600K的文件查看二进制编码，眼睛都花了，没什么特别发现！ 知识普及：颜色的RGB编码——众所周知光的颜色成分可以分为红、绿、蓝三个分量。RGB编码分别用2位16进制数表示颜色中红r绿g蓝b成分，共6位如#FF0000表示纯红，#00FF00表示纯绿，#0000FF表示纯蓝，#000000表示黑色，#FFFFFF表示白色。 至此调查没什么头绪了，gmail的图片引擎当然不会让我查看源代码，只好搞一段落。sigh...关键是在搞清600K的文件到底存了些什么，可惜没什么好的工具，jpg的编码又过于复杂555555555 ps.查阅JPEG文档时，我发现的DCT==The Discrete Cosine Transform==离散余弦变换。@@~ 随机文章: 调查浏览器 今天 去陪姥姥 无题 Coolnicsky&#038;无叶--朋友]]></description>
			<content:encoded><![CDATA[<p>在<a href="http://narkau.spaces.live.com/blog/cns!BA81F98E1CAD915C!1804.entry" target="_blank">narkau的MSN里面提到</a>，Gmail图片附件预览图会变色？奉命调查一下~</p>
<p>原帖在<a href="http://www.gseeker.com/50226711/eeaeiegmailceaeeeaeeie_40941.php" target="_blank">http://www.gseeker.com/50226711/eeaeiegmailceaeeeaeeie_40941.php</a></p>
<p>实验情况是这样，必须下载那幅特定的jpg图像，添加到gmail的附件中，预览时图片的缩略图就是橙色，而原图是蓝色。<br />
原图压缩包<a href="http://nonleaf.net/wp-content/uploads/HFlogo.rar">HFlogo.rar</a>，请解压后实验。</p>
<p>调查过程如下：</p>
<ol>
开始我认为是jpeg图像的exif部分有个橙色的缩略图，gmail就直接用了这个缩略图（相关参阅<a href="http://www.pconline.com.cn/pcedu/soft/gj/photo/0603/764865.html" target="_blank">《名不副实: 制作一张神奇的图片》</a>）。于是我用Exifer提取了这幅图像的exif缩略图，发现就是蓝色的。而且exif的缩略图和gmail生成的缩略图分辨率不同，可以排除这个假设。
</ol>
<ol>
问题集中到这个文件上来，猛然发现这个小幅的logo虽然是jpg格式，竟然有600K之大！动手将其另存为bmp才500K...这个就十分诡异了，而且这幅图再另存jpg也不会有变色的情况（另存后就质量调到最高也不会超过200K）。我开始怀疑是有人故意制造了这幅图。
</ol>
<ol>
细致分析图像，原图的蓝色RGB编码#0041FF，缩略图橙色编码在#FE4100附近（缩略图由于压缩比的问题，颜色不是那么单一）。很容易发现R值(red)和B(blue)值似乎发生交换。是不是编码的问题呢？可是jpg不使用RGB编码，而是YUV12，但也不能排除的UV值对调的可能。索性查阅一下jpg的编码规则（<a href="http://www.blueidea.com/tech/program/2006/3795.asp" target="_blank">JPEG 简易文档V2.14</a>），然后对照那个600K的文件查看二进制编码，眼睛都花了，没什么特别发现！</p>
<p><strong>知识普及：颜色的RGB编码——众所周知光的颜色成分可以分为红、绿、蓝三个分量。RGB编码分别用2位16进制数表示颜色中红r绿g蓝b成分，共6位如#FF0000表示纯红，#00FF00表示纯绿，#0000FF表示纯蓝，#000000表示黑色，#FFFFFF表示白色。</strong></ol>
<p>至此调查没什么头绪了，gmail的图片引擎当然不会让我查看源代码，只好搞一段落。sigh...关键是在搞清600K的文件到底存了些什么，可惜没什么好的工具，jpg的编码又过于复杂555555555</p>
<p>ps.查阅JPEG文档时，我发现的DCT==The Discrete Cosine Transform==离散余弦变换。@@~
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/403.html" rel="bookmark" title="一月 14, 2008">考试结束</a></li>
<li><a href="http://nonleaf.net/120.html" rel="bookmark" title="六月 16, 2006">也说改变</a></li>
<li><a href="http://nonleaf.net/462.html" rel="bookmark" title="十一月 21, 2009">苍梧谣</a></li>
<li><a href="http://nonleaf.net/279.html" rel="bookmark" title="一月 29, 2007">概率问题</a></li>
<li><a href="http://nonleaf.net/102.html" rel="bookmark" title="五月 27, 2006">[转载]旋转木马上的幸福</a></li>
</ul>
<p><!-- Random Posts took 13.404 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/210.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Hitchhiker&#039;s Guide to the Galaxy</title>
		<link>http://nonleaf.net/186.html</link>
		<comments>http://nonleaf.net/186.html#comments</comments>
		<pubDate>Sat, 12 Aug 2006 13:35:26 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[光影情结]]></category>
		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=186</guid>
		<description><![CDATA[What is the answer to life, the universe, and everything? 不是开玩笑，你可以现在去google搜索一下，答案立刻出来~ 银河系的人们很早就在思考这个问题，他们去询问宇宙最强的电脑Deep Thought。Deep Thought说这个问题需要思考7500万年。 7500万年后早已沧海桑田，千百万人欢呼着来到Deep Thought的广场，闪光灯闪烁一片，人们激动地等待谜底解开的一刻。 Deep Thought不慌不忙的说道： The answer to the ultimate question of life, the universe, and everything is --- ????... 众人哗然，我差点没晕过去。 昨天看了电影《The Hitchhiker's Guide to the Galaxy》，幽默不仅如上，十分推荐噢。 &#8230; <a href="http://nonleaf.net/186.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://nonleaf.net/wp-content/uploads/the_hitchhikers_guide_to_the_galaxy_1.jpg" align="left" border="1" width="250" hspace="5" />What is the answer to life, the universe, and everything?</p>
<p>不是开玩笑，你可以现在去<a href="http://www.google.com/search?hl=zh-CN&#038;q=What+is+the+answer+to+life%2C+the+universe%2C+and+everything&#038;btnG=Google+%E6%90%9C%E7%B4%A2&#038;lr=" target="_blank">google搜索一下</a>，答案立刻出来~</p>
<p>银河系的人们很早就在思考这个问题，他们去询问宇宙最强的电脑Deep Thought。Deep Thought说这个问题需要思考7500万年。<br />
7500万年后早已沧海桑田，千百万人欢呼着来到Deep Thought的广场，闪光灯闪烁一片，人们激动地等待谜底解开的一刻。<br />
Deep Thought不慌不忙的说道：<br />
The answer to the ultimate question of life, the universe, and everything is --- <a href="http://www.google.com/search?hl=zh-CN&#038;q=What+is+the+answer+to+life%2C+the+universe%2C+and+everything&#038;btnG=Google+%E6%90%9C%E7%B4%A2&#038;lr=" target="_blank">????</a>...</p>
<p>众人哗然，我差点没晕过去。</p>
<p>昨天看了电影《The Hitchhiker's Guide to the Galaxy》，幽默不仅如上，十分推荐噢。</p>
<p>电影根据70年代BBC的一个著名同名广播剧改编。毫不夸张地说，这是一部想象、幽默都可以让你faint掉的电影，同时又能回味其中的讽刺。</p>
<p>Vogon人的官僚作风、附庸风雅，《Guide to the Galaxy》的科幻哲学解说，关于earth 2#的非凡创意，让人印象深刻却又不是一笑了之。</p>
<p>回到开头那个话题，你知道为什么终极问题的答案竟然是42么？<br />
在你都不知道问题本身是什么的时候，你怎么会理解答案呢？人类啊，你的能窥视宇宙的全貌么？你真的能明白自身的意义么？</p>
<p>最后贴出开始问题的一个小解答，来自广播剧作者Douglas Adams。</p>
<p>Douglas Adams was asked many times during his career why he chose the number forty-two. Many theories were proposed, but he rejected them all. On November 2, 1993, he gave an answer on alt.fan.douglas-adams: The answer to this is very simple. It was a joke. It had to be a number, an ordinary, smallish number, and I chose that one. Binary representations, base thirteen, Tibetan monks are all complete nonsense. I sat at my desk, stared into the garden and thought '42 will do' I typed it out. End of story. </p>
<p align="center"><a href="http://nonleaf.net/wp-content/uploads/the_hitchhikers_guide_to_the_galaxy_2.jpg" rel="lightbox" title="The_Hitchhikers_Guide_to_the_Galaxy"><img src="http://nonleaf.net/wp-content/uploads/the_hitchhikers_guide_to_the_galaxy_2.jpg" width="420" alt="The_Hitchhikers_Guide_to_the_Galaxy" /></a></p>
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/789.html" rel="bookmark" title="十一月 26, 2009">[转载]北大医院、穆旦、张伯驹、梁启超</a></li>
<li><a href="http://nonleaf.net/218.html" rel="bookmark" title="九月 27, 2006">南柯一梦</a></li>
<li><a href="http://nonleaf.net/309.html" rel="bookmark" title="三月 14, 2007">Would you die, for the one you love</a></li>
<li><a href="http://nonleaf.net/35.html" rel="bookmark" title="三月 28, 2006">谁说情似烟火 岁月像河流</a></li>
<li><a href="http://nonleaf.net/180.html" rel="bookmark" title="八月 8, 2006">回家了</a></li>
</ul>
<p><!-- Random Posts took 11.790 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/186.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>我恨微软！</title>
		<link>http://nonleaf.net/166.html</link>
		<comments>http://nonleaf.net/166.html#comments</comments>
		<pubDate>Mon, 31 Jul 2006 16:43:11 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[所谓学术]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[图形学]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=166</guid>
		<description><![CDATA[今天花了一下午用VC+openGL写图形学那个扫描线算法，本来想着用STL现成的list的就行了，没想到list.sort()那个函数竟然不能接我写的函数对象，总是说不能把这个对象转换为greater。我调啊调，还是那句话，就晕了，这和greater有什么关系？难道我用错了？去翻Bjarne Stroustrup的蓝宝书TCPL，上面写的自认为和我的做法没区别。 无奈，google一下，N多人在问：how do I use STL's list's sort method (the one that takes a parameter)... 就是没人答得沾边，好不容易看一个人回复了一段可是work around的程序，读了半天发现是他把list倒腾到vector里面排序再倒腾回去。我当时就想抽他~ 最终我看到了最让人郁闷的网页，来自可爱的Microsoft... BUG: The STL list::sort() Function Doesn't Sort a List of Pointers 原来VC6的STL代码里面 template ; void sort(Pred pr); 错写成了 void sort(greater pr); &#8230; <a href="http://nonleaf.net/166.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img id="image167" height=96 alt=Bill_Gates.jpg src="http://nonleaf.net/wp-content/uploads/Bill_Gates.jpg" align="left" border="1" />今天花了一下午用VC+openGL写图形学那个扫描线算法，本来想着用STL现成的list的就行了，没想到list.sort()那个函数竟然不能接我写的函数对象，总是说不能把这个对象转换为greater<T>。我调啊调，还是那句话，就晕了，这和greater<T>有什么关系？难道我用错了？去翻Bjarne Stroustrup的蓝宝书TCPL，上面写的自认为和我的做法没区别。</p>
<p>无奈，google一下，N多人在问：how do I use STL's list's sort method (the one that takes a parameter)... 就是没人答得沾边，好不容易看一个人回复了一段可是work around的程序，读了半天发现是他把list倒腾到vector里面排序再倒腾回去。我当时就想抽他~</p>
<p>最终我看到了最让人郁闷的网页，来自可爱的Microsoft...<br />
<a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;265109" target="_blank">BUG: The STL list::sort() Function Doesn't Sort a List of Pointers</a></p>
<p>原来VC6的STL代码里面<br />
<code>template <class Pred>;<br />
   void sort(Pred pr);</code><br />
错写成了<br />
<code>void sort(greater<T> pr);</code><br />
导致无论什么参数传进去，编译器都愣要转成greater<T>。<br />
RESOLUTION里面说的解决办法和没说一样，重载greater<T>...所以我一气之下，干脆把greater直接当小于号用了，微软都这么干，我怕什么啊！</p>
<p>MS写代码的人啊，你rp哪里去了！记得上次就是因为STL库里面的另外一个BUG，让友元都不能访问私有成员，也让我调半天。没想到VC6打了sp6也不管用，还有这么严重的BUG。一看时间——Last Review : July 5, 2005，VC6推出都多少年了？</p>
<p>一个下午就这么过了，我恨微软！！！
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/444.html" rel="bookmark" title="四月 19, 2008">Alone</a></li>
<li><a href="http://nonleaf.net/125.html" rel="bookmark" title="六月 21, 2006">满眼离开</a></li>
<li><a href="http://nonleaf.net/302.html" rel="bookmark" title="二月 23, 2007">The Godfather</a></li>
<li><a href="http://nonleaf.net/196.html" rel="bookmark" title="八月 20, 2006">我又回家了...</a></li>
<li><a href="http://nonleaf.net/609.html" rel="bookmark" title="二月 14, 2009">网站开始测试</a></li>
</ul>
<p><!-- Random Posts took 13.769 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/166.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>无叶的三叶草</title>
		<link>http://nonleaf.net/37.html</link>
		<comments>http://nonleaf.net/37.html#comments</comments>
		<pubDate>Tue, 28 Mar 2006 17:30:26 +0000</pubDate>
		<dc:creator>无叶</dc:creator>
				<category><![CDATA[那些日子]]></category>
		<category><![CDATA[gay]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[爱情]]></category>

		<guid isPermaLink="false">http://nonleaf.net/?p=37</guid>
		<description><![CDATA[偷偷google了一下，说三片叶的三叶草代表爱情，如果能找到四片的，就拥有幸福。 看来叶子越多越好啊...有没有100片的？忽然发现这个名字起得不好了，无叶岂不是一片也找不到？有些郁闷了...不过，只要我们努力，幸福不就在身边么？无花可以结果，无叶为什么就不能拥有幸福？ 呵呵，强词夺理了。人总要有个寄托，或宗教、或偶像、又或者一个小物件，比如三叶草。其实，童话就写在每个人的心里，三叶草的种子也埋在每个人手心，用心浇灌便发芽长大（也许长出五片叶子也未可知噢）。是的，距离并不重要。重要的是我们有共同浇灌的心，就已足够。 随机文章: 奥运会 也说改变 生活在那端 想你, 0.01分 看了asaa的blog]]></description>
			<content:encoded><![CDATA[<p><a href="http://nonleaf.net/wp-content/uploads/clover.jpg" target="_blank" rel="lightbox[37]"><img id="image38" height="96" alt="clover.jpg" hspace="5" src="http://nonleaf.net/wp-content/uploads/clover.thumbnail.jpg" align="left" border="1" /></a>偷偷google了一下，说三片叶的三叶草代表爱情，如果能找到四片的，就拥有幸福。</p>
<p>看来叶子越多越好啊...有没有100片的？忽然发现这个名字起得不好了，无叶岂不是一片也找不到？有些郁闷了...不过，只要我们努力，幸福不就在身边么？无花可以结果，无叶为什么就不能拥有幸福？</p>
<p>呵呵，强词夺理了。人总要有个寄托，或宗教、或偶像、又或者一个小物件，比如三叶草。其实，童话就写在每个人的心里，三叶草的种子也埋在每个人手心，用心浇灌便发芽长大（也许长出五片叶子也未可知噢）。是的，距离并不重要。重要的是我们有共同浇灌的心，就已足够。</p>
<p><strong>随机文章:</strong>
<ul class="random-posts">
<li><a href="http://nonleaf.net/392.html" rel="bookmark" title="十二月 29, 2007">游泳</a></li>
<li><a href="http://nonleaf.net/32.html" rel="bookmark" title="三月 24, 2006">for the one you love</a></li>
<li><a href="http://nonleaf.net/391.html" rel="bookmark" title="十二月 28, 2007">Linus vs C++</a></li>
<li><a href="http://nonleaf.net/319.html" rel="bookmark" title="四月 25, 2007">WaterSurface v1.5 released</a></li>
<li><a href="http://nonleaf.net/993.html" rel="bookmark" title="二月 15, 2012">情人节记</a></li>
</ul>
<p><!-- Random Posts took 11.352 ms --></p>
]]></content:encoded>
			<wfw:commentRss>http://nonleaf.net/37.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

