<?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/"
	>

<channel>
	<title>Charlie's path to dEAth</title>
	<atom:link href="http://blog.charliezhu.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.charliezhu.com</link>
	<description>an engineer's log</description>
	<pubDate>Tue, 29 Jun 2010 13:56:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>跳跃，两岁半</title>
		<link>http://blog.charliezhu.com/2010/06/29/jump/</link>
		<comments>http://blog.charliezhu.com/2010/06/29/jump/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 13:55:33 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[son]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=469</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><embed width="480" height="400" align="middle" src="http://player.youku.com/player.php/sid/XMTg1NjQxMTY0/v.swf" quality="high" allowscriptaccess="sameDomain" type="application/x-shockwave-flash"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2010/06/29/jump/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fingerprint similarity and substructure filtering using Lucene</title>
		<link>http://blog.charliezhu.com/2010/04/17/fingerprint-similarity-and-substructure-filtering-using-lucene/</link>
		<comments>http://blog.charliezhu.com/2010/04/17/fingerprint-similarity-and-substructure-filtering-using-lucene/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 15:36:38 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Lucene]]></category>

		<category><![CDATA[chemoinformatics]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=460</guid>
		<description><![CDATA[Lucene is a great tool for retrieving fragmented information even including the fragmenting process (the Analyzer). So there was an intuitional way to retrieving molecules from a cheminformation database with the Lucene engine. ChemSink&#8217;s about (http://www.chemsink.com/about/) also mentions that &#34;The chemical search uses Open Babel, Lucene, and MySQL &#34;. Recently I have worked it out [...]]]></description>
			<content:encoded><![CDATA[<p>Lucene is a great tool for retrieving fragmented information even including the fragmenting process (the Analyzer). So there was an intuitional way to retrieving molecules from a cheminformation database with the Lucene engine. ChemSink&#8217;s about (http://www.chemsink.com/about/) also mentions that &quot;<em>The chemical search uses Open Babel, </em><a href="http://lucene.apache.org/java/docs/"><em>Lucene</em></a><em>, and MySQL</em> &quot;. Recently I have worked it out and have deployed on production services.</p>
<h2>How it works</h2>
<p>The concepts is connected as blow and the implementation is not hard. I work on my cheminformation platforms based on .NET and use Lucene.NET.</p>
<ol>
<li>A Molecule is a File in Lucene.</li>
<li>Fingerprint is a Field. That means other information or even another suite of fingerprint can be stored for being queried.</li>
<li>A Bit in the fingerprint is a Term.</li>
<li>Substructure search queries Lucene for all the set bit in fingerprint of the query molecule are required in the result molecules.</li>
<li>Similarity search finds the most relevant molecules.</li>
</ol>
<h2>Similarity and Lucene</h2>
<p>The most popular similarity algorithm being used is the Tanimato as written as</p>
<p><img src="http://blog.charliezhu.com/wp-content/uploads/tanimato.PNG" alt="" /></p>
<p>As my understanding, this coefficient is so widely used most because it&#8217;s simple and running fast for some time-critical cases such as online searching.</p>
<p>Lucene employs Cosin-Similarity with  Vector Space Model (VSM) of Information Retrieval.</p>
<p><a href="http://lucene.apache.org/java/3_0_0/api/all/org/apache/lucene/search/Similarity.html">http://lucene.apache.org/java/3_0_0/api/all/org/apache/lucene/search/Similarity.html</a></p>
<p><img width="401" height="108" src="http://blog.charliezhu.com/wp-content/uploads/vsm-scoring.PNG" alt="" /></p>
<p><img width="959" height="109" src="http://blog.charliezhu.com/wp-content/uploads/lucene-score-formular.PNG" alt="" /></p>
<p>and norm(t,d) part includes three parts to be multiplied, the lengthNorm part stands for what is effected by the length of the document (total fingerprint bits count of a molecule).</p>
<p>The default Similarity implementation inside Lucene is ready to be used for similar molecules retrieving.</p>
<h2>More about the lengthNorm</h2>
<p>In my researching phase I have found that the scores of several different target molecules are the same in value. It&#8217;s found that the lengthNorms are all the same for this several molecule while they have various number of fingerprint bits been set. The lengthNorm is not calculated while the searching phase but pre-calculated and stored at the indexing phase. Finally I have found this sentence inside the Lucene documents.</p>
<p>&quot;<em>However the resulted <i>norm</i> value is </em><a href="http://lucene.apache.org/java/3_0_0/api/all/org/apache/lucene/search/Similarity.html#encodeNorm%28float%29"><em><code>encoded</code></em></a><em>  as a single byte       before being stored&#8230; comes with the price of       precision loss</em>&quot;</p>
<p>So my molecules are treated as the same length documents when being queried.</p>
<table cellspacing="1" cellpadding="1" border="1" style="width: 444px; height: 83px;">
<tbody>
<tr>
<td>Molecule ID</td>
<td># of bits set</td>
<td>
<p>lengthNorm calculated<br />
            in indexing phase</p>
</td>
<td>lengthNorm stored<br />
            and been</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>11096</td>
<td>23</td>
<td>0.2085</td>
<td>0.1875</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>11578</td>
<td>27</td>
<td>0.19245</td>
<td>0.1875</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>201736</td>
<td>28</td>
<td>0.18838</td>
<td>0.1875</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>The formula to calculate lengthNorm is<em> 1.0 / Math.Sqrt(bits_set)</em></p>
<p>Fortunately, the DefaultSimilarity class could be overrided including the lengthNorm function. According to <a href="http://chemhack.com/2008/11/more-faster-fingerprint-search-with-java-cdk/">Duan Lian&#8217;s diagram</a> of distribution of number of fingerprint bit set, there exists a function to mapping this distribution to a more flat one and been using to calculate lengthNorm and  take full advantage of the precision-limited value.</p>
<p><em>&nbsp;Here is the distribution of fingerprint darkness of my database of  80000 commercial&nbsp;compounds.&nbsp;</em></p>
<p><a href="http://chemhack.com/wp-content/uploads/2008/11/e59bbee78987-3.png"><img width="500" height="507" class="alignnone size-full wp-image-141" title="Darkness" src="http://chemhack.com/wp-content/uploads/2008/11/e59bbee78987-3.png" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2010/04/17/fingerprint-similarity-and-substructure-filtering-using-lucene/feed/</wfw:commentRss>
		</item>
		<item>
		<title>儿子两岁两个月学会了翻跟头</title>
		<link>http://blog.charliezhu.com/2010/02/26/%e5%84%bf%e5%ad%90%e4%b8%a4%e5%b2%81%e4%b8%a4%e4%b8%aa%e6%9c%88%e5%ad%a6%e4%bc%9a%e4%ba%86%e7%bf%bb%e8%b7%9f%e5%a4%b4/</link>
		<comments>http://blog.charliezhu.com/2010/02/26/%e5%84%bf%e5%ad%90%e4%b8%a4%e5%b2%81%e4%b8%a4%e4%b8%aa%e6%9c%88%e5%ad%a6%e4%bc%9a%e4%ba%86%e7%bf%bb%e8%b7%9f%e5%a4%b4/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 00:37:05 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[son]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=457</guid>
		<description><![CDATA[大概半年前，为了逗他玩儿，我示范了一下翻跟头。没想到这小子念念不忘，想起来就练习一下，昨天晚上终于熟练地进行汇报演出了。壮壮最喜欢动物和动物园，现在看潜质，以后说不定可以去马戏团工作。

]]></description>
			<content:encoded><![CDATA[<p>大概半年前，为了逗他玩儿，我示范了一下翻跟头。没想到这小子念念不忘，想起来就练习一下，昨天晚上终于熟练地进行汇报演出了。壮壮最喜欢动物和动物园，现在看潜质，以后说不定可以去马戏团工作。</p>
<p><embed width="480" height="400" align="middle" type="application/x-shockwave-flash" allowscriptaccess="sameDomain" quality="high" src="http://player.youku.com/player.php/sid/XMTU0NDAyNjk2/v.swf"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2010/02/26/%e5%84%bf%e5%ad%90%e4%b8%a4%e5%b2%81%e4%b8%a4%e4%b8%aa%e6%9c%88%e5%ad%a6%e4%bc%9a%e4%ba%86%e7%bf%bb%e8%b7%9f%e5%a4%b4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>上班啦</title>
		<link>http://blog.charliezhu.com/2010/02/22/%e4%b8%8a%e7%8f%ad%e5%95%a6/</link>
		<comments>http://blog.charliezhu.com/2010/02/22/%e4%b8%8a%e7%8f%ad%e5%95%a6/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 14:18:04 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/2010/02/22/%e4%b8%8a%e7%8f%ad%e5%95%a6/</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.charliezhu.com/wp-content/uploads/2010/02/e4b88ae78fade595a6.png" alt="上班啦 google analytics" title="上班啦 google analytics" width="616" height="120" class="alignnone size-full wp-image-455" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2010/02/22/%e4%b8%8a%e7%8f%ad%e5%95%a6/feed/</wfw:commentRss>
		</item>
		<item>
		<title>悲剧</title>
		<link>http://blog.charliezhu.com/2009/11/27/%e6%82%b2%e5%89%a7/</link>
		<comments>http://blog.charliezhu.com/2009/11/27/%e6%82%b2%e5%89%a7/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 15:17:01 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[不以物喜]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=449</guid>
		<description><![CDATA[ 开车两年多，所有倒霉事都在这一周一起发生了，人品危机集中爆发。
礼拜一
一大早，上车之后准备从车位倒车，咦？好大的霜啊，白花花一片啥也看不见涅。老婆说，霜你个头，后风挡玻璃碎了！
然后和保安交涉，保安大哥没有半点承担责任的意思，还叫来同伴一起看，哇塞，玻璃碎成这样了，这得 duangduangduang敲半天啊，咱们咋都没听见呢？我说，我靠，这是钢化玻璃。一想反正有保险，还着急上班，就跟保安讲了讲职业精神和当责的态 度，鼓励他们在平凡的岗位上要做出不平凡的事业。差不多b装足了，开车上班。
保险公司服务态度忒好，看到早上我打过去的未接来电，主动找上来服务，说，我们派人上门给你装玻璃。窃喜。
保险公司的各个岗位、玻璃公司的总公司、分公司、业务员分别给我打电话，把基本情况轮番问过一遍，差点把 我逼疯才说好磨蹭到周二才到办公司上了门换。
礼拜二
因为满办公室找不到当天的报纸，玻璃大哥对我们公司的高科技性质和我的高级白领身份表 示了充分的怀疑。玻璃装得很快，期间要求我跟碎玻璃合影时pose摆得也不赖。不过天黑我快要回家的时候，玻璃大哥又回来了，说，保险公司说，你的车没年检。
哦？买车的时候已经检过了啊&#8230;
玻璃大哥有点激了。但是一想到没有必要跟一个假白领说这些，就怜悯地嘱咐我48小时内赶快检车，还有戏。
礼拜三
早上网上查好，马池口检车容易点，也比不像海淀那样车多。同时4S店推荐，去找个检车俱乐部，多花点钱省事。想趁中午吃饭， 赶快办完，到了一看，喔靠，满院子车排队都转了圈了。俱乐部大姐看我可怜，说，你先把尾气检了，明早八点之前就来，排头一号，检别的。
礼拜四
天没亮二奔北六环。亏着有俱乐部大姐，要不这乱码七糟的事情非把我这个外行整死不可。眼瞅就完事大吉，大姐说，我不是让你把保险单副本带来吗？你这个是正 本！我说，复印一个不就有副本了吗？从大姐眼神里我读懂一个字，滚，我照办了。
礼拜四中午
开车回家，死活找不到今年的副本，头两年的都找 到了。打电话问问头两年的好使不，俱乐部大姐直接给挂了。
一怒之下，打电话给保险公司，重办一个副本，哥有正本还愁副本吗？保险公司态度很好，你 来吧，我们在宣武。喔靠，保险公司在宣武？！好几年了我咋不知道涅？电话投保上门送单子，压根就没想过保险公司在哪这个问题。
不管是哪，今天必须 办完，哥就这么倔。
从回龙观一路干到南二环，走过头了，再回来，好歹是找到了。副本办的还挺顺利。重新上路，目标北六环。太tm远了，北京环路照这种半径的指数增长，九环就可以把高丽国都圈进来了。
八达岭高速上， 又产生一个傻b念头，从高速主路直接跑到北六环出来，岂不是省钱且快速？md北六环没有上辅路的出口，一路飘过，高速费翻了三倍，还要折返跑回，天都黑 了。
终于在检测场下班前15分钟赶到，俱乐部大姐还在等我。我也莫名迈出一种使命完成的豪迈脚步，掏出副本，加西亚，你的信！
俱乐部大姐 不愧是专业的，没两分钟回来了。还是不通过，你有违章。我一举手，大姐赶快捂脸。何必呢？至于吗？我举手理了理头发，脸上不变的洒脱的微笑，咬着牙根说， 再见。
玻璃大哥还在昏暗的路灯下，痴痴等我拿着新行驶证去照相。鼓起勇气打电话帮忙跟保险公司再通融一日。咋地吧，反正玻璃已经装上了，保险不赔 我也不给钱，我就不厚道了。玻璃大哥咬着牙说再给一天时间。
回到家，一年来第一次上交局网站，喔再靠，三次违章！两次都是因为没有年检被照相 了！！
礼拜五
虽然是第一次到交警队，但并不是那么紧张，我感觉自己这几天已脱胎换骨，不是那样青涩了。一边排队一边笑看交警队里的各色嬉 笑怒骂。我很从容。到我了。交警大叔的几句如冰魄入我骨缝。
叔：一次闯红灯，三次未车检被照相，800块钱12分。
我：不是两次没车检 吗？昨天刚查的。
叔：昨天下午在西直门桥还有一次。
我：（靠~昨天下午我这不是去搞副本办年检了吗？我还是成熟了，这句话没真说出口。）
我： 那这三次算一次吧，反正都是一个原因。
叔：按法规每个月都应该记一次，你这都半年了！
我：（灭火）
叔：12分，该进学习班了。
我： （彻底灭火）
叔：（毕竟老成，情绪已经缓和）你是进学习班啊还是今天别办了？
我：我不进学习班
叔：那别办了
我：那我得办
叔： 进学习班？
我：不进
叔：那别办了
我：那我得办。早晚不得办吗？
叔：那你就进学习班！！！（叔激了）
玻璃大哥还在 等我&#8230;
俱乐部大姐也在等我&#8230;
我儿子也在等我回家举高高，可是爸爸就要进学习班了&#8230;我的心都凉了&#8230;不对！顿然觉醒重返人 世，学习班不是拘留所！
后面一个小老弟赶快跟我说，他的意思是您赶快找一个人帮你消几分，你看我这不是找了好几个哥们儿一起来的么。
总算 人品没有沦丧，有兄弟打车来解围，看到他我感动得湿了。今天看来还能搞定，玻璃不用自费了。Mission possible!
警察大叔再帮我 办，给我看摄像头照片，喔靠（这是叔说的），这张，你被套牌了！还是个奥迪嘢！你赶快给朝阳的交警队打电话，三天就能消去这个违章啦！热情的大叔和仗义的 哥们都很兴奋，恨不得抱在一起庆祝一下。
我哭了。那个套牌车算我的还不行吗？要不然玻璃就要自费了。本来想从&#8220;礼拜一我家车玻璃碎了&#8221;开始说，但是叔和哥们还处在兴奋的余热中，我放弃了&#8230;
一路回来，哥们还在不停地叨叨叨地问我咋的了，亲身遭遇套牌让他很兴奋。半小时前我盼他从天而降， 半小时后我盼他瞬间消失。
自动开车以来，什么事情都没经历过，新手的不干胶都懒得揭下去，不晓得其他人开车那么多烦恼从何而来。这一次， 出险、理赔、年检、重办保险单、违章、接受处罚、被套牌，大全套的初体验了一圈。一个字，悲剧啊。

]]></description>
			<content:encoded><![CDATA[<p><img width="36" height="34" src="http://blog.charliezhu.com/wp-content/uploads/悲剧.PNG" alt="悲剧" /> 开车两年多，所有倒霉事都在这一周一起发生了，人品危机集中爆发。</p>
<p>礼拜一</p>
<p>一大早，上车之后准备从车位倒车，咦？好大的霜啊，白花花一片啥也看不见涅。老婆说，霜你个头，后风挡玻璃碎了！<br />
然后和保安交涉，保安大哥没有半点承担责任的意思，还叫来同伴一起看，哇塞，玻璃碎成这样了，这得 duangduangduang敲半天啊，咱们咋都没听见呢？我说，我靠，这是钢化玻璃。一想反正有保险，还着急上班，就跟保安讲了讲职业精神和当责的态 度，鼓励他们在平凡的岗位上要做出不平凡的事业。差不多b装足了，开车上班。<br />
保险公司服务态度忒好，看到早上我打过去的未接来电，主动找上来服务，说，我们派人上门给你装玻璃。窃喜。<br />
保险公司的各个岗位、玻璃公司的总公司、分公司、业务员分别给我打电话，把基本情况轮番问过一遍，差点把 我逼疯才说好磨蹭到周二才到办公司上了门换。</p>
<p>礼拜二</p>
<p>因为满办公室找不到当天的报纸，玻璃大哥对我们公司的高科技性质和我的高级白领身份表 示了充分的怀疑。玻璃装得很快，期间要求我跟碎玻璃合影时pose摆得也不赖。不过天黑我快要回家的时候，玻璃大哥又回来了，说，保险公司说，你的车没年检。<br />
哦？买车的时候已经检过了啊&#8230;<br />
玻璃大哥有点激了。但是一想到没有必要跟一个假白领说这些，就怜悯地嘱咐我48小时内赶快检车，还有戏。</p>
<p>礼拜三</p>
<p>早上网上查好，马池口检车容易点，也比不像海淀那样车多。同时4S店推荐，去找个检车俱乐部，多花点钱省事。想趁中午吃饭， 赶快办完，到了一看，喔靠，满院子车排队都转了圈了。俱乐部大姐看我可怜，说，你先把尾气检了，明早八点之前就来，排头一号，检别的。</p>
<p>礼拜四</p>
<p>天没亮二奔北六环。亏着有俱乐部大姐，要不这乱码七糟的事情非把我这个外行整死不可。眼瞅就完事大吉，大姐说，我不是让你把保险单副本带来吗？你这个是正 本！我说，复印一个不就有副本了吗？从大姐眼神里我读懂一个字，滚，我照办了。</p>
<p>礼拜四中午</p>
<p>开车回家，死活找不到今年的副本，头两年的都找 到了。打电话问问头两年的好使不，俱乐部大姐直接给挂了。<br />
一怒之下，打电话给保险公司，重办一个副本，哥有正本还愁副本吗？保险公司态度很好，你 来吧，我们在宣武。喔靠，保险公司在宣武？！好几年了我咋不知道涅？电话投保上门送单子，压根就没想过保险公司在哪这个问题。<br />
不管是哪，今天必须 办完，哥就这么倔。<br />
从回龙观一路干到南二环，走过头了，再回来，好歹是找到了。副本办的还挺顺利。重新上路，目标北六环。太tm远了，北京环路照这种半径的指数增长，九环就可以把高丽国都圈进来了。<br />
八达岭高速上， 又产生一个傻b念头，从高速主路直接跑到北六环出来，岂不是省钱且快速？md北六环没有上辅路的出口，一路飘过，高速费翻了三倍，还要折返跑回，天都黑 了。<br />
终于在检测场下班前15分钟赶到，俱乐部大姐还在等我。我也莫名迈出一种使命完成的豪迈脚步，掏出副本，加西亚，你的信！<br />
俱乐部大姐 不愧是专业的，没两分钟回来了。还是不通过，你有违章。我一举手，大姐赶快捂脸。何必呢？至于吗？我举手理了理头发，脸上不变的洒脱的微笑，咬着牙根说， 再见。<br />
玻璃大哥还在昏暗的路灯下，痴痴等我拿着新行驶证去照相。鼓起勇气打电话帮忙跟保险公司再通融一日。咋地吧，反正玻璃已经装上了，保险不赔 我也不给钱，我就不厚道了。玻璃大哥咬着牙说再给一天时间。<br />
回到家，一年来第一次上交局网站，喔再靠，三次违章！两次都是因为没有年检被照相 了！！</p>
<p>礼拜五</p>
<p>虽然是第一次到交警队，但并不是那么紧张，我感觉自己这几天已脱胎换骨，不是那样青涩了。一边排队一边笑看交警队里的各色嬉 笑怒骂。我很从容。到我了。交警大叔的几句如冰魄入我骨缝。<br />
叔：一次闯红灯，三次未车检被照相，800块钱12分。<br />
我：不是两次没车检 吗？昨天刚查的。<br />
叔：昨天下午在西直门桥还有一次。<br />
我：（靠~昨天下午我这不是去搞副本办年检了吗？我还是成熟了，这句话没真说出口。）<br />
我： 那这三次算一次吧，反正都是一个原因。<br />
叔：按法规每个月都应该记一次，你这都半年了！<br />
我：（灭火）<br />
叔：12分，该进学习班了。<br />
我： （彻底灭火）<br />
叔：（毕竟老成，情绪已经缓和）你是进学习班啊还是今天别办了？<br />
我：我不进学习班<br />
叔：那别办了<br />
我：那我得办<br />
叔： 进学习班？<br />
我：不进<br />
叔：那别办了<br />
我：那我得办。早晚不得办吗？<br />
叔：那你就进学习班！！！（叔激了）<br />
玻璃大哥还在 等我&#8230;<br />
俱乐部大姐也在等我&#8230;<br />
我儿子也在等我回家举高高，可是爸爸就要进学习班了&#8230;我的心都凉了&#8230;不对！顿然觉醒重返人 世，学习班不是拘留所！<br />
后面一个小老弟赶快跟我说，他的意思是您赶快找一个人帮你消几分，你看我这不是找了好几个哥们儿一起来的么。<br />
总算 人品没有沦丧，有兄弟打车来解围，看到他我感动得湿了。今天看来还能搞定，玻璃不用自费了。Mission possible!<br />
警察大叔再帮我 办，给我看摄像头照片，喔靠（这是叔说的），这张，你被套牌了！还是个奥迪嘢！你赶快给朝阳的交警队打电话，三天就能消去这个违章啦！热情的大叔和仗义的 哥们都很兴奋，恨不得抱在一起庆祝一下。<br />
我哭了。那个套牌车算我的还不行吗？要不然玻璃就要自费了。本来想从&ldquo;礼拜一我家车玻璃碎了&rdquo;开始说，但是叔和哥们还处在兴奋的余热中，我放弃了&#8230;<br />
一路回来，哥们还在不停地叨叨叨地问我咋的了，亲身遭遇套牌让他很兴奋。半小时前我盼他从天而降， 半小时后我盼他瞬间消失。</p>
<p>自动开车以来，什么事情都没经历过，新手的不干胶都懒得揭下去，不晓得其他人开车那么多烦恼从何而来。这一次， 出险、理赔、年检、重办保险单、违章、接受处罚、被套牌，大全套的初体验了一圈。一个字，悲剧啊。</p>
<p><img src="http://pic.yupoo.com/hecaitou/52363684f92c/kycsaak7.jpg" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2009/11/27/%e6%82%b2%e5%89%a7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>国货一定强——观WPS模板有感</title>
		<link>http://blog.charliezhu.com/2009/11/23/%e5%9b%bd%e8%b4%a7%e4%b8%80%e5%ae%9a%e5%bc%ba%e2%80%94%e2%80%94%e8%a7%82wps%e6%a8%a1%e6%9d%bf%e6%9c%89%e6%84%9f/</link>
		<comments>http://blog.charliezhu.com/2009/11/23/%e5%9b%bd%e8%b4%a7%e4%b8%80%e5%ae%9a%e5%bc%ba%e2%80%94%e2%80%94%e8%a7%82wps%e6%a8%a1%e6%9d%bf%e6%9c%89%e6%84%9f/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 03:27:07 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/2009/11/23/%e5%9b%bd%e8%b4%a7%e4%b8%80%e5%ae%9a%e5%bc%ba%e2%80%94%e2%80%94%e8%a7%82wps%e6%a8%a1%e6%9d%bf%e6%9c%89%e6%84%9f/</guid>
		<description><![CDATA[这些模板太体贴到位了，太符合国情、民情了，尽情展现山寨精神的精髓。看图

]]></description>
			<content:encoded><![CDATA[<p>这些模板太体贴到位了，太符合国情、民情了，尽情展现山寨精神的精髓。看图<br />
<img src="http://blog.charliezhu.com/wp-content/uploads/2009/11/wps.png" alt="wps" title="wps" width="703" height="318" class="alignnone size-full wp-image-447" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2009/11/23/%e5%9b%bd%e8%b4%a7%e4%b8%80%e5%ae%9a%e5%bc%ba%e2%80%94%e2%80%94%e8%a7%82wps%e6%a8%a1%e6%9d%bf%e6%9c%89%e6%84%9f/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Chemene JSDraw，又一个非常优秀的基于javascript的化学结构编辑器</title>
		<link>http://blog.charliezhu.com/2009/11/13/chemene-jsdraw%ef%bc%8c%e5%8f%88%e4%b8%80%e4%b8%aa%e9%9d%9e%e5%b8%b8%e4%bc%98%e7%a7%80%e7%9a%84%e5%9f%ba%e4%ba%8ejavascript%e7%9a%84%e5%8c%96%e5%ad%a6%e7%bb%93%e6%9e%84%e7%bc%96%e8%be%91%e5%99%a8/</link>
		<comments>http://blog.charliezhu.com/2009/11/13/chemene-jsdraw%ef%bc%8c%e5%8f%88%e4%b8%80%e4%b8%aa%e9%9d%9e%e5%b8%b8%e4%bc%98%e7%a7%80%e7%9a%84%e5%9f%ba%e4%ba%8ejavascript%e7%9a%84%e5%8c%96%e5%ad%a6%e7%bb%93%e6%9e%84%e7%bc%96%e8%be%91%e5%99%a8/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 15:23:49 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[chemoinformatics]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=441</guid>
		<description><![CDATA[JSDraw是Tony Yuan开发的基于javascript的在线化学结构编辑器，也能作为化学结构式的显示工具。效果很棒。
我之前所了解的类似的软件是Chemhack jsMolEditor&#160;and&#160;Chemdoodle。
JSDraw的特点是

结构图片显示的质量高。
输入的方便。我用过的最方便的在线结构输入工具，是Chemwriter。而JSDraw的输入方式和Chemwriter几乎一样，尤其是直接用键盘输入N,S,O,Cl等非C原子的功能很有用。
有&#8220;部分选择&#8221;的功能，并支持Visio里一样的用ctrl键拖拽后复制的效果。
支持反映路线输入，并支持RXN导出。而且对反应路线输入，提供了自动整理格式的功能。
调用上很有特点。网页设计者不需要单独写js代码，而是直接对需要表达为结构式显示、编辑的区域，就是div元素，赋予特定的属性即可。
能够很完美支持IE。这点jsMolEditor还不行。

Tony现在在Novartis工作。提到这个公司，自然会想到一个人，就是Peter Ertl，大名鼎鼎的JME就是他多年前开发出来并广泛使用起来的。可见这个公司文化的开放和对行业多角度的贡献。
不过JSDraw并不是开源的，对商业应用也不免费。这一点Duan Lian的jsMolEditor就开放得多(LGPL)。
JSDraw目前还没有SMILES导出的功能，但是这在Tony的计划之中。如果我写的Javascript SMILES writer能够起到一些帮助，将是我很大的荣幸。
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.chemene.com:8080/CCD/JSDraw/">JSDraw</a>是Tony Yuan开发的基于javascript的在线化学结构编辑器，也能作为化学结构式的显示工具。效果很棒。</p>
<p>我之前所了解的类似的软件是<a href="http://chemhack.com/jsmoleditor/">Chemhack jsMolEditor</a>&nbsp;and&nbsp;<a href="http://www.chemdoodle.com/">Chemdoodle</a>。</p>
<p>JSDraw的特点是</p>
<ul>
<li>结构图片显示的质量高。</li>
<li>输入的方便。我用过的最方便的在线结构输入工具，是<a href="http://chemwriter.com/">Chemwriter</a>。而JSDraw的输入方式和Chemwriter几乎一样，尤其是直接用键盘输入N,S,O,Cl等非C原子的功能很有用。</li>
<li>有&ldquo;部分选择&rdquo;的功能，并支持Visio里一样的用ctrl键拖拽后复制的效果。</li>
<li>支持反映路线输入，并支持RXN导出。而且对反应路线输入，提供了自动整理格式的功能。</li>
<li>调用上很有特点。网页设计者不需要单独写js代码，而是直接对需要表达为结构式显示、编辑的区域，就是div元素，赋予特定的属性即可。</li>
<li>能够很完美支持IE。这点jsMolEditor还不行。</li>
</ul>
<p>Tony现在在Novartis工作。提到这个公司，自然会想到一个人，就是<span class="Apple-style-span" style="font-family: Arial, Helvetica, 'Nimbus Sans L', sans-serif; border-collapse: collapse; line-height: 11px; "><a href="http://peter-ertl.com/">Peter Ertl</a>，大名鼎鼎的JME就是他多年前开发出来并广泛使用起来的。可见这个公司文化的开放和对行业多角度的贡献。</span></p>
<p>不过JSDraw并不是开源的，对商业应用也不免费。这一点Duan Lian的jsMolEditor就开放得多(LGPL)。</p>
<p>JSDraw目前还没有SMILES导出的功能，但是这在Tony的计划之中。如果我写的<a href="http://charliezhu.nfshost.com/jsBabel/">Javascript SMILES writer</a>能够起到一些帮助，将是我很大的荣幸。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2009/11/13/chemene-jsdraw%ef%bc%8c%e5%8f%88%e4%b8%80%e4%b8%aa%e9%9d%9e%e5%b8%b8%e4%bc%98%e7%a7%80%e7%9a%84%e5%9f%ba%e4%ba%8ejavascript%e7%9a%84%e5%8c%96%e5%ad%a6%e7%bb%93%e6%9e%84%e7%bc%96%e8%be%91%e5%99%a8/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fast building SMILES structure viewer with Dingo and WPF</title>
		<link>http://blog.charliezhu.com/2009/11/02/fast-building-smiles-structure-viewer-with-dingo-and-wpf/</link>
		<comments>http://blog.charliezhu.com/2009/11/02/fast-building-smiles-structure-viewer-with-dingo-and-wpf/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:40:50 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Coding]]></category>

		<category><![CDATA[chemoinformatics]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=432</guid>
		<description><![CDATA[Indigo is recently introduced as open-source chemoinformatics toolkit &#60;1&#62;, &#60;2&#62;.
Dingo is a molecule and reaction rendering library included in Indigo and with .NET C# wrapper to make it possible for me to build a WPF app with it. Dingo and WPF make things so simple.

Amazing feeling to stand on the giant&#8217;s shoulder. Not too much [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://opensource.scitouch.net/indigo/">Indigo</a> is recently introduced as open-source chemoinformatics toolkit <a href="http://blog.rguha.net/?p=436">&lt;1&gt;</a>, <a href="http://depth-first.com/articles/2009/10/29/indigo-open-source-cheminformatics-for-c-and-net">&lt;2&gt;</a>.</p>
<p>Dingo is a molecule and reaction rendering library included in Indigo and with .NET C# wrapper to make it possible for me to build a WPF app with it. Dingo and WPF make things so simple.</p>
<p><img height="608" width="798" border="1" alt="" src="http://blog.charliezhu.com/wp-content/uploads/wpf1.PNG" /></p>
<p>Amazing feeling to stand on the giant&#8217;s shoulder. Not too much code pasted here</p>
<h3>Compound class to transform SMILES to Bitmap objects with Dingo</h3>
<pre>
    public class Compound
    {
        public String smi{ get; set;}
        public Compound(String smiles)
        {
            smi = smiles;
        }
        public BitmapSource bmp {
            get{
                return Smi2Bitmap(smi, 160, 160);
            }
        }
        public static BitmapSource loadBitmap(System.Drawing.Bitmap source)
        {
            return System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(source.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty,
                System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
        }
        public static BitmapSource Smi2Bitmap(String smi, int Width, int Height)
        {
            Dingo dg = new Dingo();
            dg.loadMolecule(smi);
            dg.setBackgroundColor(System.Drawing.Color.White);
            System.Drawing.Bitmap bmp = dg.renderToBitmap(Width, Height);
            return loadBitmap(bmp);
        }
    }
</pre>
<h3>SMILES file reader</h3>
<pre>
    public class SMIReader: System.Collections.IEnumerable
    {
        private StreamReader sr;
        public SMIReader(String path)
        {
            sr = new StreamReader(path);
        }
        public IEnumerator GetEnumerator()
        {
            String line;
            while ((line = sr.ReadLine()) != null)
            {
                yield return new Compound(line.Split('\t')[0].Split(' ')[0]);
            }
        }
    }
</pre>
<h3>XAML code of the listbox</h3>
<p>Notes: To show as many structure pictures blocks on screen the WrapPanel is used as ItemsPanel. This depresses performance for large file that all SMILES are read in but lazy loaded in the default StackPanel mode.</p>
<pre>
            &lt;ListBox Name=&quot;list1&quot; Height=&quot;539&quot; Width=&quot;790&quot;
                     ItemTemplate=&quot;{StaticResource MolListboxTemplate}&quot;
                     ScrollViewer.HorizontalScrollBarVisibility=&quot;Disabled&quot;
                     IsSynchronizedWithCurrentItem =&quot;True&quot;&gt;
                &lt;ListBox.ItemsPanel&gt;
                    &lt;ItemsPanelTemplate&gt;
                        &lt;WrapPanel/&gt;
                    &lt;/ItemsPanelTemplate&gt;
                &lt;/ListBox.ItemsPanel&gt;
            &lt;/ListBox&gt;
</pre>
<h3>Item template of the listbox to support structure images displaying</h3>
<pre>
    &lt;Window.Resources&gt;
        &lt;DataTemplate x:Key=&quot;MolListboxTemplate&quot;&gt;
            &lt;WrapPanel Margin=&quot;3&quot;&gt;
                &lt;StackPanel&gt;
                    &lt;Image Source=&quot;{Binding bmp}&quot; Height=&quot;160&quot; Width=&quot;160&quot;&gt;&lt;/Image&gt;
                    &lt;TextBox Text=&quot;{Binding smi}&quot; Width=&quot;160&quot;&gt;&lt;/TextBox&gt;
                &lt;/StackPanel&gt;
            &lt;/WrapPanel&gt;
        &lt;/DataTemplate&gt;
    &lt;/Window.Resources&gt;
</pre>
<h3>Button event to trigger databinding</h3>
<pre>
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            System.Windows.Forms.OpenFileDialog ofd = new System.Windows.Forms.OpenFileDialog();
            ofd.Filter = &quot;SMILES file(*.smi)|*.smi&quot;;
            if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                String path = ofd.FileName;
                textBlock1.Text = path;
                list1.ItemsSource = new nchem.SMIReader(path);
            }
        }
</pre>
<p>Done.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2009/11/02/fast-building-smiles-structure-viewer-with-dingo-and-wpf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>又一个智力玩具</title>
		<link>http://blog.charliezhu.com/2009/10/10/%e5%8f%88%e4%b8%80%e4%b8%aa%e6%99%ba%e5%8a%9b%e7%8e%a9%e5%85%b7/</link>
		<comments>http://blog.charliezhu.com/2009/10/10/%e5%8f%88%e4%b8%80%e4%b8%aa%e6%99%ba%e5%8a%9b%e7%8e%a9%e5%85%b7/#comments</comments>
		<pubDate>Sat, 10 Oct 2009 13:13:44 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[Life]]></category>

		<category><![CDATA[son]]></category>

		<category><![CDATA[不以物喜]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=428</guid>
		<description><![CDATA[儿子肯定不会玩，对我来说也有一些难度。挺好玩的。
展开

折叠
;
]]></description>
			<content:encoded><![CDATA[<p>儿子肯定不会玩，对我来说也有一些难度。挺好玩的。</p>
<p>展开</p>
<p><a title="PIC091002074335 by Charlie.Zhu, on Flickr" href="http://www.flickr.com/photos/charliezhu/3997316349/"><img width="375" height="500" alt="PIC091002074335" src="http://farm4.static.flickr.com/3499/3997316349_23ae8c0972.jpg" /></a></p>
<p>折叠</p>
<p><a title="PIC091002074247 by Charlie.Zhu, on Flickr" href="http://www.flickr.com/photos/charliezhu/3997315835/"><img width="375" height="500" alt="PIC091002074247" src="http://farm3.static.flickr.com/2608/3997315835_3179fb5064.jpg" /></a>;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2009/10/10/%e5%8f%88%e4%b8%80%e4%b8%aa%e6%99%ba%e5%8a%9b%e7%8e%a9%e5%85%b7/feed/</wfw:commentRss>
		</item>
		<item>
		<title>在线化学结构输入软件最重要的功能</title>
		<link>http://blog.charliezhu.com/2009/10/04/%e5%9c%a8%e7%ba%bf%e5%8c%96%e5%ad%a6%e7%bb%93%e6%9e%84%e8%be%93%e5%85%a5%e8%bd%af%e4%bb%b6%e6%9c%80%e9%87%8d%e8%a6%81%e7%9a%84%e5%8a%9f%e8%83%bd/</link>
		<comments>http://blog.charliezhu.com/2009/10/04/%e5%9c%a8%e7%ba%bf%e5%8c%96%e5%ad%a6%e7%bb%93%e6%9e%84%e8%be%93%e5%85%a5%e8%bd%af%e4%bb%b6%e6%9c%80%e9%87%8d%e8%a6%81%e7%9a%84%e5%8a%9f%e8%83%bd/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 14:20:34 +0000</pubDate>
		<dc:creator>charlie</dc:creator>
		
		<category><![CDATA[chemoinformatics]]></category>

		<category><![CDATA[不以物喜]]></category>

		<guid isPermaLink="false">http://blog.charliezhu.com/?p=422</guid>
		<description><![CDATA[Rich在用ChemWriter的License作奖品请大家写一些结构输入软件的重要功能特性，进行竞赛。我不如就写点中文的吧。仅限于在线编辑的软件 ( online editor only )。
文件导入 (file importing)
没有谁的研究工作是在某个在线编辑器上进行的，更多的是文件形式存在的结构文件。比如Chemdraw的CDX文件。而重画一遍结构式，绝对是痛苦的事情。没有哪个研发助理和采购助理乐意干这件事。所以需要导入功能。导入功能在另一个侧面可以弥补功能上的不足，因为结构都已经在其他商业软件上做好了。
在线的结构文件导入，基于ActiveX的Chemdraw功能最全；硕大的JChemPaint可以支持InChI/SMILE等输入；Chemwriter可以导入mol文件；如果网页开发人员不多写一些代码，JME只能干画。
大小 (plugin size)
既然是在线使用，size就重要。比如JChemPaint有 382kB；Chemwriter 111kB；JME 40kB。
输入方便 (easy to input)
这一点Chemwriter可居榜首。鼠标在原子、键悬停时有显示；反复点击某个键更改键类型；直接在键盘上输入元素名称等等实用功能都做到了。
而且也比较美观。
所以综合来说，我很想用用Chemwriter，所以就写上面这些希望有点运气。
&#160;
]]></description>
			<content:encoded><![CDATA[<p>Rich在用ChemWriter的License作奖品请大家写一些结构输入软件的重要功能特性，进行<a href="http://metamolecular.com/promotions/chemwriter-september-09">竞赛</a>。我不如就写点中文的吧。仅限于在线编辑的软件 ( online editor only )。</p>
<h3>文件导入 (file importing)</h3>
<p>没有谁的研究工作是在某个在线编辑器上进行的，更多的是文件形式存在的结构文件。比如Chemdraw的CDX文件。而重画一遍结构式，绝对是痛苦的事情。没有哪个研发助理和采购助理乐意干这件事。所以需要导入功能。导入功能在另一个侧面可以弥补功能上的不足，因为结构都已经在其他商业软件上做好了。</p>
<p>在线的结构文件导入，基于ActiveX的Chemdraw功能最全；硕大的<a title="JChemPaint" href="http://sourceforge.net/apps/mediawiki/cdk/index.php?title=JChemPaint">JChemPaint</a>可以支持InChI/SMILE等输入；<a href="http://chemwriter.com/">Chemwriter</a>可以导入mol文件；如果网页开发人员不多写一些代码，JME只能干画。</p>
<h3>大小 (plugin size)</h3>
<p>既然是在线使用，size就重要。比如<a title="JChemPaint" href="http://sourceforge.net/apps/mediawiki/cdk/index.php?title=JChemPaint">JChemPaint</a>有 382kB；Chemwriter 111kB；JME 40kB。</p>
<h3>输入方便 (easy to input)</h3>
<p>这一点Chemwriter可居榜首。鼠标在原子、键悬停时有显示；反复点击某个键更改键类型；直接在键盘上输入元素名称等等实用功能都做到了。</p>
<p>而且也比较美观。</p>
<p>所以综合来说，我很想用用Chemwriter，所以就写上面这些希望有点运气。</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.charliezhu.com/2009/10/04/%e5%9c%a8%e7%ba%bf%e5%8c%96%e5%ad%a6%e7%bb%93%e6%9e%84%e8%be%93%e5%85%a5%e8%bd%af%e4%bb%b6%e6%9c%80%e9%87%8d%e8%a6%81%e7%9a%84%e5%8a%9f%e8%83%bd/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
