<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2" -->
<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/"
	>

<channel>
	<title>bsod's braindumps &#187; coding</title>
	<link>http://blog.superstring.nl</link>
	<description>nosce te ipsum</description>
	<pubDate>Mon, 29 Mar 2010 16:20:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>
	<language>en</language>
			<item>
		<title>Why boost is impractical</title>
		<link>http://blog.superstring.nl/2010/03/29/why-boost-is-impractical/</link>
		<comments>http://blog.superstring.nl/2010/03/29/why-boost-is-impractical/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:15:52 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2010/03/29/why-boost-is-impractical/</guid>
		<description><![CDATA[In the C++ programming world, the peer reviewed boost libraries are a gold standard to measure every other library on. Several parts of this library are being made standard in the next C++ standard, C++0x.
So, everybody would be using boost, right?
Well, no&#8230; You see, boost is a BIG library. It installs 64Mb worth of header [...]]]></description>
			<content:encoded><![CDATA[<p>In the C++ programming world, the peer reviewed <a href="http://www.boost.org/">boost libraries</a> are a gold standard to measure every other library on. Several parts of this library are being made standard in the next C++ standard, C++0x.</p>
<p>So, everybody would be using boost, right?</p>
<p>Well, no&#8230; You see, boost is a BIG library. It installs 64Mb worth of header files alone, 24Mb of libraries, and takes 20 minutes to compile on my machine, an average dual-core.</p>
<p>Now suppose I have a simple C++ program, a few files long, that uses some boost to parse the commandline. that would build in some seconds&#8230; why would i wait for 20 minutes for the code to arrive to simply parse the commandline? I&#8217;m not very happy that parsing the commandline this way requires you to redistribute a 300K+ .dll file.</p>
<p>GNU getopt on the other hand, compiles to less than 5K of code that you link in directly, so no .dll needed.</p>
<p>And they both do more or less the same thing. Sure, boost.program_options does a lot more, but it just is too excessive. And that&#8217;s why boost is impractical. You want a sip, but you get a bucketload shoved down your throat <img src='http://blog.superstring.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2010/03/29/why-boost-is-impractical/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Turing machines</title>
		<link>http://blog.superstring.nl/2008/03/18/turing-machines/</link>
		<comments>http://blog.superstring.nl/2008/03/18/turing-machines/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 14:37:42 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2008/03/18/turing-machines/</guid>
		<description><![CDATA[I was surfing the web and found this blog article on Turing machines, and it mentions this great Turing machine java applet.
]]></description>
			<content:encoded><![CDATA[<p>I was surfing the web and found this <a href="http://goodmath.blogspot.com/2006/03/playing-with-mathematical-machines.html">blog article</a> on Turing machines, and it mentions this great Turing machine <a href="http://ironphoenix.org/tril/tm/">java applet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2008/03/18/turing-machines/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New C++ feature: concepts</title>
		<link>http://blog.superstring.nl/2008/03/01/new-c-feature-concepts/</link>
		<comments>http://blog.superstring.nl/2008/03/01/new-c-feature-concepts/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 00:51:36 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2008/03/01/new-c-feature-concepts/</guid>
		<description><![CDATA[There is a new language feature in C++ going into the upcoming standard, &#8216;concepts&#8217;. If you seriously want to know more about them, there is a google talk about them (There is a google talk index site here and at youtube). Below is the shortest usable example of using concepts. Remember when reading the code: [...]]]></description>
			<content:encoded><![CDATA[<p>There is a new language feature in C++ going into the upcoming standard, &#8216;concepts&#8217;. If you seriously want to know more about them, there is a <a href="http://video.google.com/videoplay?docid=-1790714981047186825">google talk</a> about them (There is a google talk index site <a href="http://almaer.com/techtalkshowcase/white.html">here</a> and at <a href="http://www.youtube.com/profile_videos?user=googletechtalks">youtube</a>). Below is the shortest usable example of using concepts. Remember when reading the code: a concept defines which functions and operations a type, used to instantiate a template with, must provide. The code below compiles and runs with <a href="http://www.generic-programming.org/software/ConceptGCC/">ConceptGCC</a>.</p>
<p><code><br />
// list all operators and functions used in the<br />
// template 'add_t' (below) into concept AddType.<br />
concept AddType&lt;typename T&gt;<br />
{<br />
  T::T(const T&#038;);<br />
  T operator+(const T&#038;,const T&#038;);<br />
}</p>
<p>template &lt;AddType T&gt;	// notice 'AddType' instead of 'typename'<br />
struct add_t<br />
{<br />
  // uses the required operator+, and copies<br />
  // the result using the copy constructor<br />
  T add(const T&#038; a, const T&#038; b) { return a + b; }<br />
};</p>
<p>// an 'int' can do all that's required by AddType...<br />
concept_map AddType&lt;int&gt; {}</p>
<p>int main()<br />
{<br />
  add_t&lt;int&gt; x;</p>
<p>  int result = x.add(1,2);</p>
<p>  return result;<br />
}</code><br />
As you can see, all this is just a complicated way of writing 1+2, so if you optimize properly, all this boils down to: <code>int main() { return 3; }</code> as it should.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2008/03/01/new-c-feature-concepts/feed/</wfw:commentRss>
		</item>
		<item>
		<title>C# Coding</title>
		<link>http://blog.superstring.nl/2007/10/06/c-coding/</link>
		<comments>http://blog.superstring.nl/2007/10/06/c-coding/#comments</comments>
		<pubDate>Fri, 05 Oct 2007 23:32:40 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2007/10/06/c-coding/</guid>
		<description><![CDATA[With my new job i&#8217;m confined to the C# coding, but not all is lost, i&#8217;ve already more or less accepted that windows coding must be C# .NET.
However, the language C# is easy to work with, and has many possibilities for writing good code. And the Visual Studio IDE allows RAD for various types of [...]]]></description>
			<content:encoded><![CDATA[<p>With my new job i&#8217;m confined to the C# coding, but not all is lost, i&#8217;ve already more or less accepted that windows coding must be C# .NET.<br />
However, the language C# is easy to work with, and has many possibilities for writing good code. And the Visual Studio IDE allows RAD for various types of projects.<br />
And if you really want native code in those C# programs, like zlib or libpng, you can use C++ assemblies to do that.<br />
So not all portability is lost, but certain parts require specific windows coding, and that&#8217;s O.k. for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2007/10/06/c-coding/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Unittesting and c++ templates</title>
		<link>http://blog.superstring.nl/2007/05/02/unittesting-and-c-templates/</link>
		<comments>http://blog.superstring.nl/2007/05/02/unittesting-and-c-templates/#comments</comments>
		<pubDate>Wed, 02 May 2007 05:43:07 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2007/05/02/unittesting-and-c-templates/</guid>
		<description><![CDATA[I&#8217;ve been doing some C++  templates recently, and I found out that &#8216;unit testing&#8217; is absolutely handy when making templates. Say you have a template like this:
template&#60;class T> struct foo { T data; foo() { data = 0; } };
I could define an operator &#8216;+&#8217; on it using complicated syntax, but say I have [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some C++  templates recently, and I found out that &#8216;unit testing&#8217; is absolutely handy when making templates. Say you have a template like this:</p>
<p><code>template&lt;class T> struct foo { T data; foo() { data = 0; } };</code></p>
<p>I could define an operator &#8216;+&#8217; on it using complicated syntax, but say I have done that, and I want to test that it works. (And, say, you want  T is &#8217;std::complex&lt;float>&#8217; and &#8216;float&#8217;, for example.) Okay:</p>
<p><code>template&lt;class T><br />
struct foo_test<br />
  {<br />
    inline foo_test() /* here we test the whole 'foo' class on syntax */<br />
      {<br />
        foo&lt;T> x,y,z;<br />
        z = x + y;<br />
      }<br />
  };<br />
inline void foo_test_instantiate() /* here we instantiate *the test* for our supported types */<br />
  {<br />
    foo_test&lt;float> tmp1;<br />
    foo_test&lt;std ::complex&lt;float> > tmp2;<br />
    foo_test&lt;std::complex&lt;long double> > tmp3;<br />
    /* done testing supported types */<br />
  }</code></p>
<p>I suppose you can place this kind of syntax checking right into the header file, as it has zero code overhead, if it wasn&#8217;t for the fact that those get too big as it is, and testing doesn&#8217;t belong there anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2007/05/02/unittesting-and-c-templates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>C++ braindump on iterators</title>
		<link>http://blog.superstring.nl/2007/04/28/c-braindump-on-iterators/</link>
		<comments>http://blog.superstring.nl/2007/04/28/c-braindump-on-iterators/#comments</comments>
		<pubDate>Sat, 28 Apr 2007 19:40:34 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2007/04/28/c-braindump-on-iterators/</guid>
		<description><![CDATA[Iterators are really fun, because when you implement them in your own class, you can have all STL algorithms at your disposal. It&#8217;s typical in current C++ to want this kind of things. Here is a few links about that: [gpwiki.org] and (less interesting), [codeguru.com].      
]]></description>
			<content:encoded><![CDATA[<p>Iterators are really fun, because when you implement them in your own class, you can have all STL algorithms at your disposal. It&#8217;s typical in current C++ to want this kind of things. Here is a few links about that: [<a href="http://gpwiki.org/index.php/C_plus_plus:Modern_C_plus_plus:Iterators">gpwiki.org</a>] and (less interesting), [<a href="http://www.codeguru.com/cpp/cpp/algorithms/lists/article.php/c5135/#more">codeguru.com</a>].      </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2007/04/28/c-braindump-on-iterators/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AMD Quad Father</title>
		<link>http://blog.superstring.nl/2006/10/21/amd-quad-father/</link>
		<comments>http://blog.superstring.nl/2006/10/21/amd-quad-father/#comments</comments>
		<pubDate>Sat, 21 Oct 2006 21:28:10 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2006/10/21/amd-quad-father/</guid>
		<description><![CDATA[Okay, the cpu industry goes fast at the moment. Just as I laid my hands on my first Intel Core Duo processor, AMD is gonna bring out a Quad processor configuration.
This is pretty awesome stuff:  
&#8221; During our session, AMD was quick to point out the inherent benefits of their &#8220;Direct Connect&#8221; architecture, which [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, the cpu industry goes fast at the moment. Just as I laid my hands on my first Intel Core Duo processor, AMD is gonna bring out a Quad processor configuration.</p>
<p>This is pretty awesome stuff:  </p>
<p>&#8221; During our session, AMD was quick to point out the inherent benefits of their &#8220;Direct Connect&#8221; architecture, which is brought to the system via serial HyperTransport links. </p>
<p>In the architecture Memory, CPUs and certain IO subsystems are all directly connected to each other via HT and it affords AMD a huge advantage in scalability.  So much so that they&#8217;re already speaking of octal core implementations.  In addition, it&#8217;s our early estimation that this is the single most important advantage that a quad-core AMD architecture has over Intel&#8217;s Kentsfield CPU that is soon to be launched.  </p>
<p>(&#8230;) The board  has no less that 48 lanes of PCI Express connectivity brought out to its four full-length X16 PCIe slots. This will provide a ton of room for expansion for not only graphics but other technologies like PCI Express RAID cards for example.  Also note the 12 X 3G SATA ports &#8212; holy RAID Batman.  </p>
<p>(&#8230;)  Specifically the machines had two instances of City of Heroes running, two HD video streams playing, including a Battlefield 2142 trailer, and a video conversion going on, all at the same time.  In this case all four cores are pegged at 100% utilization but in fact there is plenty of horsepower left to navigate around Windows XP and launch other applications.  AMD is citing that more than 20 mutli-threaded game titles are targeted for release in 2007.  We&#8217;d offer that is even perhaps a bit conservative, as without question the world has now officially gone multi-core, whether you consider the developer or end user community.&#8221;</p>
<p>So. That&#8217;s a shitload of horsepower. Do I need it? Sometimes, but surely not all the time. Right now all what i&#8217;m doing is typing this blog entry. I <em>could</em> do some video conversion in the background, but I&#8217;m probably done coverting that few video&#8217;s pretty soon.</p>
<p>(<a href="http://slashdot.org/articles/06/10/21/1430236.shtml">slashdot link</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2006/10/21/amd-quad-father/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Moving from 32 to 64 bits</title>
		<link>http://blog.superstring.nl/2006/01/25/moving-from-32-to-64-bits/</link>
		<comments>http://blog.superstring.nl/2006/01/25/moving-from-32-to-64-bits/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 21:53:48 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/?p=48</guid>
		<description><![CDATA[Windows Vista will mean several things: DRM, 64-bit multicore processors, more than 4GB memory (true 64-bits, ddr3), and DirectX 10.
C/C++ compilers generate great assembly code, but sometimes you want to get down to the metal and do every instruction yourself. Under the x86 architecture, this usually means you want to do specific MMX/SSE stuff in [...]]]></description>
			<content:encoded><![CDATA[<p>Windows Vista will mean several things: DRM, 64-bit multicore processors, more than 4GB memory (true 64-bits, ddr3), and DirectX 10.</p>
<p>C/C++ compilers generate great assembly code, but sometimes you want to get down to the metal and do every instruction yourself. Under the x86 architecture, this usually means you want to do specific MMX/SSE stuff in your application.</p>
<p><b>compiler code generation</b></p>
<p>To support modern architectures, you basically need to recompile. <a href="http://en.wikipedia.org/wiki/AMD64">x86-64</a> issues are handled by recompile for that architecture, sse2 stuff requires your compiler to be very good at vectorizing code, and multi-core is handled by using multithreaded coding (<a href="http://www.google.com/search?q=Boost.Threads">Boost.Threads</a>, for example). </p>
<p><b>x86-64</b></p>
<p>Most issues are straightforward, but there are a few big differences. First of all, the x87 floating point is not supported under amd64. You must use sse2. Secondly, the 64bit version of MSDEV does not support inline asm anymore. gcc however obviously supports inline asm. In either case, you can use <b>fasm</b> for 64-bit asm modules.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2006/01/25/moving-from-32-to-64-bits/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Qemu for Windows</title>
		<link>http://blog.superstring.nl/2006/01/19/qemu/</link>
		<comments>http://blog.superstring.nl/2006/01/19/qemu/#comments</comments>
		<pubDate>Thu, 19 Jan 2006 11:13:50 +0000</pubDate>
		<dc:creator>bsod</dc:creator>
		
		<category><![CDATA[.english]]></category>

		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://blog.superstring.nl/2006/01/19/qemu/</guid>
		<description><![CDATA[I&#8217;ve installed qemu 0.8.0 for windows yesterday, and installed windows XP on it. It works like a charm, but I&#8217;m still working out the details on the network device.
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve installed <a href="http://en.wikipedia.org/wiki/QEMU">qemu</a> 0.8.0 for windows yesterday, and installed windows XP on it. It works like a charm, but I&#8217;m still working out the details on the network device.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.superstring.nl/2006/01/19/qemu/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
