<?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>Luin&#039;s Blog &#187; 闲言碎语</title>
	<atom:link href="http://luinlee.com/category/texts/onewordtext/feed/" rel="self" type="application/rss+xml" />
	<link>http://luinlee.com</link>
	<description>A long river</description>
	<lastBuildDate>Sat, 07 Aug 2010 04:55:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>140个字符能干啥，能写个程序你信不信？</title>
		<link>http://luinlee.com/333/program-written-in-140-chars/</link>
		<comments>http://luinlee.com/333/program-written-in-140-chars/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 15:08:59 +0000</pubDate>
		<dc:creator>Luin</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[闲言碎语]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://luinlee.com/?p=333</guid>
		<description><![CDATA[前几天在网上看到一个网站征集140字写成的小说，觉得挺有意思。获得第一名的Ron Gould(墙外)大牛写的小说着实“惊艳”(尽管我英语很烂，但为了显示我坚决备战四级的决心，还是决定把它译成中文)： “时间旅行成功了！”一张纸条上写着，“不过你只能回到过去并且不能再回来了。” 当我发觉这是我自己的笔迹时，不禁打了个寒颤。 “Time travel works!” the note read. “However you can only travel to the past and one-way.” I recognized my own handwriting and felt a chill. 其它作品访问：The Winners of the Twitter Writing Contest Are… 不过有没有想过用140个字符写一个程序？ “啊！这是不可能的！”在我看到某墙外网站的一篇文章前如果有人那样问我我一定会这样回答。 可惜，事实是： 第一个程序，但不是最好的： MINI TWITTER(啊不，是迷你饭否！啊不，是迷你叽歪&#8230;啊！管它呢&#8230;) 136 chars &#60;form&#62;&#60;input name=a&#62;&#60;input type=submit&#62;&#60;/form&#62; &#60;?if&#40;strlen&#40;$_GET&#91;a&#93;&#41;&#60;140&#41; &#123;$h=fopen&#40;a,“a”&#41;;fwrite&#40;$h,$_GET&#91;a&#93;.”&#60;hr&#62;”&#41;;&#125; echo@readfile&#40;a&#41;?&#62; 它可以实现微博最简单的功能：发表消息，显示消息以及做些必要验证。 第二个程序，已经开始出人意料了： RSS/RDF parser [...]]]></description>
			<content:encoded><![CDATA[<p>前几天在网上看到一个网站征集140字写成的小说，觉得挺有意思。获得第一名的<a href="http://twitter.com/rgouldtx/statuses/818253230">Ron Gould</a>(墙外)大牛写的小说着实“惊艳”(尽管我英语很烂，但为了显示我坚决备战四级的决心，还是决定把它译成中文)：</p>
<blockquote><p>
“时间旅行成功了！”一张纸条上写着，“不过你只能回到过去并且不能再回来了。” 当我发觉这是我自己的笔迹时，不禁打了个寒颤。<br />
“Time travel works!” the note read. “However you can only travel to the past and one-way.” I recognized my own handwriting and felt a chill.
</p></blockquote>
<p>其它作品访问：<a href="http://www.copyblogger.com/twitter-writing-contest-winners/">The Winners of the Twitter Writing Contest Are…</a></p>
<h3>不过有没有想过用140个字符写一个程序？</h3>
<p>“啊！这是不可能的！”在我看到某墙外网站的一篇文章前如果有人那样问我我一定会这样回答。<br />
可惜，事实是：</p>
<p>第一个程序，但不是最好的：<br />
<strong>MINI TWITTER</strong>(啊不，是迷你饭否！啊不，是迷你叽歪&#8230;啊！管它呢&#8230;) <em>136 chars</em></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;form&gt;&lt;input name=a&gt;&lt;input type=submit&gt;&lt;/form&gt;
<span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>a<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">140</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span><span style="color: #000088;">$h</span><span style="color: #339933;">=</span><span style="color: #990000;">fopen</span><span style="color: #009900;">&#40;</span>a<span style="color: #339933;">,</span>“a”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>fwrite<span style="color: #009900;">&#40;</span><span style="color: #000088;">$h</span><span style="color: #339933;">,</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>a<span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span>”<span style="color: #339933;">&lt;</span>hr<span style="color: #339933;">&gt;</span>”<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span><span style="color: #339933;">@</span><span style="color: #990000;">readfile</span><span style="color: #009900;">&#40;</span>a<span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>它可以实现微博最简单的功能：发表消息，显示消息以及做些必要验证。</p>
<p>第二个程序，已经开始出人意料了：<br />
<strong>RSS/RDF parser with formatted output in 135 chars of PHP</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>p<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #b1b100;">as</span><span style="color: #000088;">$l</span><span style="color: #009900;">&#41;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span>’<span style="color: #339933;">/&lt;</span><span style="color: #009900;">&#40;</span>title<span style="color: #339933;">|</span>link<span style="color: #009900;">&#41;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span>^<span style="color: #339933;">&lt;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">/</span>’<span style="color: #339933;">,</span><span style="color: #000088;">$l</span><span style="color: #339933;">,</span><span style="color: #000088;">$m</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #b1b100;">echo</span><span style="color: #000088;">$m</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">==</span>‘<span style="color: #990000;">link</span>’?” <span style="color: #339933;">&lt;</span>a<span style="color: #339933;">&gt;</span>link<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;</span>hr<span style="color: #339933;">&gt;</span>”<span style="color: #339933;">:</span><span style="color: #000088;">$m</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>RSS解析器，怎么样？看看Demo:<br />
<a href="http://test.neziric.org/140/feed-parser.php?u=http://feeds.delicious.com/v2/rss/?count=15">http://test.neziric.org/140/feed-parser.php?u=http://feeds.delicious.com/v2/rss/?count=15</a></p>
<p>第三个程序：<br />
<strong>JPG压缩器</strong>,可以对半压缩，不过它用了186个字符。</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?</span><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span>‘Content<span style="color: #339933;">-</span>type<span style="color: #339933;">:</span>’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>list<span style="color: #009900;">&#40;</span><span style="color: #000088;">$w</span><span style="color: #339933;">,</span><span style="color: #000088;">$h</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">=</span><span style="color: #990000;">getimagesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>a<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$b</span><span style="color: #339933;">=</span><span style="color: #990000;">imagecreatetruecolor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$w</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #000088;">$h</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagecopyresized</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #339933;">,</span><span style="color: #990000;">imagecreatefromjpeg</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>a<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$w</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #000088;">$h</span><span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span><span style="color: #000088;">$w</span><span style="color: #339933;">,</span><span style="color: #000088;">$h</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>imagejpeg<span style="color: #009900;">&#40;</span><span style="color: #000088;">$b</span><span style="color: #009900;">&#41;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>最后一个，我最喜欢的：<br />
<strong>A PHP web framework in 131 chars!!!!!</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">require</span> __DIR__<span style="color: #339933;">.</span>’<span style="color: #339933;">/</span>c<span style="color: #339933;">.</span>php’<span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">is_callable</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span>‘c’<span style="color: #009900;">&#93;</span> ?<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> ‘Woah<span style="color: #339933;">!</span>’<span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
  throw <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #009900;">&#40;</span>‘Error’<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$c</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>靠，它有一个默认控制器，访问不可用的控制器时会抛异常。不仅用了PHP5.3的新特性，而且效率相当高，这就是国外的PHP程序员(劝别真的在你的网站上用它&#8230;)。</p>
<p>P.S. 提到了国外，又想起了昨天的经历：三个寂寞男生(好吧，我不是很寂寞&#8230;)走在和谐的长安街上，迎面走来了一个可爱的武警叔叔，和蔼的盘问了我们好久，又问我们要了身份证登记。哦，明明都过去两天了！</p>
]]></content:encoded>
			<wfw:commentRss>http://luinlee.com/333/program-written-in-140-chars/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>淫淫状态二则，有亮点</title>
		<link>http://luinlee.com/424/renren/</link>
		<comments>http://luinlee.com/424/renren/#comments</comments>
		<pubDate>Thu, 27 May 2010 15:08:36 +0000</pubDate>
		<dc:creator>Luin</dc:creator>
				<category><![CDATA[闲言碎语]]></category>

		<guid isPermaLink="false">http://luinlee.com/?p=424</guid>
		<description><![CDATA[话说某天宿舍5人早上没起来，大鑫哥自己去上线代，回来后他发了条精彩的状态，亮点在倒数第二条回复： 回想到前不久一个人的状态： 这个亮点太明显了，不解释。]]></description>
			<content:encoded><![CDATA[<p>话说某天宿舍5人早上没起来，大鑫哥自己去上线代，回来后他发了条精彩的状态，亮点在倒数第二条回复：</p>
<p><a class="highslide img_3" href="http://luinlee.com/wp-content/uploads/2010/05/Screenshot.png" onclick="return hs.expand(this)"><img class="alignnone size-medium wp-image-425" title="状态1" src="http://luinlee.com/wp-content/uploads/2010/05/Screenshot-300x193.png" alt="" width="300" height="193" /></a></p>
<p>回想到前不久一个人的状态：</p>
<p><a class="highslide img_4" href="http://luinlee.com/wp-content/uploads/2010/05/Screenshot-1.png" onclick="return hs.expand(this)"><img class="alignnone size-medium wp-image-426" title="状态2" src="http://luinlee.com/wp-content/uploads/2010/05/Screenshot-1-300x276.png" alt="" width="300" height="276" /></a></p>
<p>这个亮点太明显了，不解释。</p>
]]></content:encoded>
			<wfw:commentRss>http://luinlee.com/424/renren/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>统计Dreamweaver当前站点的代码行数</title>
		<link>http://luinlee.com/360/tongjidhangshu/</link>
		<comments>http://luinlee.com/360/tongjidhangshu/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 05:12:27 +0000</pubDate>
		<dc:creator>Luin</dc:creator>
				<category><![CDATA[学习&技术]]></category>
		<category><![CDATA[闲言碎语]]></category>
		<category><![CDATA[Dreamweaver]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://luinlee.com/?p=360</guid>
		<description><![CDATA[自己辛辛苦苦写了一堆PHP代码，想统计一下自己到底写了多少行代码然后装逼向别人显摆一下怎么办呢？Dreamweaver作为一个可视化网页开发工具似乎对代码行数并不感冒，它只会在编辑器中显示行数。当然如果你愿意，可以打开每份文件然后用计算器把行数们加起来。 还有更好的方法。 利用Dreamweaver的查找功能，打开它的“使用正则表达式”选项，这样我们只要统计处换行符的个数就能知道行数了(不要纠结最后一行根本没有换行符)。 如果你担心自己的工作量因为空行被夸大的话，可以把\n改成.+,这样只会统计有内容的行，而且也不会忽略掉最后一行。]]></description>
			<content:encoded><![CDATA[<p>自己辛辛苦苦写了一堆PHP代码，想统计一下自己到底写了多少行代码然后装逼向别人显摆一下怎么办呢？Dreamweaver作为一个可视化网页开发工具似乎对代码行数并不感冒，它只会在编辑器中显示行数。当然如果你愿意，可以打开每份文件然后用计算器把行数们加起来。</p>
<p>还有更好的方法。</p>
<p>利用Dreamweaver的查找功能，打开它的“使用正则表达式”选项，这样我们只要统计处换行符的个数就能知道行数了(不要纠结最后一行根本没有换行符)。</p>
<p><a class="highslide img_6" href="http://luinlee.com/wp-content/uploads/2010/02/hangshu.png" onclick="return hs.expand(this)"><img class="alignnone size-full wp-image-361" title="hangshu" src="http://luinlee.com/wp-content/uploads/2010/02/hangshu.png" alt="" width="512" height="214" /></a></p>
<p>如果你担心自己的工作量因为空行被夸大的话，可以把<strong>\n</strong>改成<strong>.+</strong>,这样只会统计有内容的行，而且也不会忽略掉最后一行。</p>
]]></content:encoded>
			<wfw:commentRss>http://luinlee.com/360/tongjidhangshu/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
