<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/feedsky6.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" 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/" version="2.0"><channel><atom:link href="http://feed.feedsky.com/murray" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/murray" type="application/rss+xml"></fs:self_link><lastBuildDate>Sat, 14 Jan 2012 15:23:36 GMT</lastBuildDate><title>murray-专注于网站建设及优化</title><description>murray的后院</description><link>http://murray.cn</link><language>en</language><pubDate>Sat, 14 Jan 2012 15:31:09 GMT</pubDate><item><title>关于apache下网站加速利器mod-pagespeed</title><link>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/</link><content:encoded>&lt;p&gt;自从有了自己独立服务器，一直认为自己网站速度还是挺快的，但自从上了监控宝之后，发现其实自己服务器的服务经常断。有很多时候网站是不可用的，这个让我很郁闷。一直在看dbanotes（大冯）的博客，知道他的服务器跟我都是在linode下，并且都是linux。然而我们的网站访问速度大相径庭。这一点肯定是我服务器没有配置好。&lt;br /&gt;
于是我通过查看两个网站页面HTTP状态，发现两个网站的网页返回HEAD信息差别不大，只有一个X-Mod-Pagespeed信息不知道是做什么的。看来这个参数的作用很大。&lt;br /&gt;
原来这是贴心的 Google 特为懒惰型网站主提供了傻瓜化解决方案，据称该模块可以有效将网页加载速度提高50%，Google这款加速模块简单的解决了许多复情况的问题：&lt;br /&gt;
-如果你的网站采用apache构建服务器，不需要对网站CMS系统进行处理即可应用；&lt;br /&gt;
-加速模块可以自行对网络传输的html字节优化及对图象，css进入压缩优化传输；&lt;br /&gt;
-智能缓存是一大亮点，它可以自动智能缓存，加速下载&lt;/p&gt;
&lt;p&gt;以下是这个模块的版本&lt;br /&gt;
mod_pagespeed 32-bit .deb (Debian/Ubuntu)&lt;br /&gt;
mod_pagespeed 64-bit .deb (Debian/Ubuntu)&lt;br /&gt;
mod_pagespeed 32-bit .rpm (CentOS/Fedora)&lt;br /&gt;
mod_pagespeed 64-bit .rpm (CentOS/Fedora)&lt;br /&gt;
具体的安装方法：&lt;br /&gt;
首先先下载模块到服务器&lt;br /&gt;
如果你是debian的系统请运行一下命令&lt;br /&gt;
dpkg -i mod-pagespeed-*.deb&lt;br /&gt;
apt-get -f install&lt;br /&gt;
如果是centos的系统则&lt;br /&gt;
yum install at&lt;br /&gt;
rpm -U mod-pagespeed-*.rpm&lt;/p&gt;
&lt;p&gt;重启APACHE后你会发现速度真的快了&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897273/murray/feedsky/s.gif?r=http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/feed/</wfw:commentRss><description>自从有了自己独立服务器，一直认为自己网站速度还是挺快的，但自从上了监控宝之后，发现其实自己服务器的服务经常断。有很多时候网站是不可用的，这个让我很郁闷。一直在看dbanotes（大冯）的博客，知道他的服务器跟我都是在linode下，并且都是linux。然而我们的网站访问速度大相径庭。这一点肯定是我服务器没有配置好。
于是我通过查看两个网站页面HTTP状态，发现两个网站的网页返回HEAD信息差别不大，只有一个X-Mod-Pagespeed信息不知道是做什么的。看来这个参数的作用很大。
原来这是贴心的 Google 特为懒惰型网站主提供了傻瓜化解决方案，据称该模块可以有效将网页加载速度提高50%，Google这款加速模块简单的解决了许多复情况的问题：
-如果你的网站采用apache构建服务器，不需要对网站CMS系统进行处理即可应用；
-加速模块可以自行对网络传输的html字节优化及对图象，css进入压缩优化传输；
-智能缓存是一大亮点，它可以自动智能缓存，加速下载
以下是这个模块的版本
mod_pagespeed 32-bit .deb (Debian/Ubuntu)
mod_pagespeed 64-bit .deb (Debian/Ubuntu)
mod_pagespeed 32-bit .rpm (CentOS/Fedora)
mod_pagespeed 64-bit .rpm (CentOS/Fedora)
具体的安装方法：
首先先下载模块到服务器
如果你是debian的系统请运行一下命令
dpkg -i mod-pagespeed-*.deb
apt-get -f install
如果是centos的系统则
yum install at
rpm -U mod-pagespeed-*.rpm
重启APACHE后你会发现速度真的快了&lt;img src=&quot;http://www1.feedsky.com/t1/596897273/murray/feedsky/s.gif?r=http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>linux</category><category>mod-pagespeed</category><category>技术研究</category><category>Apache</category><pubDate>Sat, 14 Jan 2012 23:23:36 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/#comments</comments><guid isPermaLink="false">http://murray.cn/?p=1230</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2012/01/linux-apache-mod-pagespeed/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897273/5311714</fs:itemid></item><item><title>php中json编码和解码的一些提示</title><link>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/</link><content:encoded>&lt;p&gt;对于php下的web service应用，json因其快速，轻量在小数据量传输的时候非常有优势，但用的时候有些小细节需要注意。我就是把数组存进去，再取出来的时候发现变成对象了，才发现原来是这样。&lt;br /&gt;
在运行环境上，json在php5.2以上才是内置的。&lt;br /&gt;
常用的方法是json_encode和json_decode。&lt;br /&gt;
json_encode的参数只有一个，就是要被转换的数据,而json_decode就不一样，他可以把json格式转换成对象(object)和数组两种&lt;br /&gt;
下面是个例子&lt;br /&gt;
$arr = array(&amp;#8221;1&amp;#8243;,&amp;#8221;2&amp;#8243;,&amp;#8221;3&amp;#8243;);&lt;br /&gt;
print_r($arr);&lt;br /&gt;
echo json_encode($arr);&lt;br /&gt;
print_r(json_decode(json_encode($arr)));&lt;br /&gt;
print_r(json_decode(json_encode($arr), true));&lt;/p&gt;
&lt;p&gt;如果数组转成json，想解码回来的，别忘了加个参数true&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897274/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/feed/</wfw:commentRss><description>对于php下的web service应用，json因其快速，轻量在小数据量传输的时候非常有优势，但用的时候有些小细节需要注意。我就是把数组存进去，再取出来的时候发现变成对象了，才发现原来是这样。
在运行环境上，json在php5.2以上才是内置的。
常用的方法是json_encode和json_decode。
json_encode的参数只有一个，就是要被转换的数据,而json_decode就不一样，他可以把json格式转换成对象(object)和数组两种
下面是个例子
$arr = array(&amp;#8221;1&amp;#8243;,&amp;#8221;2&amp;#8243;,&amp;#8221;3&amp;#8243;);
print_r($arr);
echo json_encode($arr);
print_r(json_decode(json_encode($arr)));
print_r(json_decode(json_encode($arr), true));
如果数组转成json，想解码回来的，别忘了加个参数true&lt;img src=&quot;http://www1.feedsky.com/t1/596897274/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>json_decode</category><category>JSON</category><category>技术研究</category><category>PHP</category><category>array</category><category>object</category><category>json_encode</category><pubDate>Sat, 31 Dec 2011 14:56:12 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/#comments</comments><guid isPermaLink="false">http://murray.cn/?p=1227</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/12/php-json-encode-decode-array-object/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897274/5311714</fs:itemid></item><item><title>本博已于今天正式迁移到Linode</title><link>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/</link><content:encoded>&lt;p&gt;为了便于管理今天本博已正式迁移到了linode，linode在东京的机房步给力啊，怎么有时候会ping超时呢&lt;/p&gt;
&lt;p&gt;特此记录以下。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897275/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/12/murraycn-move-to-linode/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/feed/</wfw:commentRss><description>为了便于管理今天本博已正式迁移到了linode，linode在东京的机房步给力啊，怎么有时候会ping超时呢
特此记录以下。&lt;img src=&quot;http://www1.feedsky.com/t1/596897275/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/12/murraycn-move-to-linode/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>linux</category><category>工作日志</category><category>linode</category><pubDate>Tue, 06 Dec 2011 17:05:14 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/#comments</comments><guid isPermaLink="false">http://murray.cn/?p=1225</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/12/murraycn-move-to-linode/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897275/5311714</fs:itemid></item><item><title>游戏服务器管理-文件同步的解决方案</title><link>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/</link><content:encoded>&lt;p&gt;服务器均使用LINUX的CENTOS，同步程序使用Rsync，台湾服务器为Rsync的服务端&lt;/p&gt;
&lt;p&gt;服务端配置&lt;/p&gt;
&lt;p&gt;同步软件安装&lt;br /&gt;
yum -y install xinetd&lt;/p&gt;
&lt;p&gt;启动rsync服务端&lt;br /&gt;
#rsync &amp;#8211;daemon&lt;/p&gt;
&lt;p&gt;配置同步软件为可用&lt;br /&gt;
vi /etc/xinetd.d/rsync&lt;/p&gt;
&lt;p&gt;# default: off&lt;br /&gt;
# description: The rsync server is a good addition to an ftp server, as it /&lt;br /&gt;
#      allows crc checksumming etc.&lt;br /&gt;
service rsync&lt;br /&gt;
{&lt;br /&gt;
disable               = no           // change&lt;br /&gt;
socket_type      = stream&lt;br /&gt;
wait                   = no&lt;br /&gt;
user                 = root&lt;br /&gt;
server             = /usr/bin/rsync&lt;br /&gt;
server_args    = &amp;#8211;daemon&lt;br /&gt;
log_on_failure   += USERID&lt;br /&gt;
}&lt;br /&gt;
配置本地同步参数&lt;br /&gt;
vi /etc/rsyncd.conf&lt;/p&gt;
&lt;p&gt;[game-test-taiwan]&lt;br /&gt;
path = /var/www/&lt;br /&gt;
host allow = xx.xx.xx.xx&lt;br /&gt;
host deny = *&lt;br /&gt;
list = true&lt;br /&gt;
uid = root&lt;br /&gt;
gid = root&lt;/p&gt;
&lt;p&gt;客户端配置&lt;/p&gt;
&lt;p&gt;安装同步软件&lt;br /&gt;
yum install -y rsync&lt;br /&gt;
配置排除指定目录或文件(每条记录占一行，支持通配符)&lt;br /&gt;
vi /etc/rsync-exclude-test&lt;/p&gt;
&lt;p&gt;/xxxxxx&lt;/p&gt;
&lt;p&gt;执行同步(从服务器端下拉)&lt;br /&gt;
rsync -avz &amp;#8211;delete &amp;#8211;exclude-from=/etc/rsync-exclude-test 203.69.85.43::game-test-taiwan /var/backup&lt;br /&gt;
执行同步(从客户端上传)&lt;br /&gt;
rsync -avz &amp;#8211;delete &amp;#8211;exclude-from=/etc/rsync-exclude-test /var/backup 203.69.85.43::game-test-taiwan/forrsync&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897276/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/feed/</wfw:commentRss><description>服务器均使用LINUX的CENTOS，同步程序使用Rsync，台湾服务器为Rsync的服务端
服务端配置
同步软件安装
yum -y install xinetd
启动rsync服务端
#rsync &amp;#8211;daemon
配置同步软件为可用
vi /etc/xinetd.d/rsync
# default: off
# description: The rsync server is a good addition to an ftp server, as it /
#      allows crc checksumming etc.
service rsync
{
disable               = no       [...]&lt;img src=&quot;http://www1.feedsky.com/t1/596897276/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>工作日志</category><pubDate>Tue, 05 Jul 2011 15:49:34 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1220</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/07/game-linux-server-rsync-daemon/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897276/5311714</fs:itemid></item><item><title>wordpress获取当前分类页的ID</title><link>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/</link><content:encoded>&lt;p&gt;最近搞WORDPRESS的最新版，做模板的时候想获取当前分类的ID，以下是实现代码&lt;/p&gt;
&lt;div&gt;&lt;span&gt;获取当前分类页的ID&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;lt;?php if (is_category()) {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; global $wp_query;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; $cat_id = $wp_query-&amp;gt;get_queried_object_id();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897277/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/feed/</wfw:commentRss><description>最近搞WORDPRESS的最新版，做模板的时候想获取当前分类的ID，以下是实现代码
获取当前分类页的ID
&amp;#60;?php if (is_category()) {
 global $wp_query;
 $cat_id = $wp_query-&amp;#62;get_queried_object_id();
 }
?&amp;#62;&lt;img src=&quot;http://www1.feedsky.com/t1/596897277/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>wordpress</category><category>get_queried_object_id</category><category>is_category</category><category>技术研究</category><category>cat-id</category><pubDate>Sat, 30 Apr 2011 19:47:33 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1218</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/04/wordpress-cat-id-is_category-get_queried_object_id/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897277/5311714</fs:itemid></item><item><title>android开发笔记</title><link>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/</link><content:encoded>&lt;p&gt;1. 修改了创建工程时候的默认activity的名称，发现发布项目时不能正常编译。编译的还是旧的名称，显示找不到：ActivityManager: Error: Activity class does not exist.&lt;br /&gt;
解决办法：在项目的根目录修改配置文件AndroidManifest.xml中的application中的activity&lt;br /&gt;
2. 对两个activity做跳转，发现部署后一直报错并“意外停止”，这是简单的小程序，不可能吃内存太多的。肯定是哪里不对。启用了debug模式，知道到logcat，发现里面有这样一句“ have you declared this activity in your AndroidManifest.xml”，看来又是AndroidManifest.xml的配置问题。果然在其中加了后，跳转后的activity正常了。&lt;br /&gt;
3. android程序在调试时出现了套接字异常“java.net.SocketException: Permission denied”。这是一个经典错误， Socket不能对外连接，错误不会被报出，调试的时候，能看到Exception,  一般是抛出 java.net.socketexception permission denied这个异常。只要你的程序想联网，就会抛出这个异常，最终联网失败。 原因是： 需要访问到网络必须要有权限，在AndroidManifest.xml中，需要进行如下配置：&lt;br /&gt;
4. could not write file images\/system.img, No space left on device一般的目录是这里C:\Documents and Settings\Administrator\.android，而这个盘已经满了，只剩下几十M的容量是不够的。（系统盘一般是C盘），因为空间不足就无法启动，删了一些文件后重新运行eclipse就好了&lt;br /&gt;
5. 往string[] 添加元素的方法，一个for循环中 string[i] = 对应item[i]&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897278/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/feed/</wfw:commentRss><description>1. 修改了创建工程时候的默认activity的名称，发现发布项目时不能正常编译。编译的还是旧的名称，显示找不到：ActivityManager: Error: Activity class does not exist.
解决办法：在项目的根目录修改配置文件AndroidManifest.xml中的application中的activity
2. 对两个activity做跳转，发现部署后一直报错并“意外停止”，这是简单的小程序，不可能吃内存太多的。肯定是哪里不对。启用了debug模式，知道到logcat，发现里面有这样一句“ have you declared this activity in your AndroidManifest.xml”，看来又是AndroidManifest.xml的配置问题。果然在其中加了后，跳转后的activity正常了。
3. android程序在调试时出现了套接字异常“java.net.SocketException: Permission denied”。这是一个经典错误， Socket不能对外连接，错误不会被报出，调试的时候，能看到Exception,  一般是抛出 java.net.socketexception permission denied这个异常。只要你的程序想联网，就会抛出这个异常，最终联网失败。 原因是： 需要访问到网络必须要有权限，在AndroidManifest.xml中，需要进行如下配置：
4. could not write file images\/system.img, No space left on device一般的目录是这里C:\Documents and Settings\Administrator\.android，而这个盘已经满了，只剩下几十M的容量是不够的。（系统盘一般是C盘），因为空间不足就无法启动，删了一些文件后重新运行eclipse就好了
5. 往string[] 添加元素的方法，一个for循环中 string[i] = 对应item[i]&lt;img src=&quot;http://www1.feedsky.com/t1/596897278/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>android</category><category>activitymanager</category><category>denied</category><category>技术研究</category><category>Permission</category><category>exception</category><category>androidmanifest</category><pubDate>Fri, 29 Apr 2011 19:40:13 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1216</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/04/android%e5%bc%80%e5%8f%91%e7%ac%94%e8%ae%b0/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897278/5311714</fs:itemid></item><item><title>Android开发常见问题及解决方法</title><link>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/</link><content:encoded>&lt;p&gt;&lt;strong&gt;1.ActivityManager: Warning: Activity not started, its current task has been brought to the front&lt;/strong&gt;&lt;br /&gt;
说明：模拟器中已经有一个实例在运行。&lt;br /&gt;
解决方法：退出模拟器中运行的程序，再次运行即可解决！&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.No grammar constraints (DTD or XML schema) detected for the document&lt;/strong&gt;&lt;br /&gt;
说明：在编辑器中看到像这样关于缺少语法约束（DTD 或 XML 架构）的警告，尽管忽略这些警告。&lt;br /&gt;
解决方法：windows -&amp;gt; preferences -&amp;gt; xml -&amp;gt; xml files -&amp;gt; validation -&amp;gt; Indicate when no grammar is specified: 选择Ignore即可。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.R.java: no such file or directory&lt;/strong&gt;&lt;br /&gt;
说明：R类不存在。&lt;br /&gt;
解决方法：Windows-&amp;gt;Preference-&amp;gt;Java-&amp;gt;Build Path中，将Folders改为选中Projects即可。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.res\layout\*.xml: Invalid file name: must contain only [a-z0-9_.]&lt;/strong&gt;&lt;br /&gt;
说明：样式XML的文件名起的不符合要求。文件名中只能是小写英文字符、数字、&amp;#8221;_&amp;#8221;或者&amp;#8221;.&amp;#8221;。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5.INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES&lt;/strong&gt;&lt;br /&gt;
说明：这样的问题主要是签名冲突造成的，比如你使用了ADB的debug权限签名，但后来使用标准sign签名后再安装同一个文件会出现这样的错误提示。&lt;br /&gt;
解决方法：卸载原有版本再进行安装，而adb install -r参数是无法解决这个问题。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;6.Android程序为什么没有退出设计？&lt;/strong&gt;&lt;br /&gt;
答：Google Android平台在设计程序声明周期上比较特殊，可能是考虑到第二次加载时保证速度的原因而没有强制加入内存释放问题，所有的资源回收由Dalvik GC自动完成，所以在设计开发时一定要注意Activity和 Service类的生命周期问题，显示在最上层的窗口将有最高的优先级，当Android操作系统内存不够用时自动将会根据历史栈按优先级强制杀掉进程。&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;7.Emulator Control GPS轨迹发送按钮有时会变灰不可点。&lt;/strong&gt;&lt;br /&gt;
答：重启Eclipse。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897279/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/feed/</wfw:commentRss><description>1.ActivityManager: Warning: Activity not started, its current task has been brought to the front
说明：模拟器中已经有一个实例在运行。
解决方法：退出模拟器中运行的程序，再次运行即可解决！
2.No grammar constraints (DTD or XML schema) detected for the document
说明：在编辑器中看到像这样关于缺少语法约束（DTD 或 XML 架构）的警告，尽管忽略这些警告。
解决方法：windows -&amp;#62; preferences -&amp;#62; xml -&amp;#62; xml files -&amp;#62; validation -&amp;#62; Indicate when no grammar is specified: 选择Ignore即可。
3.R.java: no such file or directory
说明：R类不存在。
解决方法：Windows-&amp;#62;Preference-&amp;#62;Java-&amp;#62;Build Path中，将Folders改为选中Projects即可。
4.res\layout\*.xml: Invalid file name: must contain [...]&lt;img src=&quot;http://www1.feedsky.com/t1/596897279/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>android</category><category>技术研究</category><category>eclipse</category><category>XML</category><category>activity</category><category>GOOGLE</category><pubDate>Thu, 28 Apr 2011 19:38:40 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1212</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/04/google-android-eclipse-activity-service/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897279/5311714</fs:itemid></item><item><title>html中title没写完整造成同样的页面firefox可以显示，其他浏览器都是空白</title><link>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/</link><content:encoded>&lt;p&gt;无聊的IE，失败的IE就是个垃圾。&lt;br /&gt;
不过也怪自己不好，一个页面在IE中或者在基于IE内核的浏览器中显示为一片空白，但是在火狐浏览器或者其他非IE浏览器中显示正常，这种情况下问题很有可能出现在Title标签上。&lt;br /&gt;
这次记住了：&lt;br /&gt;
1.title标签未写完整。&lt;br /&gt;
如：《title》murray-专注于网站建设及优化《title》，&lt;br /&gt;
解决办法：只要把它更改完整应该就没问题。&lt;br /&gt;
2.title标签位置不对。&lt;br /&gt;
如： 《title》murray-专注于网站建设及优化《/title》&lt;br /&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;&lt;br /&gt;
解决办法：将meta标签内和title标签位置互换即可。&lt;br /&gt;
原因：Content-Type的位置出现在title之前。这使得IE浏览器不知怎么解释这个数据（按照图片解析还是按照文本解析），IE一片迷茫，所以就出现空白现象。FireFox 会“阅读”完所有代码后判断编码方式，自然不会出现空白现象。&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897280/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/feed/</wfw:commentRss><description>无聊的IE，失败的IE就是个垃圾。
不过也怪自己不好，一个页面在IE中或者在基于IE内核的浏览器中显示为一片空白，但是在火狐浏览器或者其他非IE浏览器中显示正常，这种情况下问题很有可能出现在Title标签上。
这次记住了：
1.title标签未写完整。
如：《title》murray-专注于网站建设及优化《title》，
解决办法：只要把它更改完整应该就没问题。
2.title标签位置不对。
如： 《title》murray-专注于网站建设及优化《/title》

解决办法：将meta标签内和title标签位置互换即可。
原因：Content-Type的位置出现在title之前。这使得IE浏览器不知怎么解释这个数据（按照图片解析还是按照文本解析），IE一片迷茫，所以就出现空白现象。FireFox 会“阅读”完所有代码后判断编码方式，自然不会出现空白现象。&lt;img src=&quot;http://www1.feedsky.com/t1/596897280/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>blank</category><category>工作日志</category><category>meta</category><category>TITLE</category><category>html</category><category>IE</category><category>Firefox</category><pubDate>Thu, 14 Apr 2011 15:29:20 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1210</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/04/html-titile-blank-firefox-ie-google-kongbai/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897280/5311714</fs:itemid></item><item><title>linode服务器重装全纪录</title><link>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/</link><content:encoded>&lt;p&gt;大家都说linode好用，还真的好用，这么一转眼就用了一年半了。最近刚刚重装了自己在LINODE的服务器。在此之前，我用的是debian，后来发现centos用起来太方便了。于是就琢磨着把系统换一下。在网上，查了好久的资料没有一个相对完整的解决方案。于是，我只好临时买了一个新的linode节点，做测试。下面就把大致的过程写出来。&lt;br /&gt;
其实，Linode的系统重装很快很方便。主要就是之前你的数据怎么整理，备份再在重装后恢复回来。&lt;br /&gt;
我的解决办法分两步：&lt;br /&gt;
1，首先先把现有的linode节点重新划分，把现有的一个镜像盘分为两个，举例来说，我现在的linode系统分为两个硬盘镜像(disk image):512MB Swap Image和Debian Disk Image，其中Debian Disk Image有16G，所有的东西都在这里。我用linode的resize工具现将16G中没有用到的10G划分出来。然后再新建一个硬盘镜像（Create a new Disk Image），把这10G作为一个外挂硬盘来用，命名为：extdisk。（注意:以上操作要先关闭系统）&lt;br /&gt;
2，在Lionde的系统配置部分（Configuration Profiles）找到自己的debian配置，点击编辑(edit)，找到外挂硬盘（Block Device Assignment）部分，在/dev/xvdc这里下拉找到新建的外挂硬盘extdisk，保存设置。然后启动操作系统。&lt;br /&gt;
3，正常登录操作系统，首先查看外挂硬盘是否正常，打入fdisk -l 发现列表中已经有/dev/xvdc，接下来，我们就要想办法把外挂硬盘挂入操作系统了。现在你想挂入的地方新建一个目录，比如我选在根目录新建一个叫extdisk,命令是：mkdir /extdisk，然后用Mount /dev/xvdc /extdisk把外挂硬盘挂入操作系统。命令正常执行后，我们ls /extdisk，发现正常访问，这就表示我们的外挂硬盘正常工作了。我们可以把我们需要备份的文件都拷进来。&lt;br /&gt;
4，备份完毕后，关闭操作系统，开始重装。先删除debian的硬盘镜像（Debian Disk Image），然后删除操作系统的配置文件（My Debian Profile），之后在重建一个Linux版本（Deploy a Linux Distribution）就可以了，重建的时候，他会自动把你刚刚删除的硬盘镜像的空间用上，很方便。这次的Linux版本可要选对了，我选择的是Centos 5.5&lt;br /&gt;
5，启动centos，在把步骤3中的操作重做一遍，把刚刚的备份硬盘镜像重新挂进来，我们的重装就完成了。&lt;/p&gt;
&lt;p&gt;重装系统风险很大，请大家务必慎重哈&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897281/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/03/linode-server-rebuild-install/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/feed/</wfw:commentRss><description>大家都说linode好用，还真的好用，这么一转眼就用了一年半了。最近刚刚重装了自己在LINODE的服务器。在此之前，我用的是debian，后来发现centos用起来太方便了。于是就琢磨着把系统换一下。在网上，查了好久的资料没有一个相对完整的解决方案。于是，我只好临时买了一个新的linode节点，做测试。下面就把大致的过程写出来。
其实，Linode的系统重装很快很方便。主要就是之前你的数据怎么整理，备份再在重装后恢复回来。
我的解决办法分两步：
1，首先先把现有的linode节点重新划分，把现有的一个镜像盘分为两个，举例来说，我现在的linode系统分为两个硬盘镜像(disk image):512MB Swap Image和Debian Disk Image，其中Debian Disk Image有16G，所有的东西都在这里。我用linode的resize工具现将16G中没有用到的10G划分出来。然后再新建一个硬盘镜像（Create a new Disk Image），把这10G作为一个外挂硬盘来用，命名为：extdisk。（注意:以上操作要先关闭系统）
2，在Lionde的系统配置部分（Configuration Profiles）找到自己的debian配置，点击编辑(edit)，找到外挂硬盘（Block Device Assignment）部分，在/dev/xvdc这里下拉找到新建的外挂硬盘extdisk，保存设置。然后启动操作系统。
3，正常登录操作系统，首先查看外挂硬盘是否正常，打入fdisk -l 发现列表中已经有/dev/xvdc，接下来，我们就要想办法把外挂硬盘挂入操作系统了。现在你想挂入的地方新建一个目录，比如我选在根目录新建一个叫extdisk,命令是：mkdir /extdisk，然后用Mount /dev/xvdc /extdisk把外挂硬盘挂入操作系统。命令正常执行后，我们ls /extdisk，发现正常访问，这就表示我们的外挂硬盘正常工作了。我们可以把我们需要备份的文件都拷进来。
4，备份完毕后，关闭操作系统，开始重装。先删除debian的硬盘镜像（Debian Disk Image），然后删除操作系统的配置文件（My Debian Profile），之后在重建一个Linux版本（Deploy a Linux Distribution）就可以了，重建的时候，他会自动把你刚刚删除的硬盘镜像的空间用上，很方便。这次的Linux版本可要选对了，我选择的是Centos 5.5
5，启动centos，在把步骤3中的操作重做一遍，把刚刚的备份硬盘镜像重新挂进来，我们的重装就完成了。
重装系统风险很大，请大家务必慎重哈&lt;img src=&quot;http://www1.feedsky.com/t1/596897281/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/03/linode-server-rebuild-install/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>linux</category><category>fdisk</category><category>debian</category><category>技术研究</category><category>rebuild</category><category>centos</category><category>install</category><category>mount</category><category>linode</category><pubDate>Mon, 28 Mar 2011 12:54:24 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1206</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/03/linode-server-rebuild-install/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897281/5311714</fs:itemid></item><item><title>linux centos 5 lamp(apache mysql php) yum自动安装shell脚本</title><link>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/</link><content:encoded>&lt;p&gt;手头有N台linux centos 5的服务器，每次配置都要打很多命令，不想这么烦下去了。&lt;br /&gt;
自己写了一个自动安装脚本，包括了apache mysql php的自动Yum安装。最后还设置了防火墙。&lt;br /&gt;
记录一下，想要源文件的可以跟我要。&lt;/p&gt;
&lt;p&gt;别忘了，给这个文件这是一个执行权限，简单的来就是chmod 7777&lt;/p&gt;
&lt;p&gt;#! /bin/bash&lt;br /&gt;
yum -y install httpd php mysql mysql-server php-mysql&lt;br /&gt;
echo &amp;#8216;install httpd,php,mysql,php success&amp;#8217;&lt;br /&gt;
# define auto run&lt;br /&gt;
/sbin/chkconfig httpd on&lt;br /&gt;
/sbin/chkconfig &amp;#8211;add mysqld&lt;br /&gt;
/sbin/chkconfig mysqld on&lt;br /&gt;
echo &amp;#8216;define httpd mysqld autorun success&amp;#8217;&lt;br /&gt;
# start service&lt;br /&gt;
/sbin/service httpd restart&lt;br /&gt;
/sbin/service mysqld restart&lt;br /&gt;
echo &amp;#8217;start httpd mysqld success&amp;#8217;&lt;br /&gt;
#define mysql password&lt;br /&gt;
mysqladmin -u root password &amp;#8216;ismurray&amp;#8217;&lt;br /&gt;
echo &amp;#8216;define mysql password success&amp;#8217;&lt;br /&gt;
# install apache ext&lt;br /&gt;
yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql&lt;br /&gt;
echo &amp;#8216;install apache ext success&amp;#8217;&lt;br /&gt;
# install php ext&lt;br /&gt;
yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc&lt;br /&gt;
echo &amp;#8216;install php ext success&amp;#8217;&lt;br /&gt;
# install mysql ext&lt;br /&gt;
yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql&lt;br /&gt;
echo &amp;#8216;install mysql ext success&amp;#8217;&lt;br /&gt;
# define iptables 80 22 3306&lt;br /&gt;
/sbin/iptables -I INPUT -p tcp &amp;#8211;dport 80 -j ACCEPT&lt;br /&gt;
/sbin/iptables -I INPUT -p tcp &amp;#8211;dport 22 -j ACCEPT&lt;br /&gt;
/sbin/iptables -I INPUT -p tcp &amp;#8211;dport 3306 -j ACCEPT&lt;br /&gt;
/etc/rc.d/init.d/iptables save&lt;br /&gt;
echo &amp;#8216;define iptables success&amp;#8217;&lt;/p&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/596897282/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</content:encoded><wfw:commentRss>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/feed/</wfw:commentRss><description>手头有N台linux centos 5的服务器，每次配置都要打很多命令，不想这么烦下去了。
自己写了一个自动安装脚本，包括了apache mysql php的自动Yum安装。最后还设置了防火墙。
记录一下，想要源文件的可以跟我要。
别忘了，给这个文件这是一个执行权限，简单的来就是chmod 7777
#! /bin/bash
yum -y install httpd php mysql mysql-server php-mysql
echo &amp;#8216;install httpd,php,mysql,php success&amp;#8217;
# define auto run
/sbin/chkconfig httpd on
/sbin/chkconfig &amp;#8211;add mysqld
/sbin/chkconfig mysqld on
echo &amp;#8216;define httpd mysqld autorun success&amp;#8217;
# start service
/sbin/service httpd restart
/sbin/service mysqld restart
echo &amp;#8217;start httpd mysqld success&amp;#8217;
#define mysql password
mysqladmin -u root password &amp;#8216;ismurray&amp;#8217;
echo &amp;#8216;define mysql password success&amp;#8217;
# install apache ext
yum -y [...]&lt;img src=&quot;http://www1.feedsky.com/t1/596897282/murray/feedsky/s.gif?r=http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;</description><category>linux</category><category>技术研究</category><category>PHP</category><category>mysql</category><category>yum</category><category>shell</category><category>centos</category><category>install</category><category>Apache</category><category>LAMP</category><pubDate>Thu, 24 Mar 2011 16:40:55 +0800</pubDate><author>murray</author><comments>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/#comments</comments><guid isPermaLink="false">http://www.murray.cn/?p=1202</guid><dc:creator>murray</dc:creator><fs:srclink>http://murray.cn/index.php/2011/03/linux-centos-5-lamp-apache-mysql-install-yum-shell/</fs:srclink><fs:srcfeed>http://www.murray.cn/index.php/feed/</fs:srcfeed><fs:itemid>feedsky/murray/~7202615/596897282/5311714</fs:itemid></item></channel></rss>
