<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.songchen.org" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>陈松 - </title>
 <link>http://www.songchen.org</link>
 <description></description>
 <language>zh-hans</language>
<item>
 <title>Best of Vim Tips 中文版</title>
 <link>http://www.songchen.org/node/15</link>
 <description>&lt;p&gt;__BEGIN__&lt;br /&gt;
---------------------------------------------------------------------------­---&lt;br /&gt;
# searching 查找&lt;br /&gt;
/joe/e                      : cursor set to End of match&lt;br /&gt;
                              把光标定位在匹配单词最后一个字母处&lt;br /&gt;
/joe/e+1                    : cursor set to End of match plus 1&lt;br /&gt;
                              把光标定位在匹配单词最后一个字母的下一个字母处&lt;br /&gt;
/joe/s-2                    : cursor set to Start of match minus 2&lt;br /&gt;
                              把光标定位在匹配单词第一个字母往前数两个字母的位置&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/node/15&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/node/15#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/11">vim</category>
 <pubDate>Fri, 27 Apr 2007 23:42:50 -0600</pubDate>
 <dc:creator>wml</dc:creator>
 <guid isPermaLink="false">15 at http://www.songchen.org</guid>
</item>
<item>
 <title>coLinux</title>
 <link>http://www.songchen.org/blog/colinux</link>
 <description>&lt;p&gt;如果你还在为cygwin下build php失败或其他类似的问题而烦恼，向你隆重推荐很好用的&lt;a href=&quot;http://www.colinux.org/&quot; rel=&quot;nofollow&quot;&gt;coLinux&lt;/a&gt;，和vmware类似是虚拟机技术，而且是free的。我感觉非常稳定，速度也很快（比cygwin）。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;这里有更好的教程&lt;/strong&gt;&lt;br /&gt;
&lt;a href=&quot;http://studftp.stut.edu.tw/~m9335203/colinux/colinux.html&quot;&gt;http://studftp.stut.edu.tw/~m9335203/colinux/colinux.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;我写的这个只是为了自己方便（每次安装都要读那么长的教程太痛苦了）总结了一个不用思考的step by step，基本上copy+paste每一行命令应该就应该能用了&lt;/p&gt;
&lt;h3&gt;预先准备&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/blog/colinux&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/blog/colinux#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/10">unix</category>
 <pubDate>Sun, 14 May 2006 02:34:12 -0600</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">14 at http://www.songchen.org</guid>
</item>
<item>
 <title>Be Lazy!</title>
 <link>http://www.songchen.org/blog/rasmus-be-lazy</link>
 <description>&lt;p&gt;这是&lt;a href=&quot;http://lerdorf.com/bio.php&quot; rel=&quot;nofollow&quot;&gt;Rasmus&lt;/a&gt;教给我的最重要的东西。&lt;/p&gt;
&lt;p&gt;那年Rasmus来北京参加DevCon，&lt;a href=&quot;http://bl.ah.cn/&quot; rel=&quot;nofollow&quot;&gt;blah&lt;/a&gt; blah讲了不少。他那个presentation真够长的（不仅拿着它在全公司世界各地office巡演，我发现他又稍微改了&lt;a href=&quot;http://lerdorf.com/lca05.pdf&quot; rel=&quot;nofollow&quot;&gt;一下&lt;/a&gt;就去参加linux conf au了，真是太不厚道了）&lt;/p&gt;
&lt;p&gt;整个presentation的精义就在于两个字“&lt;strong&gt;Be Lazy&lt;/strong&gt;”。&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;strong&gt;不要试图解决不存在的问题&lt;/strong&gt;&lt;br /&gt;
许多人，虽然没有意识到，非常热衷于解决根本不存在的问题。比如：真的需要多国语言支持吗？真的需要完全用面向对象OOP吗？他们花了很多精力实现了这些美好的意愿，而是解决了根本不存在的问题！事实上，很多应用只需要用gb2312就足够了；而有些使用纯OOP的程序，除了降低效率以外，我也看不太出有任何意义。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/blog/rasmus-be-lazy&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/blog/rasmus-be-lazy#comment</comments>
 <pubDate>Thu, 11 May 2006 09:26:20 -0600</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">13 at http://www.songchen.org</guid>
</item>
<item>
 <title>最基本的cache</title>
 <link>http://www.songchen.org/blog/cache-101</link>
 <description>&lt;p&gt;&lt;strong&gt;摘要：本文试图说服你使用不到10行代码的缓存提高你的web程序效率。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;如果你已经写了一段时间的web应用，而且它们越来越大的时候，你就会注意到性能是个问题。当我们假设人工要比机器贵（在正规的公司，这通常是事实），作为工程师，我们就必须考虑到优化程序的效率。&lt;/p&gt;
