<?xml version="1.0" encoding="UTF-8"?>
  <feed xmlns="http://www.w3.org/2005/Atom">
  <title type="html"><![CDATA[钟爱梦欣]]></title>
  <subtitle type="html"><![CDATA[今生今世爱你到永远！]]></subtitle>
  <id>http://lovemx.com/blog/</id>
  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/" /> 
  <link rel="self" type="application/atom+xml" href="http://lovemx.com/blog/atom.asp" /> 
  <generator uri="http://www.pjhome.net/" version="2.8">PJBlog3</generator> 
  <updated>2011-11-10T19:55:37+08:00</updated>

  <entry>
	  <title type="html"><![CDATA[熬夜指南]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=3" label="随便说说" /> 
	  <updated>2011-11-10T19:55:37+08:00</updated>
	  <published>2011-11-10T19:55:37+08:00</published>
		  <summary type="html"><![CDATA[首先,能不熬夜还是不熬的好。<br/><br/>熬夜前的准备<br/>下午时候，不要吃泡面来填饱肚子，以免火气太大。晚餐应多补充一些含维生素C或含有胶原蛋白的食物，鱼类、豆类这些。<br/>拿热水泡脚很养人，对于熬夜时候保持精力也很管用。<br/>开始熬夜前，来一颗维他命Ｂ群营养丸，维他命Ｂ能够解除疲劳，增强人体免疫力。拿医保卡去学校随便拿一瓶，也就是几十块的事情。<br/><br/>熬夜中<br/>熬夜的人，最先想到的就是喝咖啡提神。但是咖啡因虽然提神，相对地会消耗体内与神经、肌肉协调有关的维他命B群，缺乏维他命B群的人本来就比较容易累，更可能形成恶性循环，养成酗茶、酗咖啡的习惯，需要量愈来愈多，效果却愈来愈差。因此，我个人比较推荐喝茶，绿茶很不错，可以提神，又可以消除体内多余的自由基，据说还有些防辐射的作用。不过貌似肠胃不好的人喝不得绿茶，那枸杞大枣茶或菊花茶也是很好的选择，提神而且有去火的功效。<br/><br/>熬夜时候不要吃太多甜食，高糖虽有高热量，刚开始让人兴奋，却会消耗维他命B群，会让人容易疲劳，也容易引来肥胖问题。<br/><br/>熬夜时候最好的食物是水果，这个道理就不用多说了。值得注意的是，花生米、杏仁、腰果、胡桃等干果类食品，含有丰富的蛋白质、维生素B、维生素E、钙和铁等矿物质以及植物油，而胆固醇的含量很低，对恢复体能有特殊的功效。绝对是熬夜必备之选啊。<br/><br/>熬夜时，大脑需氧量会增大，最好隔一个小时到走廊做一些简单易行的肌肉放松动作，一方面舒缓筋骨，预防颈椎病之类的；另一方面，可以多呼吸一些新鲜空气，提神又减压。<br/><br/>熬夜后<br/>其实，熬夜时候因为要忙着码代码，精神一直紧绷着，倒是并不难受。反倒是熬夜之后，才是真正痛苦的时候，精神萎靡、头疼欲裂都是常事儿。这个确实没什么好办法，只能说按之前技巧来做，痛苦会少一些。 <br/><br/>熬完夜直接补觉到中午，我个人觉得这是最好的恢复方式。因为千理由万理由，熬夜最让人难受的还是睡眠时间不够。<br/><br/>如果没这个条件，那中午也至少要睡一个小时。常言道，“午睡一小时抵过晚上睡三小时”。<br/><br/>大体就这些了，大家有些好的建议也不妨提出来。要想熬夜精神好，就得有技巧啊。]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/FreeTalk/AoYeZhiNan.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=26</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[lucene.net 的查询方式query条件判断]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=5" label="技术段子" /> 
	  <updated>2011-08-08T18:40:49+08:00</updated>
	  <published>2011-08-08T18:40:49+08:00</published>
		  <summary type="html"><![CDATA[<div id="cnblogs_post_body">
<p style="margin: 5px auto; text-indent: 0px;"><strong>第一、按词条搜索 － TermQuery<span class="Apple-converted-space"> </span><br />
</strong>query = new TermQuery(new Term(&quot;name&quot;,&quot;word1&quot;));</p>
<p style="margin: 5px auto; text-indent: 0px;">hits = searcher.search(query);</p>
<p style="margin: 5px auto; text-indent: 0px;">这样就可以把 field 为 name 的所有包含 word1 的文档检索出来了。</p>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第二、 &ldquo;与或&rdquo;搜索 － BooleanQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">它实际是一个组合 query 看看下面的代码：</p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">query1 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> TermQuery(</span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">name</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">,</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">word1</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">)); <br />
<br />
query2 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> TermQuery(</span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">name</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">,</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">word2</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">)); <br />
BooleanQuery query</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> BooleanQuery();<br />
query.add(query1, BooleanClause.Occur.MUST);   <br />
query.add(query2, BooleanClause.Occur.MUST); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); </span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;">其中的MUST、SHOULD、MUST_NOT表示与、或、非,从字面意思很容易理解<span class="Apple-converted-space"> </span><br />
Lucene 可以最多支持连续 1024 的 query 的组合。</p>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第三、 在某一范围内搜索 － RangeQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">IndexSearcher searcher </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> IndexSearcher(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">F:\资源\lucene研究\test</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Term beginTime </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">time</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">,</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">200001</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Term endTime </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">time</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">,</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">200005</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Hits hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">null</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">; <br />
<br />
RangeQuery query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">null</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">; <br />
<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> RangeQuery(beginTime, endTime, </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">false</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); </span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;">RangeQuery 的构造函数的参数分别代表起始、结束、是否包括边界。这样我们就可以按照要求检索了。</p>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第四、 使用前缀检索 － PrefixQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">这个检索的机制有点类似于 indexOf() 从前缀查找。这个常在英文中使用，中文中就很少使用了。代码如下：</p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">IndexSearcher searcher </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> IndexSearcher(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">F:\资源\lucene研究\test</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Term pre1 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">name</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">Da</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> PrefixQuery(pre1); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); </span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第五、 多关键字的搜索 － PhraseQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">可以多个关键字同时查询。使用如下：</p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> PhraseQuery(); <br />
<br />
query.add(word1); <br />
<br />
query.add(word2); <br />
<br />
query.setSlop(</span><span style="color: rgb(128, 0, 128); line-height: 19px; font-family: &quot;Courier New&quot;;">0</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); <br />
<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">'david' 与 'mary' 紧紧相隔的 Document</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
query.setSlop(</span><span style="color: rgb(128, 0, 128); line-height: 19px; font-family: &quot;Courier New&quot;;">2</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); <br />
<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">'david' 与 'mary' 中相隔两个词的短语 </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); </span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;">这里我们要注意 query.setSlop(); 这个方法的含义。</p>
<p style="margin: 5px auto; text-indent: 0px;">query.setSlop(0); 紧紧相连 （这个的条件比较苛刻）</p>
<p style="margin: 5px auto; text-indent: 0px;">query.setSlop(2); 相隔</p>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第六、 使用短语缀搜索 － PharsePrefixQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">使用 PharsePrefixQuery 可以很容易的实现相关短语的检索功能。</p>
<p style="margin: 5px auto; text-indent: 0px;">实例：</p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> PhrasePrefixQuery(); <br />
<br />
</span><span style="color: rgb(0, 128, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">//</span><span style="color: rgb(0, 128, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> 加入可能的所有不确定的词 </span><span style="color: rgb(0, 128, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"><br />
</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"><br />
Term word1 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">david</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Term word2 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">mary</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Term word3 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">smith</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Term word4 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">robert</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
query.add(</span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term[]{word1, word2}); <br />
<br />
</span><span style="color: rgb(0, 128, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">//</span><span style="color: rgb(0, 128, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> 加入确定的词 </span><span style="color: rgb(0, 128, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"><br />
</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"><br />
query.add(word4); <br />
<br />
query.setSlop(</span><span style="color: rgb(128, 0, 128); line-height: 19px; font-family: &quot;Courier New&quot;;">2</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); <br />
<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> 存在短语 'david robert' 或 'mary robert' 的文档 </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); </span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第七、 相近词语的搜索 － fuzzyQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">可以通俗的说它是一种模糊查询。</p>
<p style="margin: 5px auto; text-indent: 0px;">实例：</p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">Term word1 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">david</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); <br />
<br />
Hits hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">null</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">; <br />
<br />
FuzzyQuery query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">null</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">; <br />
<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> FuzzyQuery(word1); <br />
<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query); <br />
<br />
printResult(hits,</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> 与 'david' 相似的词 </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">); </span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;"><strong>第八、 使用通配符搜索 － WildcardQuery</strong></p>
<p style="margin: 5px auto; text-indent: 0px;">实例：</p>
<p style="margin: 5px auto; text-indent: 0px;">&nbsp;</p>
<div class="cnblogs_code" style="padding: 5px; border: 1px solid rgb(204, 204, 204); font-family: &quot;Courier New&quot;; font-size: 13px; word-break: break-all; overflow-x: auto; overflow-y: auto; background-color: rgb(245, 245, 245);">
<div><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">IndexSearcher searcher </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> IndexSearcher(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">F:\资源\lucene研究\test</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);<br />
Term word1 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">*ever</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);<br />
Term word2 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">wh?ever</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);<br />
Term word3 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">h??ever</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);<br />
<br />
Term word4 </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> Term(</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">content</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">ever*</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);<br />
WildcardQuery query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">null</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">;<br />
Hits hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">null</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">;<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> WildcardQuery(word1);<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query);<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">*ever</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> WildcardQuery(word2);<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query);<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">wh?ever</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);     <br />
<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> WildcardQuery(word3);<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query);<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">h??ever</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);     <br />
<br />
query </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> </span><span style="color: rgb(0, 0, 255); line-height: 19px; font-family: &quot;Courier New&quot;;">new</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> WildcardQuery(word4);<br />
hits </span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">=</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;"> searcher.search(query);<br />
printResult(hits, </span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">ever*</span><span style="color: rgb(128, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">&quot;</span><span style="color: rgb(0, 0, 0); line-height: 19px; font-family: &quot;Courier New&quot;;">);</span></div>
</div>
<p style="margin: 5px auto; text-indent: 0px;">由上可以看出通配符？代便 1 个字符， * 代表 0 到多个字符。</p>
<p style="margin: 5px auto; text-indent: 0px;">Lucene 现在支持以上八中的搜索方式，我们可以根据需要选择适合自己的搜索方式。当然上面提供的一些可能对英文还是比较有效，中文就不可取了，所以我们开始想想百度，我们只在一个输入框中搜索结果。有了这个疑问我们揭开下一章的讨论吧！</p>
<p style="margin: 5px auto; text-indent: 0px;">查询字符串的解析：这个就是我们经常在一个输入框中输入我们要检索的文字，交给搜索引擎去帮我们分词。</p>
<p style="margin: 5px auto; text-indent: 0px;">QueryParser 类就是对查询字符串的解析类。</p>
<p style="margin: 5px auto; text-indent: 0px;">看看它的用法：</p>
<p style="margin: 5px auto; text-indent: 0px;">query = QueryParser.parse(key1, &quot;name&quot;, new StandardAnalyzer());</p>
<p style="margin: 5px auto; text-indent: 0px;">hits = searcher.search(query);</p>
<p style="margin: 5px auto; text-indent: 0px;">它直接返回一个 Query 对象。需要传入的参数分别是：</p>
<p style="margin: 5px auto; text-indent: 0px;">用户需要查询的字符串、需要检索的对应字段名称、采用的分词类。</p>
<p style="margin: 5px auto; text-indent: 0px;">Analyzer analyzer = new CJKAnalyzer();</p>
<p style="margin: 5px auto; text-indent: 0px;">String[] fields = {&quot;filename&quot;, &quot;content&quot;};</p>
<p style="margin: 5px auto; text-indent: 0px;">Query query = MultiFieldQueryParser.parse(searchword, fields, analyzer);</p>
<p style="margin: 5px auto; text-indent: 0px;">Hits hits = searcher.search(query);</p>
<p style="margin: 5px auto; text-indent: 0px;">QueryParser 的&ldquo;与&rdquo; 和 &ldquo;或&rdquo;：</p>
<p style="margin: 5px auto; text-indent: 0px;">QueryParser 之间默认是或，我们想改变为与的话加入以下代码：</p>
<p style="margin: 5px auto; text-indent: 0px;">QueryParser.setOperator(QueryParser.DEFAULT_OPERATOR_AND);</p>
<p style="margin: 5px auto; text-indent: 0px;">就可以了。</p>
<p style="margin: 5px auto; text-indent: 0px;">本文来自CSDN博客：<a href="http://blog.csdn.net/hehui21/archive/2008/09/03/2874178.aspx" style="color: rgb(67, 113, 166);">http://blog.csdn.net/hehui21/archive/2008/09/03/2874178.aspx</a></p>
</div>
<p>&nbsp;</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/TechnologyScripts/25.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=25</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[客厅和电视的比例的一个算法]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=3" label="随便说说" /> 
	  <updated>2011-08-07T16:25:51+08:00</updated>
	  <published>2011-08-07T16:25:51+08:00</published>
		  <summary type="html"><![CDATA[即观看距离是电视机对角距离的3--4倍，可以保证用眼的健康。<br/>电视的尺寸是英寸，一英寸等于25.4毫米。<br/>3500/3.5=1000,1000/25.4=39（吋）。<br/>所以，39吋左右即可，上下差一些，问题不大。<br/><br/>以上是以3.5米宽的客厅为例。]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/FreeTalk/KeTingHeDianShiDeBiLiDeYiGeSuanFa.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=24</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[IT从业者：你的工作=生活？]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=4" label="励志段子" /> 
	  <updated>2011-08-04T15:46:54+08:00</updated>
	  <published>2011-08-04T15:46:54+08:00</published>
		  <summary type="html"><![CDATA[　　你的每一天有多少时间是在工作？工作之外还有其他的什么活动吗？对这两个问题的回答，在来访的各类人员中，我们发现，越是中高收入的阶层，往往对第二个问题的回答是空泛的，缺乏操作性。而在这类人群中，又以IT从业者的答案最让人忧虑，日工作时间往往超过12个小时，而工作之外的活动仍然对着电脑的竟然占据了75%以上。职业侵占生活，已经真实的发生了。<br/><br/>职业侵占生活，正在成为我们的生活之殇。这是转型期社会的集体症状，不分性别，不分阶层，工作第一、生活第二，作为职场潜规则被规定下来。我们之中的每一位，几乎都在经历着这一切。<br/>　　<br/>　　在来访的人群中，做一个小型的问卷调查，我们惊讶的发现，越是中高收入的阶层，职业侵占生活的比率就越高，而在这类人群中，又以IT从业者的情况最为严重。已经工作了7年的资深程序设计员韩青，曾经在一次咨询中，明确的说道，他在刚刚入行的时候，日工作时间，曾一度达到20个小时。<br/>　　<br/>　　“那时年轻，而且有热情，对工作认真负责，同时，也的确需要20个小时来工作，否则就没有办法走得更远，很快就会被更好的员工所替代。”<br/>　　<br/>　　然而，如此漫长的工作时间之后呢？我们究竟为什么允许职业如此侵占我们的生活呢？<br/>　　<br/>　　在一家知名软件公司从事销售工作的林华说，有一天，和他同办公室的张雯突然对他说：“我觉得自己没有了生活。”林华回想那天时，感觉到自己被惊出了一身冷汗。他实在没有想到，好强、不服输、总是干劲十足的张雯会说出这句话。而这分感受，竟与自己如此相同。<br/>　　<br/>　　这相同是由每天中午永远不定点吃就的午饭、晚上做不完的方案以及在全国各地之间打着“飞的”当天往返之类的节奏构成的。这相同也是由他们的角色决定的，他们都是公司的业务骨干。谁也不知道为什么，每天都有无以计数的事情等着做。<br/>　　<br/>　　“你看4层写字楼里的小姑娘，天天有时间把自己打扮得漂漂亮亮，下班后不是上那儿去玩就是去这儿吃。我的生活里还剩下些什么？！”聚会，推掉。电影、书籍，搁置。年假，作废。而在每一个24小时里，减掉不充分的睡眠，减掉给孩子和家人所尽的少得不能再少的义务，余下时间就只有工作。这几近无边的责任与付出，最终积累成一种情绪：不快乐！<br/>　　<br/>　　都是类机器人的IT人<br/>　　<br/>　　韩青戏称自己这类软件程序员为“类机器人”。“只有当自己是个机器，才能一直坚持下去，事实上，我都不知道我是如何坚持到现在的。”<br/>　　<br/>　　同样的话，在从事同一工作的小丁口中被解释为：“我们这类人，还不如机器人，机器人不吃饭，不睡觉，至少可以不觉得疲惫和累，而我们却是有感知的血肉的人，所以我们会疲惫会累，但却没有喊停的权利。到了现在，结果就是我已经不知道什么是累，也不知道该如何停下来，更不知道停下来之后，要做点儿什么。”<br/>　　<br/>　　而林华则说：“我怀疑自己的生活。这是无趣、枯燥、没有温度的生活。这真的就是生活的本身？可为什么我看那些其他行业的人们，都活得有滋有味的？他们的时间是从哪儿来的？”林华甚至认为，那些挣到的钱，在无人分享快乐或痛苦的状态里，毫无意义。<br/>　　<br/>　　心理学认为，人最深层、最重要的情感诉求就是亲密关系，没有它，工作取得再高的成就，也无法让自己真正踏实、安定下来。遗憾的是，“我想建立亲密关系，但太麻烦了。”它甚至比攻克某一个技术上的困境还难。而长久的无沟通生涯，也带来IT从业者日渐困顿的人际关系。为了逃避这无法面对的孤独，为了自我价值感的满足，像上瘾一样，愈发将更多的精力投注在工作之上。<br/>　　<br/>　　而在经济高速发展的现代社会，每个人都认同一件事：不拼命，就被抛弃。在信息技术发展迅猛的IT行业里，甚至于由不得你不拼命，每天工作时间不是由自己所能决定的，就如同被市场化了的某一个螺丝钉，要不断地旋动来使得“价值”得到最大限度地“实现”。但正是如此，职业不仅侵犯着我们的生活，更侵犯着我们的生命。这样说并非危言耸听。<br/>　　<br/>　　在听心文章《IT“公民”的健康困境》一文中，就曾经明确的提供这样的数据：有数据显示，公安、IT、文化演艺等职业已经成为“过劳死”的高发区，“过劳死”时的平均年龄为44岁，其中IT阶层年龄最低，仅仅为37.9岁。<br/>　　<br/>　　身体已经不得不用停下、不配合的方式给我们警告了，为什么我们依然认为，“闲”和“空”的状态，是那么的不能接受、没有价值感？是谁把这样的观念凌驾于生命之上？<br/>　　<br/>　　慢慢认同，逐渐疲惫<br/>　　<br/>　　奥修说，生命最完满的存在，是做我们自己。可惜的是，由于对职业所代表的社会价值的高度认同，我们甚至不知道今天的自己，所行所言所拥有的性格，有多少还是出于自己的本性。<br/>　　<br/>　　在公司副总的位置上坐了3年，卢安宇越来越多的想起大学时候的自己。他曾是那么自由爽快，爱玩，爱乱开玩笑，敢于仗义执言，最恨逢场作戏。而毕业之后，他从最基础的程序员到现在成为公司的副总，一路疲惫的摸爬滚打过来，让他日益收敛起真实的自己，甚至从着装上，都能看得出来，休闲、风格化的着装几乎不再穿了，一律由清一色深灰、墨蓝的刻板职业装构成——而这曾是他最恨的。大学时代的女友自从他工作2年后离开了他，从那之后他再也没有过一个正经的可以称之为女朋友的伴侣。从最初憎恨不负责任的关系到现在一夜情变成了他的生活常态，卢安宇渐渐怀疑，这还是从前的自己么？从前那个校园里的风云人物、从前那些呼朋唤友的日子，怎么突然之间就变成了现在这个除了公司就是家的男人了呢？<br/>　　<br/>　　寻找心理咨询师求助的卢安宇至少还能认识到自己的现状和问题，更多的人呢？身在其位，当职业角色作如是要求的时候，我们必须尽快学会接受。但如果对接受没有警觉，不画一道界线，这些要求就会侵占我们的内心。在IT行业环境可以用恶劣二字来形容的当下，对底线的把握和了解则更为重要。当我们对职业要求过度认同，会把职业的价值观内化到自身，因而波及日常生活中的关系。这对关系的伤害可能是无可挽回的——而我们每个人，其实都需要从这些对我们至关重要的关系里获得支持和能量。<br/>　　<br/>　　当了解到这一点，我们就会知道，那些越来越深的压抑感和无法排解的孤独感到底是从何而来了，也就会了解，这像是滚雪球一样越滚越大的疲惫感和无力感是如何出现的了。当我们对于自身所处职业价值观的认同感越深，我们就会感到越无力越疲惫。越来越多的压力被背负，越来越多的困难被横亘……最后压垮的，一定是我们自身。<br/>　　<br/>　　在当下行业环境尚不完善更不健康的IT行业当中，每一个从业者更应当深刻的了解到这一行业的价值观，不断反思其侵略性，不断的强化自己的底线。每一个人的生活都不等于工作。<br/>　　<br/>　　每一个人的成长先是塑造我们的自我认识。进而，和那无所不在的社会要求伙同一气，将我们体内那个自由自在的“孩童我”紧紧地扼住。那个本性要放松、淘气、喜欢快乐的“孩童我”，居住在一个被强大的“社会我”评判、要求、控制、没有享乐空间的内心世界。<br/>　　<br/>　　当我们身处IT行业，并以此行业来作为我们深陷工作、躲避关系的借口时，我们正是在忘掉最初的自己。而一个和内在自我分离的人，注定是越发疲惫，注定是无法快乐的。<br/>　　<br/>　　IT从业者们，你还要自己的生活=工作吗？]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/Inspirational/ITCongYeZheNiDeGongZuoShengHuo.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=23</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[都是一辈子 - 大有和天成]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=4" label="励志段子" /> 
	  <updated>2011-06-21T15:36:19+08:00</updated>
	  <published>2011-06-21T15:36:19+08:00</published>
		  <summary type="html"><![CDATA[大有和天成从小生活在一个村，一起上的小学。 大有从小顽皮,不好读书,十六岁初中没毕业离开了学校；天成自幼好学,成绩优秀,十六岁考上全市里最好的高中。<br/>&nbsp;&nbsp; 1.大有每天在村里晃悠，爹妈看着发愁，心想这孩子将来怎么办呀；天成每日都苦读诗书，父母喜在心里，村里人都认定他必有出息。<br/>&nbsp;&nbsp; 2.那年，大有和天成都是十九岁，大有跟着村里的外出打工，来到了高速公路的工地，保底工资三千块；天成考上了一所重点大学，读的是道路与桥梁专业，学费每年五千多。 <br/>&nbsp;&nbsp; 3.那年，大有和天成都是二十三岁大有的爹妈给他说个巧媳妇，是邻村的，特别贤惠；天成在大学里谈了个女朋友，是邻校的，很有文化。&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp; 4.那年，大有和天成都是二十四岁，大有在老家结了婚，把媳妇带到工地上，来给他洗衣做饭，恩爱有加；天成终于大学毕业，找了施工单位工作，跟女友分居两地，朝思暮想。 <br/>&nbsp;&nbsp; 5.大有每天很快乐，下了班就没事，吃了饭和媳妇散散步，晚上便和工友打麻将看电视；天成每天很忙碌，白天跑遍工地，晚上还做资料画图纸，好久不见的女友跟他分手了。 <br/>&nbsp;&nbsp; 6.那年，大有和天成都是二十八岁。大有攒下了二十万，已是两个娃娃的爹，心想着回家盖栋漂亮的楼房；天成过了中级职称，还是单身一个人过，心想着再干几年就是高级了；<br/>&nbsp;&nbsp; 7.大友在农村老家盖了两层小楼，装修很漂亮，剩的钱买了一群小猪仔，让媳妇回家种地养猪；天成在城里贷款买了一套新房，按揭三千多，父母给介绍了新女朋友，在城里上班很少见面。<br/>&nbsp;&nbsp; . 那年，大有和天成都是三十一岁，大有媳妇从老家打电话来说：大有，现在家里有房有存款，咱喂喂猪，种种地，很幸福了，家里不能没有男人，你快回来吧；天成媳妇从城里打电话来说：天成，小孩的借读费要十五万呢，家里没有存款了，你看能不能找公司借点。 <br/>&nbsp;&nbsp; 9.大有听了媳妇的话，离开了工地，回老家跟老婆一起养猪，照顾父母小孩；天成听了妻子的话，更努力工作，去了偏远又艰苦的工地，很难回家一次。<br/>&nbsp;&nbsp; 10.那年，大有和天成都是三十五岁，猪肉价格疯涨，大有的一大圈猪成了宝贝，一年赚了十几万；通货膨胀严重，天成的公司很难接到项目，很多人都待岗了；<br/>&nbsp;&nbsp; 11.那年，大有和天成都是五十岁了，大有已是三个孙子的爷爷，天天晒着太阳抽着旱烟在村里转悠；天成已是高级路桥工程师，天天顶着太阳皱着眉头在工地检查；<br/>&nbsp;&nbsp; 12.那年，大有和天成都是六十岁了，大有过六十大寿，老伴说：一家团圆多好呀，家里的事就让娃们操心吧，外面有啥好玩的地方咱出去转转；天成退休摆酒席，领导说：回家歇着没意思，返聘回单位做技术顾问吧，工地上有什么问题您给指导指导；<br/>&nbsp;&nbsp; 13.大有病了一场，大有拉着老伴的手说：我活了快七十岁了，有儿有孙的，知足了；天成病了一场，天成抚着妻子的手说：我在外工作几十年，让你受苦了，对不起；<br/>&nbsp;&nbsp; 14.……由于长期体力劳动，吃的是自家种的菜、养的猪，大有身体一直很硬朗，慢慢就恢复了。由于长期熬夜加班、天成喝酒应酬、工地食堂饭菜也很差，身上落下很多毛病，很快就去世了。 <br/>&nbsp;&nbsp; 15.八十岁的大有蹲在村头抽着旱烟袋，看着远远的山；远远的山上有一片公墓，天成已在那里静静睡去；大有在鞋底磕磕烟灰，拄着拐杖站起身，望了望那片公墓，自言自语地说：唉，都是一辈子呀… <br/>&nbsp;&nbsp;&nbsp;&nbsp;谨以此向工作在一线的同行们致以最高的敬意！你们付出了青春、爱情、亲情甚至生命，你们也是最可爱的人。<br/>&nbsp;&nbsp; 人的一生很短暂，希望大家给自己多一些时间，给家人多一些关爱。在战斗一线少喝酒、少抽烟、少熬夜，照顾好自己的身体和健康。&nbsp;&nbsp; 转载的，有点儿启发，给好友们分享一下，思考思考,人一生很短,该玩别客气]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/Inspirational/DouShiYiBeiZiDaYouHeTianCheng.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=22</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[你的老板会因为你拼命编写代码而感谢你吗？]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=4" label="励志段子" /> 
	  <updated>2011-06-08T12:01:50+08:00</updated>
	  <published>2011-06-08T12:01:50+08:00</published>
		  <summary type="html"><![CDATA[<p>&nbsp;　　<span class="Apple-style-span" style="font-family: Verdana; font-size: 14px; line-height: 21px; ">程序员热衷于长时间地工作。我想说的是，你就承认吧，你的工作/老板并没有让你这样做，你自己要这样做而已。当然，我知道，也许并非所有程序员都喜欢长时间的编程。不过肯定的是，随着加班成为业内的普遍现象，至少一半的程序员必须喜欢加班，不是吗？
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">我早已听到以下这类借口。&ldquo;不，不是那样的，我们只是喜欢炫酷的技术活，而且不想遗留未解决的问题。实际上，加班是一件好事，它让我们变得出色！&rdquo;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
我认为，你不能只见树木，不见森林。从某个角度来说，你这样做并非为了自己，而是为了&ldquo;某个人&rdquo;。无须质疑，他也许是个高尚的人，但你并不是他的奴隶。从其他角度来说，<strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">你有多少次加班，是为了解决问题，研究新技术，编码实现某些东西，以及在截止时间之前完成任务</strong>？但是，你在业务上是机智过人的程序开发者，你在帮助公司获得成功。公司管理者已经向你说明了公司的经济状况&mdash;&mdash;必须这样做，公司依靠你。我想说的是，除非这个管理者现在就在你旁边，半夜2点还在陪你聊天，否则他的话将一文不值。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
让我来讲述一个朋友曾经跟我说过的故事。这个故事是关于一个天才程序员的，姑且叫他John吧。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
John是一个百万程序员当中才出现一个的超级明星。他理解和编写代码的能力高超，工作效率是其他任何人的20倍。有一天，公司拿到了一项短交 期的大项目。客户提供了一本厚得让所有人沮丧的规格说明书。John出手相助，他把说明书带回家，此后三天没有人有关于他的消息。他回来上班的时候，样子 十分憔悴，但他看懂了整本说明书并完成了项目的基本框架。除了一小部分不可能完成之外，说明书的其余部分，甚至连客户自己也不甚了解的需求，John也完 成了。真让人吃惊！<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
当我第一次听说这个故事时，感受颇深，我问了第一个问题&ldquo;那john现在何处？&rdquo;我朋友回答&mdash;&mdash;&ldquo;他死了，生活太艰难了！&rdquo;或许用编程过劳死来形容更加合适。这个故事令人意外的是&mdash;&mdash;John才30岁而已。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
程序员从分享死亡竞赛故事来获得反常的快乐。甚至当我们带着厌恶的情绪去这样做的时候，这种厌恶也带着一丝得意，以此怂恿同事去做得&ldquo;更好&rdquo;。 但这有点像那些穿着短裤的家伙，他们的短裤短到你都看得到他们的内裤；也有点像一些把抽烟当时尚的人，他们和他们的朋友觉得这很酷，其他人却觉得愚蠢。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">使糟糕的情况更糟</strong><br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
我可以理解偶尔付出一些额外努力以及一两天加班到半夜的必要性。但是，当偶尔变成经常，当老板不再因为你的努力而经常感谢你，而是习以为常时， 我们就遇到了麻烦。老板希望程序员经常加班，这不仅是你的悲哀，也是整个行业的。人类就像狗一样，非常容易受到正面和负面强化的影响。整个行业的发展受到 长年因过度加班而死亡的悲剧影响，直到某个阶段，在那个阶段甚至还奖励这种行为。我们每次陷入长时间的争论中，都持续消极地加剧了这种趋势。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
这不能帮助我们管理团队。你只需要让一个人做主，其他人遵守。内疚带来平等&mdash;&mdash;&ldquo;我们不能让我们的伙伴独自去做困难的事情，我们得帮帮忙&rdquo;。遵 守的人越多，那些抛下同伴的人压力就会越大，直到整个团队半夜里聚在一起喝可乐，吃披萨。但他们如何容纳一个同样的人进入他们的世界，因为在这里也有一个 因特立独行而著名的程序员。当我们还是学生时，我们乐于把所有事情都推给某个人处理，然后在校内做我们想要做的事；但当我们走上工作岗位时，一切都要靠我 们自己。真让人困惑。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
有趣的是，有时候这些大量的努力甚至并没有得到正常合理的追踪记录，好像它反而让项目看起来很糟糕一样。所以他们&ldquo;作假帐&rdquo;，正如客户只关心每 个人每周工作40小时（或者他们拿的是40个小时的工资），也许还会关心项目在目前的进度，但他们从不在意小组每个成员花费在项目上的另外40个小时。好 吧，或许他们会在&ldquo;第二套假账&rdquo;中追踪记录的团队成员的真正努力。虽然会计会因为此类造假而锒铛入狱，但在IT业内，没有人会反对这种造假的要求。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">可接受的进度成果</strong><br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
大多数敏捷开发过程都会就可接受的开发进度进行讨论。不过，我也见过有些甚至自认为灵活的团队会花几个小时的时间坐下来一起讨论交流如何让程序更加高效合理，等等，你懂的。尽管团队成员的思维依旧敏捷，你却不敢说出其他东西。<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
每当我想起这东西，我总想到律师。你就像一个刚入门的律师，付出了大量的努力和时间，这是你在这个行业中获得成功的常规途径。没有一个程序员想 要跟律师做比较，但情况经常很相似，除非你不希望跟程序开发人员一样通过长时间的加班取得进步（就跟律师一样，除非你在4大咨询公司打工，也可以成为一名 律师）。所以，律师跟程序员，哪个是呆子？<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
关于一周工作时间超过40小时导致生产力下降的研究呈现出令人不安的规律性。作为程序员，如果你的创造力下降了，你的失误就会增加，你就会遗漏 现存的问题，等等；直到到达某个阶段，这个阶段中，你做错的东西比做对的东西还要多。当你花了很多的时间在同样的活动中时，我是否应该特别提到健康问题。 关于饮食，你只能靠可乐存活很长一段时间&mdash;&mdash;可怜的John甚至活下来不到40小时。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: center; "><br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<img src="http://img.cnbeta.com/newsimg/110607/172437050457304.png" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; width: 579px; height: 483px; " alt="" /><br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />
</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">　　你现在能清楚我在反对长时间的工作和面临死亡威胁的行军了吗？<a href="http://www.jobbole.com/entry.php/252" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); text-decoration: none; ">你的睡眠时间和睡眠质量达标了吗？</a>或 许最近某一天我会告诉你我如何收到叫醒电话（wake up call），这是一个有趣的故事。把猫赶在一起，很容易与在相同的方向下让程序员取得预期的成果这种情况相比较，这是我对我们的人（程序员）又爱又恨的地 方。但我希望过段时候后，所有聪明的程序员要一个明确的立场，坚决消除十分糟糕和违背生产力的业内趋势之一。正如我所提到的，聪明的程序员不喜欢长时间工作，也不会因为迫于压力而加班，他们把更多的时间用于享受生活。</p>
</span></p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/Inspirational/NiDeLaoBanHuiYinWeiNiPinMingBianXieDaiMaErGanXieNiMa.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=21</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[程序员经典语录]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=5" label="技术段子" /> 
	  <updated>2011-04-15T12:26:26+08:00</updated>
	  <published>2011-04-15T12:26:26+08:00</published>
		  <summary type="html"><![CDATA[<p>温家妹子收集的。一定要转一下。也一定要链接一下原文是址：</p>
<div>&nbsp;<a href="http://www.w328.com/?p=524">http://www.w328.com/?p=524</a>
<div>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">程序员版同桌的你：明天你是否会想起，昨天你写的程序，明天你是否还惦记，曾经爱编程的你，领导们都已想不起，曾经加班的你，我也是偶然看程序，才想起同事的你，谁聘了牛B烘烘的你，谁安慰天天加班的你，谁把你的设计做起，谁给你做的升级。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-527" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c5.jpg" alt="" width="440" height="316" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">宝玉便走近黛玉身边坐下，又细细打量一番，因问：&ldquo;妹妹可曾做过开发？&rdquo;黛玉道：&ldquo;不曾有，只会一点HTML.&rdquo;宝玉又道：&ldquo;可想过学JAVA&rdquo;。黛玉便忖度着因他一定是学过JAVA，故问我有也无，因答：我没有，想来做JAVA开发是件罕事，岂能人人都能做的。 宝玉听了登时发作起痴狂病来打开电脑，狠命卸去JDK</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-528" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c6.gif" alt="" width="409" height="269" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">我喜欢优雅和高效的代码。代码逻辑应当直截了当，叫缺陷难以隐藏；尽量减少依赖关系，使之便于维护；依据某种分层战略完善错误处理代码；性能调至最优，省得引诱别人做没规矩的优化，搞出一堆混乱来。整洁的代码只做好一件事。&mdash;-Bjarne Stroustrup</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-529" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c7.jpg" alt="" width="430" height="323" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">有的女人就像Windows，虽然很优秀，但是安全隐患太大。 有的女人就像UNIX 她条件很好，然而不是谁都能玩的起。 有的女人就像C#，长的很漂亮，但是家务活不行。 有的女人就像Java,只需一点付出她就会为你到处服务。 有的女人就像Javascri&#112;t，虽然对她处处小心但最终还是没有结果。欢迎补充？</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-530" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c8.jpg" alt="" width="426" height="469" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">IT人表示屁股上还得纹一个&lt;/body&gt; 。 要不中间来个hello world</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-531" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c9.jpg" alt="" width="440" height="331" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">十年生死两茫茫，写程序，到天亮。千行代码，Bug何处藏。 纵使上线又怎样，朝令改，夕断肠。 领导每天新想法，天天改，日日忙。相顾无言，惟有泪千行。每晚灯火阑珊处，夜难寐，又加班。</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-532" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c10.jpg" alt="" width="440" height="295" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">老婆给当程序员的老公打电话：&ldquo;下班顺路买三个包子带回来，如果看到卖西瓜的，买一个。&rdquo; 当晚，程序员老公手捧一个包子进了家门。。。 老婆怒道：&ldquo;你怎么就买了一个包子？！&rdquo; 老公答曰：&ldquo;因为看到了卖西瓜的。&rdquo;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; "><img class="aligncenter size-full wp-image-533" title="程序员经典语录" src="http://www.w328.com/wp-content/uploads/2011/04/c11.jpg" alt="" width="144" height="134" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " /></p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">&nbsp;</p>
<p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-indent: 2em; font-family: 微软雅黑, 宋体; line-height: 32px; font-size: medium; ">程序员爱情观：爱情就是死循环，一旦执行就陷进去了；爱上一个人，就是内存泄漏&ndash;你永远释放不了；真正爱上一个人的时候，那就是常量限定，永远不会改变；女朋友就是私有变量，只有我这个类才能调用；情人就是指针用的时候一定要注意，要不然就带来巨大的灾难。</p>
</div>
<p>&nbsp;</p>
</div>]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/TechnologyScripts/ChengXuYuanJingDianYuLu.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=20</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[你是一个善于利用时间的人吗？  ]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=4" label="励志段子" /> 
	  <updated>2011-04-13T02:04:25+08:00</updated>
	  <published>2011-04-13T02:04:25+08:00</published>
		  <summary type="html"><![CDATA[　　要很好地完成工作就必须善于利用自己的工作时间。工作是很多的，时间却是有限的。时间是最宝贵的财富。没有时间，计划再好，目标再高，能力再强，也是空的。时间是如此宝贵，但它又是最有伸缩性的―――它可以一瞬即逝，也可以发挥最大的效力。对于生产和商业活动来，就是潜在的资本。在工业史上，经常有这样的事情：仅仅是一天之差，就可以导致一个企业的巨大成功和另一企业的倒闭破产。<br/>　　<br/>　　所以，不懂得利用时间就是最无能的管理者。浪费时间就等于浪费企业的财富。<br/>　　<br/>　　会不会利用时间不是单纯地看工作时间内是否充满了各种工作。有很多管理人员，从早忙到晚，不单在工作时间内挤满了各种工作。而且还在工作时间以外寻找时间继续工作。单纯从这个现象看，并不能表明该管理人员会利用时间。他的工作精神固然是好的，但他还不能称得上是最好的经理，也不能称他是善于利用时间的能手。<br/>　　<br/>　　会不会利用时间，关键在于会不会制定完善的、合理的工作计划。所谓工作计划，就是填写自己和企业的工作时间表―――某年某月某日要做什么事；哪些事先做，哪些事后做°哪个时间内以哪些事为重点；安排哪些时间内做什么事售上都业的目标何时达到；……等等。<br/>　　<br/>　　但是，所有计划地利用工作时并不是要求管理人员把末来的工作时间全部地填满工作内容。有计划地利用工作时间，主要是合理地安排最主要的工作和最关键的问题。这些工作和问题，只要安排得适时和得当，就会像机器的主轴带动整个机器运转那样，促使其他的事情按时完成。<br/>　　<br/>　　因此，真正会利用时间的人，不是把大量时间花于忙乱的工作中，而是用在拟订计划中。能干的管理者，用很多时间去周密地考虑工作计划―――确定工作目标的手段和方法，预定出目标的进程及步骤。他不但在年初这样做，在动手做每件事以前也这样做就是说，在这些能干的管理者看来，大的目标有大的计划，中等程度的工作有中等程度的计划，小的工作则有小的计划。总之，大事小事，都要事先周密考虑。一旦考虑出完整的计划，执行起来就很顺利。表面看来，作计划和考虑问题的时间占用得多了，但实际上，从总耗用时间量来计算，却节省了许多宝贵的-----即压缩时间的流程，充分利用了每个单位的时间。]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/Inspirational/NiShiYiGeShanYuLiYongShiJianDeRenMa.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=19</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[程序出错后 程序员给测试人员的20条高频回复]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=3" label="随便说说" /> 
	  <updated>2011-04-02T22:23:40+08:00</updated>
	  <published>2011-04-02T22:23:40+08:00</published>
		  <summary type="html"><![CDATA[程序员和软件测试员之间的关系无须多言。这些经典回复是国外程序员总结分享的，“全球通用”。<br/>　　20. &#34;That’s weird…&#34; 很奇怪……<br/>　　19. &#34;It’s never done that before.&#34; 以前没这样过的。<br/>　　18. &#34;It worked yesterday.&#34; 昨天还好好的。<br/><br/>17. &#34;How is that possible?&#34; 那怎么可能？（怎么会出问题？）<br/>　　16. &#34;It must be a hardware problem.&#34; 这一定是硬件问题。<br/>　　15. &#34;What did you type in wrong to get it to crash?&#34; 你输入什么东西后才崩溃的？<br/>　　14. &#34;There is something funky in your data.&#34; 你的数据有问题。<br/>　　13. &#34;I haven’t touched that module in weeks!&#34; 我好几个礼拜没动那个程序了！<br/>　　12. &#34;You must have the wrong version.&#34; 你一定在用错误的版本。<br/>　　11. &#34;It’s just some unlucky coincidence.&#34; 这只是凑巧。<br/>　　10. &#34;I can’t test everything!&#34; 我无法测试所有东西。（我的机器环境下，无法测试所有的可能情况。）<br/>　　09. &#34;THIS can’t be the source of THAT.&#34; “这”不可能是问题的原因。<br/>　　08. &#34;It works, but it hasn’t been tested.&#34; 程序能用，不过还没有测试。<br/>　　07. &#34;Somebody must have changed my code.&#34; 一定有人改了我的代码。<br/>　　06. &#34;Did you check for a virus on your system?&#34; 你的电脑扫描病毒了么？<br/>　　05. &#34;Even though it doesn’t work, how does it feel? 即便程序不行了，（你觉得）程序写得如何？<br/>　　04. &#34;You can’t use that version on your system.&#34; 你不能在你系统上使用那个版本的程序。（程序版本和系统有冲突。）<br/>　　03. &#34;Why do you want to do it that way?&#34; 你怎么会想着那样操作啊？<br/>　　02. &#34;Wh&#101;re were you when the program blew up?&#34; 程序崩溃时，你在做什么呢？（做了哪些操作？）<br/>　　01. &#34;It works on my machine&#34; 在我机器上好好的！！！（潜台词：怎么在你那就出问题了呢！！！）<br/>]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/FreeTalk/ChengXuChuCuoHouCheng.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=18</id>
  </entry>	
		
  <entry>
	  <title type="html"><![CDATA[Windows 2003下安装avast!]]></title>
	  <author>
		 <name>醋醋狗</name>
		 <uri>http://lovemx.com/blog/</uri>
		 <email>hncucugo@yahoo.com.cn</email>
	  </author>
	  <category term="" scheme="http://lovemx.com/blog/default.asp?cateID=5" label="技术段子" /> 
	  <updated>2011-03-27T13:27:25+08:00</updated>
	  <published>2011-03-27T13:27:25+08:00</published>
		  <summary type="html"><![CDATA[<p>&nbsp;<span class="Apple-style-span" style="color: rgb(70, 70, 70); font-family: Verdana, 微软雅黑, Arial, 宋体; line-height: 21px; "><img src="http://www.mzwu.com/pic/201010/015.gif" border="0" alt="" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(250, 247, 239); border-right-color: rgb(250, 247, 239); border-bottom-color: rgb(250, 247, 239); border-left-color: rgb(250, 247, 239); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br />
<br />
Windows Server 2003下一安装avast!就会弹出上边提示，百度后知道得修改下注册表相关权限才可以安装，步骤如下：<br />
<br />
①.运行&quot;regedit&quot;打开注册表编辑器；<br />
<br />
②.依次展开&quot;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control&quot;，右键点击ProductOptions项，选择&quot;权限&quot;，拒绝当前登录用户读取权限：<br />
<img src="http://www.mzwu.com/pic/201010/016.gif" border="0" alt="" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(250, 247, 239); border-right-color: rgb(250, 247, 239); border-bottom-color: rgb(250, 247, 239); border-left-color: rgb(250, 247, 239); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; " /><br />
<br />
③.再次安装avast!就可以了：<br />
<img src="http://www.mzwu.com/pic/201010/017.gif" border="0" alt="" title="在新窗口打开图片" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(250, 247, 239); border-right-color: rgb(250, 247, 239); border-bottom-color: rgb(250, 247, 239); border-left-color: rgb(250, 247, 239); margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; cursor: pointer; " /><br />
<br />
安装完后可恢复用户对ProductOptions的读取权限，但下次升级时记得再取消即可。&nbsp;</span></p>
<p>我装完没有去掉那个。然后也升级过了。老实说觉得这个杀软还是不错的。毕竟用了一年多了。而且表现一直良好。更新也够快。不像一些用过的那些自己骗自己的杀软。说得杀掉了。等会又中了。又杀。</p>]]></summary>
	  <link rel="alternate" type="text/html" href="http://lovemx.com/blog/article/TechnologyScripts/Windows2003XiaAnZhuangavast.html" /> 
	  <id>http://lovemx.com/blog/default.asp?id=17</id>
  </entry>	
		
</feed>

