<?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>AgilePHP &#187; CodeBox</title>
	<atom:link href="http://www.agilephp.net/tag/codebox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.agilephp.net</link>
	<description>开发可以敏捷，人生需要慢慢体味</description>
	<lastBuildDate>Thu, 03 Nov 2011 11:53:07 +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>测试下CodeBox</title>
		<link>http://www.agilephp.net/2009/05/test-codebox/</link>
		<comments>http://www.agilephp.net/2009/05/test-codebox/#comments</comments>
		<pubDate>Thu, 21 May 2009 06:50:34 +0000</pubDate>
		<dc:creator>bbiao</dc:creator>
				<category><![CDATA[博客]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[CodeBox]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.agilephp.net/?p=27</guid>
		<description><![CDATA[想想以后应该用得着这个插件，毕竟有些时候还是会在博客里贴上代码的。这是插件的主页：http://wordpress.org/extend/plugins/wp-codebox/ #include &#38;lt;stdio.h&#38;gt; double ComputePI&#40;&#41; &#123; int segment = 16 * 256; double length = 1.0; double segment_width = length / segment; double sum = 0.0; int step = 0; double pos = 0.0; &#160; for &#40;step = 0; step &#38;lt; segment; step++&#41; &#123; pos = &#40;step + 0.5&#41; * segment_width; &#160; sum += 4 [...]<h3>相关文章</h3>
<ol>
		<li><a href="http://www.agilephp.net/2009/10/range-in-http/" rel="bookmark">RANGE in HTTP</a><!-- (2.8)--></li>
		<li><a href="http://www.agilephp.net/2009/10/java-wait-and-notify/" rel="bookmark">Java中线程同步的简单用法</a><!-- (2.2)--></li>
		<li><a href="http://www.agilephp.net/2009/10/live-writer-and-wordpress/" rel="bookmark">在Live Writer中编辑WordPress博客</a><!-- (2)--></li>
	</ol>
]]></description>
			<content:encoded><![CDATA[<p>想想以后应该用得着这个插件，毕竟有些时候还是会在博客里贴上代码的。这是插件的主页：<a href="http://wordpress.org/extend/plugins/wp-codebox/" target="_blank">http://wordpress.org/extend/plugins/wp-codebox/</a></p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &amp;lt;stdio.h&amp;gt;</span>
<span style="color: #993333;">double</span> ComputePI<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">int</span> segment		<span style="color: #339933;">=</span> <span style="color: #0000dd;">16</span> <span style="color: #339933;">*</span> <span style="color: #0000dd;">256</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">double</span> length		<span style="color: #339933;">=</span> <span style="color:#800080;">1.0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">double</span> segment_width	<span style="color: #339933;">=</span> length <span style="color: #339933;">/</span> segment<span style="color: #339933;">;</span>
	<span style="color: #993333;">double</span> sum		<span style="color: #339933;">=</span> <span style="color:#800080;">0.0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">int</span> step 		<span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
	<span style="color: #993333;">double</span> pos 		<span style="color: #339933;">=</span> <span style="color:#800080;">0.0</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>step <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> step <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> segment<span style="color: #339933;">;</span> step<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		pos <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>step <span style="color: #339933;">+</span> <span style="color:#800080;">0.5</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> segment_width<span style="color: #339933;">;</span>
&nbsp;
		sum <span style="color: #339933;">+=</span> <span style="color: #0000dd;">4</span> <span style="color: #339933;">/</span> <span style="color: #009900;">&#40;</span><span style="color: #0000dd;">1</span> <span style="color: #339933;">+</span> pos <span style="color: #339933;">*</span> pos<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	sum <span style="color: #339933;">*=</span> segment_width<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> sum<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</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;">double</span> pi <span style="color: #339933;">=</span> ComputePI<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;PI is %f<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> pi<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h3>相关文章</h3>
<ol>
		<li><a href="http://www.agilephp.net/2009/10/range-in-http/" rel="bookmark">RANGE in HTTP</a><!-- (2.8)--></li>
		<li><a href="http://www.agilephp.net/2009/10/java-wait-and-notify/" rel="bookmark">Java中线程同步的简单用法</a><!-- (2.2)--></li>
		<li><a href="http://www.agilephp.net/2009/10/live-writer-and-wordpress/" rel="bookmark">在Live Writer中编辑WordPress博客</a><!-- (2)--></li>
	</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.agilephp.net/2009/05/test-codebox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