&lt;p&gt;在我的经历中，缓存（cache）往往比任何其他方式更能够轻易而有效地提高应用的性能。&lt;/p&gt;
&lt;p&gt;当我们习惯把所有的数据放到数据库中的时候，我们通常假设数据库管理系统DBMS可以应对我们的要求。当你的应用因为访问量的不断增加而变得越来越迟缓的时候，90%的情况你会发现是因为数据库存在瓶颈。是的，MySQL非常的快，但这不是完全依赖它的很好的理由。你会发现，在脚本语言和数据库之间建立一个缓存机制是十分必要的。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/blog/cache-101&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/blog/cache-101#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/9">cache</category>
 <category domain="http://www.songchen.org/taxonomy/term/8">优化</category>
 <pubDate>Wed, 10 May 2006 07:21:12 -0600</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">12 at http://www.songchen.org</guid>
</item>
<item>
 <title>Scanmus @ Paranoid Conference</title>
 <link>http://www.songchen.org/blog/scanmus</link>
 <description>&lt;p&gt;因为一些原因没有去Paranoid Conference，Lucy回来告诉我，Rasmus在会议上就是拿中国的几个project做例子，其中居然就有我的大作，呜呜呜……看来这就是我轻视&lt;a href=&quot;http://b2evolution.net/news/2005/11/13/b2evolution_passing_the_scanmus_test&quot; class=&quot;bb-url&quot;&gt;Scanmus&lt;/a&gt;（一个Rasmus闲来无事写得扫描XSS的工具）的恶果。&lt;/p&gt;
&lt;p&gt;Security最基本的一些sense：&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;escape！&lt;/li&gt;
&lt;li&gt;尽量validate输入&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;类型：数字，email，url&lt;/li&gt;
&lt;li&gt;范围：枚举，数字的范围，字符长度&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;内部应用间的api限制外网访问&lt;/li&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/blog/scanmus&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/blog/scanmus#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/7">安全</category>
 <pubDate>Tue, 28 Feb 2006 07:21:42 -0700</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">10 at http://www.songchen.org</guid>
</item>
<item>
 <title>不值得信赖的addslash()和mysql_real_escape_string()</title>
 <link>http://www.songchen.org/blog/php-addslash-mysql_real_escape_string-xss</link>
 <description>&lt;p&gt;长久以来，我一直依赖mysql_real_escape_string()防范SQL injection。看起来它并不像我想象的那么值得信赖。&lt;/p&gt;
