<?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>路途志 &#187; 路途志</title>
	<atom:link href="http://www.lutuzhi.com/author/gavinchen/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lutuzhi.com</link>
	<description>一路走来，路途志</description>
	<lastBuildDate>Mon, 08 Aug 2011 16:04:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Jquery根据ID判断对象是否存在</title>
		<link>http://www.lutuzhi.com/howto/585.html</link>
		<comments>http://www.lutuzhi.com/howto/585.html#comments</comments>
		<pubDate>Mon, 08 Aug 2011 15:30:34 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[判断对象是否存在]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/?p=585</guid>
		<description><![CDATA[在一个小场景中,在进行$(&#39;#id&#39;).html(value);操作前，需要线判断#id这个对象是否存在。一开始尝试了下面的代码： if($(&#34;#id&#34;)){ return true; }else{ return false; } 测试后发现上述代码无法正常工作,无论在何种情况下,$(&#34;#id&#34;) 的返回值都是object。 google一下，找到了答案： if($(&#34;#id&#34;).length&#62;0){ return true; }else{ return false; } 使 jQuery 对象的属性 length作为判断条件来验证指定的ID关联的对象是否存在，如果 length&#62; 0 就存在。 或者 if($(&#34;#id&#34;)[0]){ return true; } else { return false; }]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/585.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP setcookie 指定domain参数后，在IE下设置cookie失效</title>
		<link>http://www.lutuzhi.com/php/575.html</link>
		<comments>http://www.lutuzhi.com/php/575.html#comments</comments>
		<pubDate>Sat, 04 Jun 2011 04:58:06 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP setcookie domain]]></category>
		<category><![CDATA[setcookie IE下失效]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/php/575.html</guid>
		<description><![CDATA[setcookie函数指定domain参数后，在IE下的表现和在chrome、firefox中的表现不同，这不是php setcookie函数的问题，这是IE的问题。 下面的代码：在chrome和firefox下可以生成三个cookie： cookie[one]、cookie[two]、cookie[three] 在IE下，只能生成cookie[one]、cookie[two]两个cookie，第三个因为指定了”.65.la”,导致cookie[three]生成失败。 &#60;?phpsetcookie(“cookie[one]“, “cookieone”,time()+36000,”/”);setcookie(“cookie[two]“, “cookietwo”,time()+36000,”/”);setcookie(“cookie[three]“, “cookiethree”, time()+36000,”/”,”.65.la”); // 页面重新if (isset($_COOKIE["cookie"])) {&#160;&#160;&#160; foreach ($_COOKIE["cookie"] as $name =&#62; $value) {&#160;&#160;&#160;&#160;&#160;&#160;&#160; $name = htmlspecialchars($name);&#160;&#160;&#160;&#160;&#160;&#160;&#160; $value = htmlspecialchars($value);&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo “$name : $value &#60;br /&#62;\n”;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; }&#160; } ?&#62; 多次实验之后，确认IE认为”.65.la”这种形式的域名参数是不规范的。如果要cookie在所有子域名通用的话，可以通过全局变量来变通的实现。]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/php/575.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>NGINX 301重定向</title>
		<link>http://www.lutuzhi.com/nginx-2/571.html</link>
		<comments>http://www.lutuzhi.com/nginx-2/571.html#comments</comments>
		<pubDate>Sun, 22 May 2011 17:51:42 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[NGINX]]></category>
		<category><![CDATA[NGINX 301]]></category>
		<category><![CDATA[重定向配置]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/nginx-2/571.html</guid>
		<description><![CDATA[股票分析报告网站http://www.65.la在百度的收录都很诡异。65.la的百度收录数量比www.65.la的收录数量还要多一些，这和我的预期不一致。一直以来友情链接和内链都是主打的www.65.la，在google里也是将www.65.la作为首选域名的。但是这个个设置对百度无效，百度的快照甚至有时候是www.65.la是最新的有时候是65.la是最新的额。今天痛下决心，把65.la重定向到www.65.la，在nginx上做如下配置即可实现了： &#160; &#160;&#160;&#160;&#160; server {&#160;&#160; listen&#160;&#160;&#160;&#160;&#160;&#160; 80;&#160;&#160; server_name&#160; www.65.la 65.la; #下面的红色字体即为301重定向所需要的配置&#160;&#160;&#160; if ($host != &#8216;www.65.la&#8217; ) {&#160;&#160;&#160; rewrite ^/(.*)$ http://www.65.la/$1 permanent;&#160;&#160;&#160; }&#160;&#160; index index.html index.htm index.php;&#160;&#160; root&#160; /opt/www/65;&#160;&#160; location ~ .*\.(php&#124;php5)?$&#160;&#160; {&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; #fastcgi_pass&#160; unix:/tmp/php-cgi.sock;&#160;&#160;&#160;&#160; fastcgi_pass&#160; 127.0.0.1:9000;&#160;&#160;&#160;&#160; fastcgi_index index.php;&#160;&#160;&#160;&#160; include fcgi.conf;&#160;&#160; }&#160;&#160; error_page&#160; 404 /404.html;&#160;&#160; log_format&#160; 65&#160; &#8216;$remote_addr &#8211; $remote_user [$time_local] “$request” &#8216;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8216;$status $body_bytes_sent [...]]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/nginx-2/571.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 中require、require_once、include、include_once区别</title>
		<link>http://www.lutuzhi.com/php/570.html</link>
		<comments>http://www.lutuzhi.com/php/570.html#comments</comments>
		<pubDate>Fri, 20 May 2011 01:55:25 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[require require_once include include_once]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/php/570.html</guid>
		<description><![CDATA[require() :包含并运行指定文件。 include() :包含并运行指定文件。 require_once() ：包含并运行指定文件，如果目标文件已经包含过，则不再次包含，和require() 语句类似。 include_once() 包含并运行指定文件，如果目标文件已经包含过，则不再次包含，和include() 语句类似。 require()和require_once()的区别： 如果被包含文件中的代码已经被包含了，则不会再次包含。 require_once() 适用于在脚本执行期间某文件有可能被包含多次的情况下，为了确保它只被包含一次以避免函数重定义，变量重新赋值等问题。 include()和include_once()的区别： 如果被包含文件中的代码已经被包含了，则不会再次包含。 include_once() 适用于在脚本执行期间某文件有可能被包含多次的情况下，为了确保它只被包含一次以避免函数重定义，变量重新赋值等问题。 require()和include()的区别 需要注意的是，require() 和 include() 在遇到错误时的行为完全不同， include()会产生一个警告，后面的代码会继续执行，而 require() 则导致一个致命错误，停止脚本运行。 提示：如果希望在被包含的文件出错时就退出脚本运行，就用require（），否则的话就用include（）。 require_once()和include_once()的区别 需要注意的是，require_once() 和 include_once() 在遇到错误时的行为完全不同， include_once()会产生一个警告，后面的代码会继续执行，而 require_once() 则导致一个致命错误，停止脚本运行。 提示：如果希望在被包含的文件出错时就退出脚本运行，就用require（），否则的话就用include（）。 适用范围： 包含文件任意次数，出错时终止脚本运行：适用require(); 包含文件任意次数，且出错时不停止：适用include； 包含文件一次，出错时终止脚本运行：适用require_once(); 只包含文件一次，且出错时不停止：适用include_once()；]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/php/570.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php中@什么意思</title>
		<link>http://www.lutuzhi.com/howto/562.html</link>
		<comments>http://www.lutuzhi.com/howto/562.html#comments</comments>
		<pubDate>Fri, 29 Apr 2011 10:16:35 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[php中@什么意思]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/howto/562.html</guid>
		<description><![CDATA[经常在函数调用前面看到@的存在，这是什么意思呢？比如：@fread。 &#160; 在函数调用前面加上@的作用是忽略函数调用过程中产生的错误信息。避免用户在访问网站是遇到莫名其妙的错误代码。]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/562.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>000190852213，骗子电话</title>
		<link>http://www.lutuzhi.com/howto/561.html</link>
		<comments>http://www.lutuzhi.com/howto/561.html#comments</comments>
		<pubDate>Thu, 28 Apr 2011 10:36:03 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[000190852213]]></category>
		<category><![CDATA[骗子]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/howto/561.html</guid>
		<description><![CDATA[今天接到一个电话，000190852213打过来的。 拿起来就听到提示“您的电话已欠费，将强制停机。如果有以为，请按0转人工台”。 按0后，听到一个很别扭的声音，装模作样的的模仿电信10000号客服的流程问了我几个问题。 本来想仔细了解下这是一个什么样的骗局，后来实在是那个声音让我太不舒服了，果断挂了电话。 类似的电话接到过好几次了,有的说是电话绑定了一个什么业务，欠了巨多的钱，有的说是法院有传票。总之每句 话都在挠你的痒痒肉。这时候要注意的是千万不能透露个人的详细信息，比如身份证号码之类的。]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/561.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>三种方式重启NGINX</title>
		<link>http://www.lutuzhi.com/howto/560.html</link>
		<comments>http://www.lutuzhi.com/howto/560.html#comments</comments>
		<pubDate>Thu, 28 Apr 2011 10:28:28 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[NGINX重启]]></category>
		<category><![CDATA[重启NGINX]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/howto/560.html</guid>
		<description><![CDATA[1.借助 -s 参数重启NGINX # /opt/nginx/sbin/nginx -s reload 这里的 -s 表示给nginx住进程发送一个信号。可选的信号为：stop,quit,reoptn,reload，在这里我们用reload信号来让nginx重启 &#160; 2.用kill命令重启NGINX kill –HUP `cat /opt/nginx/sbin/nginx.pid` 这里尤其需要注意的是上面的单引号一定要是斜斜的这个单引号（后撇号），用&#8217;（正撇号）这样的单引号会出错。 3.用php脚本重启NGINX &#60;?php passthru(escapeshellcmd(“sudo kill -HUP `cat /usr/local/nginx/nginx.pid`”)) ?&#62; passthru 的作用是运行外部程序，并在屏幕上显示结果。不需要使用 echo 或 return 来查看结果；它们会显示在浏览器上。]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/560.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql的Table is readonly解决方案</title>
		<link>http://www.lutuzhi.com/howto/559.html</link>
		<comments>http://www.lutuzhi.com/howto/559.html#comments</comments>
		<pubDate>Wed, 27 Apr 2011 18:47:29 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[mysql table is readonly]]></category>
		<category><![CDATA[mysql 表只读]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/howto/559.html</guid>
		<description><![CDATA[今天，把mysql下一个数据的表复制到另一个文件夹，结果访问时，提示”Table is readonly”的错误。 我的主机是centos5,因为之前遇到很多权限问题，当看到这个提示时，第一反应就是数据表的权限设置除了问题。 给出错的表文件赋予写权限之后，还是提示出错。google之后发现还需要flush一下才行。用 mysqladmin -u &#60;username&#62; -p flush-tables 命令成功flush所有readonly的表后，问题解决。 此次解决mysql table is readonly的具体步骤是： 给mysql的数据库目录加上可写权限，即777到mysql的Bin目录执行刷新 mysqladmin -u &#60;username&#62; -p flush-tables 另：更改了mysql权限表，可以重启mysql 服务器mysqladmin -u &#60;username&#62; -p reload 为了避免下次再遇到此类问题时不至于无解，在此把mysql Table is readonly（mysql数据表只读）这个问题的解决方案做个总结。 遇到mysql table is readonly（数据表只读）之类的提示，从下面5个角度来检查问题的原因： 1.看看只读的表文件权限是否配置得当。2.查看只读表是否上锁。3. 查看的数据库用户对该数据库的只读表是否具有单独的访问控制。4. 使用MySQL的优化或者修复操作对只读数据表进行修复(我用的是sqlyog)5. 查看你的只读表是否为InnoDB类型，这种类型的表是不能复制使用的。]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/559.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP代码中用冒号替代花括号</title>
		<link>http://www.lutuzhi.com/howto/558.html</link>
		<comments>http://www.lutuzhi.com/howto/558.html#comments</comments>
		<pubDate>Wed, 20 Apr 2011 10:16:01 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[PHP冒号]]></category>
		<category><![CDATA[流程控制替代语法]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/howto/558.html</guid>
		<description><![CDATA[最近在读一个系统的代码，不断的遇到类似下面的这样格式的写法。 &#60;?php if ($a == 5): ?&#62;A is equal to 5&#60;?php endif; ?&#62; 虽然也能大体知道这样的代码是干嘛的，但是始终觉得不是很痛快，仔细读了下相关的手册，了然了。 &#160; 这样的代码用了PHP中的流程控制替代语法： PHP 提供了一些流程控制的替代语法，包括 if，while，for，foreach 和 switch。 替代语法的基本形式是把左花括号（{）换成冒号（:），把右花括号（}）分别换成endif;，endwhile;，endfor;，endforeach; 以及 endswitch;。 在上面的例子中，HTML 内容“A is equal to 5”用替代语法嵌套在 if 语句中。该 HTML 的内容仅在 $a 等于 5 时显示。 替代语法同样可以用在 else 和 elseif 中。下面是一个包括 elseif 和 else 的 if 结构用替代语法格式写的例子 &#60;?phpif ($a == 5):&#160;&#160;&#160; echo “a [...]]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/558.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wordpress 换域名后无法访问</title>
		<link>http://www.lutuzhi.com/howto/557.html</link>
		<comments>http://www.lutuzhi.com/howto/557.html#comments</comments>
		<pubDate>Wed, 20 Apr 2011 09:41:59 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[经验记录]]></category>
		<category><![CDATA[聚焦开源]]></category>
		<category><![CDATA[wordpress换域名]]></category>
		<category><![CDATA[无法访问]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/howto/557.html</guid>
		<description><![CDATA[wordpress换域名后，博客无法访问了，改了所有的能改的配置文件，错误依然。 看来问题只能在数据库里找了，研究发现在数据库中的w_options表，保存了老域名相关的信息。把 w_options表中option_value所有老域名的信息，更新成新域名后，问题解决。]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/howto/557.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

