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

<channel>
	<title>刻程</title>
	<atom:link href="http://www.liuhuadong.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.liuhuadong.com</link>
	<description>Life on the run , Dream on the way</description>
	<lastBuildDate>Wed, 10 Mar 2010 11:19:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>不完整宿命论</title>
		<link>http://www.liuhuadong.com/archives/759/index.html</link>
		<comments>http://www.liuhuadong.com/archives/759/index.html#comments</comments>
		<pubDate>Wed, 10 Mar 2010 11:13:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[个人感悟]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=759</guid>
		<description><![CDATA[肯定有一个不知道叫什么名字的神主宰一切,上帝,佛祖,或者女娲,我干脆就叫他老天爷,或者上苍.他安排决定地球上的一切. 比如发明家的发明,是上苍安排发明家小时候的一切,让他学会一切必要的知识,让他养成勤于思考的习惯,然后再让他从事发明工作,最后引导他发明某些东西. 发明家的努力固然重要,但是这一切都是早就设计好的.只是没有人能提前知道罢了.
上面引用的是在sinablog上看到的评论。第一次看到有人持有这样的观点感到有点不可思议，后来再看到很多人都有这样的观点有点惊奇，再后来看到有人持有这样的观点，我甚至都没什么感觉了，到现在再看到有人这样，我甚至觉得他们可爱了。仔细品味一下这个思想，与我在这篇博文里谈到的蚂蚁在多维空间的观点近乎相同，只是前者是通过个人“感觉”出来的东西，我是理性分析出来的罢了。寻找有类此观点的人，我相信我们会成为很好的朋友，虽然我的性格极端反对这种观点。
]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/759/index.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>密码保护：虎年大吉</title>
		<link>http://www.liuhuadong.com/archives/740/index.html</link>
		<comments>http://www.liuhuadong.com/archives/740/index.html#comments</comments>
		<pubDate>Wed, 03 Mar 2010 09:03:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[不知所云]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=740</guid>
		<description><![CDATA[无法提供任何摘要。这是一篇受保护的文章。]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/740/index.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php5.3开始出现的Function ereg() is deprecated Error问题解决办法</title>
		<link>http://www.liuhuadong.com/archives/727/index.html</link>
		<comments>http://www.liuhuadong.com/archives/727/index.html#comments</comments>
		<pubDate>Sun, 28 Feb 2010 01:34:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP/Mysql]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=727</guid>
		<description><![CDATA[PHP 5.3  ereg() 无法正常使用，提示“Function ereg() is deprecated Error”。问题根源是php中有两种正则表示方法，一个是posix，一个是perl，php6打算废除posix的正则表示方法所以后来就加了个preg_match。此问题解决办法很简单，在ereg前加个过滤提示信息符号即可：把ereg()变成@ereg()。这样屏蔽了提示信息，但根本问题还是没有解决，php在5.2版本以前ereg都使用正常，在5.3以后，就要用preg_match来代替ereg。所以就需要变成这样，原来：
ereg(&#34;^[0-9]*$&#34;,$page)
变成：
preg_match(&#34;/^[0-9]*$/&#34;,$page)
特别提醒：posix与perl的很明显的表达区别就是是否加斜杠，所以与ereg相比，后者在正则的前后分别增加了两个&#8221;/&#8221;符号，不能缺少。
Tips:此问题在php5.2之前版本不会出现。
=====================================
好心情不知从何而来，打开窗子暮然发现：下雪了。
=====================================
从蜘蛛发现discuz X在http://www.discuz.org开始测试了
]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/727/index.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>discuz in iphone</title>
		<link>http://www.liuhuadong.com/archives/711/index.html</link>
		<comments>http://www.liuhuadong.com/archives/711/index.html#comments</comments>
		<pubDate>Sat, 27 Feb 2010 05:25:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP/Mysql]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[不知所云]]></category>
		<category><![CDATA[互联网]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=711</guid>
		<description><![CDATA[这两天一直在搞这个，话不多说，先上图：

]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/711/index.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>js中getYear()在不同浏览器中的兼容性及解决方案</title>
		<link>http://www.liuhuadong.com/archives/704/index.html</link>
		<comments>http://www.liuhuadong.com/archives/704/index.html#comments</comments>
		<pubDate>Mon, 22 Feb 2010 03:53:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=704</guid>
		<description><![CDATA[在调试程序时，客户有要求页首需要增加时间显示。显然就用到了Date()中的getYear()来直接显示年份：
var now&#160; = new Date();var year = now.getYear();document.write(year);
IE显示正常，但在firefox和chrome下显示为110年（应该显示为1900+110=2010年），在网上搜索了一下答案，得到结论是IE为了提高兼容性，只要通过Date()取得的年份是两位或三位，那么就认为人的寿命不可能是1900年之多，所以智能的自动增加1900作为显示结果，即用getYear()即可显示为2010。但对于firefox和chrome等遵循标准的浏览器来讲，这样的做法显然有些可笑，于是搜索到这个解决办法：
var now&#160; = new Date();var year = ( now.getYear() &#60; 1900 ) ? ( 1900 + now.getYear() ) : now.getYear();document.write(year);
上面的解决办法是对年份进行判断，小于1900则自动加上以显示正确年份，这样就完全兼容了所有浏览器的年份显示。
其实这里要写的不只是上面的解决方案，最佳解决方案是这样的：getYear()是js1.0标准的旧用法，现在提倡用getFullYear()即可得到完整年份：
var now&#160; = new Date();var year = now.getFullYear();document.write(year);
]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/704/index.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>祝大家虎年如意</title>
		<link>http://www.liuhuadong.com/archives/695/index.html</link>
		<comments>http://www.liuhuadong.com/archives/695/index.html#comments</comments>
		<pubDate>Sat, 13 Feb 2010 13:08:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[不知所云]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=695</guid>
		<description><![CDATA[祝认识我的所有人：虎年吉祥、身体健康、万事如意！我就不再一一发短信了
]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/695/index.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>有希望是幸福的</title>
		<link>http://www.liuhuadong.com/archives/691/index.html</link>
		<comments>http://www.liuhuadong.com/archives/691/index.html#comments</comments>
		<pubDate>Wed, 10 Feb 2010 02:34:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[电影音乐]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=691</guid>
		<description><![CDATA[对阿凡达的期待远远大于其他电影，《阿凡达》仍然一票难求，只有明天再看，今天只好看了《锦衣卫》。对此电影没有写观后感的欲望，影片中只有那些大漠风情的片段深刻的留在脑海&#8212;-那应该是孤独存在的地方。看之前的一些生活中的想法，在影片中似乎找到了解释，恩&#8212;-有希望是幸福的。
下午4点看了阿凡达，影院人员爆满。可惜立体效果没有想象中好，加之个人戴的眼镜与3d眼镜冲突，需要戴两个眼镜看，实在难受。完全没有享受到3d带来的震撼，将来有机会去imax看吧。。
]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/691/index.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>小新闻一则</title>
		<link>http://www.liuhuadong.com/archives/681/index.html</link>
		<comments>http://www.liuhuadong.com/archives/681/index.html#comments</comments>
		<pubDate>Mon, 08 Feb 2010 07:42:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[不知所云]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=681</guid>
		<description><![CDATA[先看新闻一则。
回忆起n年前，许昌某处，全华永普张旭我们一起闲聊的时候，忘了是哪个说的：hd呀，你看人家那个李强……（后面省略）。当时确实不以为然，自从经历了一些事情后，那些邪恶的想法就从来消失在萌芽状态，感觉这些想法有些不靠谱。我应该在内心里感谢大学里面的老师们，给我了很好的学习机会和很多帮助；感谢张旭和我一起体验第一次坐电梯的感觉；感谢在cm工作的几年里接受的正面的文化熏陶，使我受益匪浅；感谢几位好朋友一起交流而意识到的想法。看到这个新闻后我就在想，如果我当时听取了那个建议，那现在这个新闻中是否就会出现我的名字了。
于是，我的大脑立刻又出现了那句我已经给很多人讲过的话：小胜在技巧，中胜在实力，大胜在人格。
如今似乎又回到了刚毕业的状态，又要做出一些选择，只不过在选择中承受了更大的压力。好的是，目标明朗了，那点压力又能算得了什么呢。与以前的虚无的梦想相比，现在的方向似乎更加明确了一点，目标更加清晰一些。早该到来的汹涌的压力们，是迎接你们到来的时候了。
在通往陌生城市的路上，看着窗外一波一波伴随着火车前进而倒退的风景，我在心里对自己说：hi，我回来了。
]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/681/index.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>密码保护：珍藏文章</title>
		<link>http://www.liuhuadong.com/archives/678/index.html</link>
		<comments>http://www.liuhuadong.com/archives/678/index.html#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:35:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[不知所云]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=678</guid>
		<description><![CDATA[无法提供任何摘要。这是一篇受保护的文章。]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/678/index.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP基于二分法的手机号码归属查询与传统查询效率比较</title>
		<link>http://www.liuhuadong.com/archives/655/index.html</link>
		<comments>http://www.liuhuadong.com/archives/655/index.html#comments</comments>
		<pubDate>Mon, 01 Feb 2010 09:52:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP/Mysql]]></category>

		<guid isPermaLink="false">http://www.liuhuadong.com/?p=655</guid>
		<description><![CDATA[作者：刘华栋(xhat)，2010年2月，个人原创，转载请注明出处
出于对算法对于系统的影响的好奇，决定实验性的在实际生产环境中研究一下算法对系统效率的影响。二分法最重要的是对有序数据的查询定位，例如手机号码就是一个很贴切的有序排列的数据例子。
如果数据量很小，例如只有10条有序数据，要查询其中的第9条数据，轮询查询需要查询9次确定结果，二分法查询次数为3次（分别是匹配第5、8、9条记录）即可确定结果。数据量越大，二分法所带来的效率就是程2的阶乘递增，可以大大提升服务器的运行效率、提升用户等待时间、节省服务器资源。
实验环境：LAMP
实验数据：国内手机号码归属地。手机号码前7位代表一个号段，生成从1300000到1590000之间的所有号段按从小到大排列，大约30万条数据。
传统查询：对于任意手机号码，截取前7位，从数据库中第一条记录开始循环向下匹配，如果对照，则返回查询结果。
flock($fp,LOCK_SH);$note = fread($fp,filesize('./data.php'));&#160; //读取数据fclose($fp);$note = explode(&#34;\n&#34;,$note);array_pop($note);array_shift($note);$num = count($note);$_data = '';//循环查询开始for($i=1;$i&#60;$num;$i++){&#160;&#160; &#160;$row = explode(&#34; &#34;,$note[$i]);&#160;&#160; &#160;if($m == $row[0]){&#160;&#160; &#160; &#160; &#160;$_data = $row;&#160;&#160; &#160; &#160; &#160;break;&#160;&#160; &#160;}}
实测结果：最快0.03512秒、最慢0.63043秒、平均查询用时约为0.4秒。
二分法查询：对于任意手机号码，截取前7位。首先匹配数据库中最中间的第100000条数据，根据二分法原则，若匹配结果比中间值大，重新选择第二次匹配第100000到200000的中间值&#8212;-第150000条数据。以此类推，直到查询到最后一位正确的值返回结果。那么每次的查询次数小于或等于17次。
flock($fp,LOCK_SH);$note = fread($fp,filesize('./data.php'));&#160; &#160; &#160;//读取数据fclose($fp);$note = explode(&#34;\n&#34;,$note);array_pop($note);array_shift($note);$num = count($note);&#160; &#160; &#160;//统计数据库总记录数$_data = '';$low = 0;&#160; &#160; &#160;//二分法两端点变量$hight = $num;while($m &#60; 1599999){&#160;&#160; &#160;$num = ceil(($hight + $low)/2);&#160;&#160; &#160;$row = explode(&#34; &#34;,$note[$num]);&#160;&#160; [...]]]></description>
		<wfw:commentRss>http://www.liuhuadong.com/archives/655/index.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