&lt;p&gt;问题来自多字节编码。例如在GBK里，0xbf27并不是一个合法的双字节字符，因此addslash()会把它转义成0xbf5c27，碰巧0xbf5c是一个合法的双字节字符，由此可以注入一个0x27 (&#039;)。&lt;/p&gt;
&lt;p&gt;addslash()无药可救。mysql_real_escape_string()可以根据字符集正确地转义，但是需要在建立数据库联接的时候指明“SET CHARACTER SET &#039;GBK&#039;”。&lt;/p&gt;
</description>
 <comments>http://www.songchen.org/blog/php-addslash-mysql_real_escape_string-xss#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/1">php</category>
 <category domain="http://www.songchen.org/taxonomy/term/7">安全</category>
 <pubDate>Sat, 18 Feb 2006 08:18:12 -0700</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">9 at http://www.songchen.org</guid>
</item>
<item>
 <title>由filter想到的一些</title>
 <link>http://www.songchen.org/blog/php-filter-more</link>
 <description>&lt;p&gt;在公司的intranet翻文档的时候，突然发现Rasmus提及，&lt;a href=&quot;http://pecl.php.net/package/filter&quot; class=&quot;bb-url&quot;&gt;filter&lt;/a&gt;其实是我们公司赠与PHP开源社区的。&lt;/p&gt;
&lt;p&gt;想一想，PHP开发者主力就是Zend和Yahoo!。（想起Google前一段时间终于把&lt;a href=&quot;http://www.python.org/~guido/Resume.html&quot; class=&quot;bb-url&quot;&gt;Guido van Rossum&lt;/a&gt;给收了，而&lt;a href=&quot;http://lerdorf.com/resume/&quot; class=&quot;bb-url&quot;&gt;Rasmus&lt;/a&gt;和&lt;a href=&quot;http://www.gravitonic.com/about/resume.php&quot; class=&quot;bb-url&quot;&gt;Andrei&lt;/a&gt;早就是我的同事了）Zend的不厚道出了名的，否则PHP不可能这么久一直没有一个内置的opcode cache，白白牺牲掉那些性能。（感谢上帝，PHP 6.0的发行包会含有APC，但是默认还是关闭的）我们公司是不是厚道，我不好说，但是起码在做show方便远不及“Don&#039;t be evil”的Google——&lt;a href=&quot;http://code.google.com/projects.html&quot; class=&quot;bb-url&quot;&gt;Google Code&lt;/a&gt;，Goobutu，还有中国的&lt;a href=&quot;http://www.googlechinablog.com/&quot; class=&quot;bb-url&quot;&gt;黑板报&lt;/a&gt;。回到技术，关于我们公司使用PHP的情况，请仔细阅读Michael Radwin的&lt;a href=&quot;http://public.yahoo.com/~radwin/talks/php-at-yahoo-zend2005.ppt&quot; class=&quot;bb-url&quot;&gt;这个Presentation&lt;/a&gt;，其中有一些细节我觉得对外面的人还是很有价值的。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/blog/php-filter-more&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/blog/php-filter-more#comment</comments>
 <pubDate>Sat, 18 Feb 2006 06:37:44 -0700</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">8 at http://www.songchen.org</guid>
</item>
<item>
 <title>APC bug</title>
 <link>http://www.songchen.org/blog/php-apc-bug</link>
 <description>&lt;p&gt;最近在做一个—呃，几个million的daily pv—的project。用APC做cache后发现有问题，不时地coredump。研究了一下才发现居然这些机器上装的还是2.x的APC，赶快升级到了3.0.8——问题消失。估计就是上次我跟Rasmus说的，用APC存取size大一点点的数组会有coredump的bug。想到这里，才发现最近和Rasmus失去联络了。&lt;/p&gt;
</description>
 <comments>http://www.songchen.org/blog/php-apc-bug#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/4">apc</category>
 <category domain="http://www.songchen.org/taxonomy/term/6">pecl</category>
 <category domain="http://www.songchen.org/taxonomy/term/1">php</category>
 <pubDate>Sun, 08 Jan 2006 04:43:09 -0700</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">7 at http://www.songchen.org</guid>
</item>
<item>
 <title>memcache 2.0.0</title>
 <link>http://www.songchen.org/blog/php-memcache-2.0.0</link>
 <description>&lt;p&gt;Antony终于推出了&lt;a href=&quot;http://pecl.php.net/package/memcache&quot; rel=&quot;nofollow&quot;&gt;memcache 2.0.0&lt;/a&gt;。&lt;br /&gt;
支持多服务器load balance和failover。&lt;/p&gt;
&lt;p&gt;感谢上帝，我终于不用去backtrace &lt;a href=&quot;http://www.klir.com/~johnm/php-mcache/&quot; rel=&quot;nofollow&quot;&gt;mcache&lt;/a&gt;的coredump了。这个世界太美好了。&lt;/p&gt;
&lt;p&gt;（我是&lt;a href=&quot;http://www.danga.com/memcached/&quot; rel=&quot;nofollow&quot;&gt;memcached&lt;/a&gt;的粉丝）&lt;/p&gt;
</description>
 <comments>http://www.songchen.org/blog/php-memcache-2.0.0#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/3">memcached</category>
 <category domain="http://www.songchen.org/taxonomy/term/6">pecl</category>
 <category domain="http://www.songchen.org/taxonomy/term/1">php</category>
 <pubDate>Sun, 08 Jan 2006 03:39:51 -0700</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">6 at http://www.songchen.org</guid>
</item>
<item>
 <title>最近关注的php扩展</title>
 <link>http://www.songchen.org/blog/php-pdo-filter</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://pecl.php.net/package/PDO&quot; target=&quot;blank&quot; rel=&quot;nofollow&quot;&gt;PDO&lt;/a&gt;&lt;br /&gt;
现在我见到的许多大一些的php应用都会使用数据库抽象层。PDO毕竟是扩展，比php写的DBAL效率会好很多。&lt;/p&gt;
&lt;p&gt;DBAL是我大学时候的最爱。后来总觉得这种缥缈的完美主义实在影响性能，而且在99.99%的情况不能带来一点好处；更换DBMS千年难见一次，而DBAL确会在每次request上都带来overhead，所以我再也没有用过了。即便PDO的效率会搞很多，我怀疑自己真的会不会使用PDO。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://pecl.php.net/package/filter&quot; target=&quot;blank&quot; rel=&quot;nofollow&quot;&gt;filter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.songchen.org/blog/php-pdo-filter&quot;&gt;阅读更多&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.songchen.org/blog/php-pdo-filter#comment</comments>
 <category domain="http://www.songchen.org/taxonomy/term/6">pecl</category>
 <category domain="http://www.songchen.org/taxonomy/term/1">php</category>
 <pubDate>Sat, 17 Dec 2005 07:28:50 -0700</pubDate>
 <dc:creator>陈松</dc:creator>
 <guid isPermaLink="false">4 at http://www.songchen.org</guid>
</item>
</channel>
</rss>
