<?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>DEAN LEE:/DEV/BLOG &#187; source-code</title>
	<atom:link href="http://www.deanlee.cn/tag/source-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.deanlee.cn</link>
	<description>mount /dev/brain &#124;&#124; tail -f /var/log/thoughts &#62;&#62; /pub/www</description>
	<lastBuildDate>Tue, 27 Jul 2010 05:21:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>how to sort CAtlArray using qsort</title>
		<link>http://www.deanlee.cn/programming/how-to-sort-catlarray-using-qsort/</link>
		<comments>http://www.deanlee.cn/programming/how-to-sort-catlarray-using-qsort/#comments</comments>
		<pubDate>Sun, 12 Aug 2007 15:41:10 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[catlarray]]></category>
		<category><![CDATA[qsort]]></category>
		<category><![CDATA[source-code]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/technology/how-to-sort-catlarray-using-qsort/</guid>
		<description><![CDATA[This is nothing new at all,here is the source code: CAtlArray< CSomeClass*> m_myArray; qsort(m_myArray.GetData(), m_myArray.GetCount(), sizeof(CSomeClass*), (int(*)(const void*, const void*))SortTheArray); &#160; the Comparison function would look like the following: int __cdecl SortTheArray(CSomeClass **pp1, CSomeClass **pp2) { .... } Related posts:QWebView:How to open link in an extern browserA fast memory Pool used by LogMicroscope@35A Programmer&#8217;s Reference [...]


Related posts:<ol><li><a href='http://www.deanlee.cn/programming/qwebviewhow-to-open-link-in-an-extern-browser/' rel='bookmark' title='Permanent Link: QWebView:How to open link in an extern browser'>QWebView:How to open link in an extern browser</a></li><li><a href='http://www.deanlee.cn/programming/a-fast-memory-pool-used-by-logmicroscope35/' rel='bookmark' title='Permanent Link: A fast memory Pool used by LogMicroscope@35'>A fast memory Pool used by LogMicroscope@35</a></li><li><a href='http://www.deanlee.cn/programming/a-programmers-reference-for-excuses/' rel='bookmark' title='Permanent Link: A Programmer&#8217;s Reference for Excuses'>A Programmer&#8217;s Reference for Excuses</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This is nothing new at all,here is the source code:</p>
<pre class="prettyprint">CAtlArray< CSomeClass*> m_myArray;
qsort(m_myArray.GetData(), m_myArray.GetCount(), sizeof(CSomeClass*),
  (int(*)(const void*, const void*))SortTheArray);</pre>
<p>&nbsp;</p>
<p>the Comparison function would look like the following:</p>
<pre class="prettyprint">int __cdecl SortTheArray(CSomeClass **pp1, CSomeClass **pp2)
{
    ....
}</pre>
<img src="http://www.deanlee.cn/?ak_action=api_record_view&id=324&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.deanlee.cn/programming/qwebviewhow-to-open-link-in-an-extern-browser/' rel='bookmark' title='Permanent Link: QWebView:How to open link in an extern browser'>QWebView:How to open link in an extern browser</a></li><li><a href='http://www.deanlee.cn/programming/a-fast-memory-pool-used-by-logmicroscope35/' rel='bookmark' title='Permanent Link: A fast memory Pool used by LogMicroscope@35'>A fast memory Pool used by LogMicroscope@35</a></li><li><a href='http://www.deanlee.cn/programming/a-programmers-reference-for-excuses/' rel='bookmark' title='Permanent Link: A Programmer&#8217;s Reference for Excuses'>A Programmer&#8217;s Reference for Excuses</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/programming/how-to-sort-catlarray-using-qsort/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google Code Prettify for wordpress</title>
		<link>http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/</link>
		<comments>http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 15:03:21 +0000</pubDate>
		<dc:creator>Dean Lee</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[code-snippets]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[source-code]]></category>
		<category><![CDATA[syntax-highlighting]]></category>

		<guid isPermaLink="false">http://www.deanlee.cn/technology/google-code-prettifer-for-wordpress/</guid>
		<description><![CDATA[This small wordpress plugin enable syntax highlighting of code snippets in your post using Google Code Prettify. Notice: you will need to have JavaScript enabled in your browser for this to work. I had developed another Source Code syntax highlighting plugin using Geshi before,but they are totally different things.with Geshi,code is parsed on the server [...]


Related posts:<ol><li><a href='http://www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/' rel='bookmark' title='Permanent Link: Source Code syntax highlighting plugin for WordPress (V1.2)'>Source Code syntax highlighting plugin for WordPress (V1.2)</a></li><li><a href='http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-is-now-hosted-on-google-code/' rel='bookmark' title='Permanent Link: Fckeditor for wordpress is now hosted on Google Code'>Fckeditor for wordpress is now hosted on Google Code</a></li><li><a href='http://www.deanlee.cn/programming/moved-openssl-for-windows-to-google-code/' rel='bookmark' title='Permanent Link: Moved OpenSSL for windows to google code'>Moved OpenSSL for windows to google code</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This small wordpress plugin enable syntax highlighting of code snippets in your post using <a href="http://code.google.com/p/google-code-prettify/">Google Code Prettify</a>.</p>
<p><font color="#ff0000">Notice:</font> you will <strong>need</strong> to have <strong>JavaScript enabled</strong> in your browser for this to work.</p>
<p>I had developed another <a href="http://www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/">Source Code syntax highlighting plugin</a> using <a href="http://qbnz.com/highlighter/">Geshi</a> before,but they are totally different things.with Geshi,code is parsed on the server side,no javascript is needed.</p>
<p>It&#8217;s hard to say which is the better,choose one based on your own needs.</p>
<p class="download"><a title="Download" href="http://www.deanlee.cn/downloads/google_code_prettify_v1.1.zip">Download Google Code Prettify for wordpress v1.1</a></p>
<p><strong>Installation</strong></p>
<p>This plugin requires <a href="http://www.wordpress.org">WordPress</a> v.2.0 or later.</p>
<ol>
<li>unzip and upload the files to your wp-content/plugins/ directory.</li>
<li>Activate the plugin by logging into your WordPress administration panel, going to &lsquo;Plugins&rsquo;, then clicking the&nbsp; &#8216;Activate&#8217;&nbsp; button for&nbsp; &#8216;Google Code Prettify&#8217;.</li>
<li>Done,enjoy it.</li>
</ol>
<p><strong>Usage</strong></p>
<p>Put code snippets in &lt;pre class=&quot;prettyprint&quot;&gt;&#8230;&lt;/pre&gt; or &lt;code class=&quot;prettyprint&quot;&gt;&#8230;&lt;/code&gt; and it will automatically be pretty printed.</p>
<p><strong>Example</strong></p>
<p>Bash</p>
<pre class="prettyprint">
#!/bin/bash

# Fibonacci numbers
# Writes an infinite series to stdout, one entry per line
function fib() {
  local a=1
  local b=1
  while true ; do
    echo $a
    local tmp=$a
    a=$(( $a + $b ))
    b=$tmp
  done
}

# output the 10th element of the series and halt
fib | head -10 | tail -1</pre>
<p><a href="http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html">More examples</a></p>
<p><strong>FAQ</strong> (from <a title="http://code.google.com/p/google-code-prettify/" href="http://code.google.com/p/google-code-prettify/" target="_blank">http://code.google.com/p/google-code-prettify/</a>)</p>
<ol>
<li><strong>Which languages does it work for?<br />
    </strong>The comments in <tt>prettify.js</tt> are authoritative but the lexer should work on a number of languages including C and friends, Java, Python, Bash, SQL, HTML, XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk and a decent subset of Perl, but, because of commenting conventions, doesn&#8217;t work on Smalltalk, Lisp-like, or CAML-like languages.</li>
<li><strong>How do I specify which language my code is in?<br />
    </strong>There&#8217;s no way to tell it which language because would complicate the interface. If it doesn&#8217;t guess the language properly, that&#8217;s a bug.</li>
<li><strong>Which browsers does it work with?<br />
    </strong>It&#8217;s been tested with IE 6, Firefox 1.5 &amp; 2, and Safari 2.0.4. Look at <a href="http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html">the test page</a> to see if it works in your browser.</li>
</ol>
<img src="http://www.deanlee.cn/?ak_action=api_record_view&id=153&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://www.deanlee.cn/wordpress/code_highlighter_plugin_for_wordpress/' rel='bookmark' title='Permanent Link: Source Code syntax highlighting plugin for WordPress (V1.2)'>Source Code syntax highlighting plugin for WordPress (V1.2)</a></li><li><a href='http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-is-now-hosted-on-google-code/' rel='bookmark' title='Permanent Link: Fckeditor for wordpress is now hosted on Google Code'>Fckeditor for wordpress is now hosted on Google Code</a></li><li><a href='http://www.deanlee.cn/programming/moved-openssl-for-windows-to-google-code/' rel='bookmark' title='Permanent Link: Moved OpenSSL for windows to google code'>Moved OpenSSL for windows to google code</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.deanlee.cn/wordpress/google-code-prettify-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>108</slash:comments>
		</item>
	</channel>
</rss>
