<?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>ada的博客 – 点滴分享，用心品味生活</title>
	<atom:link href="http://www.jianghuimin.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jianghuimin.com</link>
	<description>喜欢产品设计，移动开发，捣鼓网站相关东东</description>
	<lastBuildDate>Sun, 29 Jan 2012 01:28:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>php最常用的最有作用的函数</title>
		<link>http://www.jianghuimin.com/whoami/1524.html</link>
		<comments>http://www.jianghuimin.com/whoami/1524.html#comments</comments>
		<pubDate>Sun, 29 Jan 2012 01:24:29 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[杂谈]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[函数]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1524</guid>
		<description><![CDATA[tempnam 生成唯一文件名 例 tempnam('./yzm/tmpimage','cookie');//生成唯一文件名 array_values 重建数组索引 file_exists 判断文件是否存在，文件要使用绝对路径 var_dump 输出出变量 例 $cookie_file = dirname(__FILE__)."/yzm/tmpimage/emscookie"; var_dump(file_exists($cookie_file)) 未完待续...]]></description>
			<content:encoded><![CDATA[<p>tempnam 生成唯一文件名<br />
例<br />
tempnam('./yzm/tmpimage','cookie');//生成唯一文件名</p>
<p>array_values 重建数组索引</p>
<p>file_exists 判断文件是否存在，文件要使用绝对路径</p>
<p>var_dump 输出出变量</p>
<p>例<br />
$cookie_file = dirname(__FILE__)."/yzm/tmpimage/emscookie";<br />
var_dump(file_exists($cookie_file))<br />
未完待续...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/whoami/1524.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux生成core文件、core文件路径设置</title>
		<link>http://www.jianghuimin.com/program/cplusplus/1521.html</link>
		<comments>http://www.jianghuimin.com/program/cplusplus/1521.html#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:21:33 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[core]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1521</guid>
		<description><![CDATA[在Linux下产生并调试core文件 先看看我用的是个什么机器： $ uname -a Linux dev 2.4.21-9.30AXsmp #1 SMP Wed May 26 23:37:09 EDT 2004 i686 i686 i386 GNU/Linux 再看看默认的一些参数，注意core file size是个0，程序出错时不会产生core文件了。 $ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) 4 max memory size (kbytes, -m) unlimited [...]]]></description>
			<content:encoded><![CDATA[<p>在Linux下产生并调试core文件 先看看我用的是个什么机器：</p>
<p>$ uname -a<br />
Linux dev 2.4.21-9.30AXsmp #1 SMP Wed May 26 23:37:09 EDT 2004 i686 i686 i386 GNU/Linux</p>
<p>再看看默认的一些参数，注意core file size是个0，程序出错时不会产生core文件了。</p>
<p><span id="more-1521"></span><br />
$ ulimit -a<br />
core file size (blocks, -c) 0<br />
data seg size (kbytes, -d) unlimited<br />
file size (blocks, -f) unlimited<br />
max locked memory (kbytes, -l) 4<br />
max memory size (kbytes, -m) unlimited<br />
open files (-n) 2048<br />
pipe size (512 bytes, -p) 8<br />
stack size (kbytes, -s) 10240<br />
cpu time (seconds, -t) unlimited<br />
max user processes (-u) 7168<br />
virtual memory (kbytes, -v) unlimited</p>
<p>写个简单的程序，看看core文件是不是会被产生。</p>
<p>$ more foo.c</p>
<p>#include <stdio.h></p>
<p>static void sub(void);</p>
<p>int main(void)<br />
{<br />
    sub();<br />
    return 0;<br />
}</p>
<p>static void sub(void)<br />
{<br />
    int *p = NULL;</p>
<p>    /* derefernce a null pointer, expect core dump. */<br />
    printf("%d", *p);<br />
}</p>
<p>$ gcc -Wall -g foo.c<br />
$ ./a.out<br />
Segmentation fault</p>
<p>$ ls -l core.*<br />
ls: core.*: No such file or directory</p>
<p>没有找到core文件，我们改改ulimit的设置，让它产生。1024是随便取的，要是core文件大于1024个块，就产生不出来了。</p>
<p>$ ulimit -c 1024</p>
<p>$ ulimit -a<br />
core file size (blocks, -c) 1024<br />
data seg size (kbytes, -d) unlimited<br />
file size (blocks, -f) unlimited<br />
max locked memory (kbytes, -l) 4<br />
max memory size (kbytes, -m) unlimited<br />
open files (-n) 2048<br />
pipe size (512 bytes, -p) 8<br />
stack size (kbytes, -s) 10240<br />
cpu time (seconds, -t) unlimited<br />
max user processes (-u) 7168<br />
virtual memory (kbytes, -v) unlimited</p>
<p>$ ./a.out<br />
Segmentation fault (core dumped)<br />
$ ls -l core.*<br />
-rw------- 1 uniware uniware 53248 Jun 30 17:10 core.9128</p>
<p>注意看上述的输出信息，多了个(core dumped)。确实产生了一个core文件，9128是该进程的PID。我们用GDB来看看这个core。</p>
<p>$ gdb --core=core.9128<br />
GNU gdb Asianux (6.0post-0.20040223.17.1AX)<br />
Copyright 2004 Free Software Foundation, Inc.<br />
GDB is free software, covered by the GNU General Public License, and you are<br />
welcome to change it and/or distribute copies of it under certain conditions.<br />
Type "show copying" to see the conditions.<br />
There is absolutely no warranty for GDB. Type "show warranty" for details.<br />
This GDB was configured as "i386-asianux-linux-gnu".<br />
Core was generated by `./a.out'.<br />
Program terminated with signal 11, Segmentation fault.<br />
#0 0x08048373 in ?? ()<br />
(gdb) bt<br />
#0 0x08048373 in ?? ()<br />
#1 0xbfffd8f8 in ?? ()<br />
#2 0x0804839e in ?? ()<br />
#3 0xb74cc6b3 in ?? ()<br />
#4 0x00000000 in ?? ()</p>
<p>此时用bt看不到backtrace，也就是调用堆栈，原来GDB还不知道符号信息在哪里。我们告诉它一下：</p>
<p>(gdb) file ./a.out<br />
Reading symbols from ./a.out...done.<br />
Using host libthread_db library "/lib/tls/libthread_db.so.1".<br />
(gdb) bt<br />
#0 0x08048373 in sub () at foo.c:17<br />
#1 0x08048359 in main () at foo.c:8</p>
<p>此时backtrace出来了。</p>
<p>(gdb) l<br />
8         sub();<br />
9         return 0;<br />
10     }<br />
11<br />
12     static void sub(void)<br />
13     {<br />
14         int *p = NULL;<br />
15<br />
16         /* derefernce a null pointer, expect core dump. */<br />
17         printf("%d", *p);<br />
(gdb)</p>
<p>在程序不寻常退出时，内核会在当前工作目录下生成一个core文件（是一个内存映像，同时加上调试信息）。使用gdb来查看core文件，可以指示出导致程序出错的代码所在文件和行数。</p>
<p>1.core文件的生成开关和大小限制<br />
---------------------------------<br />
 1）使用ulimit -c命令可查看core文件的生成开关。若结果为0，则表示关闭了此功能，不会生成core文件。<br />
 2）使用ulimit -c filesize命令，可以限制core文件的大小（filesize的单位为kbyte）。若ulimit -c unlimited，则表示core文件的大小不受限制。如果生成的信息超过此大小，将会被裁剪，最终生成一个不完整的core文件。在调试此core文件的时候，gdb会提示错误。</p>
<p>2.core文件的名称和生成路径<br />
----------------------------<br />
core文件生成路径:<br />
输入可执行文件运行命令的同一路径下。<br />
若系统生成的core文件不带其他任何扩展名称，则全部命名为core。新的core文件生成将覆盖原来的core文件。</p>
<p>1）/proc/sys/kernel/core_uses_pid可以控制core文件的文件名中是否添加pid作为扩展。文件内容为1，表示添加pid作为扩展名，生成的core文件格式为core.xxxx；为0则表示生成的core文件同一命名为core。<br />
可通过以下命令修改此文件：<br />
echo "1" > /proc/sys/kernel/core_uses_pid</p>
<p>2）proc/sys/kernel/core_pattern可以控制core文件保存位置和文件名格式。<br />
可通过以下命令修改此文件：<br />
echo "/corefile/core-%e-%p-%t" > core_pattern，可以将core文件统一生成到/corefile目录下，产生的文件名为core-命令名-pid-时间戳<br />
以下是参数列表:<br />
    %p - insert pid into filename 添加pid<br />
    %u - insert current uid into filename 添加当前uid<br />
    %g - insert current gid into filename 添加当前gid<br />
    %s - insert signal that caused the coredump into the filename 添加导致产生core的信号<br />
    %t - insert UNIX time that the coredump occurred into filename 添加core文件生成时的unix时间<br />
    %h - insert hostname where the coredump happened into filename 添加主机名<br />
    %e - insert coredumping executable name into filename 添加命令名</p>
<p>3.core文件的查看<br />
-----------------<br />
 core文件需要使用gdb来查看。<br />
 gdb ./a.out<br />
 core-file core.xxxx<br />
 使用bt命令即可看到程序出错的地方。<br />
以下两种命令方式具有相同的效果，但是在有些环境下不生效，所以推荐使用上面的命令。<br />
1）gdb -core=core.xxxx<br />
file ./a.out<br />
bt<br />
2）gdb -c core.xxxx<br />
file ./a.out<br />
bt</p>
<p>4.开发板上使用core文件调试<br />
-----------------------------<br />
如果开发板的操作系统也是linux，core调试方法依然适用。如果开发板上不支持gdb，可将开发板的环境（依赖库）、可执行文件和core文件拷贝到PC的linux下。<br />
在 PC上调试开发板上产生的core文件，需要使用交叉编译器自带的gdb，并且需要在gdb中指定solib-absolute-prefix和 solib-search-path两个变量以保证gdb能够找到可执行程序的依赖库路径。有一种建立配置文件的方法，不需要每次启动gdb都配置以上变量，即：在待运行gdb的路径下建立.gdbinit。<br />
配置文件内容：<br />
set solib-absolute-prefix YOUR_CROSS_COMPILE_PATH<br />
set solib-search-path YOUR_CROSS_COMPILE_PATH<br />
set solib-search-path YOUR_DEVELOPER_TOOLS_LIB_PATH<br />
handle SIG32 nostop noprint pass</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/program/cplusplus/1521.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>httpclient连接超时设置</title>
		<link>http://www.jianghuimin.com/program/java/1515.html</link>
		<comments>http://www.jianghuimin.com/program/java/1515.html#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:08:49 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[andoird]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[httpclient]]></category>
		<category><![CDATA[超时]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1515</guid>
		<description><![CDATA[/* 从连接池中取连接的超时时间 */ ConnManagerParams.setTimeout(params, 1000); /* 连接超时 */ HttpConnectionParams.setConnectionTimeout(params, 2000); /* 请求超时 */ HttpConnectionParams.setSoTimeout(params, 4000); 第一行设置ConnectionPoolTimeout：这定义了从ConnectionManager管理的连接池中取出连接的超时时间，此处设置为1秒。 第二行设置ConnectionTimeout：这定义了通过网络与服务器建立连接的超时时间。Httpclient包中通过一个异步线程去创建与服务器的socket连接，这就是该socket连接的超时时间，此处设置为2秒。 第三行设置SocketTimeout：这定义了Socket读数据的超时时间，即从服务器获取响应数据需要等待的时间，此处设置为4秒。 以上3种超时分别会抛出ConnectionPoolTimeoutException,ConnectionTimeoutException与SocketTimeoutException。 &#160; httpclient post方法封装 public static String post(String url, NameValuePair... params) { try { // 编码参数 List&#60;NameValuePair&#62; formparams = new ArrayList&#60;NameValuePair&#62;(); // 请求参数 for (NameValuePair p : params) { formparams.add(p); } UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams, CHARSET); [...]]]></description>
			<content:encoded><![CDATA[<p>/* 从连接池中取连接的超时时间 */<br />
ConnManagerParams.setTimeout(params, 1000);<br />
/* 连接超时 */<br />
HttpConnectionParams.setConnectionTimeout(params, 2000);<br />
/* 请求超时 */<br />
HttpConnectionParams.setSoTimeout(params, 4000);</p>
<p>第一行设置ConnectionPoolTimeout：这定义了从ConnectionManager管理的连接池中取出连接的超时时间，此处设置为1秒。<br />
第二行设置ConnectionTimeout：这定义了通过网络与服务器建立连接的超时时间。Httpclient包中通过一个异步线程去创建与服务器的socket连接，这就是该socket连接的超时时间，此处设置为2秒。<br />
第三行设置SocketTimeout：这定义了Socket读数据的超时时间，即从服务器获取响应数据需要等待的时间，此处设置为4秒。<br />
以上3种超时分别会抛出ConnectionPoolTimeoutException,ConnectionTimeoutException与SocketTimeoutException。</p>
<p>&nbsp;</p>
<p>httpclient post方法封装</p>
<p><code>public static String post(String url, NameValuePair... params) {<br />
try {<br />
// 编码参数<br />
List&lt;NameValuePair&gt; formparams = new ArrayList&lt;NameValuePair&gt;(); // 请求参数<br />
for (NameValuePair p : params) {<br />
formparams.add(p);<br />
}<br />
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(formparams,<br />
CHARSET);<br />
// 创建POST请求<br />
HttpPost request = new HttpPost(url);<br />
request.setEntity(entity);<br />
// 发送请求<br />
HttpClient client = getHttpClient();<br />
HttpResponse response = client.execute(request);<br />
if(response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {<br />
throw new RuntimeException("请求失败");<br />
}<br />
HttpEntity resEntity =  response.getEntity();<br />
return (resEntity == null) ? null : EntityUtils.toString(resEntity, CHARSET);<br />
} catch (UnsupportedEncodingException e) {<br />
Log.w(TAG, e.getMessage());<br />
return null;<br />
} catch (ClientProtocolException e) {<br />
Log.w(TAG, e.getMessage());<br />
return null;<br />
} catch (IOException e) {<br />
throw new RuntimeException("连接失败", e);<br />
}</p>
<p>}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/program/java/1515.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.net.SocketException: No route to host</title>
		<link>http://www.jianghuimin.com/android/1512.html</link>
		<comments>http://www.jianghuimin.com/android/1512.html#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:06:48 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[andoird]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1512</guid>
		<description><![CDATA[网络环境不好，连不上网络异常，把手机放到信号好的地方就能解决。]]></description>
			<content:encoded><![CDATA[<p>网络环境不好，连不上网络异常，把手机放到信号好的地方就能解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/android/1512.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>编译zxing核心包过程</title>
		<link>http://www.jianghuimin.com/android/1507.html</link>
		<comments>http://www.jianghuimin.com/android/1507.html#comments</comments>
		<pubDate>Fri, 27 Jan 2012 14:03:51 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[andoird]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1507</guid>
		<description><![CDATA[先安装ant，然后下载代码，按如下步骤编译即可]]></description>
			<content:encoded><![CDATA[<p>先安装ant，然后下载代码，按如下步骤编译即可</p>
<p><a href="http://www.jianghuimin.com/wp-content/uploads/2012/01/build.jpg"><img class="alignnone size-full wp-image-1508" title="zxing包编译过程" src="http://www.jianghuimin.com/wp-content/uploads/2012/01/build.jpg" alt="" width="674" height="440" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/android/1507.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php过滤html标签函数</title>
		<link>http://www.jianghuimin.com/whoami/1503.html</link>
		<comments>http://www.jianghuimin.com/whoami/1503.html#comments</comments>
		<pubDate>Tue, 24 Jan 2012 06:47:47 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[杂谈]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1503</guid>
		<description><![CDATA[strip_tags()，能过滤标准的html标签，只留下html中的内容，去掉标签元素。]]></description>
			<content:encoded><![CDATA[<p>strip_tags()，能过滤标准的html标签，只留下html中的内容，去掉标签元素。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/whoami/1503.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP数组适用unset删除重建索引</title>
		<link>http://www.jianghuimin.com/program/php/1498.html</link>
		<comments>http://www.jianghuimin.com/program/php/1498.html#comments</comments>
		<pubDate>Mon, 23 Jan 2012 16:23:45 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1498</guid>
		<description><![CDATA[1.unset删除元素后不会重建数组的索引。 array_values()可以实现索引重建 //************about unset************************ //$a = array(1 => 'one', 2 => 'two', 3 => 'three'); //unset($a[2]); /* will produce an array that would have been defined as $a = array(1 => 'one', 3 => 'three'); and NOT $a = array(1 => 'one', 2 =>'three'); */ //$b = array_values($a); // Now $b is array(0 => 'one', [...]]]></description>
			<content:encoded><![CDATA[<p>1.unset删除元素后不会重建数组的索引。</p>
<p>array_values()可以实现索引重建<br />
<span id="more-1498"></span><br />
			//************about unset************************<br />
			//$a = array(1 => 'one', 2 => 'two', 3 => 'three');<br />
			//unset($a[2]);<br />
			/* will produce an array that would have been defined as<br />
			   $a = array(1 => 'one', 3 => 'three');<br />
			   and NOT<br />
			   $a = array(1 => 'one', 2 =>'three');<br />
			*/</p>
<p>			//$b = array_values($a);<br />
			// Now $b is array(0 => 'one', 1 =>'three')<br />
			//**********************************************</p>
<p>2.preg_match 参数 U s i 作用<br />
/u 表示按unicode(utf-8)匹配（主要针对多字节比如汉字）<br />
/i 表示不区分大小写（如果表达式里面有 a， 那么 A 也是匹配对象）<br />
/s 表示将字符串视为单行来匹配</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/program/php/1498.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>resources.ap_资源文件不存在错误</title>
		<link>http://www.jianghuimin.com/android/1491.html</link>
		<comments>http://www.jianghuimin.com/android/1491.html#comments</comments>
		<pubDate>Sun, 01 Jan 2012 09:20:55 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[andoird]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[文件不存在]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1491</guid>
		<description><![CDATA[Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist. 对工程的包名重构后出现这个错误。 &#160; 解决办法： Project &#62; Clean 重新生成工程即可。]]></description>
			<content:encoded><![CDATA[<p>Compile Error: Error generating final archive: java.io.FileNotFoundException: ..\bin\resources.ap_ does not exist.</p>
<p>对工程的包名重构后出现这个错误。</p>
<p>&nbsp;</p>
<p>解决办法：</p>
<p><code>Project &gt; Clean</code></p>
<p>重新生成工程即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/android/1491.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android R.java文件丢失后重新生成</title>
		<link>http://www.jianghuimin.com/android/1489.html</link>
		<comments>http://www.jianghuimin.com/android/1489.html#comments</comments>
		<pubDate>Sun, 01 Jan 2012 09:16:00 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[andoird]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[R文件]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1489</guid>
		<description><![CDATA[方法1：右击工程-&#62;选择Android Tools-&#62;选择Fix Project Properties 。 方法 2:  右击你的工程(项目)——&#62;Properties——&#62;Android ——&#62; 选择相应的target 然后 点击 apply 即可。 这样就应该OK！如若不行，向下看！ &#160; 主要看工程中带红色“X”号的地方，主要检查布局文件xml，如果这里面有错误，就不会重新生成了， 先排除这里的错误，然后进行方法1或方法2即可。]]></description>
			<content:encoded><![CDATA[<p>方法1：右击工程-&gt;选择Android Tools-&gt;选择Fix Project Properties 。</p>
<p><span style="color: #ff0000;">方法 2: </span> 右击你的工程(项目)——&gt;Properties——&gt;Android ——&gt; 选择相应的target 然后 点击 apply 即可。<span style="color: #ff0000;"><br />
</span></p>
<p>这样就应该OK！如若不行，向下看！</p>
<p>&nbsp;</p>
<p>主要看工程中带红色“X”号的地方，主要检查布局文件xml，如果这里面有错误，就不会重新生成了，</p>
<p>先排除这里的错误，然后进行方法1或方法2即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/android/1489.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>google c/c++编程风格总结</title>
		<link>http://www.jianghuimin.com/program/cplusplus/1483.html</link>
		<comments>http://www.jianghuimin.com/program/cplusplus/1483.html#comments</comments>
		<pubDate>Tue, 27 Dec 2011 08:11:21 +0000</pubDate>
		<dc:creator>mood</dc:creator>
				<category><![CDATA[c++]]></category>
		<category><![CDATA[规范]]></category>

		<guid isPermaLink="false">http://www.jianghuimin.com/?p=1483</guid>
		<description><![CDATA[先阐述几个概念： 　　Pascal Case ：当标识符由两个或者两个以上单词组成的时候，单词之间不加其他的符号，并且每个单词首字母都必须大写，例如PascalCase。 　　camel Case: 当标识符由两个或者两个以上单词组成的时候，单词间不加其他的符号，并且第一个单词以小写开头，其他单词以大写开头。例如camelCase。 　　Unix/Linux变量命名方法：当程序由两个或两个以上单词组成的时候，单词都以小写开头，并且以_连接。  　　下面是Google C++编程规范的一些内容： 　　一、命名 　　　　1）普通变量：linux命名规范 。例如：string table_name; 　　　　2）常量： k+PascalCase。例如 const int kDayInAWeek = 7; 　　　　3）类私有成员： linux命名规范+_。 例如：int parament_count_; 　　　　4）普通函数命名：PascalCase。例如：AddTableEntry()。 　　　　5）存储函数：linux命名方法。例如： 　　　　　　　int num_entries() const {return num_entries_}; 　　　　　　　void set_num_entries(){int num_entries}; 　　　　6)枚举：值为全大写组成的单词，单词以_分割。例如MY_ENUM_VALUE 　　　　7)类名、结构名：PascalCase 　　二、函数参数 　　　　输入参数在钱，输出参数在后。 　　三、头文件排序 　　　　C系统头文件 　　　　C++系统头文件 　　　　其他库头文件 　　　　本项目内头文件 　　四、文件注释 　　　　1、创建时间  作者 　　　　2、修改时间  修改人   修改函数列表 　　　　3、头文件中，首先生命该类的作用，对函数的用法作简单说明 　　五、其他约定 　　　　1、每行不要超过80个字符，包含长路径或者头文件保护的情况除外； 　　　　2、设定编辑器将tab转换为空格，最好为4个空格； 　　　　3、空循环体使用{}、continue，而不是一个分号； 　　　　4、不要使用匈牙利命名法。]]></description>
			<content:encoded><![CDATA[<p>先阐述几个概念：</p>
<p><strong>　　Pascal Case </strong>：当标识符由两个或者两个以上单词组成的时候，单词之间不加其他的符号，并且每个单词首字母都必须大写，例如PascalCase。</p>
<p><strong>　　camel Case</strong>: 当标识符由两个或者两个以上单词组成的时候，单词间不加其他的符号，并且第一个单词以小写开头，其他单词以大写开头。例如camelCase。</p>
<p>　　<strong>Unix/Linux变量命名方法</strong>：当程序由两个或两个以上单词组成的时候，单词都以小写开头，并且以_连接。 </p>
<p>　　下面是Google C++编程规范的一些内容：</p>
<p><strong>　　一、命名</strong></p>
<p>　　　　1）普通变量：linux命名规范 。例如：string table_name;</p>
<p>　　　　2）常量： k+PascalCase。例如 const int kDayInAWeek = 7;</p>
<p>　　　　3）类私有成员： linux命名规范+_。 例如：int parament_count_;</p>
<p>　　　　4）普通函数命名：PascalCase。例如：AddTableEntry()。</p>
<p>　　　　5）存储函数：linux命名方法。例如：</p>
<p>　　　　　　　int num_entries() const {return num_entries_};</p>
<p>　　　　　　　void set_num_entries(){int num_entries};</p>
<p>　　　　6)枚举：值为全大写组成的单词，单词以_分割。例如MY_ENUM_VALUE</p>
<p>　　　　7)类名、结构名：PascalCase</p>
<p>　<strong>　二、函数参数</strong></p>
<p>　　　　输入参数在钱，输出参数在后。</p>
<p>　<strong>　三、头文件排序</strong></p>
<p>　　　　C系统头文件</p>
<p>　　　　C++系统头文件</p>
<p>　　　　其他库头文件</p>
<p>　　　　本项目内头文件</p>
<p><strong>　　四、文件注释</strong></p>
<p>　　　　1、创建时间  作者</p>
<p>　　　　2、修改时间  修改人   修改函数列表</p>
<p>　　　　3、头文件中，首先生命该类的作用，对函数的用法作简单说明</p>
<p><strong>　　五、其他约定</strong></p>
<p>　　　　1、每行不要超过80个字符，包含长路径或者头文件保护的情况除外；</p>
<p>　　　　2、设定编辑器将tab转换为空格，最好为4个空格；</p>
<p>　　　　3、空循环体使用{}、continue，而不是一个分号；</p>
<p>　　　　4、不要使用匈牙利命名法。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jianghuimin.com/program/cplusplus/1483.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

