<?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>Extrawurst</title>
	<atom:link href="http://www.extrawurst.org/blog11/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.extrawurst.org/blog11</link>
	<description>coding, tools and fun</description>
	<lastBuildDate>Tue, 24 May 2011 19:28:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Social Coding</title>
		<link>http://www.extrawurst.org/blog11/2011/05/social-coding/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=social-coding</link>
		<comments>http://www.extrawurst.org/blog11/2011/05/social-coding/#comments</comments>
		<pubDate>Sat, 14 May 2011 15:29:20 +0000</pubDate>
		<dc:creator>extrawurst</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.extrawurst.org/blog11/?p=169</guid>
		<description><![CDATA[Everyone of us knows the feeling when you are glad to find a project on sourceforge that seems to be exactly what you were looking for just to find it abandoned, outdated, unfinished or simple plain broken. That is frustrating. And in almost all cases before I&#8217;d just close the browser tab at such a [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone of us knows the feeling when you are glad to find a project on sourceforge that seems to be exactly what you were looking for just to find it abandoned, outdated, unfinished or simple plain broken. That is frustrating. And in almost all cases before I&#8217;d just close the browser tab at such a point.<br />
But now my coding went social <img src='http://www.extrawurst.org/blog11/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I started my social coding journey on <a href="http://bitbucket.org">bitbucket.org</a>. Already using some code from there it was just a matter of time until I felt the need to submit a patch anyway. So I thought &#8220;let&#8217;s try this fancy stuff everyone is talking about&#8221;.<br />
A fork and a few patches and pull requests later I must say I like it. It feels more user friendly from the source control point of view (I guess Mercurial as a distributed version control system helps here). But it feels also much more alive thanks to this social aspects. I got a list of projects and people I can follow and I can comment patches and even specific code lines of others.<br />
And now there is <a href="http://ohloh.org">ohloh.org</a>. They even take it one more step forward. This site is not so much about the code in terms of developing but in terms of analyzing it and socializing it. I can add projects here and they try to analyze how many people are/were working on it. They apply metrics to say something about the code quality it has and how alive it is. They even got those crazy calculations how much a project is worth in respect to the work hours it took. They estimate Firefox worth $88m. But one of the most interesting aspects of ohloh is that you can even find out who else is working on similar projects near you. This is especially funny since you find a lot of familiar faces there and more often than I&#8217;d imagined they were not as old and not even as far away as I thought.<br />
All in all I think the times are great to collaborate. I wish I had more time for this <img src='http://www.extrawurst.org/blog11/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I published a little open source tool that i wrote to help me messing with OpenCL source files: <a href="https://bitbucket.org/Extrawurst/clcompile">clcompile<br />
</a></p>
<p>Visit me on bitbucket at <a href="https://bitbucket.org/Extrawurst/">www.bitbucket.org/Extrawurst</a><br />
Visit me on ohloh at <a href="https://www.ohloh.net/accounts/Extrawurst">www.ohloh.net/accounts/Extrawurst</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.extrawurst.org/blog11/2011/05/social-coding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLInfo goes portable 2</title>
		<link>http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clinfo-goes-portable-2</link>
		<comments>http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 18:32:08 +0000</pubDate>
		<dc:creator>extrawurst</dc:creator>
				<category><![CDATA[D language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.extrawurst.org/blog11/?p=119</guid>
		<description><![CDATA[It was a long and painful way until i managed to do my tool using gtkD1. Well just after I had finished my port to gtkD I was told that I should give DWT2 another try. I must confess I wasn&#8217;t expecting much after my last experiences with a SWT port. But DWT really is [...]]]></description>
			<content:encoded><![CDATA[<p>It was a long and painful way until i managed to do my tool using gtkD<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/#footnote_0_119" id="identifier_0_119" class="footnote-link footnote-identifier-link" title="post about gtkD">1</a></sup>. Well just after I had finished my port to gtkD I was told that I should give DWT<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/#footnote_1_119" id="identifier_1_119" class="footnote-link footnote-identifier-link" title="DWT project page">2</a></sup> another try.</p>
<p>
<a href="http://www.extrawurst.org/blog11/wp-content/gallery/CLInfo/clinfo04.png" title="New look using DWT" class="shutterset_singlepic6" >
	<img class="ngg-singlepic ngg-right" src="http://www.extrawurst.org/blog11/wp-content/gallery/cache/6_web20|watermark_200x_clinfo04.png" alt="CLInfo 0.7.0" title="CLInfo 0.7.0" />
</a>
I must confess I wasn&#8217;t expecting much after my last experiences with a SWT port. But DWT really is mature. I got it to build very fast and the snippets helped me a lot learning the usage. The lib design comes more natural to me than gtkD and I had the same results in a fraction of the time it took me to tame gtkD. Now my CLInfo Tool<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/#footnote_2_119" id="identifier_2_119" class="footnote-link footnote-identifier-link" title="CLInfo Tool Page">3</a></sup> is DWT based.</p>
<p><strong>DWT in short</strong></p>
<p>Pro:</p>
<ul>
<li>Much more intuitive design &#8211; I didn&#8217;t even miss the gui designer</li>
<li>Better documentation with a lot of example snippets</li>
<li>No need to ship a bunch of dependencies with the binary</li>
</ul>
<p>Con:</p>
<ul>
<li>Not absolutely everything of the SWT is ported yet</li>
<li>No gui designer</li>
<li>Build script uses rake<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/#footnote_3_119" id="identifier_3_119" class="footnote-link footnote-identifier-link" title="rake project page">4</a></sup> &#8211; one more dependency for users of the lib</li>
</ul>
<p>All in all my conclusion for now is going with DWT for GUI applications in D. At least if it stands the test under linux. But that is still to come..</p>
<ol class="footnotes"><li id="footnote_0_119" class="footnote"><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/">post about gtkD</a></li><li id="footnote_1_119" class="footnote"><a href="http://www.dsource.org/projects/dwt">DWT project page</a></li><li id="footnote_2_119" class="footnote"><a href="http://www.extrawurst.org/blog11/opencl-info/">CLInfo Tool Page</a></li><li id="footnote_3_119" class="footnote"><a href="http://rake.rubyforge.org/">rake project page</a></li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.extrawurst.org/blog11/2011/04/clinfo-goes-portable-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLInfo goes portable</title>
		<link>http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clinfo-0-6-0-goes-portable</link>
		<comments>http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 14:32:25 +0000</pubDate>
		<dc:creator>extrawurst</dc:creator>
				<category><![CDATA[D language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.extrawurst.org/blog11/?p=75</guid>
		<description><![CDATA[Everyone knows my affection for the D programming language. The one thing that kept me from using it in some commercial projects already was the lack of a usable platform independent GUI library for D2. There is one very mature GUI lib called DFL1 for D2 available but it has one big inconvenience: it is [...]]]></description>
			<content:encoded><![CDATA[<p>Everyone knows my affection for the D programming language. The one thing that kept me from using it in some commercial projects already was the lack of a usable platform independent GUI library for D2.</p>
<p>There is one very mature GUI lib called DFL<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_0_75" id="identifier_0_75" class="footnote-link footnote-identifier-link" title="Website DFL">1</a></sup> for D2 available but it has one big inconvenience: it is not platform independent, it is Win32 only. The first revisions of my CLInfo<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_1_75" id="identifier_1_75" class="footnote-link footnote-identifier-link" title="Website CLInfo">2</a></sup> tool are written using it. It made me feel home immediately. It is structured like all the libraries for Win32 I was used to: Delphi VCL, MFC and .Net Win Forms.</p>
<p>Now it is not as if there are no platform independent libraries for D out there in development, like DWT<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_2_75" id="identifier_2_75" class="footnote-link footnote-identifier-link" title="Website DWT">3</a></sup> , QtD<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_3_75" id="identifier_3_75" class="footnote-link footnote-identifier-link" title="Website QtD">4</a></sup> or GtkD<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_4_75" id="identifier_4_75" class="footnote-link footnote-identifier-link" title="Website GtkD">5</a></sup> . But the main problem is that most of them are either not ported to D2 or simply still too immature.<br />
Recently I decided to give GtkD another try because it was released in a new version<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_5_75" id="identifier_5_75" class="footnote-link footnote-identifier-link" title="Announcement of GtkD 1.4">6</a></sup> . And well what can I say. It works. Well at least I was able to to compile it without any hassle which is nothing natural looking back to all those times I already tried them before.<br />
So nothing was stopping me from messing around on those unknown grounds anymore&#8230; I thought&#8230;<br />
Well as I said I was used to the Win32 way GUI for my whole life and as it turns out this is a quite different way compared to the open-source gimp Gtk way.<br />
At first I tried to follow some tutorials teaching me how to programmatically set up my UI which evolved to a disaster when the UI got more complex than having a bunch of buttons and a list with a menubar.
<a href="http://www.extrawurst.org/blog11/wp-content/gallery/CLInfo/clinfo02.png" title="New look using GTK+" class="shutterset_singlepic4" >
	<img class="ngg-singlepic ngg-right" src="http://www.extrawurst.org/blog11/wp-content/gallery/cache/4_web20|watermark_200x_clinfo02.png" alt="CLInfo 0.6.0" title="CLInfo 0.6.0" />
</a>
<br />
Then I learned about the Glade Designer<sup><a href="http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/#footnote_6_75" id="identifier_6_75" class="footnote-link footnote-identifier-link" title="Website Glade">7</a></sup> which felt quite familiar to what I was used to. But I used the wrong export format, apparently libglade and the glade file format was deprecated and no one told me <img src='http://www.extrawurst.org/blog11/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .<br />
Back to square one. Now I use the gtkBuilder and the according file format. But the code using this still feels quite alien to me.<br />
Anyway I finally got the same UI I had on windows using GtkD and hypothetically my tool should now build and run under Linux too. Guess that is the next journey to come <img src='http://www.extrawurst.org/blog11/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<ol class="footnotes"><li id="footnote_0_75" class="footnote"><a href="http://www.dprogramming.com/dfl.php">Website DFL</a></li><li id="footnote_1_75" class="footnote"><a href="http://www.extrawurst.org/blog11/opencl-info/">Website CLInfo</a></li><li id="footnote_2_75" class="footnote"><a href="http://www.dsource.org/projects/dwt">Website DWT</a></li><li id="footnote_3_75" class="footnote"><a href="http://www.dsource.org/projects/qtd">Website QtD</a></li><li id="footnote_4_75" class="footnote"><a href="http://www.dsource.org/projects/gtkd">Website GtkD</a></li><li id="footnote_5_75" class="footnote"><a href="http://www.digitalmars.com/d/archives/digitalmars/D/announce/GtkD_1_4_released._20307.html">Announcement of GtkD 1.4</a></li><li id="footnote_6_75" class="footnote"><a href="http://glade.gnome.org/">Website Glade</a></li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.extrawurst.org/blog11/2011/04/clinfo-0-6-0-goes-portable/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>CLInfo 0.5.1 and metaprogramming in D</title>
		<link>http://www.extrawurst.org/blog11/2011/01/clinfo-0-5-1-and-metaprogramming-in-d/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clinfo-0-5-1-and-metaprogramming-in-d</link>
		<comments>http://www.extrawurst.org/blog11/2011/01/clinfo-0-5-1-and-metaprogramming-in-d/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 15:09:29 +0000</pubDate>
		<dc:creator>extrawurst</dc:creator>
				<category><![CDATA[D language]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[meta programming]]></category>
		<category><![CDATA[OpenCL]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.extrawurst.org/blog11/?p=43</guid>
		<description><![CDATA[I just added support for three missing caps that CLInfo did not yet show: CL_DEVICE_SINGLE_FP_CONFIG CL_DEVICE_QUEUE_PROPERTIES CL_DEVICE_TYPE All three of them have types defined as enums and those values are used as bitfields (or masks) so the driver can support multiple values of these. To support such bitfields in my application i wanted to come [...]]]></description>
			<content:encoded><![CDATA[<p>I just added support for three missing caps that <a href="http://www.extrawurst.org/blog11/?page_id=5" target="_self">CLInfo</a> did not yet show:</p>
<ul>
<li>CL_DEVICE_SINGLE_FP_CONFIG</li>
<li>CL_DEVICE_QUEUE_PROPERTIES</li>
<li>CL_DEVICE_TYPE</li>
</ul>
<p>All three of them have types defined as enums and those values are used as bitfields (or <a href="http://en.wikipedia.org/wiki/Mask_%28computing%29" target="_blank">masks</a>) so the driver can support multiple values of these.</p>
<p>To support such bitfields in my application i wanted to come up with convenient generic method and D enables me to do so using meta programming techniques:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="d" style="font-family:monospace;">string<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> bitfieldToStrings<span style="color: #66cc66;">&#40;</span>T<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#40;</span>T _val<span style="color: #66cc66;">&#41;</span>
	<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #000000; font-weight: bold;">is</span><span style="color: #66cc66;">&#40;</span>T <span style="color: #66cc66;">==</span> <span style="color: #993333;">enum</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#123;</span>
	string<span style="color: #66cc66;">&#91;</span><span style="color: #66cc66;">&#93;</span> res<span style="color: #66cc66;">;</span>
&nbsp;
	<span style="color: #b1b100;">foreach</span><span style="color: #66cc66;">&#40;</span>mem<span style="color: #66cc66;">;</span> __traits<span style="color: #66cc66;">&#40;</span>allMembers<span style="color: #66cc66;">,</span> T<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #993333;">auto</span> memValue <span style="color: #66cc66;">=</span> <span style="color: #000000; font-weight: bold;">mixin</span><span style="color: #66cc66;">&#40;</span>mem<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span> <span style="color: #66cc66;">&#40;</span>_val <span style="color: #66cc66;">&amp;</span> memValue<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">==</span> memValue<span style="color: #66cc66;">&#41;</span>
		<span style="color: #66cc66;">&#123;</span>
			res <span style="color: #66cc66;">~=</span> mem<span style="color: #66cc66;">;</span>
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">return</span> res<span style="color: #66cc66;">;</span>
<span style="color: #66cc66;">&#125;</span></pre></td></tr></table></div>

<p>This template method returns an array of which enum members are masked in the given value (as a string array). I want to emphasize some parts of this function which for me make D code so elegant and clean (especially compared to C++):</p>
<ol>
<li>Contracts(Line 2): C++0x dismissed them, D has them for almost a year. Here i want to make sure the template will only be used with enum types.</li>
<li>Strings(Line 4): D has first class strings (array of immutable chars) which makes my life a lot easier.</li>
<li>Foreach(Line 6): What is there more to say ? Just convenient.</li>
<li>Compile time reflections(Line 6): __traits is a pity of a name for such a powerful construct which in this case returns an array of strings of all members of a given type (in this case our enum)</li>
<li>Automatic type inference(Line 8): C++0x finally has it too. But it is too new to be used platform independently. D has it since dawn of time.</li>
<li><a href="http://www.digitalmars.com/d/2.0/mixin.html">String mixin</a>(Line 8): Some may <a href="http://stackoverflow.com/questions/3300447/is-using-d-string-mixins-for-code-reuse-an-anti-pattern">argue</a> this is a hackish concept but for me it came in handy very often. Here we mixin every member of the enum to check if it is masked in the given value.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.extrawurst.org/blog11/2011/01/clinfo-0-5-1-and-metaprogramming-in-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CLInfo</title>
		<link>http://www.extrawurst.org/blog11/2011/01/clinfo/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clinfo</link>
		<comments>http://www.extrawurst.org/blog11/2011/01/clinfo/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 21:42:30 +0000</pubDate>
		<dc:creator>extrawurst</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[D]]></category>
		<category><![CDATA[OpenCL]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.extrawurst.org/blog11/?p=21</guid>
		<description><![CDATA[I&#8217;ve been looking into OpenCL recently. I found it to be really useful and interesting. While developing a few samples for myself to get my head around it i found it rather annoying to always break into my code to find out the properties of all the different capabilities my graphics card/OpenCL driver supported. After [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking into <a href="http://www.khronos.org/opencl/" target="_blank">OpenCL</a> recently. I found it to be really useful and interesting. While developing a few samples for myself to get my head around it i found it rather annoying to always break into my code to find out the properties of all the different capabilities my graphics card/OpenCL driver supported. After searching the web for a while i was not able to find a decent win32 tool that would let me enumerate all the info. So i wrote one myself. <a href="http://www.extrawurst.org/blog11/?page_id=5" target="_self">CLInfo</a> is written in <a href="http://www.digitalmars.com/d/2.0/" target="_blank">D</a> and is Win32 only.</p>
<p><a href="http://www.extrawurst.org/blog11/?page_id=5" target="_self">Download</a> the current version on the <a href="http://www.extrawurst.org/blog11/?page_id=5" target="_self">CLInfo Page</a>.</p>

<a href="http://www.extrawurst.org/blog11/wp-content/gallery/CLInfo/CLInfo01.png" title="First GUI was DFL based" class="shutterset_singlepic3" >
	<img class="ngg-singlepic" src="http://www.extrawurst.org/blog11/wp-content/gallery/cache/3__400x_CLInfo01.png" alt="CLInfo 0.5.3" title="CLInfo 0.5.3" />
</a>

]]></content:encoded>
			<wfw:commentRss>http://www.extrawurst.org/blog11/2011/01/clinfo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello World</title>
		<link>http://www.extrawurst.org/blog11/2011/01/hello-world-2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hello-world-2</link>
		<comments>http://www.extrawurst.org/blog11/2011/01/hello-world-2/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 12:43:17 +0000</pubDate>
		<dc:creator>extrawurst</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://www.extrawurst.org/blog11/?p=15</guid>
		<description><![CDATA[This blog aims to present my person, my thoughts and my professional and private projects. More to come soon&#8230;]]></description>
			<content:encoded><![CDATA[<p>This blog aims to present my person, my thoughts and my professional and private projects. More to come soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.extrawurst.org/blog11/2011/01/hello-world-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

