<?xml version="1.0" encoding="gb2312"?>
<rss version="2.0">
<channel>
<title><![CDATA[对酒当歌]]></title>
        <image>
        <title>http://hi.baidu.com</title>
        <link>http://hi.baidu.com</link>
        <url>http://img.baidu.com/img/logo-hi.gif</url>
        </image>
<description><![CDATA[应权 通变 弘思 远益]]></description>
<link>http://hi.baidu.com/walkandsing</link>
<language>zh-cn</language>
<generator>www.baidu.com</generator>
<ttl>5</ttl>


<item>
        <title><![CDATA[struct vs typedef struct]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/d77a756057893e41eaf8f87a.html]]></link>
        <description><![CDATA[
		
		常见的结构定义方式有以下两种：<br>
struct id{...};&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   (1)<br>
typedef struct {} id;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   (2)<br>
二者的区别在于(1)中的id是一个tag，(2)中的id是一个type，具体体现在定义变量时：<br>
struct id v1;<br>
id v1;<br>
<br>
二者还有些细微的差别，当定义linked list时，在结构体中需引用结构名，如下：<br>
struct list{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   ...<br>
&nbsp;&nbsp;&nbsp; <a href="http://hi.baidu.com/walkandsing/blog/item/d77a756057893e41eaf8f87a.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/%C4%AC%C8%CF%B7%D6%C0%E0">默认分类</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/d77a756057893e41eaf8f87a.html#comment">查看评论</a>]]></description>
        <pubDate>2008-06-19  14:45</pubDate>
        <category><![CDATA[默认分类]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/d77a756057893e41eaf8f87a.html</guid>
</item>

<item>
        <title><![CDATA[C中函数返回的一些心得]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/86b1d01b24d45dfeae513341.html]]></link>
        <description><![CDATA[
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    学C有一段时间了，有些东西让习惯了Java的我有些不太适应。其中一个就是如何将栈中的值返回，这几天有点体悟，记录下来：<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    一般来说函数值的返回有以下几种方法：<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    1）使用global变量，但缺点是对函数的多次调用会互相影响，也就是说函数是non-reentracy<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    2）使用static变量，缺点同上<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    3）使用动态分配的内 <a href="http://hi.baidu.com/walkandsing/blog/item/86b1d01b24d45dfeae513341.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/c%26%2338%3Bc%2B%2B">c&#38;c++</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/86b1d01b24d45dfeae513341.html#comment">查看评论</a>]]></description>
        <pubDate>2008-02-26  20:53</pubDate>
        <category><![CDATA[c&#38;c++]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/86b1d01b24d45dfeae513341.html</guid>
</item>

<item>
        <title><![CDATA[秋日]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/c87aa6990c5d0f0c6e068cdb.html]]></link>
        <description><![CDATA[
		
		<div align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    <strong><font size="4">秋日</font></strong></div>
<div align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    程颢</div>
<div align="center">闲来无事不从容，睡觉东窗日已红。<br>
万物静观皆自得，四时佳兴与人同。<br>
道通天地有形外，思入风云变态中。<br>
富贵不淫贫贱乐，男儿到此</div> <a href="http://hi.baidu.com/walkandsing/blog/item/c87aa6990c5d0f0c6e068cdb.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/%D4%D3%CE%C4">杂文</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/c87aa6990c5d0f0c6e068cdb.html#comment">查看评论</a>]]></description>
        <pubDate>2008-01-16  21:04</pubDate>
        <category><![CDATA[杂文]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/c87aa6990c5d0f0c6e068cdb.html</guid>
</item>

<item>
        <title><![CDATA[vim配置备忘]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/7338ce167594861c962b4376.html]]></link>
        <description><![CDATA[
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     主要的配置基本参考<a target="_blank" href="http://blog.chinaunix.net/u1/55904/showart_435472.html">这里</a>，这样配置后基本有点IDE的样子了，但没有代码自动补全和代码提示，加上echoFunc和omnicppcomplete就行了。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;     echoFunc的配置很简单，直接放到plugin目录就行了。omnicppcomplete也一样，解压缩就行了，但这时仅对自己的源代码里类、结构提供auto-complete，想要对STL提供auto-complete的话就得用ctags生成STL源码的tag文件，到 <a href="http://hi.baidu.com/walkandsing/blog/item/7338ce167594861c962b4376.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Linux">Linux</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/7338ce167594861c962b4376.html#comment">查看评论</a>]]></description>
        <pubDate>2008-01-07  11:58</pubDate>
        <category><![CDATA[Linux]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/7338ce167594861c962b4376.html</guid>
</item>

<item>
        <title><![CDATA[HTML编码的自动发现]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/77108c58f003fcdd9c82040f.html]]></link>
        <description><![CDATA[
		
		写了个自认为还算健壮的html网页编码的自动发现程序，基本的想法就是：<br>
1. 从HTTP Header中的Content-Type: text/html;charset=gbk中提取<br>
2. 从HTML中的Meta标签&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf8&quot; /&gt;中提取<br>
3. 利用Mozilla的jchardet从byte级别猜测<br>
4. 若以上方法均失败，则返回gb18030（因为主要处理中文）<br>
大致的流程是：<br>
1. 用ascii编码读取网页数据<br>
2. 利用正则表达式&quot;Content-Type:.*charset\\s*=\\s*(.*)\\s*&quot;提取Header中的 <a href="http://hi.baidu.com/walkandsing/blog/item/77108c58f003fcdd9c82040f.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Java">Java</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/77108c58f003fcdd9c82040f.html#comment">查看评论</a>]]></description>
        <pubDate>2007-10-07  15:44</pubDate>
        <category><![CDATA[Java]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/77108c58f003fcdd9c82040f.html</guid>
</item>

<item>
        <title><![CDATA[异常处理的一些心得]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/ec4f6c8b0cb6fe11c9fc7a63.html]]></link>
        <description><![CDATA[
		
		异常在意料之中？<br>
1）否=&gt;代码不够健壮，应该修改代码<br>
2）是=&gt;异常可恢复？<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  1）否=&gt;底层程序？<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  1）否=&gt;批处理？<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  1）否=&gt;打印异常信息到console，退出程序<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://hi.baidu.com/walkandsing/blog/item/ec4f6c8b0cb6fe11c9fc7a63.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Java">Java</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/ec4f6c8b0cb6fe11c9fc7a63.html#comment">查看评论</a>]]></description>
        <pubDate>2007-10-04  18:06</pubDate>
        <category><![CDATA[Java]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/ec4f6c8b0cb6fe11c9fc7a63.html</guid>
</item>

<item>
        <title><![CDATA[Roller 4源码分析笔记（5）- 搜索]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/01fa5823cf34d1519922ed41.html]]></link>
        <description><![CDATA[
		
		&nbsp;&nbsp;&nbsp;&nbsp;      实现Roller的搜索功能的包是org.apache.roller.weblogger.business.search及其子包org.apache.roller.weblogger.business.search.operations。依然是经典的Facade模式，由Interface IndexManager提供总的访问接口，IndexMangerImpl提够实现，如下图所示。<br>
<div align="center" forimg="1"><a href="http://hiphotos.baidu.com/walkandsing/pic/item/0621802feb4fdf321f3089d5.jpg" target="_blank"> </a>
</div> <a href="http://hi.baidu.com/walkandsing/blog/item/01fa5823cf34d1519922ed41.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Java">Java</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/01fa5823cf34d1519922ed41.html#comment">查看评论</a>]]></description>
        <pubDate>2007-10-02  10:51</pubDate>
        <category><![CDATA[Java]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/01fa5823cf34d1519922ed41.html</guid>
</item>

<item>
        <title><![CDATA[目录拷贝]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/fc9a4fda0d5a21d8b6fd4896.html]]></link>
        <description><![CDATA[
		
		<pre><span class="term_command">tar -cvf - /etc | tar -xvf -<br>总忘，备份一下</span></pre> 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Linux">Linux</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/fc9a4fda0d5a21d8b6fd4896.html#comment">查看评论</a>]]></description>
        <pubDate>2007-09-14  19:52</pubDate>
        <category><![CDATA[Linux]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/fc9a4fda0d5a21d8b6fd4896.html</guid>
</item>

<item>
        <title><![CDATA[Roller 4源码分析笔记（4）- 访问计数]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/a35c44af13524ef8fbed50da.html]]></link>
        <description><![CDATA[
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   一直想知道像访问计数这样频繁发生但数据量很小的数据库更新应该如何处理，看了Roller才恍然大悟。其实很简单，就是缓冲。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   这个功能主要是通过HitCountQueue来实现的，它实际上就是一个允许并发访问的List，每次访问一个blog，这个blog的handle就放入这个队列中，代表一次访问。在实例化这个队列的时候，同时开启一个线程ContinuousWorkerThread，每隔3分钟将队列中的数据同步到数据库中。 
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Java">Java</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/a35c44af13524ef8fbed50da.html#comment">查看评论</a>]]></description>
        <pubDate>2007-09-06  14:54</pubDate>
        <category><![CDATA[Java]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/a35c44af13524ef8fbed50da.html</guid>
</item>

<item>
        <title><![CDATA[Roller 4源码分析笔记（3）- 业务层的入口]]></title>
        <link><![CDATA[http://hi.baidu.com/walkandsing/blog/item/fbea54edf4478ad7b31cb1f2.html]]></link>
        <description><![CDATA[
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  WebloggerFactory是整个业务层的入口，一般的用法是：<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  Weblogger weblogger = WebloggerFactory.getWeblogger();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  UserManager um = weblogger.getUserManager();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  WeblogManager wm = weblogger.getWeblogManager();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  . . . .<br>
<br>
&nbsp; <a href="http://hi.baidu.com/walkandsing/blog/item/fbea54edf4478ad7b31cb1f2.html">阅读全文</a>
		
		<br/><b>类别：</b><a href="http://hi.baidu.com/walkandsing/blog/category/Java">Java</a>&nbsp;<a href="http://hi.baidu.com/walkandsing/blog/item/fbea54edf4478ad7b31cb1f2.html#comment">查看评论</a>]]></description>
        <pubDate>2007-09-04  16:18</pubDate>
        <category><![CDATA[Java]]></category>
        <author><![CDATA[walkandsing]]></author>
		<guid>http://hi.baidu.com/walkandsing/blog/item/fbea54edf4478ad7b31cb1f2.html</guid>
</item>


</channel>
</rss>