<?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>Francis&#039; Blog</title>
	<atom:link href="http://blog.francistm.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.francistm.com</link>
	<description>无名小博</description>
	<lastBuildDate>Mon, 08 Mar 2010 03:12:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>回家了</title>
		<link>http://blog.francistm.com/archives/274.html</link>
		<comments>http://blog.francistm.com/archives/274.html#comments</comments>
		<pubDate>Sun, 17 Jan 2010 06:00:19 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[自娱自乐]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=274</guid>
		<description><![CDATA[回家了，由于地理位置比较特殊，所以会在网络上消失一段时间。大家不用担心……
（此文为自动发布）
Random PostsIE6 的时代过去啦又是一年反编译迅雷链接的小工具瑞星卡卡“安全”浏览器又一顿折腾 Grub4Dos]]></description>
			<content:encoded><![CDATA[<p>回家了，由于地理位置比较特殊，所以会在网络上消失一段时间。大家不用担心……</p>
<p>（此文为自动发布）</p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/226.html" title="从今开始专心学习技术">从今开始专心学习技术</a></li><li><a href="http://blog.francistm.com/archives/221.html" title="又重来了">又重来了</a></li><li><a href="http://blog.francistm.com/archives/151.html" title="瑞星卡卡“安全”浏览器">瑞星卡卡“安全”浏览器</a></li><li><a href="http://blog.francistm.com/archives/257.html" title="开始VIM">开始VIM</a></li><li><a href="http://blog.francistm.com/archives/78.html" title="Grub 引导 Slax">Grub 引导 Slax</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/274.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>iPod Touch 入手了</title>
		<link>http://blog.francistm.com/archives/273.html</link>
		<comments>http://blog.francistm.com/archives/273.html#comments</comments>
		<pubDate>Thu, 14 Jan 2010 18:06:33 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[苹果]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=273</guid>
		<description><![CDATA[感谢酋长，iPod Touch入手了。
就一句话：
用iPhone的人都不好意思跟其他人说iPhone不好。
如果你没有玩过Linux，不知道SSH、FTP或者DAV，就不要考虑iPhone了。相比之下，Nokia的智能机反而更优秀。
Random PostsWine on Ubuntu经典FPS － COD4开始VIMWin 上安装 SubVersion迷上了UPLink]]></description>
			<content:encoded><![CDATA[<p>感谢酋长，iPod Touch入手了。</p>
<p>就一句话：</p>
<blockquote><p>用iPhone的人都不好意思跟其他人说iPhone不好。</p></blockquote>
<p>如果你没有玩过Linux，不知道SSH、FTP或者DAV，就不要考虑iPhone了。相比之下，Nokia的智能机反而更优秀。</p>
<h3  class="related_post_title">Random Posts</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/14.html" title="成功安装Ubuntu到移动硬盘">成功安装Ubuntu到移动硬盘</a></li><li><a href="http://blog.francistm.com/archives/87.html" title="无聊闲扯-6/1">无聊闲扯-6/1</a></li><li><a href="http://blog.francistm.com/archives/212.html" title="编写的首个Flex项目就此下岗">编写的首个Flex项目就此下岗</a></li><li><a href="http://blog.francistm.com/archives/156.html" title="OFP2 &#8211; Dragon Rising">OFP2 &#8211; Dragon Rising</a></li><li><a href="http://blog.francistm.com/archives/173.html" title="Akismet 新增统计视图">Akismet 新增统计视图</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/273.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>经典FPS - COD6</title>
		<link>http://blog.francistm.com/archives/272.html</link>
		<comments>http://blog.francistm.com/archives/272.html#comments</comments>
		<pubDate>Sat, 09 Jan 2010 16:09:55 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[游戏]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=272</guid>
		<description><![CDATA[不得不承认，现代战争(ModernWarfare)真是个好系列，前所未有的好游戏。
画面和游戏性我就不多说了，还是那么的经典。即使你不喜欢游戏，也完全可以把它当作一款现代战争的小说来阅读。


这一代玩的是俄语版，整个故事情节还是在查阅了字典以及几位舍友的讨论下理清的。这一代的故事更加错综复杂，更加紧张、刺激、感人。
从万丈深渊的哈萨克斯坦雪山到俄国潜艇基地，再到美国华盛顿。不少新的面孔加入，同时也有几位浴血奋战的战友离开。
延续COD4的故事，俄国内战结束，居然是反叛军获胜。军火商Zakhaev被树立为新的俄罗斯英雄。
故事开始发生于阿富汗：
美军75游骑兵团二等兵Allen在阿富汗作战，由于表现不错，被前线指挥官将军Shepherd选中，去做俄罗斯激进组织Ultranationalists的卧底。
莫斯科机场（个人认为SVO2）：
Allen被派去做卧底，和恐怖分子头目Makarov在莫斯科机场实时恐怖活动。撤离时，不知道因为什么原因身份暴露，被Makarov击中，阵亡在莫斯科机场（个人认为是SVO2）。尸体被俄国军队发现，并且发现了他美国人的身份。由此引发了美俄大战。
哈萨克斯坦，俄国空军机场：
上校MacTavish（四代中的Soap）带领新的手下中士Roach执行任务，去机场拿回美军坠落卫星上的敌我识别模块，虽然中途被俄军团团围住，但成功逃脱，顺利完成任务。
美国华盛顿附近：
虽然Soap和Roach行动成功，但俄军已经成功破解ACS模块，绕过了美国的防御系统。大量俄国精锐部队空降美国。中士Foley带领麾下奋力地抗。与俄国空降部队苦战。
巴西：
TaskForce141追查此次事件，追查到了巴西的两个军火商，但是没有进展。
俄国某油井：
TaskForce141接到任务解救人质，发现整个油井都被恐怖组织所控制，并且恐怖分子配有对空导弹系统。消灭了所有的恐怖分子后得到消息，直接乘飞机前往俄罗斯某处的古堡。
俄国某古堡：
从天而降，一直杀入古堡底层。发现关押在这里的犯人居然是Cpt.Price。两人重逢，激动万分。Cpt.Soap当场归还了随身携带的那把手枪（上作中Cpt.Price最后时刻丢给他的那把）。
俄国某处Makarove的藏身处、俄国某潜艇基地：
Cpt.Price自己决定兵分两路，由Ghost和Sgt.Roach去搜查Makarov的住处，自己和Cpt.Soap去俄国潜艇基地，用核弹的EMP来暴力终止美俄两国的战争。
Ghost与Sgt.Roach经过苦战，终于得到了数据，美军前来接应。没想到将军Shepherd才是最终的幕后Boss，将Ghost于Roach打到后，用汽油点燃。
Cpt.Price和Cpt.Soap这里成功发射核弹，但是指控将军Shepherd的证据却被夺走。

美国华盛顿：
中士Foley奋力地抗。但敌军过于强大，身陷险境。就在这时，从俄国海军基地发射的核弹在华盛顿上空爆炸。核弹的EMP致使所有电子装备全部失效，俄国的空军优势瞬间全无，美军开始反击。但总指挥部认为华盛顿已失守，准备进行毁灭性的空军火力打击。就在战斗机飞临白宫头顶之时，夺回了白宫，释放信号弹取消了这次空军的打击行动。
阿富汗某废弃机库：
出来混迟早是要还的，在失去了Roach和Ghost之后，Cpt.Price和Cpt.Soap誓要为他们报仇，追查出幕后真凶。与他们为敌的全部是Gen.Shepherd手下的精锐部队，两人穷追不舍，终于找到了Gen.Shepherd。
在Gen.Shepherd部下与Makarov部下的混战中，Cpt.Price和Cpt.Soap逃离了这里。
阿富汗某秘密军事基地：
Makarov也想干掉Gen.Shepherd，但是念在Zakhaev的旧仇上，仅仅给予了情报和装备上的支援。
两人苦苦前进，终于追到了Gen.Shepherd。眼看就要追到了幕后真凶。这紧急关头，一架CH-47将将军接走。Cpt.Price一发M203榴弹，将没飞多远的直升机打了下来，两人也撞到了岸边。
没想到Gen.Shepherd宝刀未老，一下将Cpt.Soap用刀刺倒在地。就在掏出手枪，即将开枪的瞬间，Cpt.Price扑来，再次救了Cpt.Soap一命。
一团混乱中，Cpt.Price与Gen.Shepherd三人撕打在一团。被刀刺中的Cpt.Soap拔出了身上的刀，飞向Gen.Shepherd。
一切都平静下来，Nikolai驾驶着MH-6，将受伤的两人接走。
故事依然未完待续……
Related PostWCG2009 首日公开赛结束世界变化太快了闪点行动2 失望至极回归 War3OFP2 &#8211; Dragon Rising]]></description>
			<content:encoded><![CDATA[<p>不得不承认，现代战争(ModernWarfare)真是个好系列，前所未有的好游戏。<br />
画面和游戏性我就不多说了，还是那么的经典。即使你不喜欢游戏，也完全可以把它当作一款现代战争的小说来阅读。</p>
<p><span id="more-272"></span>
<p style="text-align:center;"><img src="http://pic.yupoo.com/francis-tm/170598abffdd/medium.jpg" alt=""/></p>
<p>这一代玩的是俄语版，整个故事情节还是在查阅了字典以及几位舍友的讨论下理清的。这一代的故事更加错综复杂，更加紧张、刺激、感人。<br />
从万丈深渊的哈萨克斯坦雪山到俄国潜艇基地，再到美国华盛顿。不少新的面孔加入，同时也有几位浴血奋战的战友离开。</p>
<p><a href="http://blog.francistm.com/archives/135.html">延续COD4的故事</a>，俄国内战结束，居然是反叛军获胜。军火商Zakhaev被树立为新的俄罗斯英雄。</p>
<p>故事开始发生于阿富汗：</p>
<blockquote><p>美军75游骑兵团二等兵Allen在阿富汗作战，由于表现不错，被前线指挥官将军Shepherd选中，去做俄罗斯激进组织Ultranationalists的卧底。</p></blockquote>
<p>莫斯科机场（个人认为SVO2）：</p>
<blockquote><p>Allen被派去做卧底，和恐怖分子头目Makarov在莫斯科机场实时恐怖活动。撤离时，不知道因为什么原因身份暴露，被Makarov击中，阵亡在莫斯科机场（个人认为是SVO2）。尸体被俄国军队发现，并且发现了他美国人的身份。由此引发了美俄大战。</p></blockquote>
<p>哈萨克斯坦，俄国空军机场：</p>
<blockquote><p>上校MacTavish（四代中的Soap）带领新的手下中士Roach执行任务，去机场拿回美军坠落卫星上的敌我识别模块，虽然中途被俄军团团围住，但成功逃脱，顺利完成任务。</p></blockquote>
<p>美国华盛顿附近：</p>
<blockquote><p>虽然Soap和Roach行动成功，但俄军已经成功破解ACS模块，绕过了美国的防御系统。大量俄国精锐部队空降美国。中士Foley带领麾下奋力地抗。与俄国空降部队苦战。</p></blockquote>
<p>巴西：</p>
<blockquote><p>TaskForce141追查此次事件，追查到了巴西的两个军火商，但是没有进展。</p></blockquote>
<p>俄国某油井：</p>
<blockquote><p>TaskForce141接到任务解救人质，发现整个油井都被恐怖组织所控制，并且恐怖分子配有对空导弹系统。消灭了所有的恐怖分子后得到消息，直接乘飞机前往俄罗斯某处的古堡。</p></blockquote>
<p>俄国某古堡：</p>
<blockquote><p>从天而降，一直杀入古堡底层。发现关押在这里的犯人居然是Cpt.Price。两人重逢，激动万分。Cpt.Soap当场归还了随身携带的那把手枪（上作中Cpt.Price最后时刻丢给他的那把）。</p></blockquote>
<p>俄国某处Makarove的藏身处、俄国某潜艇基地：</p>
<blockquote><p>Cpt.Price自己决定兵分两路，由Ghost和Sgt.Roach去搜查Makarov的住处，自己和Cpt.Soap去俄国潜艇基地，用核弹的EMP来暴力终止美俄两国的战争。<br />
Ghost与Sgt.Roach经过苦战，终于得到了数据，美军前来接应。没想到将军Shepherd才是最终的幕后Boss，将Ghost于Roach打到后，用汽油点燃。<br />
Cpt.Price和Cpt.Soap这里成功发射核弹，但是指控将军Shepherd的证据却被夺走。
</p></blockquote>
<p>美国华盛顿：</p>
<blockquote><p>中士Foley奋力地抗。但敌军过于强大，身陷险境。就在这时，从俄国海军基地发射的核弹在华盛顿上空爆炸。核弹的EMP致使所有电子装备全部失效，俄国的空军优势瞬间全无，美军开始反击。但总指挥部认为华盛顿已失守，准备进行毁灭性的空军火力打击。就在战斗机飞临白宫头顶之时，夺回了白宫，释放信号弹取消了这次空军的打击行动。</p></blockquote>
<p>阿富汗某废弃机库：</p>
<blockquote><p>出来混迟早是要还的，在失去了Roach和Ghost之后，Cpt.Price和Cpt.Soap誓要为他们报仇，追查出幕后真凶。与他们为敌的全部是Gen.Shepherd手下的精锐部队，两人穷追不舍，终于找到了Gen.Shepherd。<br />
在Gen.Shepherd部下与Makarov部下的混战中，Cpt.Price和Cpt.Soap逃离了这里。</p></blockquote>
<p>阿富汗某秘密军事基地：</p>
<blockquote><p>Makarov也想干掉Gen.Shepherd，但是念在Zakhaev的旧仇上，仅仅给予了情报和装备上的支援。<br />
两人苦苦前进，终于追到了Gen.Shepherd。眼看就要追到了幕后真凶。这紧急关头，一架CH-47将将军接走。Cpt.Price一发M203榴弹，将没飞多远的直升机打了下来，两人也撞到了岸边。<br />
没想到Gen.Shepherd宝刀未老，一下将Cpt.Soap用刀刺倒在地。就在掏出手枪，即将开枪的瞬间，Cpt.Price扑来，再次救了Cpt.Soap一命。<br />
一团混乱中，Cpt.Price与Gen.Shepherd三人撕打在一团。被刀刺中的Cpt.Soap拔出了身上的刀，飞向Gen.Shepherd。<br />
一切都平静下来，Nikolai驾驶着MH-6，将受伤的两人接走。</p></blockquote>
<p>故事依然未完待续……</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/256.html" title="WCG2009 首日公开赛结束">WCG2009 首日公开赛结束</a></li><li><a href="http://blog.francistm.com/archives/252.html" title="世界变化太快了">世界变化太快了</a></li><li><a href="http://blog.francistm.com/archives/249.html" title="闪点行动2 失望至极">闪点行动2 失望至极</a></li><li><a href="http://blog.francistm.com/archives/189.html" title="回归 War3">回归 War3</a></li><li><a href="http://blog.francistm.com/archives/156.html" title="OFP2 &#8211; Dragon Rising">OFP2 &#8211; Dragon Rising</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/272.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>谁说PHP很烂</title>
		<link>http://blog.francistm.com/archives/270.html</link>
		<comments>http://blog.francistm.com/archives/270.html#comments</comments>
		<pubDate>Fri, 08 Jan 2010 02:27:14 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=270</guid>
		<description><![CDATA[今天看到Harry的Twitter上，Reply的一个链接，说“以前的PHP很烂”。这类的看的也不是一次两次了。虽然我不是什么高手，我还是忍不住说几句，PHP有那么烂么？
（所有代码测试环境： PHP 5.2.10）
规范不严格？


if&#40;$name == 'francis'&#41;
&#123;
    echo 'I am francis';
    //标准括号形式
&#125;
&#160;
if&#40;$name == 'francis'&#41;:
    echo 'I am francis';
    //类似Python的缩进式
endif;
&#160;
if&#40;$name == 'francis'&#41;
    echo 'I am francis';
//单行也可以省略括号

虽然这些代码很弱智，但是你可以用其中任何一个顺手的方式来写，执行的结果都是一样的，这到底是规范不严格还是自由灵活？

变量定义不严格？


$age = 20;
$name = 'francis';
echo &#34;I'm {$name} and {$age} years old.';

字符串和整数变量就这样随意的加在一起了？的确不严格啊，但是不是更便于字符串输出？如果非要加一个变量类型，也不是不行。

$age = &#40;Integer&#41;$_GET&#91;'age'&#93;;
$name = &#40;String&#41;$_GET&#91;'name'&#93;;
echo &#34;I'm {$name} and [...]]]></description>
			<content:encoded><![CDATA[<p>今天看到<a href="http://twitter.com/harryxu/statuses/7500666388">Harry的Twitter上</a>，Reply的一个<a href="http://blog.ez2learn.com/2010/01/08/old-php-sucks/">链接，说“以前的PHP很烂”</a>。这类的看的也不是一次两次了。虽然我不是什么高手，我还是忍不住说几句，PHP有那么烂么？</p>
<p><span id="more-270"></span>（所有代码测试环境： PHP 5.2.10）<br />
<strong>规范不严格？</strong></p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'francis'</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'I am francis'</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//标准括号形式</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'francis'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'I am francis'</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">//类似Python的缩进式</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'francis'</span><span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'I am francis'</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">//单行也可以省略括号</span></pre></div></div>

<p>虽然这些代码很弱智，但是你可以用其中任何一个顺手的方式来写，执行的结果都是一样的，这到底是规范不严格还是自由灵活？
</p></blockquote>
<p><strong>变量定义不严格？</strong></p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #000088;">$age</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'francis'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;I'm <span style="color: #006699; font-weight: bold;">{$name}</span> and <span style="color: #006699; font-weight: bold;">{$age}</span> years old.';</span></pre></div></div>

<p>字符串和整数变量就这样随意的加在一起了？的确不严格啊，但是不是更便于字符串输出？如果非要加一个变量类型，也不是不行。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #000088;">$age</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Integer<span style="color: #009900;">&#41;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'age'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$name</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;I'm <span style="color: #006699; font-weight: bold;">{$name}</span> and <span style="color: #006699; font-weight: bold;">{$age}</span> years old.&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>这样有什么意义，真搞不懂……</p></blockquote>
<p><strong>结构混乱？</strong></p>
<blockquote>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #000088;">$person</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$person</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'age'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$person</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'francis'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;I'm <span style="color: #006699; font-weight: bold;">{$person['name']}</span> and <span style="color: #006699; font-weight: bold;">{$person['age']}</span> years old.&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>这样是很乱，双引号套单引号，尖括号套方括号。当然，结构也不是不可以有：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #000000; font-weight: bold;">class</span> Person
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$age</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$age</span><span style="color: #339933;">,</span> <span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">age</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Integer<span style="color: #009900;">&#41;</span><span style="color: #000088;">$age</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>String<span style="color: #009900;">&#41;</span><span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sayHello<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;I'm <span style="color: #006699; font-weight: bold;">{$this-&gt;name}</span> and <span style="color: #006699; font-weight: bold;">{$this-&gt;age}</span> years old.&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000088;">$me</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Person<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'francis'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$me</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sayHello</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>非要这样写，C/C++/Java的OOP狂人才觉得爽么？
</p></blockquote>
<p><strong>运行效率低？</strong></p>
<blockquote><p>我应该不会写出一个要循环读取数据库上万次的程序，即使需要如此大量且高效的读写数据，我也会用本地文件作缓存的……</p></blockquote>
<p>还有太多太多，不要随便说一个语言多么的烂。说他烂，是因为你不了解他。<br />
唉，半夜失眠，一不小心又说了很多疯话，大家见谅……<br />
<!--more--></p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/269.html" title="失败的09年">失败的09年</a></li><li><a href="http://blog.francistm.com/archives/263.html" title="PHP中引用路径的解决">PHP中引用路径的解决</a></li><li><a href="http://blog.francistm.com/archives/261.html" title="有趣的PHP判断">有趣的PHP判断</a></li><li><a href="http://blog.francistm.com/archives/253.html" title="写了一周的PHP">写了一周的PHP</a></li><li><a href="http://blog.francistm.com/archives/252.html" title="世界变化太快了">世界变化太快了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/270.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>失败的09年</title>
		<link>http://blog.francistm.com/archives/269.html</link>
		<comments>http://blog.francistm.com/archives/269.html#comments</comments>
		<pubDate>Thu, 31 Dec 2009 22:56:26 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[自娱自乐]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[俄国]]></category>
		<category><![CDATA[学校]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=269</guid>
		<description><![CDATA[引用一句老话：记得我的08年就挺失败的，没想到09年也同样的失败。
好在今年可以回家过春节，倒计时11天开始。
回顾09：

虽然进了传说中的大一，但俄国的大学很让我真的很失望；
一直想学Zend Framework，可因为种种原因还是没学会；
感谢Wopus.Org的各位前辈，教会了我很多东西；

展望10：

学会Zend Framwork；
学习Objective-C；
找一个实践的机会；

唉，一不小心又说了这么多疯话。
Related Post谁说PHP很烂PHP中引用路径的解决有趣的PHP判断写了一周的PHP世界变化太快了]]></description>
			<content:encoded><![CDATA[<p>引用一句老话：记得<a href="http://blog.francistm.com/archives/185.html">我的08年就挺失败</a>的，没想到09年也同样的失败。<br />
好在今年可以回家过春节，倒计时11天开始。</p>
<p><span id="more-269"></span>回顾09：</p>
<ul>
<li>虽然进了传说中的大一，但俄国的大学很让我真的很失望；</li>
<li>一直想学Zend Framework，可因为种种原因还是没学会；</li>
<li>感谢<a href="http://www.wopus.org">Wopus.Org</a>的各位前辈，教会了我很多东西；</li>
</ul>
<p>展望10：</p>
<ul>
<li>学会Zend Framwork；</li>
<li>学习Objective-C；</li>
<li>找一个实践的机会；</li>
</ul>
<p>唉，一不小心又说了这么多疯话。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/270.html" title="谁说PHP很烂">谁说PHP很烂</a></li><li><a href="http://blog.francistm.com/archives/263.html" title="PHP中引用路径的解决">PHP中引用路径的解决</a></li><li><a href="http://blog.francistm.com/archives/261.html" title="有趣的PHP判断">有趣的PHP判断</a></li><li><a href="http://blog.francistm.com/archives/253.html" title="写了一周的PHP">写了一周的PHP</a></li><li><a href="http://blog.francistm.com/archives/252.html" title="世界变化太快了">世界变化太快了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/269.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Adobe AIR 程序维护</title>
		<link>http://blog.francistm.com/archives/268.html</link>
		<comments>http://blog.francistm.com/archives/268.html#comments</comments>
		<pubDate>Thu, 24 Dec 2009 21:50:23 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=268</guid>
		<description><![CDATA[Linux下的Adobe AIR 1.5 表现还算不错，已经可以和Windows下的相提并论了。但是由于权限机制不同、目录结构不同等等问题，维护起来还是有很大差异的。
安装 Adobe AIR 1.5：

cd ~/
wget http://airdownload.adobe.com/air/lin/download/latest/AdobeAIRInstaller.bin
chmod +x ./AdobeAIRInstaller.bin
./AdobeAIRInstaller.bin

然后按照步骤一步一步操作即可。（中途需要管理员权限）
添加AIR程序：
在安装了AIR Runtime之后，直接双击AIR程序包即可出现安装向导。
删除AIR程序：
假设所有的AIR程序都安装在 /opt/AIR/* ；

dpkg -S /opt/AIR/*

这样即可得到每个AIR程序的包名称，例如删除twhirl。

dpkg -S /opt/AIR/*
#会得到返回结果
#de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1: /opt/AIR/twhirl
dpkg -P de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1

这样即可删除twhirl。
如果我们不慎删除了这个包，会出现AIR无法重新安装的情况。
解决方法：
搜索相关包，然后删除所有配置文件即可。
例如，我们已经破坏了twhirl的程序，出现了不能运行也无法重新安装，用下面的方法：

dpkg -l &#124; grep twhirl
#会得到返回结果
#de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1: /opt/AIR/twhirl
dpkg -P de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1

这样在删除了twhirl的参与配置文件之后，便可以重新安装了。
Related Post小试 CloneZilla又回到了Ubuntu开始VIM编写的首个Flex项目就此下岗Weekend Session &#8211; 3]]></description>
			<content:encoded><![CDATA[<p>Linux下的Adobe AIR 1.5 表现还算不错，已经可以和Windows下的相提并论了。但是由于权限机制不同、目录结构不同等等问题，维护起来还是有很大差异的。</p>
<p><span id="more-268"></span>安装 Adobe AIR 1.5：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>airdownload.adobe.com<span style="color: #000000; font-weight: bold;">/</span>air<span style="color: #000000; font-weight: bold;">/</span>lin<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>latest<span style="color: #000000; font-weight: bold;">/</span>AdobeAIRInstaller.bin
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x .<span style="color: #000000; font-weight: bold;">/</span>AdobeAIRInstaller.bin
.<span style="color: #000000; font-weight: bold;">/</span>AdobeAIRInstaller.bin</pre></div></div>

<p>然后按照步骤一步一步操作即可。（中途需要管理员权限）</p>
<p>添加AIR程序：<br />
在安装了AIR Runtime之后，直接双击AIR程序包即可出现安装向导。</p>
<p>删除AIR程序：<br />
假设所有的AIR程序都安装在 /opt/AIR/* ；</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-S</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>AIR<span style="color: #000000; font-weight: bold;">/*</span></pre></div></div>

<p>这样即可得到每个AIR程序的包名称，例如删除twhirl。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-S</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>AIR<span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #666666; font-style: italic;">#会得到返回结果</span>
<span style="color: #666666; font-style: italic;">#de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1: /opt/AIR/twhirl</span>
<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-P</span> de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1</pre></div></div>

<p>这样即可删除twhirl。</p>
<p>如果我们不慎删除了这个包，会出现AIR无法重新安装的情况。<br />
解决方法：<br />
搜索相关包，然后删除所有配置文件即可。<br />
例如，我们已经破坏了twhirl的程序，出现了不能运行也无法重新安装，用下面的方法：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-l</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> twhirl
<span style="color: #666666; font-style: italic;">#会得到返回结果</span>
<span style="color: #666666; font-style: italic;">#de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1: /opt/AIR/twhirl</span>
<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-P</span> de.makesoft.twhirl.0ea062bc275e7ed1e6ec3762effd73c7158adf33.1</pre></div></div>

<p>这样在删除了twhirl的参与配置文件之后，便可以重新安装了。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/266.html" title="小试 CloneZilla">小试 CloneZilla</a></li><li><a href="http://blog.francistm.com/archives/265.html" title="又回到了Ubuntu">又回到了Ubuntu</a></li><li><a href="http://blog.francistm.com/archives/257.html" title="开始VIM">开始VIM</a></li><li><a href="http://blog.francistm.com/archives/212.html" title="编写的首个Flex项目就此下岗">编写的首个Flex项目就此下岗</a></li><li><a href="http://blog.francistm.com/archives/200.html" title="Weekend Session &#8211; 3">Weekend Session &#8211; 3</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/268.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>K2 1.0 正式版发布</title>
		<link>http://blog.francistm.com/archives/267.html</link>
		<comments>http://blog.francistm.com/archives/267.html#comments</comments>
		<pubDate>Tue, 22 Dec 2009 23:35:57 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=267</guid>
		<description><![CDATA[看到K2 1.0发布的消息，激动坏了，比前几天看到WP2.9发布还要激动。
不多说了，喜欢K2的朋友们快更新吧。
Related Post写了一周的PHP终于完成CleanOption的汉化又重来了升级至WP2.8有网上了]]></description>
			<content:encoded><![CDATA[<p>看到<a href="http://getk2.com/2009/12/k2-1-0/">K2 1.0发布的消息</a>，激动坏了，比前几天看到<a href="http://www.wopus.org/wordpress-news/wordpress-29-news/1873.html">WP2.9发布</a>还要激动。</p>
<p>不多说了，喜欢K2的朋友们快更新吧。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/253.html" title="写了一周的PHP">写了一周的PHP</a></li><li><a href="http://blog.francistm.com/archives/243.html" title="终于完成CleanOption的汉化">终于完成CleanOption的汉化</a></li><li><a href="http://blog.francistm.com/archives/221.html" title="又重来了">又重来了</a></li><li><a href="http://blog.francistm.com/archives/182.html" title="升级至WP2.8">升级至WP2.8</a></li><li><a href="http://blog.francistm.com/archives/178.html" title="有网上了">有网上了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/267.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>小试 CloneZilla</title>
		<link>http://blog.francistm.com/archives/266.html</link>
		<comments>http://blog.francistm.com/archives/266.html#comments</comments>
		<pubDate>Tue, 22 Dec 2009 15:14:29 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=266</guid>
		<description><![CDATA[一直在找一个Linux下的备份软件，可是Linux下高手太多，而且都对tar有一种独特的感情，大家都是直接用tar来备份系统。用tar来备份，速度和压缩率都很不错。但是功能很少，不能算是一个真正的备份工具。
偶然看见有个台湾做的开源项目再生龙(CloneZilla)。这是一个基于Debian的发行版，所以功能和稳定性来说，都不落后于Ghost这种商业软件。软件是全中文的，一用就会。
为了数据的安全，软件本身只能将镜像恢复至原始分区。如果分区大小和镜像不相符，将会报错。仔细看了下FAQ，才找到了手动解决的办法。

su
mount /dev/sdb /home/partimag
cat /home/partimag/backup/sdxxx &#124; gzip -d -c &#124; partclone.extx -r -C -o /dev/sdxxx -

这样，可以手动将镜像backup下的某个镜像强制还原至/dev/sdxxx这个分区，而不用考虑分区大小等问题。
有兴趣可以参考下面的网站：
CloneZilla.Org
PartClone.Org
Related PostAdobe AIR 程序维护又回到了Ubuntu开始VIMWeekend Session &#8211; 3NTFS中创建文件链接]]></description>
			<content:encoded><![CDATA[<p>一直在找一个Linux下的备份软件，可是Linux下高手太多，而且都对tar有一种独特的感情，大家都是直接用tar来备份系统。用tar来备份，速度和压缩率都很不错。但是功能很少，不能算是一个真正的备份工具。</p>
<p><span id="more-266"></span>偶然看见有个台湾做的开源项目再生龙(CloneZilla)。这是一个基于Debian的发行版，所以功能和稳定性来说，都不落后于Ghost这种商业软件。软件是全中文的，一用就会。</p>
<p>为了数据的安全，软件本身只能将镜像恢复至原始分区。如果分区大小和镜像不相符，将会报错。仔细看了下FAQ，才找到了手动解决的办法。</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #c20cb9; font-weight: bold;">su</span>
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>partimag
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>partimag<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>sdxxx <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-d</span> <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">|</span> partclone.extx <span style="color: #660033;">-r</span> <span style="color: #660033;">-C</span> <span style="color: #660033;">-o</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdxxx -</pre></div></div>

<p>这样，可以手动将镜像backup下的某个镜像强制还原至/dev/sdxxx这个分区，而不用考虑分区大小等问题。</p>
<p>有兴趣可以参考下面的网站：<br />
<a href="http://clonezilla.org/">CloneZilla.Org</a><br />
<a href="http://partclone.org/">PartClone.Org</a></p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/268.html" title="Adobe AIR 程序维护">Adobe AIR 程序维护</a></li><li><a href="http://blog.francistm.com/archives/265.html" title="又回到了Ubuntu">又回到了Ubuntu</a></li><li><a href="http://blog.francistm.com/archives/257.html" title="开始VIM">开始VIM</a></li><li><a href="http://blog.francistm.com/archives/200.html" title="Weekend Session &#8211; 3">Weekend Session &#8211; 3</a></li><li><a href="http://blog.francistm.com/archives/193.html" title="NTFS中创建文件链接">NTFS中创建文件链接</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/266.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>又回到了Ubuntu</title>
		<link>http://blog.francistm.com/archives/265.html</link>
		<comments>http://blog.francistm.com/archives/265.html#comments</comments>
		<pubDate>Thu, 17 Dec 2009 01:16:45 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=265</guid>
		<description><![CDATA[Fedora其实很好用的，尤其是Yum的增量更新。
只是今天修改分区表出了点意外，再加上Fedora备份无法还原。重装系统找了半天居然把Fedora的盘丢了，只能换回了Ubuntu904。
学校的VPN在Ubuntu里还是无法连接，只能拿台式机来当做网关来上网，痛苦啊。用惯了Fedora，Ubuntu很多东西感觉都很简单，哈哈。
Related PostAdobe AIR 程序维护小试 CloneZilla关站开始VIM多机共享上网方案]]></description>
			<content:encoded><![CDATA[<p>Fedora其实很好用的，尤其是Yum的增量更新。</p>
<p>只是今天修改分区表出了点意外，再加上Fedora备份无法还原。重装系统找了半天居然把Fedora的盘丢了，只能换回了Ubuntu904。</p>
<p>学校的VPN在Ubuntu里还是无法连接，只能拿台式机来当做网关来上网，痛苦啊。用惯了Fedora，Ubuntu很多东西感觉都很简单，哈哈。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/268.html" title="Adobe AIR 程序维护">Adobe AIR 程序维护</a></li><li><a href="http://blog.francistm.com/archives/266.html" title="小试 CloneZilla">小试 CloneZilla</a></li><li><a href="http://blog.francistm.com/archives/260.html" title="关站">关站</a></li><li><a href="http://blog.francistm.com/archives/257.html" title="开始VIM">开始VIM</a></li><li><a href="http://blog.francistm.com/archives/250.html" title="多机共享上网方案">多机共享上网方案</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/265.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PHP中引用路径的解决</title>
		<link>http://blog.francistm.com/archives/263.html</link>
		<comments>http://blog.francistm.com/archives/263.html#comments</comments>
		<pubDate>Wed, 09 Dec 2009 22:28:39 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=263</guid>
		<description><![CDATA[当不能修改php.ini的时候，require 和 include 的路径问题就会变的复杂了。
用 __autoload 函数自动载入类文件的时候，同样会出现这个问题。
其实，完全可以越过定义 include_path 属性来实现类的自动载入。
当前环境为Unix系统，且所有的类文件均已类名称来命名，且保存在 ./classes 下。
autoLoad.php 文件内容：

$docRoot = dirname&#40;__FILE__&#41;;
function __autoload&#40;$className&#41;
&#123;
    global $docRoot;
    $classFile = $docRoot . '/classes/' . $className . '.php';
    if&#40; file_exists&#40;$classFile&#41; &#41;
        require_once $classFile;
    else
      [...]]]></description>
			<content:encoded><![CDATA[<p>当不能修改php.ini的时候，require 和 include 的路径问题就会变的复杂了。<br />
用 __autoload 函数自动载入类文件的时候，同样会出现这个问题。</p>
<p>其实，完全可以越过定义 include_path 属性来实现类的自动载入。<br />
当前环境为Unix系统，且所有的类文件均已类名称来命名，且保存在 ./classes 下。</p>
<p><span id="more-263"></span>autoLoad.php 文件内容：</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #000088;">$docRoot</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> __autoload<span style="color: #009900;">&#40;</span><span style="color: #000088;">$className</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$docRoot</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$classFile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$docRoot</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/classes/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$className</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'.php'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$classFile</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">require_once</span> <span style="color: #000088;">$classFile</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">else</span>
        <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p&gt;Could not load '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$className</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' class&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>为什么不将 $docRoot 定义为函数变量，反而要单独外部定义 $docRoot 变量，然后用 global 这样低效率的方法来访问它呢？</p>
<p>这样做也是为了其它脚本方便。如果还有其它脚本需要使用 require 、 include 或者 file_get_contents 这类函数，我们就不需要重新定义一个文件路径，就直接使用 global 方法，全部以绝对路径来访问。</p>
<p>个人感觉为了所有位置都能有一个引用文件的标准，牺牲这个效率还是值得的。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/270.html" title="谁说PHP很烂">谁说PHP很烂</a></li><li><a href="http://blog.francistm.com/archives/269.html" title="失败的09年">失败的09年</a></li><li><a href="http://blog.francistm.com/archives/261.html" title="有趣的PHP判断">有趣的PHP判断</a></li><li><a href="http://blog.francistm.com/archives/253.html" title="写了一周的PHP">写了一周的PHP</a></li><li><a href="http://blog.francistm.com/archives/252.html" title="世界变化太快了">世界变化太快了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/263.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>小试 Pascal</title>
		<link>http://blog.francistm.com/archives/262.html</link>
		<comments>http://blog.francistm.com/archives/262.html#comments</comments>
		<pubDate>Tue, 08 Dec 2009 20:55:43 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Pascal]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/archives/262.html</guid>
		<description><![CDATA[此日志纯粹凑数量，还请高手无视。
编译器：Free Pascal 。

Program HelloWorld;
Begin
    WriteLn&#40;'Hello World'&#41;;
End.

无敌的Hello World 啊。
写习惯了PHP这种东西，写Pascal这种“次”先进的语言实在不习惯。
Related Post谁说PHP很烂失败的09年PHP中引用路径的解决有趣的PHP判断写了一周的PHP]]></description>
			<content:encoded><![CDATA[<p>此日志纯粹凑数量，还请高手无视。</p>
<p><span id="more-262"></span>编译器：<a href="http://www.freepascal.org/" target="_blank">Free Pascal</a> 。</p>

<div class="wp_syntax"><div class="code"><pre class="pascal" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #000000; font-weight: bold;">Program</span> HelloWorld;
<span style="color: #000000; font-weight: bold;">Begin</span>
    <span style="color: #000066;">WriteLn</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'Hello World'</span><span style="color: #009900;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">End</span>.</pre></div></div>

<p>无敌的Hello World 啊。<br />
写习惯了PHP这种东西，写Pascal这种“次”先进的语言实在不习惯。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/270.html" title="谁说PHP很烂">谁说PHP很烂</a></li><li><a href="http://blog.francistm.com/archives/269.html" title="失败的09年">失败的09年</a></li><li><a href="http://blog.francistm.com/archives/263.html" title="PHP中引用路径的解决">PHP中引用路径的解决</a></li><li><a href="http://blog.francistm.com/archives/261.html" title="有趣的PHP判断">有趣的PHP判断</a></li><li><a href="http://blog.francistm.com/archives/253.html" title="写了一周的PHP">写了一周的PHP</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/262.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>有趣的PHP判断</title>
		<link>http://blog.francistm.com/archives/261.html</link>
		<comments>http://blog.francistm.com/archives/261.html#comments</comments>
		<pubDate>Sun, 06 Dec 2009 19:03:05 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=261</guid>
		<description><![CDATA[测试环境 Apache 2.2.14 , PHP 5.2.11。


1
2
3
4
5
6
if&#40; TRUE &#41;:
    if&#40; TRUE &#41;
        echo 'Say something';
else:
    echo 'Say nothing';
endif;

结果并非希望的那样，运行后会提示第4行出错。
仔细看了下手册，在这里看到这样一段笔记：
Instead of concluding that the else statement was intended to match the if($b) statement (and erroring out), the parser could match the else statement to the [...]]]></description>
			<content:encoded><![CDATA[<p>测试环境 Apache 2.2.14 , PHP 5.2.11。</p>
<p><span id="more-261"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family: 'DejaVu Sans Mono', 'Courier New';"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900; font-weight: bold;">TRUE</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900; font-weight: bold;">TRUE</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Say something'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">else</span><span style="color: #339933;">:</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Say nothing'</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>结果并非希望的那样，运行后会提示第4行出错。</p>
<p>仔细看了下手册，在<a href="http://www.php.net/manual/en/control-structures.elseif.php#71982">这里</a>看到这样一段笔记：</p>
<blockquote><p>Instead of concluding that the else statement was intended to match the if($b) statement (and erroring out), the parser could match the else statement to the if($a) statement, which shares its syntax.</p></blockquote>
<p>原来不是bug。虽然PHP真的很飘逸，但是还是要规范。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/270.html" title="谁说PHP很烂">谁说PHP很烂</a></li><li><a href="http://blog.francistm.com/archives/269.html" title="失败的09年">失败的09年</a></li><li><a href="http://blog.francistm.com/archives/263.html" title="PHP中引用路径的解决">PHP中引用路径的解决</a></li><li><a href="http://blog.francistm.com/archives/253.html" title="写了一周的PHP">写了一周的PHP</a></li><li><a href="http://blog.francistm.com/archives/252.html" title="世界变化太快了">世界变化太快了</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/261.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>关站</title>
		<link>http://blog.francistm.com/archives/260.html</link>
		<comments>http://blog.francistm.com/archives/260.html#comments</comments>
		<pubDate>Sat, 05 Dec 2009 17:06:19 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[网络]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=260</guid>
		<description><![CDATA[BT@China 挂了，不知道VeryCD会有什么反应。还有什么QQ旋风、迅雷……
VIM用久了就会发现它的强大之处了。虽说不如各种IDE功能强大，但对于写代码，还真能提高不少效率。
Related Post又回到了Ubuntu多机共享上网方案]]></description>
			<content:encoded><![CDATA[<p>BT@China 挂了，不知道VeryCD会有什么反应。还有什么QQ旋风、迅雷……</p>
<blockquote><p>VIM用久了就会发现它的强大之处了。虽说不如各种IDE功能强大，但对于写代码，还真能提高不少效率。</p></blockquote>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/265.html" title="又回到了Ubuntu">又回到了Ubuntu</a></li><li><a href="http://blog.francistm.com/archives/250.html" title="多机共享上网方案">多机共享上网方案</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/260.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>又有一个DNS服务器</title>
		<link>http://blog.francistm.com/archives/258.html</link>
		<comments>http://blog.francistm.com/archives/258.html#comments</comments>
		<pubDate>Thu, 03 Dec 2009 23:14:53 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=258</guid>
		<description><![CDATA[以前一直用的是中国电信的DNS，但来了学校以后，由于DNS服务器老挂（估计是因为暴风影音），我就开始使用 OpenDNS 了。
现在Google也公布了一个DNS服务器，有兴趣的朋友们可以试一试。
OpenDNS 地址

208.67.222.222
208.67.220.220


Google Public DNS 地址

8.8.8.8
8.8.4.4


我这里的测试结果，好像还是OpenDNS的速度稍快一些（大约5ms左右）。
Related PostGoogle 空间站今天自己做了个Gmail图标]]></description>
			<content:encoded><![CDATA[<p>以前一直用的是中国电信的DNS，但来了学校以后，由于DNS服务器老挂（估计是<a rel="nofollow" href="http://internet.solidot.org/article.pl?sid=09/05/20/0552254" target="_blank">因为暴风影音</a>），我就开始使用 <a rel="nofollow" href="http://www.opendns.com/" target="_blank">OpenDNS</a> 了。</p>
<p>现在<a rel="nofollow" href="http://code.google.com/speed/public-dns/" target="_blank">Google也公布了一个DNS服务器</a>，有兴趣的朋友们可以试一试。</p>
<blockquote><p>OpenDNS 地址</p>
<ul>
<li>208.67.222.222</li>
<li>208.67.220.220</li>
</ul>
</blockquote>
<blockquote><p>Google Public DNS 地址</p>
<ul>
<li>8.8.8.8</li>
<li>8.8.4.4</li>
</ul>
</blockquote>
<p>我这里的测试结果，好像还是OpenDNS的速度稍快一些（大约5ms左右）。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/149.html" title="Google 空间站">Google 空间站</a></li><li><a href="http://blog.francistm.com/archives/39.html" title="今天自己做了个Gmail图标">今天自己做了个Gmail图标</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/258.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>开始VIM</title>
		<link>http://blog.francistm.com/archives/257.html</link>
		<comments>http://blog.francistm.com/archives/257.html#comments</comments>
		<pubDate>Thu, 26 Nov 2009 02:08:20 +0000</pubDate>
		<dc:creator>francis</dc:creator>
				<category><![CDATA[技术相关]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://blog.francistm.com/?p=257</guid>
		<description><![CDATA[为了提高技术，决定学习VIM。
最近心情不好，一直很低迷，希望新的Fedora可以和我一起开始新的生活。
Related PostAdobe AIR 程序维护小试 CloneZilla又回到了UbuntuWeekend Session &#8211; 3NTFS中创建文件链接]]></description>
			<content:encoded><![CDATA[<p>为了提高技术，决定学习VIM。</p>
<p>最近心情不好，一直很低迷，希望新的Fedora可以和我一起开始新的生活。</p>
<h3  class="related_post_title">Related Post</h3><ul class="related_post"><li><a href="http://blog.francistm.com/archives/268.html" title="Adobe AIR 程序维护">Adobe AIR 程序维护</a></li><li><a href="http://blog.francistm.com/archives/266.html" title="小试 CloneZilla">小试 CloneZilla</a></li><li><a href="http://blog.francistm.com/archives/265.html" title="又回到了Ubuntu">又回到了Ubuntu</a></li><li><a href="http://blog.francistm.com/archives/200.html" title="Weekend Session &#8211; 3">Weekend Session &#8211; 3</a></li><li><a href="http://blog.francistm.com/archives/193.html" title="NTFS中创建文件链接">NTFS中创建文件链接</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://blog.francistm.com/archives/257.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
