<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">

<channel>
	<title>Verdana DevNotes</title>
	
	<link>http://www.phpvim.net</link>
	<description>思念的时候，就来一杯爱尔兰咖啡吧...</description>
	<lastBuildDate>Mon, 29 Jun 2009 22:29:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<itunes:explicit>no</itunes:explicit><itunes:subtitle>思念的时候，就来一杯爱尔兰咖啡吧...</itunes:subtitle><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/verdana" type="application/rss+xml" /><item>
		<title>影驰 8800GT 的花屏原因</title>
		<link>http://www.phpvim.net/journal/8800gt-screen-mess.html</link>
		<comments>http://www.phpvim.net/journal/8800gt-screen-mess.html#comments</comments>
		<pubDate>Mon, 08 Jun 2009 18:03:08 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[Journal]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=478</guid>
		<description><![CDATA[2年前 G92 核心推出后，关于 8800GT 的问题就不断，这个问题就是——花屏，原因众说纷纭，却没有定论，而最终 NV 跳出来说 G92 没质量问题，有问题是因为用户 OC 所致，只要将频率调整为公版默认频率即可。OC 是导致花屏的主要原因，当然也不是唯一的原因。
去年4月份的时候，我购进了我的第一块 8800GT——影驰的 8800GT 游戏盒子，之所以说“第一块”，是因为这块显卡在服役不到 1年的时间就寿终正寝了。当时花屏了几次，然后在我正在爽 《COD5》时，屏幕暗下&#8230;&#8230;没有任何 OC 行为，温度也不高，因为当时是11月份，屋子里面冷的都要结冰了，我只能认为这是显卡本身的质量问题。返修回来以后，用了不到1个小时，再次黑屏，无法点亮系统。影驰的代理商也没有2次维修，而是给我调换了一块新的 8800GT，看做工似乎和第一块不是一批货，拿到新卡大约1个多月以后，天气开始慢慢变热，而我的花屏噩梦也终于降临了！
开始是《魔兽世界》花屏，横向、纵向线条甚至是满屏幕杂色雪花点，并且频繁出现 NV 显示器驱动重启的状况，WOW 几乎是隔几分钟就重启一次或者是被迫关闭。WOW 算是好的，开《鬼泣》、《COD5》这样的游戏，几乎1，2分钟内就会花屏，有时候甚至直接蓝屏死机，最终发展到连 2D 情况下，比如看网页或者待机的时候，都会花屏，真是把人逼疯啊！
查询了 N 多的资料发现，造成 8800GT 花屏的原因大约如下：
显卡供电不足
散热问题，或 OC 导致显存过热
内存兼容性问题
驱动兼容性问题
金手指氧化，PCI-E 插槽有异物接触不良
可是这些我都做了详细的排查，很遗憾，这些都不是造成我这块 8800GT 花屏的原因，但花屏肯定是卡本身的原因，因为我拿到别人的机器上面也会出现花屏，而花屏的时候，温度都不算太高，一般都是大约 60 多度左右的时候，就开始花了，这个温度显然又很正常。我甚至打开了将所有的配件全部拆开，清理掉了所有的灰尘，但问题丝毫没有改善。虽然不是灰尘的原因，但是最终却因此解决了花瓶的问题，因为我心不在焉的清理 CPU 飞尘的时候，一把把所有的硅胶都摸到的了手上，只好跑去买了新的硅胶，重新给涂上。几天以后当我再次面对着花屏无可奈何叹气的时候，目光落在了那没用完的硅胶上面，突然想到会不会是 GPU 上面的问题？ 果然！拆开显卡以后发现，硅胶已经快干涸了，而硅胶变质的话，显然对散热有很大影响，于是换上了新的硅胶，玩了整整一个晚上游戏，没有再出现任何花屏。虽然如此，但令人费解的是，GPU/PCB 温度反而上升了，3D 游戏中直接飚上 80 度，平时待机也有 60+ 的样子，哎！为什么温度变高了，反而不会再花屏了，难道硅胶导致软件测温有误差？真是莫名其妙啊~
]]></description>
			<content:encoded><![CDATA[<p>2年前 G92 核心推出后，关于 8800GT 的问题就不断，这个问题就是——花屏，原因众说纷纭，却没有定论，而最终 NV 跳出来说 G92 没质量问题，有问题是因为用户 OC 所致，只要将频率调整为公版默认频率即可。OC 是导致花屏的主要原因，当然也不是唯一的原因。</p>
<p>去年4月份的时候，我购进了我的第一块 8800GT——影驰的 8800GT 游戏盒子，之所以说“第一块”，是因为这块显卡在服役不到 1年的时间就寿终正寝了。当时花屏了几次，然后在我正在爽 《COD5》时，屏幕暗下&#8230;&#8230;没有任何 OC 行为，温度也不高，因为当时是11月份，屋子里面冷的都要结冰了，我只能认为这是显卡本身的质量问题。返修回来以后，用了不到1个小时，再次黑屏，无法点亮系统。影驰的代理商也没有2次维修，而是给我调换了一块新的 8800GT，看做工似乎和第一块不是一批货，拿到新卡大约1个多月以后，天气开始慢慢变热，而我的花屏噩梦也终于降临了！</p>
<p>开始是《魔兽世界》花屏，横向、纵向线条甚至是满屏幕杂色雪花点，并且频繁出现 NV 显示器驱动重启的状况，WOW 几乎是隔几分钟就重启一次或者是被迫关闭。WOW 算是好的，开《鬼泣》、《COD5》这样的游戏，几乎1，2分钟内就会花屏，有时候甚至直接蓝屏死机，最终发展到连 2D 情况下，比如看网页或者待机的时候，都会花屏，真是把人逼疯啊！</p>
<p>查询了 N 多的资料发现，造成 8800GT 花屏的原因大约如下：</p>
<p><strong>显卡供电不足</strong><br />
<strong>散热问题，或 OC 导致显存过热</strong><br />
<strong>内存兼容性问题</strong><br />
<strong>驱动兼容性问题</strong><br />
<strong>金手指氧化，PCI-E 插槽有异物接触不良</strong></p>
<p>可是这些我都做了详细的排查，很遗憾，这些都不是造成我这块 8800GT 花屏的原因，但花屏肯定是卡本身的原因，因为我拿到别人的机器上面也会出现花屏，而花屏的时候，温度都不算太高，一般都是大约 60 多度左右的时候，就开始花了，这个温度显然又很正常。我甚至打开了将所有的配件全部拆开，清理掉了所有的灰尘，但问题丝毫没有改善。虽然不是灰尘的原因，但是最终却因此解决了花瓶的问题，因为我心不在焉的清理 CPU 飞尘的时候，一把把所有的硅胶都摸到的了手上，只好跑去买了新的硅胶，重新给涂上。几天以后当我再次面对着花屏无可奈何叹气的时候，目光落在了那没用完的硅胶上面，突然想到会不会是 GPU 上面的问题？ 果然！拆开显卡以后发现，<strong>硅胶已经快干涸了</strong>，而硅胶变质的话，显然对散热有很大影响，于是换上了新的硅胶，玩了整整一个晚上游戏，没有再出现任何花屏。虽然如此，但令人费解的是，GPU/PCB 温度反而上升了，3D 游戏中直接飚上 80 度，平时待机也有 60+ 的样子，哎！为什么温度变高了，反而不会再花屏了，难道硅胶导致软件测温有误差？真是莫名其妙啊~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/journal/8800gt-screen-mess.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>为 PHP 文件设置默认图标</title>
		<link>http://www.phpvim.net/php/set-php-script-icon-windows7-and-vista.html</link>
		<comments>http://www.phpvim.net/php/set-php-script-icon-windows7-and-vista.html#comments</comments>
		<pubDate>Fri, 15 May 2009 10:06:38 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=474</guid>
		<description><![CDATA[XP 和早期的 Windows 中，你可以通过系统新增或者修改某些类型的文件图标，但是自 Vista 以后，这个功能就被 &#34;Default Programs&#34; 替代了，要修改图标只能依赖一些第三方软件。
如果不想使用第三方软件，则可以通过修改注册表来手动更改文件的图标，以下以 PHP 文件为例：

运行 regedit.exe，打开注册表编辑器。       
展开至以下分支：

1
2
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\
FileExts\.php\OpenWithProgids

若不存在的话，请手工建立。 

在右边的 Panel 中，右键新建一个二进制值（Binary Value）：phpfile，值为空即可。
    
展开至下面的位置，如果不存在，请手工建立。

1
HKEY_CLASSES_ROOT\phpfile\DefaultIcon


双击右边 Panel 中的默认（Default），输入的 ico 图标路径，如： D:\php_script.ico

退出注册表编辑器，注销 Windows，重新登录即可。 

也可以不注销 Windows，手工刷新图标缓存。
以管理员身份运行 CMD.EXE，打开命令行窗口，运行如下命令：

1
2
3
4
5
C:\Windows\system32&#62;TASKKILL /F /IM explorer.exe
C:\Windows\system32&#62;cd /d %userprofile%\AppData\Local
C:\Users\Verdana\AppData\Local&#62;del IconCache.db /a
C:\Users\Verdana\AppData\Local&#62;explorer
C:\Users\Verdana\AppData\Local&#62;exit

  
]]></description>
			<content:encoded><![CDATA[<p>XP 和早期的 Windows 中，你可以通过系统新增或者修改某些类型的文件图标，但是自 Vista 以后，这个功能就被 &quot;Default Programs&quot; 替代了，要修改图标只能依赖一些第三方软件。</p>
<p>如果不想使用第三方软件，则可以通过修改注册表来手动更改文件的图标，以下以 PHP 文件为例：</p>
<ol>
<li>运行 <strong>regedit.exe</strong>，打开注册表编辑器。       </li>
<li>展开至以下分支：

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="reg" style="font-family:monospace;"><span style="color: #800000;">HKCU</span>\Software\Microsoft\Windows\CurrentVersion\Explorer\
FileExts\.php\OpenWithProgids</pre></td></tr></table></div>

<p>若不存在的话，请手工建立。 </p>
</li>
<li>在右边的 Panel 中，右键新建一个二进制值（Binary Value）：phpfile，值为空即可。<br />
    </li>
<li>展开至下面的位置，如果不存在，请手工建立。

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="reg" style="font-family:monospace;"><span style="color: #800000;">HKEY_CLASSES_ROOT</span>\phpfile\DefaultIcon</pre></td></tr></table></div>

<p></li>
<li>双击右边 Panel 中的默认<strong>（Default）</strong>，输入的 ico 图标路径，如： D:\php_script.ico
<p></li>
<li>退出注册表编辑器，注销 Windows，重新登录即可。 </li>
</ol>
<ol>也可以不注销 Windows，手工刷新图标缓存。</ol>
<ol>以管理员身份运行 CMD.EXE，打开命令行窗口，运行如下命令：</ol>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="dos" style="font-family:monospace;">C:\Windows\system32&gt;TASKKILL /F /IM explorer.exe
C:\Windows\system32&gt;cd /d <span style="color: #33cc33;">%</span><span style="color: #448888;">userprofile</span><span style="color: #33cc33;">%</span>\AppData\Local
C:\Users\Verdana\AppData\Local&gt;del IconCache.db /a
C:\Users\Verdana\AppData\Local&gt;explorer
C:\Users\Verdana\AppData\Local&gt;exit</pre></td></tr></table></div>

<p> <img src='http://www.phpvim.net/wp-includes/images/smilies/icon_confused.gif' alt=':???:' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/php/set-php-script-icon-windows7-and-vista.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在 Nginx 中配置 Zend Framework</title>
		<link>http://www.phpvim.net/php/zend-framework-rewrite-on-nginx.html</link>
		<comments>http://www.phpvim.net/php/zend-framework-rewrite-on-nginx.html#comments</comments>
		<pubDate>Mon, 11 May 2009 06:35:23 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=473</guid>
		<description><![CDATA[
1
2
3
4
5
6
7
location / {
    root   d:/public_html;
    index  index.php index.html index.htm;
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /myproject/public/index.php last;
    }
}

按照配置文件，我的项目地址是：http://localhost/myproject/public，项目是部署在子目录 /myproject/public 里面的，如果你把 document_root 直接设置为 /myproject/public，使用 http://localhost 来访问，那么上述配置删除掉 index.php 前面的目录部分，也就是 rewrite ^/(.*)$ index.php last;
Nginx 不支持 Apache [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">location</span> / {
    root   d:/public_html;
    index  index.php index.html index.htm;
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /myproject/public/index.php last;
    }
}</pre></td></tr></table></div>

<p>按照配置文件，我的项目地址是：http://localhost/myproject/public，项目是部署在子目录 /myproject/public 里面的，如果你把 document_root 直接设置为 /myproject/public，使用 http://localhost 来访问，那么上述配置删除掉 index.php 前面的目录部分，也就是 rewrite ^/(.*)$ index.php last;</p>
<p>Nginx 不支持 Apache 的 .htaccess 文件，所以需要在 Nginx 配置文件中编写重写规则。Apache 的绝大部分 RewriteRule 命令都可以不做修改的放到 Nginx 中直接使用。你只要把 RewriteRule 改成 rewrite，[L] 改成 last 之类的就可以了，具体可以看一下 Nginx 的 Rewrite 文档。</p>
<p><a href="http://wiki.nginx.org/NginxHttpRewriteModule">http://wiki.nginx.org/NginxHttpRewriteModule</a></p>
<p>题外话，Zend Framework 越来越强大，越来越复杂了，很多追求“简洁”的 Coder 们都已经开始信誓旦旦的说要放弃 ZF 。有点搞笑，这就好像我在说：飞机太快了，价钱太贵了，不适合我，还是自行车好啊！有些人对待问题的看法极端又片面，就好像看电视剧的时候，也总是要把人分为好人和坏人一样，他们的想法很单纯——我不喜欢 ZF，因为臃肿、复杂，所以它是垃圾。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/php/zend-framework-rewrite-on-nginx.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 下 Nginx + PHP5 的安装与配置</title>
		<link>http://www.phpvim.net/php/installing-nginx-with-php5-on-windows.html</link>
		<comments>http://www.phpvim.net/php/installing-nginx-with-php5-on-windows.html#comments</comments>
		<pubDate>Sat, 09 May 2009 20:06:52 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Window]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=471</guid>
		<description><![CDATA[Nginx（Engine X） 是一个高性能的 HTTP 和 反向代理 服务器，也是一个 IMAP/POP3/SMTP 代理服务器 。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的Rambler.ru 站点开发的，它已经在该站点运行超过四年多了。Igor 将源代码以类BSD许可证的形式发布。自Nginx 发布四年来，Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。目前国内各大门户网站已经部署了Nginx，如新浪、网易、腾讯等；国内几个重要的视频分享网站也部署了Nginx，如六房间、酷6等。新近发现Nginx 技术在国内日趋火热，越来越多的网站开始部署Nginx。 
安装 PHP5
  从 http://www.php.net/downloads.php 下载最新的 PHP5 Windows 版本，解压到 C:\php5，把 php.ini-recommended 更名为 php.ini，修改几个选项：

1
2
3
4
5
6
7
8
9
10
11
12
13
error_reporting = E_ALL
display_errors = On
extension_dir = &#34;C:\php5\ext&#34;
&#160;
; 动态扩展，可以根据需要去掉 extension 前面的注释 ; 
; 如加载 PDO, MySQL
extension=php_pdo.dll
extension=php_pdo_mysql.dll
&#160;
; CGI 设置
cgi.force_redirect = 1
cgi.fix_pathinfo = 1
cgi.rfc2616_headers = 1

PHP [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><a href="http://nginx.net">Nginx</a>（Engine X） 是一个高性能的 HTTP 和 反向代理 服务器，也是一个 IMAP/POP3/SMTP 代理服务器 。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的Rambler.ru 站点开发的，它已经在该站点运行超过四年多了。Igor 将源代码以类BSD许可证的形式发布。自Nginx 发布四年来，Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。目前国内各大门户网站已经部署了Nginx，如新浪、网易、腾讯等；国内几个重要的视频分享网站也部署了Nginx，如六房间、酷6等。新近发现Nginx 技术在国内日趋火热，越来越多的网站开始部署Nginx。 </p></blockquote>
<h3>安装 PHP5</h3>
<p>  从 <a href="http://www.php.net/downloads.php">http://www.php.net/downloads.php</a> 下载最新的 PHP5 Windows 版本，解压到 C:\php5，把 php.ini-recommended 更名为 php.ini，修改几个选项：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;"><span style="color: #000099;">error_reporting</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> E_ALL</span>
<span style="color: #000099;">display_errors</span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> On</span>
<span style="color: #000099;">extension_dir</span> <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;C:\php5\ext&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; 动态扩展，可以根据需要去掉 extension 前面的注释 ; </span>
<span style="color: #666666; font-style: italic;">; 如加载 PDO, MySQL</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_pdo.dll</span>
<span style="color: #000099;">extension</span><span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">php_pdo_mysql.dll</span>
&nbsp;
<span style="color: #666666; font-style: italic;">; CGI 设置</span>
cgi.force_redirect <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span>
cgi.fix_pathinfo <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span>
cgi.rfc2616_headers <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;"> 1</span></pre></td></tr></table></div>

<p><span id="more-471"></span>PHP 加载扩展需要注意依赖性，比如 php_exif.dll 需要 php_mbstring.dll，你必须要把 php_mbstring.dll 放在 php_exif.dll 前面才能加载成功。有些扩展依赖额外的 dll 文件，如 PHP 5.0+ ，php_mysqli.dll 依赖 libmysql.dll，而 php_oci8.dll，你则需要安装 Oracle 8 的客户端。如果你对这些依赖性不是太了解，可以参考一下安装包中的 install.txt 文件。 </p>
<p>依赖文件的搜索顺序：首先是 php.exe 所在的目录，如果是 ISAPI 模式，那么会搜索 Web Server 的启动位置，比如 Apache 的 bin 目录；其次是 Windows PATH 环境变量中的目录。这里<strong>不要</strong>复制任何文件到 Windows 目录中，有必要的话，可以把 C:\php5 加到 PATH 中，有利于以后 PHP 的升级。</p>
<h3>安装 Nginx</h3>
<p>从 v0.7.52 开始，Nginx 开始发布 Windows 版本的 Nginx，你可以在其官方网站上面下载：<br />
  <br /><a href="http://nginx.net">http://nginx.net</a></p>
<p>当然也可以去 <a href="http://www.kevinworthington.com/nginx-for-windows/">Kevin Worthington</a> 的网站上面找找。</p>
<p>我使用的是 0.8.1，下载好以后，解压到 C:\nginx。</p>
<p>那么如何配置 Nginx，使其可以和 PHP 协同工作？</p>
<h3>配置 PHP FastCGI</h3>
<p>Nginx 需要和 FastCGI Server 配合才能处理请求，有两种方式运行 PHP FastCGI Server，一种就是使用 PHP 内置的 FastCGI 管理器：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">C:<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>php-cgi.exe <span style="color: #660033;">-b</span> 127.0.0.1:<span style="color: #000000;">9000</span> <span style="color: #660033;">-c</span> C:<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></td></tr></table></div>

<p>另外一种方式是使用第三方工具，比如 PHP-FPM 、spawn-fcgi 等。显然！要在 Windows 中使用这些工具是件极其痛苦的事情，你可能需要 Cygwin 之类的东西才行，的确<a href="http://www.softwareprojects.com/resources/programming/t-installing-nginx-web-server-w-php-and-ssl-1474.html">有人这么做了</a>，虽然我觉得那是自寻烦恼。</p>
<p>下一步，开始修改 Nginx 的配置文件 C:\nginx\conf\nginx.conf，找到 php 相关的部分，修改如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</span>
<span style="color: #00007f;">location</span> ~ \.php$ {
    root     D:/public_html;    
    <span style="color: #00007f;">include</span>  php.conf;
}</pre></td></tr></table></div>

<p>root 也就是 $document_root 指的是你的 php scripts 根目录，设置为你的网站根目录。在 Windows 下，需要注意的是 root 的路径，最好使用 &quot;/&quot; 作为路径分隔符，而不是 Windows 默认的 &quot;\&quot;，否则容易出问题。比如，这个路径：D:\public_html\test，就不会起作用，Nginx 会抛出 500 错误，原因是 \test 中 \t 被解析为制表符。当然再加上一个反斜杠转义也是可以的，如：d:\\public_html\\test。</p>
<p>php.conf 是我自己创建的用来保存 php 配置的文件，其实里面只有 3 行命令：</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="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># 连接到本机 9000 端口，这里的端口是指 PHP FastCGI Server 开启的端口，</span>
<span style="color: #adadad; font-style: italic;"># 请与 php-cgi.exe 开启的端口保持一致</span>
<span style="color: #adadad; font-style: italic;"># 当 Nginx 收到 php 文件的请求时，会自动转发到 PHP FastCGI Server</span>
fastcgi_pass    127.0.0.1:<span style="color: #ff0000;">9000</span>;
fastcgi_index   index.php;
<span style="color: #00007f;">include</span>         fastcgi_params;</pre></td></tr></table></div>

<p>之所以要创建一个独立的 php.conf 保存配置为了精简 nginx.conf，当在 nginx 中配置多个虚拟主机时，每个虚拟主机都需要配置 php，那么主配置文件就会变得臃肿。</p>
<p>除此以外，还需要修改一下 C:\nginx\conf\fastcgi_params 文件，加入一行：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">fastcgi_param    SCRIPT_FILENAME    $document_root$fastcgi_script_name;</pre></td></tr></table></div>

<p><span style="color: darkred">修改 php.ini，设置 cgi.fix_pathinfo = 1</span>，这非常重要，否则 PHP 将无法找到需要处理的 php 脚本。</p>
<p>以 FastCGI 模式运行 PHP，还需要设置 2 个环境变量：<br />
PHP_FCGI_CHILDREN &#8212; pre-fork 子进程数量，默认值为 0 （PHP4.3.0 之前的版本为 8）<br />
PHP_FCGI_MAX_REQUESTS &#8212;  每个子进程退出前所需要处理的请求数，默认值为 500</p>
<p>如果你不设置 PHP_FCGI_CHILDREN 的话，实际上 PHP 不会 fork 出任何的子进程，只有一个进程在处理请求，当处理的请求数达到  PHP_FCGI_MAX_REQUESTS 时，便会自动关闭。<br />
Windows 环境中第一个选项没作用，把第二个参数设置为环境变量，由于是本机开发环境，所以数值随意自己设置，别太小就行。</p>
<p>一些其他的设置，主服务器：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #adadad; font-style: italic;"># 默认开启的进程数</span>
worker_processes  <span style="color: #ff0000;">1</span>;
&nbsp;
error_log  logs/error.log;
<span style="color: #adadad; font-style: italic;">#error_log  logs/error.log  notice;</span>
<span style="color: #adadad; font-style: italic;">#error_log  logs/error.log  info;</span>
&nbsp;
<span style="color: #adadad; font-style: italic;">#pid        logs/nginx.pid;</span>
&nbsp;
events {
    <span style="color: #adadad; font-style: italic;"># 一个进程所处理的最大连接数上限，</span>
    <span style="color: #adadad; font-style: italic;"># 本地开发，不需要默认的 1024，这里改为 64</span>
    worker_connections  <span style="color: #ff0000;">64</span>;
}</pre></td></tr></table></div>

<p>当某个目录下面不存在默认 index.php index.html 等首页文件时，Nginx 会抛出 403 ERROR，如果你需要罗列此目录，则可以在 http {&#8230; } 中加入如下命令：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="apache" style="font-family:monospace;">autoindex <span style="color: #0000ff;">on</span>;
autoindex_exact_size <span style="color: #0000ff;">on</span>;
autoindex_localtime <span style="color: #0000ff;">on</span>;</pre></td></tr></table></div>

<h3>OK，整合到一起</h3>
<p>创建 start_nginx.bat，用于同时启动 PHP FastCGI 和 Nginx：</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="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> off
<span style="color: #b1b100; font-weight: bold;">echo</span> Starting PHP FastCGI...
RunHiddenConsole C:/php5/php-cgi.exe -b 127.0.0.1:<span style="color: #cc66cc;">9000</span> -c C:/php5/php.ini
&nbsp;
<span style="color: #b1b100; font-weight: bold;">echo</span> Starting nginx...
C:/nginx/nginx.exe</pre></td></tr></table></div>

<p>RunHiddenConsole.exe 是一个用来隐藏 DOS 窗口的小程序，可以在<a href="http://blogbuildingu.com/files/RunHiddenConsole.zip">这里</a>下载。 </p>
<p>start_nginx.bat 开启后，也会有 DOS 窗口，但是可以安全的关掉，并不会关闭 Nginx 和 php-cgi.exe。</p>
<p>同样 stop_nginx.bat，用来关闭：</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="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> off
<span style="color: #b1b100; font-weight: bold;">echo</span> Stopping nginx...
taskkill /F /IM nginx.exe &gt; <span style="color: #0000ff; font-weight: bold;">nul</span>
<span style="color: #b1b100; font-weight: bold;">echo</span> Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe &gt; <span style="color: #0000ff; font-weight: bold;">nul</span>
<span style="color: #00b100; font-weight: bold;">exit</span></pre></td></tr></table></div>

<p>到这里基本配置完毕了。</p>
<h3>更新记录</h3>
<p><strong>2009/06/30</strong><br />
<br />增加环境变量 PHP_FCGI_CHILDREN，PHP_FCGI_MAX_REQUESTS 的说明</p>
<p><strong>2009/06/10</strong><br />
<br />修饰一下行文用语</p>
<p><strong>2009/05/13</strong><br />
<br />更新 root 命令的路径中目录分隔符的注意事项。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/php/installing-nginx-with-php5-on-windows.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<enclosure url="http://blogbuildingu.com/files/RunHiddenConsole.zip" length="1034" type="application/zip" /><media:content url="http://blogbuildingu.com/files/RunHiddenConsole.zip" fileSize="1034" type="application/zip" /><itunes:subtitle>Nginx（Engine X） 是一个高性能的 HTTP 和 反向代理 服务器，也是一个 IMAP/POP3/SMTP 代理服务器 。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的Rambler.ru 站点开发的，它已经在该站点运行超过四年多了。Igor 将源代码以类BSD许可证的形式发布。自Nginx 发布四年来，Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。目前国内各大门户网站已经部署了Nginx，如新浪、网易、腾讯等；国内几个重要的视频分享网</itunes:subtitle><itunes:summary>Nginx（Engine X） 是一个高性能的 HTTP 和 反向代理 服务器，也是一个 IMAP/POP3/SMTP 代理服务器 。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的Rambler.ru 站点开发的，它已经在该站点运行超过四年多了。Igor 将源代码以类BSD许可证的形式发布。自Nginx 发布四年来，Nginx 已经因为它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名了。目前国内各大门户网站已经部署了Nginx，如新浪、网易、腾讯等；国内几个重要的视频分享网站也部署了Nginx，如六房间、酷6等。新近发现Nginx 技术在国内日趋火热，越来越多的网站开始部署Nginx。 安装 PHP5 从 http://www.php.net/downloads.php 下载最新的 PHP5 Windows 版本，解压到 C:\php5，把 php.ini-recommended 更名为 php.ini，修改几个选项： 1 2 3 4 5 6 7 8 9 10 11 12 13 error_reporting = E_ALL display_errors = On extension_dir = &amp;#34;C:\php5\ext&amp;#34; &amp;#160; ; 动态扩展，可以根据需要去掉 extension 前面的注释 ; ; 如加载 PDO, MySQL extension=php_pdo.dll extension=php_pdo_mysql.dll &amp;#160; ; CGI 设置 cgi.force_redirect = 1 cgi.fix_pathinfo = 1 cgi.rfc2616_headers = 1 PHP [...]</itunes:summary><itunes:keywords>PHP, Nginx, Window</itunes:keywords></item>
		<item>
		<title>关闭 WordPress 的 Post Revisions 功能</title>
		<link>http://www.phpvim.net/wordpress/turn-off-post-revision.html</link>
		<comments>http://www.phpvim.net/wordpress/turn-off-post-revision.html#comments</comments>
		<pubDate>Fri, 08 May 2009 20:06:36 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=466</guid>
		<description><![CDATA[从 2.6 开始，WordPress 增加了一个叫做 &#8220;Post Revision&#8221; 的功能，用来保存文章修订历史，这个功能类似在百科类网站中很普遍。但对博客站来说，感觉意义不大，至少对我这样的普通用户来说是不需要的，除非你经常修改你的文章，需要回档到之前的版本，而对于这个功能是否合理，也有很多争论。诸如没有页面设置来关闭这个功能，浪费存储空间，影响性能等等。
现在仍然是通过 wp-config.php 来关闭：

1
2
3
4
/**
 * Turn off &#34;Post Revisions&#34;
 */
define &#40;'WP_POST_REVISIONS', 0&#41;;

对于以前存在的 Revisions 可以通过如下的 SQL 语句删除：

1
DELETE FROM wp_posts WHERE post_type = &#34;revision&#34;;

]]></description>
			<content:encoded><![CDATA[<p>从 2.6 开始，WordPress 增加了一个叫做 &#8220;Post Revision&#8221; 的功能，用来保存文章修订历史，这个功能类似在百科类网站中很普遍。但对博客站来说，感觉意义不大，至少对我这样的普通用户来说是不需要的，除非你经常修改你的文章，需要回档到之前的版本，而对于这个功能是否合理，也有很多争论。诸如没有页面设置来关闭这个功能，浪费存储空间，影响性能等等。</p>
<p>现在仍然是通过 wp-config.php 来关闭：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Turn off &quot;Post Revisions&quot;
 */</span>
<span style="color: #990000;">define</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_POST_REVISIONS'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>对于以前存在的 Revisions 可以通过如下的 SQL 语句删除：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> wp_posts <span style="color: #993333; font-weight: bold;">WHERE</span> post_type <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">&quot;revision&quot;</span>;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/wordpress/turn-off-post-revision.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>EAN-13 条形码末位校验码计算</title>
		<link>http://www.phpvim.net/javascript/ean-13-barcode-check-digit.html</link>
		<comments>http://www.phpvim.net/javascript/ean-13-barcode-check-digit.html#comments</comments>
		<pubDate>Sun, 03 May 2009 23:15:53 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=456</guid>
		<description><![CDATA[具体的计算步骤：

12 位数字从左至右，分别计算奇数位以及偶数位之和
求奇数位之和
求偶数位之和，结果乘以 3
第 2、3 步，2 个计算结果相加
第 4 步的结果取个位数，用 10 减去个位数得到的数字，即是校验码
第 5 步个位数为 0 的话，校验码也是 0


下面是用 MooTools 实现的代码：

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
 * EAN-13 條形碼生成
 *
 * num_system: 国家代码（3位）
 * manufacturer_code: 厂商代码（4位）
 * product_code: 产品代码（5位）
 */
var BarCode = new Class&#40;&#123;
    // 初始化
    initialize: function&#40;num_system, manufacturer_code, product_code&#41;
    &#123;
     [...]]]></description>
			<content:encoded><![CDATA[<p>具体的计算步骤：</p>
<ol>
<li>12 位数字从左至右，分别计算奇数位以及偶数位之和</li>
<li>求奇数位之和</li>
<li>求偶数位之和，结果乘以 3</li>
<li>第 2、3 步，2 个计算结果相加</li>
<li>第 4 步的结果取个位数，用 10 减去个位数得到的数字，即是校验码</li>
<li>第 5 步个位数为 0 的话，校验码也是 0</li>
</ol>
<p><span id="more-456"></span></p>
<p>下面是用 MooTools 实现的代码：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">/**
 * EAN-13 條形碼生成
 *
 * num_system: 国家代码（3位）
 * manufacturer_code: 厂商代码（4位）
 * product_code: 产品代码（5位）
 */</span>
<span style="color: #003366; font-weight: bold;">var</span> BarCode <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// 初始化</span>
    initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>num_system<span style="color: #339933;">,</span> manufacturer_code<span style="color: #339933;">,</span> product_code<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// 转换为字符串</span>
        num_system          <span style="color: #339933;">=</span> num_system.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        manufacturer_code   <span style="color: #339933;">=</span> manufacturer_code.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        product_code        <span style="color: #339933;">=</span> product_code.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 得到前 12 位条形码</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">number</span> <span style="color: #339933;">=</span> num_system <span style="color: #339933;">+</span> manufacturer_code <span style="color: #339933;">+</span> product_code<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// 生成校验码</span>
    checkDigit<span style="color: #339933;">:</span> <span style="color: #003366; 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: #006600; font-style: italic;">// 将 12 位数字的字符串，拆成数组</span>
        <span style="color: #003366; font-weight: bold;">var</span> numbers <span style="color: #339933;">=</span> $A<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">number</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #003366; font-weight: bold;">var</span> s1 <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 奇数位之和</span>
        <span style="color: #003366; font-weight: bold;">var</span> s2 <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// 偶数位之和</span>
        <span style="color: #003366; font-weight: bold;">var</span> s3 <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// (s1 + s2 * 3) 取个位数</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 遍历数组开始求和</span>
        numbers.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>num<span style="color: #339933;">,</span> index<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            num <span style="color: #339933;">=</span> num.<span style="color: #660066;">toInt</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>index<span style="color: #339933;">%</span>2 <span style="color: #339933;">==</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// 奇数位</span>
                s1 <span style="color: #339933;">+=</span> num<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #006600; font-style: italic;">// 偶数位</span>
                s2 <span style="color: #339933;">+=</span> num<span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        s3 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>s1 <span style="color: #339933;">+</span> s2 <span style="color: #339933;">*</span> <span style="color: #CC0000;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">%</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 最终的校验码</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">digit_code</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> s3 <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #CC0000;">10</span> <span style="color: #339933;">-</span> s3 <span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// 输出最终的 EAN-13 条形码</span>
    output<span style="color: #339933;">:</span> <span style="color: #003366; 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: #006600; font-style: italic;">// 计算末位校验码</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checkDigit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 输出条形码</span>
        <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">number</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">digit_code</span>.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// 示例，生成一个台湾 (471) 的商品条码</span>
<span style="color: #003366; font-weight: bold;">var</span> mycode <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> BarCode<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">471</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1314</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">52101</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">output</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/javascript/ean-13-barcode-check-digit.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML INPUT 自动关闭输入法</title>
		<link>http://www.phpvim.net/javascript/auto-close-ime-for-input.html</link>
		<comments>http://www.phpvim.net/javascript/auto-close-ime-for-input.html#comments</comments>
		<pubDate>Fri, 01 May 2009 00:53:42 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=439</guid>
		<description><![CDATA[Form 表单中常有很多输入框仅仅需要输入数字或者英文等，比如电话号码，商品条码等等，当用户在这些文本框中输入信息时，自动关闭输入法确实比较贴心。我的一个台湾客户称之为“阿呆功能”，想想确实蛮傻瓜的，因为现在很多输入法（比如 Google 拼音），回车就可以直接输入数字或者英文。
但是所有的软件都有其的固定客户使用群，而你所开发的软件的使用者都是白痴也说不定的，他们或许根本不知道世界上有 Google 拼音的存在，很大一种情况就是他们可能还在使用着系统自带的古董——智能 ABC。在这种情况，所谓的“阿呆功能”还是有其存在的价值的。

实现的方法也很简单，如下：

1
&#60;input name=&#34;input&#34; style=&#34;ime-mode:disabled&#34; /&#62;

作为一个敲代码的，您不能低估客户的淫荡程度，比如我现在手里的项目，几乎全是表单，几百个文本框，客户要求所有的表单都要如此“智能”   。
My God，我当然不可能也不愿意去找到这些需要处理的文本框，然后都插进这个 style，而且没人喜欢做这种重复性的工作。
这时候使用 JS 就可以解脱了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 将需要关闭输入法的 Input 文本框的 Id 值放进这个数组中
var names =&#91;
    'age',
    'email',
    'web',
    'phone',
    'skype'
&#93;;
&#160;
window.addEvent&#40;'domready', function &#40;&#41; &#123;
    $&#40;document.body&#41;.getElements&#40;'input'&#41;.each&#40;function&#40;element&#41; &#123;
    [...]]]></description>
			<content:encoded><![CDATA[<p>Form 表单中常有很多输入框仅仅需要输入数字或者英文等，比如电话号码，商品条码等等，当用户在这些文本框中输入信息时，自动关闭输入法确实比较贴心。我的一个台湾客户称之为“阿呆功能”，想想确实蛮傻瓜的，因为现在很多输入法（比如 Google 拼音），回车就可以直接输入数字或者英文。</p>
<p>但是所有的软件都有其的固定客户使用群，而你所开发的软件的使用者都是白痴也说不定的，他们或许根本不知道世界上有 Google 拼音的存在，很大一种情况就是他们可能还在使用着系统自带的古董——智能 ABC。在这种情况，所谓的“阿呆功能”还是有其存在的价值的。</p>
<p><span id="more-439"></span></p>
<p>实现的方法也很简单，如下：</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;input&quot;</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;ime-mode:disabled&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></td></tr></table></div>

<p>作为一个敲代码的，您不能低估客户的淫荡程度，比如我现在手里的项目，几乎全是表单，几百个文本框，客户要求所有的表单都要如此“智能” <img src='http://www.phpvim.net/wp-includes/images/smilies/icon_rolleyes.gif' alt=':roll:' class='wp-smiley' />  。</p>
<p>My God，我当然不可能也不愿意去找到这些需要处理的文本框，然后都插进这个 style，而且没人喜欢做这种重复性的工作。</p>
<p>这时候使用 JS 就可以解脱了。</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// 将需要关闭输入法的 Input 文本框的 Id 值放进这个数组中</span>
<span style="color: #003366; font-weight: bold;">var</span> names <span style="color: #339933;">=</span><span style="color: #009900;">&#91;</span>
    <span style="color: #3366CC;">'age'</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">'email'</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">'web'</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">'phone'</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">'skype'</span>
<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</span><span style="color: #339933;">,</span> <span style="color: #003366; 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: #009900;">&#40;</span>document.<span style="color: #660066;">body</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>element.<span style="color: #660066;">type</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">&quot;text&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>names.<span style="color: #660066;">contains</span><span style="color: #009900;">&#40;</span>element.<span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003366; font-weight: bold;">var</span> styles <span style="color: #339933;">=</span> element.<span style="color: #660066;">getStyles</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                styles<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'ime-mode'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'disabled'</span><span style="color: #339933;">;</span>
                element.<span style="color: #660066;">setStyles</span><span style="color: #009900;">&#40;</span>styles<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>最后只需要配置 JS 中的数组就可以了，把需要关闭输入法的文本框 id 统统放进去。<br />
你也可以此基础上实现更多的功能，比如禁止复制粘贴之类的。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/javascript/auto-close-ime-for-input.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Textarea 域的字数统计</title>
		<link>http://www.phpvim.net/javascript/textarea-words-count.html</link>
		<comments>http://www.phpvim.net/javascript/textarea-words-count.html#comments</comments>
		<pubDate>Thu, 30 Apr 2009 19:37:00 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=403</guid>
		<description><![CDATA[在一些流行的网站，比如 Twitter  等，当你在 Textarea 中输入文字，通常会有文字自动统计你已经输入了多少个字符，总计多少个字符，还能输入多少字符，这样的小提示，通常能增强用户体验，像 Twitter 这样限制 140 字的微博客站点，这个功能也变得必不可少。
而我现在正在做的一个项目，其中发送 SMS 的文本框，也必须要提示用户输入的字数，下面就是我的实现方式，采用的 Mootools。基本的计算都已经有了，只要稍作修改，比如限制文字长度，提示剩余多少文字等等，这样就可以拿到自己的项目中使用了。   


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
&#60;script language=&#34;Javascript&#34;&#62;
//&#60;[CDATA[
var Countable = new Class&#40;&#123;
    count: 0,
    sms_count: 0,
    hint_template: &#34;一共輸入了 {count} 個字，需要 {sms_count} 則簡訊傳送&#34;,
&#160;
    // 初始化
    initialize: function&#40;textareaId&#41;
    &#123;
  [...]]]></description>
			<content:encoded><![CDATA[<p>在一些流行的网站，比如 <a href="http://twitter.com" class="broken_link"  target="_blank">Twitter </a> 等，当你在 Textarea 中输入文字，通常会有文字自动统计你已经输入了多少个字符，总计多少个字符，还能输入多少字符，这样的小提示，通常能增强用户体验，像 Twitter 这样限制 140 字的微博客站点，这个功能也变得必不可少。</p>
<p>而我现在正在做的一个项目，其中发送 SMS 的文本框，也必须要提示用户输入的字数，下面就是我的实现方式，采用的 <a href="http://mootools.net" target="_blank">Mootools</a>。基本的计算都已经有了，只要稍作修改，比如限制文字长度，提示剩余多少文字等等，这样就可以拿到自己的项目中使用了。 <img src='http://www.phpvim.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
<p><span id="more-403"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>script language<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Javascript&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #006600; font-style: italic;">//&lt;[CDATA[</span>
<span style="color: #003366; font-weight: bold;">var</span> Countable <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    count<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
    sms_count<span style="color: #339933;">:</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span>
    hint_template<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;一共輸入了 {count} 個字，需要 {sms_count} 則簡訊傳送&quot;</span><span style="color: #339933;">,</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// 初始化</span>
    initialize<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>textareaId<span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #006600; font-style: italic;">// 得到 Textarea 对象</span>
        input <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span>textareaId<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #006600; font-style: italic;">// 创建一个提示信息对象</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hint</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Element<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;div&quot;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #3366CC;">'class'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;hint&quot;</span>
            <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// 放到 textarea 的后面</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hint</span>.<span style="color: #660066;">injectAfter</span><span style="color: #009900;">&#40;</span>input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// 设置事件</span>
            input.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'keydown'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">onKeyPress</span>.<span style="color: #660066;">bindWithEvent</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            input.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'keyup'</span><span style="color: #339933;">,</span>   <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">onKeyPress</span>.<span style="color: #660066;">bindWithEvent</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// 设定 Input 为 Class 属性，方便其它方法中使用</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span> <span style="color: #339933;">=</span> input<span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #006600; font-style: italic;">// 有时候刷新页面时 Firefox 会莫名奇妙缓存 Textarea 中文字</span>
            <span style="color: #006600; font-style: italic;">// 这里调用一次 update()，计算被缓存的文字长度</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">count</span> <span style="color: #339933;">=</span> input.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
            <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">count</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">sms_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
                <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">update</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// 按键处理</span>
    onKeyPress<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        event <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Event<span style="color: #009900;">&#40;</span>event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 当使用 Modifiter 组合键位时，停止计算</span>
        <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>event.<span style="color: #660066;">shift</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>event.<span style="color: #660066;">control</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>event.<span style="color: #660066;">alt</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>event.<span style="color: #660066;">meta</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">update</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// 更新</span>
    update<span style="color: #339933;">:</span> <span style="color: #003366; 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: #006600; font-style: italic;">// 获得当前 Textarea 域中文字数</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">count</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">input</span>.<span style="color: #660066;">value</span>.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">count</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">sms_count</span> <span style="color: #339933;">=</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 临时的数字数组，用于替换模板</span>
        <span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span>count<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">count</span><span style="color: #339933;">,</span> sms_count<span style="color: #339933;">:</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">sms_count</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #006600; font-style: italic;">// 翻译文字模板，将 Html 文字信息嵌入到 Hint 层中</span>
        <span style="color: #003366; font-weight: bold;">var</span> hint_html <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hint_template</span>.<span style="color: #660066;">substitute</span><span style="color: #009900;">&#40;</span>foo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hint</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> hint_html<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #006600; font-style: italic;">/**
 * Startup
 */</span>
window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</span><span style="color: #339933;">,</span> <span style="color: #003366; 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: #003366; font-weight: bold;">new</span> Countable<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sms_text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/javascript/textarea-words-count.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>白人爵士乐演唱家 Frank Sinatra</title>
		<link>http://www.phpvim.net/journal/frank-sinatra.html</link>
		<comments>http://www.phpvim.net/journal/frank-sinatra.html#comments</comments>
		<pubDate>Wed, 29 Apr 2009 20:57:33 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[Journal]]></category>
		<category><![CDATA[Music]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=364</guid>
		<description><![CDATA[
这里聊一下 Frank Sinatra，这位美国二十世纪最伟大的艺人，格莱美终身成就奖得主。他是个歌手，也是个演员，还当过主持人，还是唱片公司老板，总之是个吹拉弹唱样样精通的传奇人物   ，在网上搜索他的资料时，有看到路透社评论他的一句话：Who needs Madonna when you can have Frank Sinatra? 
可见其在美国人心目中那无与伦比的地位，之所以突然说起这个人，是因为看到她的 QQ 签名 My Way 时，突然想到她在 MSN Space 上面的一篇文章，推荐了很多歌曲，其中一首便是 Frank Sinatra 的 《My Way》。
我个人说不上喜欢爵士乐，其实有时候，仔细的想想，却也说不出来到底真心喜欢何种形式的音乐，只是有时候会去收集一些电影或者游戏的原声碟，看电影玩游戏是我的两大喜好，爱屋及乌吧！
既然说起了 Frank Sinatra，那么不得不推荐一下《Fly Me To The Moon》，这首华尔兹舞曲 Bart Howard 作于 1954 年的，很多好莱坞女星都曾经演唱过这首歌，而 Frank 翻唱的版本，则将这首歌推向了一个无以复加的高度，它甚至被阿波罗号带上了月球，成为了第一首在月球播放的歌曲。如果你是《Eva》的 Fans，相信您一定会喜欢 Frank Sinatra 的版本，作为 《Eva》的 ED 曲，整套《EVA》原声碟中，《Fly Me To The Moon》也差不多有几十个版本了。
]]></description>
			<content:encoded><![CDATA[<div class="inline right"><a href="http://www.phpvim.net/wp-content/uploads/2009/04/frank-sinatra-studio-c11737531.jpeg" onclick="return hs.expand(this);" class="highslide-image"><img src="http://www.phpvim.net/wp-content/uploads/2009/04/frank-sinatra-studio-c11737531-150x150.jpg" alt="image" title="Click to enlarge" class="sided" /></a></div>
<p>这里聊一下 Frank Sinatra，这位美国二十世纪最伟大的艺人，格莱美终身成就奖得主。他是个歌手，也是个演员，还当过主持人，还是唱片公司老板，总之是个吹拉弹唱样样精通的传奇人物 <img src='http://www.phpvim.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ，在网上搜索他的资料时，有看到路透社评论他的一句话：<b>Who needs Madonna when you can have Frank Sinatra? </b></p>
<p>可见其在美国人心目中那无与伦比的地位，之所以突然说起这个人，是因为看到她的 QQ 签名 My Way 时，突然想到她在 MSN Space 上面的一篇文章，推荐了很多歌曲，其中一首便是 Frank Sinatra 的 《My Way》。</p>
<p>我个人说不上喜欢爵士乐，其实有时候，仔细的想想，却也说不出来到底真心喜欢何种形式的音乐，只是有时候会去收集一些电影或者游戏的原声碟，看电影玩游戏是我的两大喜好，爱屋及乌吧！</p>
<p>既然说起了 Frank Sinatra，那么不得不推荐一下《Fly Me To The Moon》，这首华尔兹舞曲 Bart Howard 作于 1954 年的，很多好莱坞女星都曾经演唱过这首歌，而 Frank 翻唱的版本，则将这首歌推向了一个无以复加的高度，它甚至被阿波罗号带上了月球，成为了第一首在月球播放的歌曲。如果你是《Eva》的 Fans，相信您一定会喜欢 Frank Sinatra 的版本，作为 《Eva》的 ED 曲，整套《EVA》原声碟中，《Fly Me To The Moon》也差不多有几十个版本了。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/journal/frank-sinatra.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>关闭 Windows7 的音量自动调节</title>
		<link>http://www.phpvim.net/windows/turn-off-auto-volume-for-windows7.html</link>
		<comments>http://www.phpvim.net/windows/turn-off-auto-volume-for-windows7.html#comments</comments>
		<pubDate>Wed, 25 Mar 2009 08:45:49 +0000</pubDate>
		<dc:creator>Verdana Mu</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.phpvim.net/?p=326</guid>
		<description><![CDATA[
Windows 7 有个贴心的小功能，默认的情况下，当系统检测到系统的某设备发出声音时，会自动调节其它的设备的音量，以防止你错过一些重要的东西，比如当你的 SKYPE 收到电话时，如果系统中正在播放音乐，那么音乐的音量会被自动降低。
当然很多人可能根本不需要这个功能，比如我，当我开着 QQ 时，QQ 的好友消息的声音提示，一样会触发这个功能，foobar 的音乐音量会被默认减少 80%，我不得不重新调节系统音量。功能虽好，但是如果你不需要，那么它就不叫“贴心”，而是“麻烦”。
进入控制面板，或者右键点击系统栏的音量图标，打开声音控制面板，选择 Communications 面板，可以看到四个单选选项，选择最后一项 &#8220;Do nothing&#8221;，即可关闭这个功能。    
]]></description>
			<content:encoded><![CDATA[<div class="inline right"><a href="http://www.phpvim.net/wp-content/uploads/2009/03/auto_adjust_the_volume.png" onclick="return hs.expand(this);" class="highslide-image"><img src="http://www.phpvim.net/wp-content/uploads/2009/03/auto_adjust_the_volume-269x300.png" alt="image" title="Click to enlarge" /></a></div>
<p>Windows 7 有个贴心的小功能，默认的情况下，当系统检测到系统的某设备发出声音时，会自动调节其它的设备的音量，以防止你错过一些重要的东西，比如当你的 SKYPE 收到电话时，如果系统中正在播放音乐，那么音乐的音量会被自动降低。</p>
<p>当然很多人可能根本不需要这个功能，比如我，当我开着 QQ 时，QQ 的好友消息的声音提示，一样会触发这个功能，foobar 的音乐音量会被默认减少 80%，我不得不重新调节系统音量。功能虽好，但是如果你不需要，那么它就不叫“贴心”，而是“麻烦”。</p>
<p>进入控制面板，或者右键点击系统栏的音量图标，打开声音控制面板，选择 Communications 面板，可以看到四个单选选项，选择最后一项 &#8220;Do nothing&#8221;，即可关闭这个功能。  <img src='http://www.phpvim.net/wp-includes/images/smilies/icon_redface.gif' alt=':oops:' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.phpvim.net/windows/turn-off-auto-volume-for-windows7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<media:rating>nonadult</media:rating></channel>
</rss>
