<?php xml version="1.0" encoding="UTF-8"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title><![CDATA[曲文庆&#39;s Blog]]></title>
<link>http://www.quwenqing.com/</link>
<description><![CDATA[]]></description>
<language>zh-tw</language>
<copyright><![CDATA[CopyRight 2008 F2Blog.com|F2Cont.com All Rights Reserved.]]></copyright>
<webMaster><![CDATA[quwenqing@quwenqing.com ()]]></webMaster>
<atom:link href="http://www.quwenqing.com/rss.html" rel="self" type="application/rss+xml" />
<generator>F2blog .cont 1.1 Build 090810</generator> 
<image>
	<title>曲文庆&#39;s Blog</title> 
	<url>http://www.quwenqing.com/attachments/8278598901.jpg</url> 
	<link>http://www.quwenqing.com/</link> 
	<description>曲文庆&#39;s Blog</description> 
</image>
<item>
	<link>http://www.quwenqing.com/read-251.html</link>
	<title><![CDATA[sed 中如何替换换行符]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Wed, 24 Aug 2016 15:10:55 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-251.html</guid>	
	<description><![CDATA[<div>使用如下解决方案:</div><div><br /></div><div>sed &#39;:a;N;$!ba;s/n/,/g&#39;</div><div>（/n/ n前面有反斜杠，安全机制过滤了）&nbsp;</div><div>这将在一个循环里读取整个文件，然后将换行符替换成一个空格。</div><div><br /></div><div>说明：</div><div><br /></div><div>1、通过 :a创建一个标记</div><div>2、通过N追加当前行和下一行到模式区域</div><div>3、如果处于最后一行前，跳转到之前的标记处。 $!ba ($! 意思是不在最后一行做这操作 (最后一行就被当成最后的一行）).</div><div>4、最后置换操作把模式区域（就是整个文件）的每一个换行符换成一个空格。</div><div><br /></div><div>示例追加：</div><div>$ echo -e &quot;1 2&quot; | sed &#39;:a;N;$!ba;s/n/,/g&#39;</div><div><span style="font-size: 14.6666669845581px; line-height: 20.5333347320557px">（/n/ n前面有反斜杠，安全机制过滤了）&nbsp;</span>&nbsp;</div><div>1,2</div><div>&nbsp;</div>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-233.html</link>
	<title><![CDATA[Android手机通过USB连接通过电脑上网]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Thu, 18 Sep 2014 10:50:54 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-233.html</guid>	
	<description><![CDATA[<p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">对于各位安卓手机的友友来说，如果身边没有免费的无线WIFI网络的话或者WIFI很拥堵或者WIFI很不稳定，是一件很痛苦的事情。而下面给大家分享一个利用手机USB数据线连接电脑的宽带上网的小技巧。让你在玩手机、上网冲浪的同时，还可以充电哦！推荐给无线网络不给力的同学们吧。</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">PC环境：windows 8.1</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">系统已安装adb命令</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px"><br /></span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">前提条件：</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">1、手机必须具有root权限</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">2、手机装有busybox（或者其他可以执行route的命令）</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">3、手机必须可以通过终端方式或者adb方式连接输入命令</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px"><br /></span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">一、将手机通过USB数据线连接至电脑，再依次打开手机的系统设置 &rarr; 无线和网络 &rarr; 绑定与便携式热点 &rarr; 启用&ldquo;USB绑定&rdquo;（必须连接USB后，该选择才可选）。完成后，正常情况下电脑的网络连接窗口（在桌面的网上邻居上右键属性打开）就会多出一个新的本地连接，为了方便这里我给它重命名为 USB连接 。</span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px"><br /></span></font></p><p style="text-align: justify"><font face="Microsoft Yahei, 微软雅黑, arial, 宋体, sans-serif" size="3" color="#333333"><span style="line-height: 28px">二、在电脑可以上网的网络连接（可能是以太网，也可能是宽带连接，视当前使用的网络连接方式而定）上右键选择属性 &rarr; 共享 &rarr; 勾选 允许其他网络用户通过此计</span></font></p>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-203.html</link>
	<title><![CDATA[批处理删除指定天数日期之前的文件]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Fri, 21 Dec 2012 12:03:44 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-203.html</guid>	
	<description><![CDATA[<p>批处理删除指定天数日期之前的文件<br /> 转载自：http://bbs.bathome.net/thread-3334-1-1.html</p><p><br /> 【方案一】删除指定路径下指定天数之前（以文件的最后修改日期为准）的文件：BAT + REG + VBS<br /><br /> @echo off<br /> ::演示：删除指定路径下指定天数之前（以文件的最后修改日期为准）的文件。<br /> ::如果演示结果无误，把del前面的echo去掉，即可实现真正删除。<br /> ::本例调用了临时VBS代码进行日期计算<br /> ::本例为兼容不同的日期格式，调用reg命令（XP系统自带）统一设置日期格式，<br /> ::处理完毕之后再把日期格式恢复成原来的状态。<br /><br /> rem 指定待删除文件的存放路径<br /> set SrcDir=C:TestBatHome<br /> rem 指定天数<br /> set DaysAgo=1<br /> for /f &quot;delims=&quot; %%a in (&#39;reg query &quot;HKEY_CURRENT_USERControl PanelInternational&quot; /v sShortDate&#39;) do (<br /> &nbsp;&nbsp;&nbsp; s</p>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-136.html</link>
	<title><![CDATA[php-fpm for php-5.3.8]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Thu, 25 Aug 2011 23:02:53 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-136.html</guid>	
	<description><![CDATA[自打php集成了php-fpm后，发现php调整了策略，不再支持spawn-fcgi模式使用fastcgi了。<br /> 以前使用fastcgi时候，通过带--enable-fastcgi参数编译php，生成php-cgi文件，使用lighttpd的spawn-fcgi产生php-cgi进程，通过socket或者端口监听模式使用。<br /> 该方式在php-5.3.3还支持，在php-5.3.6（之间的版本未测试）之后，编译配置选项里已没有 --enable-fastcgi 了，是否意味着已无法通过spawn-fcgi使用fastcgi了？<br /> 方式的减少，意味着开发者选择面更窄了，意味着php对自身产品的功能垄断，对此，鄙视一下。同时对lighttpd表示默哀。<br /><br /> （2011年11月17日注：近期通过朋友提示，发现对php新版的理解还是有误区的，php集成php-fpm后，并非不支持fastcgi模式，而是在fastcgi和fpm模式之间二选一，通过是否启用enable-fpm来决定使用fpm还是fastcgi。难道两者不能同时启用？）<br /><br /><br /><div style="border-bottom: #919699 1pt solid; border-left: medium none; padding-bottom: 2pt; padding-left: 0cm; padding-right: 0cm; background: white; border-top: medium none; border-right: medium none; padding-top: 0cm"><strong><span style="font-family: 宋体; color: black; font-size: 16pt">什么是</span></strong><strong><span style="font-family: &#39;Arial&#39;,&#39;sans-serif&#39;; color: black; font-size: 16pt">php-fpm</span></strong></div><span style="font-family: &#39;Arial&#39;,&#39;sans-serif&#39;; color: #333333; font-size: 10pt">PHP FastCGI</span><span style="font-family: 宋体; color: #333333; font-size: 10pt">管理器</span><span style="font-family: &#39;Arial&#39;,&#39;sans-serif&#39;; color: #333333; font-size: 10pt">(PHP FASTCGI </span>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-125.html</link>
	<title><![CDATA[关闭访问头部的php信息]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Sun, 02 Jan 2011 22:53:03 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-125.html</guid>	
	<description><![CDATA[<p>访问php文件的头部信息，会提示：<br /><br /> HTTP/1.1 200 OK<br /> X-UA-Compatible: IE=EmulateIE7<br /> X-Powered-By: PHP/5.3.3<br /> Content-type: text/html; charset=utf-8<br /> Connection: close<br /> Transfer-Encoding: chunked<br /> Date: Sun, 02 Jan 2011 14:38:49 GMT<br /> Server: Who_knows?<br /><br /> 显露出php的版本，需要去php.ini中关闭（默认是开放的，汗一下），在php.ini中找到&ldquo;expose_php On&rdquo;，改成Off即可</p>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-100.html</link>
	<title><![CDATA[php 5.3 不建议使用的函数]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Wed, 19 May 2010 16:53:48 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-100.html</guid>	
	<description><![CDATA[<p>PHP 5.3.0 之後的 regex, 希望使用 PCRE 的規格, POSIX Regex 都不建議使用了(統一 Regex, 避免規格太多?).</p><p>所以下述是不建議使用的 Function (POSIX), 與建議替換成的 Function (PCRE) 列表, 詳可見: <a href="http://www.php.net/manual/en/reference.pcre.pattern.posix.php" target="_blank" title="PHP: Differences from POSIX regex - Manual">PHP: Differences from POSIX regex</a></p><ul><li>POSIX &rarr; PCRE </li><li>ereg_replace() &rarr; preg_replace() </li><li>eregi_replace() &rarr; preg_replace() </li><li>ereg() &rarr; preg_match() </li><li>eregi() &rarr; preg_match() </li><li>split() &rarr; preg_split() </li><li>spliti() &rarr; preg_split() </li><li>sql_regcase() &rarr; No equivalent </li></ul><h4>PHP split() 替代方案</h4><ul><li>需要 regex 的 split, 可用 <a href="http://www.php.net/manual/en/function.preg-split.php" target="_blank" title="PHP: preg_split - Manual">preg_split()</a> 代替 </li><li>不需要 regex, 只要要快速分割固定的字串, 可用 <a href="http://www.php.net/manual/en/function.explode.php" target="_blank" title="PHP: explode - Manual">explode(</a></li></ul>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-94.html</link>
	<title><![CDATA[php 5.3 中新增加的魔术变量 __DIR__]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Fri, 14 May 2010 13:46:18 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-94.html</guid>	
	<description><![CDATA[<span class="t18">&nbsp; <p>使用php的朋友都知道PHP中提供了一个魔术常量(magic constant)__FILE__，用来指向当前执行的PHP脚本。但PHP没有直接提供该脚本所在目录的常量。也就是说如果我们要得到当前PHP脚本所在的目录，需要使用dirname()这个函数：</p><p>&lt;?php</p><p>$dir =dirname(__FILE__);</p><p>?&gt;</p><p>在PHP5.3中，新增加了一个新的常量__DIR__，指向当前执行的PHP脚本所在的目录。</p><p>例如当前执行的PHP文件为 /www/quwenqing.com/index.php</p><p>则__FILE__等于&#39;/www/quwenqing.com/index.php&#39;</p><p>而__DIR__等于&#39;/www/quwenqing.com&#39;</p><p>现在我们要包含当前文件目录或子目录下的文件，可以直接使用：</p><p>&lt;?php</p><p>&nbsp;&nbsp;include(__DIR__ . &#39;/path/to/script.inc.php&#39;);<br /> ?&gt;</p></span>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-84.html</link>
	<title><![CDATA[windows server 2003 IIS上安装 PHP 5.3]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Wed, 03 Mar 2010 15:53:08 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-84.html</guid>	
	<description><![CDATA[<p>由于PHP5.3的全新特效及改进，原有的isapi方式解析PHP脚本已经不被支持，PHP从5.3.0以后的版本开始使用微软的fastcgi模式，这是一个更先进的方式，运行速度更快，更稳定！</p><br /><p>新版本的PHP5.3通过以往老方法已经不能在IIS上安装了，现在给出在IIS上安装PHP5.3以后版本的教程。</p><br /><p>首先下载并安装IIS FastCGI，下载地址<a href="http://www.quwenqing.cn/admin/%5C%22http://www.quwenqing.cn/admin/%5C%22http://www.iis.net/1521/ItemPermalink.ashx%5C%22%5C%22">http://www.iis.net/1521/ItemPermalink.ashx</a></p><br /><p>下载IIS下的PHP，下载地址<a href="http://www.quwenqing.cn/admin/%5C%22http://www.quwenqing.cn/admin/%5C%22http://windows.php.net/download/%5C%22%5C%22">http://windows.php.net/download/</a>，（注意IIS下要选择VC9的版本）解压到所需目录，该目录需要给予user读取运行权限。</p><br /> 找到PHP安装目录下的php.ini-development并改名为php.ini<span class="&quot;&quot;t_tag&quot;&quot;">文件</span>，找到下面<br /> [Date]<br /> ; Defines the default timezone used by the date functions<br /> ; <a href="http://www.quwenqing.cn/admin/%5C%22http://www.quwenqing.cn/admin/%5C%22http://php.net/date.timezone%5C%22%5C%22" target="&quot;&quot;_blank&quot;&quot;">http://php.net/date.timezone</a><br /> ; date.timezone =<br /> 更改为<br /> [Date]<br /> ; Defines the defaul]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-72.html</link>
	<title><![CDATA[PHP 5.3新版特性浅析]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Fri, 25 Dec 2009 17:19:06 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-72.html</guid>	
	<description><![CDATA[<p>　　一、mysql驱动mysqlnd</p><p>　　一直以来，php都是通过mysql客户端连接mysql，而现在mysql官方已经推出php版的mysql客户端，而这个mysqlnd有效降低内存的使用以及提高性能。具体可以看：</p><p>　　http://dev.mysql.com/downloads/connector/php-mysqlnd/</p><p>　　http://forge.mysql.com/wiki/PHP_MYSQLND<br /><img src="http://www.quwenqing.com/attachments/200912/3185075243_f2s.jpg" style="cursor:pointer;" onclick="open_img(&#39;http://www.quwenqing.com/attachments/200912/3185075243.jpg&#39;)" alt="http://www.quwenqing.com/attachments/200912/3185075243.jpg" width="400" height="263" /></p><p>　　从图中可以看出，使用mysqlnd少了从mysql驱动中复制数据到php扩展这一步。mysqlnd使用copy-on-write，也就是写时复制，读引用。</p><p>　　mysqlnd已经内置在php5.3的源码中，编译的时候使用--with-mysql=mysqlnd、--with-mysqli=mysqlnd 和 --with-pdo-mysql=mysqlnd 安装mysqlnd驱动。</p><p>　　mysqlnd的优点</p><p>　　编译php更方便了，不需要libmysql，已经内置在源码中</p><p>　　使用php许可，避免版权问题</p><p>　　使用php的内存管理，支持php内存限制(memory_limit)</p><p>　　所有数据在</p>]]></description>
</item>
<item>
	<link>http://www.quwenqing.com/read-71.html</link>
	<title><![CDATA[mysqlnd成为php 5.3中的默认mysql驱动]]></title>
	<author><![CDATA[quwenqing@quwenqing.com (曲文庆)]]></author>
	<category><![CDATA[语言技术]]></category>
	<pubDate>Fri, 25 Dec 2009 17:14:50 +0800</pubDate>
	<guid>http://www.quwenqing.com/read-71.html</guid>	
	<description><![CDATA[<p>mysqlnd成为php 5.3中的默认mysql驱动，它有如下优点：</p><ul><li>mysqlnd更容易编译: 因为它是php源码树的一个组成部分 </li><li>mysqlnd和php内部机制结合更紧密，是优化过的mysql驱动 </li><li>mysqlnd更节省内存，从测试结果来看，比传统的mysql扩展节省40%的内存 </li><li>mysqlnd更快 </li><li>mysqlnd提供了丰富的性能统计功能 </li><li>mysqlnd使用了PHP license以避免不必要的版权纠纷 </li></ul><p>这个改动应同时对mysql和pdo_mysql扩展生效。</p><h3>mysqlnd是什么</h3><p><a href="http://blogs.mysql.com/kaj/2006/10/25/69/">mysqlnd</a>是<a href="http://www.ooso.net/?tag=mysql">mysql</a>原装的php驱动</p><br /><p>参考文章：http://forge.mysql.com/wiki/PHP_MYSQLND#A_brief_history_of_PHP.E2.80.99s_MySQL_APIs</p><p>介绍了关于mysql在PHP中的成长过程~</p><ul><li>PHP 3+ - ext/mysql: the oldest extension and API - please don&rsquo;t use it any more, it does not support all MySQL features. </li></ul>]]></description>
</item>
</channel>
</rss>
