<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>robot campfire &#187; code</title>
	<atom:link href="http://www.planetraven.de/blog/tags/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.planetraven.de/blog</link>
	<description>davids weblog</description>
	<lastBuildDate>Sun, 10 Jan 2010 19:46:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/de/</creativeCommons:license>
		<item>
		<title>Using HSV to build a traffic light</title>
		<link>http://www.planetraven.de/blog/2009/09/27/using-hsv-to-build-a-traffic-light/</link>
		<comments>http://www.planetraven.de/blog/2009/09/27/using-hsv-to-build-a-traffic-light/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 21:19:36 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://www.planetraven.de/blog/?p=86</guid>
		<description><![CDATA[A small tip for anyone working on some sort of data visualization. If you have values that lie between 0.0 and 1.0 (or 0% and 100%, or $some_value and $some_other_value), you can use a simple interpolation in the HSV (or HSB) color space to get a nice &#8220;traffic light&#8221; range of colors from red to [...]]]></description>
			<content:encoded><![CDATA[<p>A small tip for anyone working on some sort of data visualization. If you have values that lie between 0.0 and 1.0 (or 0% and 100%, or <em>$some_value</em> and <em>$some_other_value</em>), you can use a simple interpolation in the HSV (or HSB) color space to get a nice &#8220;traffic light&#8221; range of colors from red to green via yellow in the middle, which is fine for displaying something that is &#8220;OK&#8221; if the values are low and gets &#8220;critical&#8221;  or &#8220;dangerous&#8221; for higher values (or vice versa). Just set the saturation and value (or brightness) parameters to 100% and use your data to vary the hue between 0° (which means red) and 120° (which is green). Since yellow sits right in the middle of that scale at 60° this gives you a smooth transition from red to yellow to green, which may look like this:</p>
<div id="attachment_92" class="wp-caption aligncenter" style="width: 210px"><img class="size-full wp-image-92" title="processing output" src="http://www.planetraven.de/blog/wp-content/uploads/output.png" alt="hue scale from 0° to 120°" width="200" height="30" /><p class="wp-caption-text">hue scale from 0° to 120°</p></div>
<p>Now this might be common knowledge, but i just stumbled upon it some time ago and thought it was a useful tidbit that i wanted to share.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planetraven.de/blog/2009/09/27/using-hsv-to-build-a-traffic-light/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/de/</creativeCommons:license>
	</item>
		<item>
		<title>Using a custom smart pointer with Boost.Python</title>
		<link>http://www.planetraven.de/blog/2009/06/13/using-a-custom-smart-pointer-with-boostpython/</link>
		<comments>http://www.planetraven.de/blog/2009/06/13/using-a-custom-smart-pointer-with-boostpython/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 18:35:25 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.planetraven.de/blog/?p=49</guid>
		<description><![CDATA[I&#8217;m currently working on creating a python wrapper for XCF using Boost.Python. During that project i stumbled upon the problem that i was wrapping some classes that used a custom smart pointer (i.e. not one from the boost library). Boost.Python is quite good at wrapping classes using smart pointers, but it has to know some [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on creating a python wrapper for <a title="XCF" href="http://xcf.sf.net">XCF</a> using <a title="Boost.Python homepage" href="http://boost.org/libs/python/">Boost.Python</a>. During that project i stumbled upon the problem that i was wrapping some classes that used a custom smart pointer (i.e. not one from the boost library). Boost.Python is quite good at wrapping classes using smart pointers, but it has to know some things about the smart pointer used first.<span id="more-49"></span></p>
<p>Most importantly, it has to know how to get the &#8220;raw&#8221; pointer from the smart pointer and how to determine the type of the object that is being pointed to (given the type of the smart pointer). Finding documentation about telling Boost.Python how to work with an unknown type of smart pointer wasn&#8217;t easy (which is why i am blogging this), but fortunately at some point i stumbled upon <a title="How to expose a custom smart pointer?" href="http://www.language-binding.net/pyplusplus/troubleshooting_guide/smart_ptrs/smart_ptrs.html">this</a>. It&#8217;s from the documentation of the Py++-package, but you don&#8217;t have to be using Py++ to use the technique described in there.</p>
<p>You have to keep a lot of things in mind when implementing this (especially when the class your smart pointer is pointing to might also have some derived subclasses, in which case you should <strong>really</strong> take a look at the original example), but in essence it all boils down to <a title="Example from the XCF SVN" href="http://xcf.svn.sourceforge.net/viewvc/xcf/tools/xcf-python/IceHandlePython.hpp?view=markup&amp;revision=1262">this</a>. In that case, IceUtil::Handle&lt;T&gt; is the smart pointer i am working with. This class is coming from <a title="The Internet Communications Engine - ZeroC" href="http://www.zeroc.com/ice.html">Ice</a>, so if you&#8217;re also using that, you might try creating something similar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planetraven.de/blog/2009/06/13/using-a-custom-smart-pointer-with-boostpython/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/de/</creativeCommons:license>
	</item>
		<item>
		<title>YAHOPL &#8211; Yet another history of programming languages</title>
		<link>http://www.planetraven.de/blog/2009/05/08/yahopl/</link>
		<comments>http://www.planetraven.de/blog/2009/05/08/yahopl/#comments</comments>
		<pubDate>Fri, 08 May 2009 18:12:03 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[lustig]]></category>

		<guid isPermaLink="false">http://www.planetraven.de/blog/?p=18</guid>
		<description><![CDATA[Aber diesmal eine kurze, unvollständige, größtenteils falsche (und sehr lustige)!
]]></description>
			<content:encoded><![CDATA[<p>Aber diesmal eine <a title="A Brief, Incomplete, and Mostly Wrong History of Programming Languages" href="http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html">kurze, unvollständige, größtenteils falsche</a> (und sehr lustige)!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.planetraven.de/blog/2009/05/08/yahopl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/de/</creativeCommons:license>
	</item>
	</channel>
</rss>
