<?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>depth first search &#187; programming</title>
	<atom:link href="http://www.depthfirstsearch.net/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depthfirstsearch.net/blog</link>
	<description>“We can only see a short distance ahead, but we can see plenty there that needs to be done.&#34;</description>
	<lastBuildDate>Sun, 05 Feb 2012 13:00:00 +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>Weird Compiler Error of the Day</title>
		<link>http://www.depthfirstsearch.net/blog/2009/06/17/weird-compiler-error-of-the-day/</link>
		<comments>http://www.depthfirstsearch.net/blog/2009/06/17/weird-compiler-error-of-the-day/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 17:23:54 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[opencv]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=1202</guid>
		<description><![CDATA[I got the following error when trying to compile the latest svn version of opencv: error: invalid controlling predicate A quick Google search yielded this gem of a compiler bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38650. The offending loop: #ifdef _OPENMP #pragma omp for schedule(static, 1) #endif /* _OPENMP */ for&#40; i = first; &#40;i &#60; first + count&#41; &#38;&#38; [...]]]></description>
			<content:encoded><![CDATA[<p>I got the following error when trying to compile the latest svn version of opencv:</p>
<blockquote><p>error: invalid controlling predicate</p></blockquote>
<p>A quick Google search yielded this gem of a compiler bug: <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38650">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38650</a>.</p>
<p>The offending loop:</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#ifdef _OPENMP</span>
<span style="color: #339933;">#pragma omp for schedule(static, 1)</span>
<span style="color: #339933;">#endif /* _OPENMP */</span>
<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> i <span style="color: #339933;">=</span> first<span style="color: #339933;">;</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">&lt;</span> first <span style="color: #339933;">+</span> count<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> next<span style="color: #339933;">;</span> i<span style="color: #339933;">++</span> <span style="color: #009900;">&#41;</span></pre></div></div>

<p>That is all.</p>
<p>UPDATE: Turns out I was using a stale configuration file from svn for this build. It seems like OpenCV has entirely too many build systems. They should ditch autoconf and go with cmake exclusively.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2009/06/17/weird-compiler-error-of-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Matrix Syntax for Sparse Programming</title>
		<link>http://www.depthfirstsearch.net/blog/2008/07/09/matrix-syntax-for-sparse-programming/</link>
		<comments>http://www.depthfirstsearch.net/blog/2008/07/09/matrix-syntax-for-sparse-programming/#comments</comments>
		<pubDate>Wed, 09 Jul 2008 18:57:03 +0000</pubDate>
		<dc:creator>JS</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[computing]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rl]]></category>

		<guid isPermaLink="false">http://www.depthfirstsearch.net/blog/?p=479</guid>
		<description><![CDATA[In response to a recent Coding Horror piece on Spartan programming I&#8217;d like to humbly submit two examples from my own recent work. First, in C++ we have: for &#40;int i = 0; i &#60; nstates; i++&#41; &#123; for &#40;int a = 0; a &#60; nactions; a++&#41; &#123; Q&#91;i&#93;&#91;a&#93; += alpha * delta * e&#91;i&#93;&#91;a&#93;; [...]]]></description>
			<content:encoded><![CDATA[<p>In response to a recent <a href="http://www.codinghorror.com/blog/archives/001148.html">Coding Horror</a> piece on <a href="http://ssdl-wiki.cs.technion.ac.il/wiki/index.php/Spartan_programming">Spartan programming</a> I&#8217;d like to humbly submit two examples from my own recent work.</p>
<p>First, in C++ we have:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> i <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> i <span style="color: #000080;">&lt;</span> nstates<span style="color: #008080;">;</span> i<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
    <span style="color: #0000ff;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #0000ff;">int</span> a <span style="color: #000080;">=</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span> a <span style="color: #000080;">&lt;</span> nactions<span style="color: #008080;">;</span> a<span style="color: #000040;">++</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
        Q<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>a<span style="color: #008000;">&#93;</span> <span style="color: #000040;">+</span><span style="color: #000080;">=</span> alpha <span style="color: #000040;">*</span> delta <span style="color: #000040;">*</span> e<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>a<span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
        e<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008000;">&#91;</span>a<span style="color: #008000;">&#93;</span> <span style="color: #000040;">*</span><span style="color: #000080;">=</span> gamma <span style="color: #000040;">*</span> lambda<span style="color: #008080;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Next, in Python with Numpy:</p>
</pre>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #008000;">self</span>.<span style="color: black;">Q</span> += <span style="color: #008000;">self</span>.<span style="color: black;">alpha</span> <span style="color: #66cc66;">*</span> delta <span style="color: #66cc66;">*</span> <span style="color: #008000;">self</span>.<span style="color: black;">e</span>
<span style="color: #008000;">self</span>.<span style="color: black;">e</span> <span style="color: #66cc66;">*</span>= <span style="color: #008000;">self</span>.<span style="color: black;">gamma</span> <span style="color: #66cc66;">*</span> <span style="color: #008000;">self</span>.<span style="color: black;">ld</span></pre></div></div>

<p>These are identical temporal difference updates in two versions of a Sarsa reinforcement learning agent. Having reasonable syntax and semantics for vector and matrix operations is essential for sparse programming in any kind of numerically intensive setting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.depthfirstsearch.net/blog/2008/07/09/matrix-syntax-for-sparse-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/19 queries in 1.657 seconds using disk: basic
Object Caching 353/399 objects using disk: basic

Served from: www.depthfirstsearch.net @ 2012-02-08 13:20:54 -->
