<?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://cnhup.net/%E6%96%B0%E9%97%BB%E5%A4%B4%E6%9D%A1/%e6%8a%80%e6%9c%af%e9%9a%8f%e7%ac%94/feed" rel="self" type="application/rss+xml" />
	<link>http://cnhup.net</link>
	<description>客家记录,IT技术随笔</description>
	<lastBuildDate>Sun, 13 Jun 2010 07:56:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>BCB6自带的正则表达式功能</title>
		<link>http://cnhup.net/133</link>
		<comments>http://cnhup.net/133#comments</comments>
		<pubDate>Fri, 29 Jan 2010 08:32:49 +0000</pubDate>
		<dc:creator>hakka</dc:creator>
				<category><![CDATA[技术随笔]]></category>

		<guid isPermaLink="false">http://cnhup.net/?p=133</guid>
		<description><![CDATA[对于C++下的正则表达式，我想用得比较多的应该就是Boost里的regex了。自从BCB2009自带了Boost1.35以后，这个regex也自然进入了BCB自带的功能行列。
对于还没用上BCB2009的人来说也不用为了一个正则表达式功能急着找boost的安装方法，其实BCB6早已经帮我们准备好了：TRegexp和pcre库。不过当年Borland也太“谦虚”了点，竟然没把这么重要的功能写进帮助？！！
先看看轻量级的TRegexp

说它是轻量级是因为它没有完整支持正则表达式，功能也很单一，只有一个find。看下面代码演示：

?View Code C&#160;
#include &#60;stdio.h&#62;
#include &#60;stdlib.h&#62;
#include &#60;regexp.h&#62;
&#160;
int main&#40;int argc, char* argv&#91;&#93;&#41;
&#123;
    char szReg&#91;&#93;=&#34;[0-9]+&#34;;             // 正则表达式，表示一个或多个'0'到'9'的字符串
    char szStr&#91;&#93;=&#34;a123b03ad94fg45&#34;;    // 待匹配的字符串
&#160;
    printf&#40;&#34;Regex: %s\n&#34;,szReg&#41;;
    printf&#40;&#34;Str: %s\n&#34;,szStr&#41;;
    printf&#40;&#34;Result: \n&#34;&#41;;
  [...]]]></description>
			<content:encoded><![CDATA[<p>对于C++下的正则表达式，我想用得比较多的应该就是Boost里的regex了。自从BCB2009自带了Boost1.35以后，这个regex也自然进入了BCB自带的功能行列。</p>
<p>对于还没用上BCB2009的人来说也不用为了一个正则表达式功能急着找boost的安装方法，其实BCB6早已经帮我们准备好了：TRegexp和pcre库。不过当年Borland也太“谦虚”了点，竟然没把这么重要的功能写进帮助？！！</p>
<p>先看看轻量级的TRegexp<br />
<span id="more-133"></span><br />
说它是轻量级是因为它没有完整支持正则表达式，功能也很单一，只有一个find。看下面代码演示：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p133code3'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1333"><td class="code" id="p133code3"><pre class="c" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
<span style="color: #339933;">#include &lt;regexp.h&gt;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #993333;">char</span> szReg<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;[0-9]+&quot;</span><span style="color: #339933;">;</span>             <span style="color: #666666; font-style: italic;">// 正则表达式，表示一个或多个'0'到'9'的字符串</span>
    <span style="color: #993333;">char</span> szStr<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;a123b03ad94fg45&quot;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// 待匹配的字符串</span>
&nbsp;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Regex: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>szReg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Str: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>szStr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Result: <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    TRegexp regex<span style="color: #009900;">&#40;</span>szReg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span>size_t len<span style="color: #339933;">=</span>0<span style="color: #339933;">,</span> nPos <span style="color: #339933;">=</span> regex.<span style="color: #202020;">find</span><span style="color: #009900;">&#40;</span>szStr<span style="color: #339933;">,&amp;</span>len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// 用find查找匹配的字符串。nPos返回子串位置[size_t(-1)表示没找到匹配的字符串]，len返回子串长度</span>
        nPos<span style="color: #339933;">!=</span>size_t<span style="color: #009900;">&#40;</span><span style="color: #339933;">-</span>1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        nPos <span style="color: #339933;">=</span> regex.<span style="color: #202020;">find</span><span style="color: #009900;">&#40;</span>szStr<span style="color: #339933;">,&amp;</span>len<span style="color: #339933;">,</span>nPos<span style="color: #339933;">+</span>len<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>      <span style="color: #666666; font-style: italic;">// 从nPos+len位置开始继续查找...</span>
    <span style="color: #009900;">&#123;</span>
        <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%.*s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> len<span style="color: #339933;">,</span> szStr<span style="color: #339933;">+</span>nPos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>          <span style="color: #666666; font-style: italic;">// 打印出查找结果</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    system<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;pause&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>虽然就一个find，功能是寒碜了一点，好在使用还算方便。在它的基础上做Match和Replace的功能也应该不算太难的事。</p>
<p>对正则表达式比较熟悉的朋友一定在想为什么不把char szReg[]=&#8221;[0-9]+&#8221;;改成char szReg[]=&#8221;\\d+&#8221;;呢？这就是偶说它功能还不完整的原因，它不支持&#8217;\'操作符！（也许有其它替代，反正偶没找到，要是哪位路过的知道 TRegexp使用&#8217;\'的方法，一定要留个言哦）。</p>
<p>于是，下面我们请出完美的pcre库。pcre库的全称是:Perl- compatible regular expressions。从名称上可以看出它遵循的是Perl的正则表达式语法，功能那是绝对没得说。不过遗憾的是BCB没有进一步把pcrecpp也带进来，所以只能用纯C的方式调用了：</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p133code4'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1334"><td class="code" id="p133code4"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &lt;stdio.h&gt;</span>
 <span style="color: #339933;">#include &lt;stdlib.h&gt;</span>
 <span style="color: #339933;">#include &lt;string.h&gt;</span>
 <span style="color: #339933;">#include &lt;pcre.h&gt;</span>
&nbsp;
 <span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span><span style="color: #339933;">*</span> argv<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>
 <span style="color: #009900;">&#123;</span>
     <span style="color: #993333;">char</span> szReg<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;d(<span style="color: #000099; font-weight: bold;">\\</span>d+)f&quot;</span><span style="color: #339933;">;</span>        <span style="color: #666666; font-style: italic;">// 抽出a和f之间的数字</span>
     <span style="color: #993333;">char</span> szStr<span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #ff0000;">&quot;a123b03ad94fg45&quot;</span><span style="color: #339933;">;</span>
&nbsp;
     <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Regex: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>szReg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Str: %s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span>szStr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;Result: <span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
     <span style="color: #993333;">const</span> <span style="color: #993333;">char</span>      <span style="color: #339933;">*</span>pszErr<span style="color: #339933;">;</span>
     <span style="color: #993333;">int</span>             nErrOffset<span style="color: #339933;">;</span>
     pcre <span style="color: #339933;">*</span>re <span style="color: #339933;">=</span> pcre_compile<span style="color: #009900;">&#40;</span>szReg<span style="color: #339933;">,</span>0<span style="color: #339933;">,&amp;</span>pszErr<span style="color: #339933;">,&amp;</span>nErrOffset<span style="color: #339933;">,</span>NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>      <span style="color: #666666; font-style: italic;">// 先准备表达式</span>
     <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>re<span style="color: #339933;">==</span>NULL<span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
         <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;compile error at:%d, %s&quot;</span><span style="color: #339933;">,</span> nErrOffset<span style="color: #339933;">,</span> pszErr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #b1b100;">return</span> <span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
&nbsp;
     <span style="color: #993333;">int</span> ovector<span style="color: #009900;">&#91;</span>30<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>    <span style="color: #666666; font-style: italic;">// 数量由szReg决定，大致为(括号对数+1)*3，可以用pcre_info获得或者直接留大一点。</span>
     <span style="color: #993333;">int</span> len <span style="color: #339933;">=</span> strlen<span style="color: #009900;">&#40;</span>szStr<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #993333;">int</span> rc <span style="color: #339933;">=</span> pcre_exec<span style="color: #009900;">&#40;</span>re<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> szStr<span style="color: #339933;">,</span> len<span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span> ovector<span style="color: #339933;">,</span> 30<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// 执行匹配</span>
     <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> i<span style="color: #339933;">&lt;</span>rc<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
     <span style="color: #009900;">&#123;</span>
         <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>substring_start <span style="color: #339933;">=</span> szStr <span style="color: #339933;">+</span> ovector<span style="color: #009900;">&#91;</span>2<span style="color: #339933;">*</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
         <span style="color: #993333;">int</span> substring_length <span style="color: #339933;">=</span> ovector<span style="color: #009900;">&#91;</span>2<span style="color: #339933;">*</span>i<span style="color: #339933;">+</span>1<span style="color: #009900;">&#93;</span> <span style="color: #339933;">-</span> ovector<span style="color: #009900;">&#91;</span>2<span style="color: #339933;">*</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
         <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%2d: %.*s<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> i<span style="color: #339933;">,</span> substring_length<span style="color: #339933;">,</span> substring_start<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #009900;">&#125;</span>
&nbsp;
     free<span style="color: #009900;">&#40;</span>re<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>   <span style="color: #666666; font-style: italic;">// 别忘了这个</span>
&nbsp;
     system<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;pause&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>对于pcre库的使用，可以到它的官方网站www.pcre.org去学习。 如果觉得不过瘾，也可以自己装过一个最新版的，再弄个pcrecpp什么的，呵呵。</p>
]]></content:encoded>
			<wfw:commentRss>http://cnhup.net/133/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>linux 启动 oracle</title>
		<link>http://cnhup.net/125</link>
		<comments>http://cnhup.net/125#comments</comments>
		<pubDate>Sat, 23 Jan 2010 05:05:04 +0000</pubDate>
		<dc:creator>hakka</dc:creator>
				<category><![CDATA[技术随笔]]></category>

		<guid isPermaLink="false">http://cnhup.net/?p=125</guid>
		<description><![CDATA[su &#8211; oracle
sqlplus /nolog
connect /as sysdba
startup
exit
lsnrctl start
]]></description>
			<content:encoded><![CDATA[<p>su &#8211; oracle<br />
sqlplus /nolog<br />
connect /as sysdba<br />
startup<br />
exit</p>
<p>lsnrctl start</p>
]]></content:encoded>
			<wfw:commentRss>http://cnhup.net/125/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql 5.5 新特性</title>
		<link>http://cnhup.net/99</link>
		<comments>http://cnhup.net/99#comments</comments>
		<pubDate>Tue, 29 Dec 2009 06:52:46 +0000</pubDate>
		<dc:creator>hakka</dc:creator>
				<category><![CDATA[技术随笔]]></category>
		<category><![CDATA[5.5]]></category>
		<category><![CDATA[enhancements]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[partitioning]]></category>

		<guid isPermaLink="false">http://cnhup.net/?p=99</guid>
		<description><![CDATA[http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html

这个页面上有说明.
]]></description>
			<content:encoded><![CDATA[<p>http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html</p>
<p><br/><br />
这个页面上有说明.</p>
]]></content:encoded>
			<wfw:commentRss>http://cnhup.net/99/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress 自定义模板</title>
		<link>http://cnhup.net/90</link>
		<comments>http://cnhup.net/90#comments</comments>
		<pubDate>Thu, 24 Dec 2009 06:18:07 +0000</pubDate>
		<dc:creator>hakka</dc:creator>
				<category><![CDATA[技术随笔]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[自定义]]></category>

		<guid isPermaLink="false">http://cnhup.net/?p=90</guid>
		<description><![CDATA[你是不是想不同的页面实现不同的布局呀！
Wordpress 很容易实现。
现在我们就按步骤一步一步来实现吧。
第一步：
使用UltraEdit创建一个文件，就叫mypage.php吧。
第二步（这一步很重要）：
在文件头输入下面的固定格式

?View Code PHP&#60;?php
/*
Template Name:  yourTemplateName
*/
?&#62;

第三步：
使用Wordpress提供的函数编辑您的模板吧。
第四步：
将文件上传到您正在使用的模板目录下.
第五步：
在Page->Add New的时候，Template项选择您的模板。
第六步：
访问您的新页面，页面布局是否全新展示了：）
gook luck.
例：

?View Code PHP&#60;?php
/*
Template Name: Archives with Content
*/
?&#62;
&#160;
&#60;?php get_header&#40;&#41;; ?&#62;
&#160;
&#60;div id=&#34;content&#34; class=&#34;fullcolumn&#34;&#62;
&#160;
 &#60;?php if &#40;have_posts&#40;&#41;&#41; : while &#40;have_posts&#40;&#41;&#41; : the_post&#40;&#41;;?&#62;
 &#60;div class=&#34;post&#34;&#62;
  &#60;div class=&#34;entrytext&#34;&#62;
   &#60;?php the_content&#40;'&#60;p class=&#34;serif&#34;&#62;Read the rest of this page &#38;raquo;&#60;/p&#62;'&#41;; ?&#62;
  &#60;/div&#62;
 &#60;/div&#62;
 &#60;?php endwhile; endif; ?&#62;
&#160;
&#60;/div&#62;
&#160;
&#60;?php get_footer&#40;&#41;; ?&#62;

]]></description>
			<content:encoded><![CDATA[<p>你是不是想不同的页面实现不同的布局呀！<br/><br />
Wordpress 很容易实现。<br/><br />
现在我们就按步骤一步一步来实现吧。</p>
<p>第一步：<span id="more-90"></span><br/><br />
使用UltraEdit创建一个文件，就叫mypage.php吧。<br/><br />
第二步（这一步很重要）：<br/><br />
在文件头输入下面的固定格式</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p90code7'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p907"><td class="code" id="p90code7"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name:  yourTemplateName
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>第三步：<br/><br />
使用Wordpress提供的函数编辑您的模板吧。<br/><br />
第四步：<br/><br />
将文件上传到您正在使用的模板目录下.<br/><br />
第五步：<br/><br />
在Page->Add New的时候，Template项选择您的模板。<br/><br />
第六步：<br/><br />
访问您的新页面，页面布局是否全新展示了：）<br/><br />
gook luck.<br/><br />
例：<br/></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p90code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p908"><td class="code" id="p90code8"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
Template Name: Archives with Content
*/</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;content&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;fullcolumn&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>
 <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;entrytext&quot;</span><span style="color: #339933;">&gt;</span>
   <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;raquo;&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
 <span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
 <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://cnhup.net/90/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++异常捕获的误区</title>
		<link>http://cnhup.net/21</link>
		<comments>http://cnhup.net/21#comments</comments>
		<pubDate>Tue, 22 Dec 2009 08:18:58 +0000</pubDate>
		<dc:creator>hakka</dc:creator>
				<category><![CDATA[技术随笔]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[异常]]></category>
		<category><![CDATA[排错]]></category>
		<category><![CDATA[机制]]></category>

		<guid isPermaLink="false">http://cnhup.net/?p=21</guid>
		<description><![CDATA[C++中的异常捕获机制

?View Code Ctry
&#123;
...
&#125;catch&#40;Exception&#38;amp;&#41;
&#123;
&#160;
AddLog&#40;记录错误信息到日志&#41;
&#125;

很深入人心，在大多数情况下，这种用法是没有问题的，但是下面的用法会导致二度异常，会在排错上造成麻烦

?View Code Ctry
&#160;
&#123;
&#160;
...
&#160;
ErrorObj
&#160;
&#125;catch&#40;Exception&#38;amp;&#41;
&#160;
&#123;
&#160;
AddLog&#40;ErrorObj出错了&#41;
&#160;
&#125;

原因是，ErrorObj这个对象已经失效，本意是在ErrorObj失效的时候捕获这个异常并输出到日志，但当再次引用的ErrorObj的时候，由于再也没有对这个异常进行再次异常捕获，程序当然就当了。
]]></description>
			<content:encoded><![CDATA[<p>C++中的异常捕获机制</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p21code11'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2111"><td class="code" id="p21code11"><pre class="c" style="font-family:monospace;">try
<span style="color: #009900;">&#123;</span>
...
<span style="color: #009900;">&#125;</span>catch<span style="color: #009900;">&#40;</span>Exception<span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
&nbsp;
AddLog<span style="color: #009900;">&#40;</span>记录错误信息到日志<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><span id="more-21"></span>很深入人心，在大多数情况下，这种用法是没有问题的，但是下面的用法会导致二度异常，会在排错上造成麻烦</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p21code12'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2112"><td class="code" id="p21code12"><pre class="c" style="font-family:monospace;">try
&nbsp;
<span style="color: #009900;">&#123;</span>
&nbsp;
...
&nbsp;
<span style="color: #202020;">ErrorObj</span>
&nbsp;
<span style="color: #009900;">&#125;</span>catch<span style="color: #009900;">&#40;</span>Exception<span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#123;</span>
&nbsp;
AddLog<span style="color: #009900;">&#40;</span>ErrorObj出错了<span style="color: #009900;">&#41;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>原因是，ErrorObj这个对象已经失效，本意是在ErrorObj失效的时候捕获这个异常并输出到日志，但当再次引用的ErrorObj的时候，由于再也没有对这个异常进行<strong>再次异常捕获</strong>，程序当然就当了。</p>
]]></content:encoded>
			<wfw:commentRss>http://cnhup.net/21/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
