<?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>Jeroens blog &#187; C#</title>
	<atom:link href="http://blog.bn2vs.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bn2vs.com</link>
	<description>Blog of Jeroen De Dauw. The latest news on my open source work and interests.</description>
	<lastBuildDate>Wed, 28 Jul 2010 16:09:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>BN+ Converter Pro 1.1.0 released</title>
		<link>http://blog.bn2vs.com/2010/05/01/bn-converter-pro-1-1-0-released/</link>
		<comments>http://blog.bn2vs.com/2010/05/01/bn-converter-pro-1-1-0-released/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 23:52:54 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[Binary Converter]]></category>
		<category><![CDATA[BN+ Converter Pro]]></category>
		<category><![CDATA[BN+ Framework]]></category>
		<category><![CDATA[BN+ Library]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[Hashing]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=809</guid>
		<description><![CDATA[Two months back I dug up the project files of BN+ Converter Pro, a .Net application I created when I was in secondary school, and did some high level refactoring to optimize it for .Net 4.0 and version 3 of my .Net class library. This was soon after I released a similar update for BN+ [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2010/05/01/bn-converter-pro-1-1-0-released/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Two months back I dug up the project files of BN+ Converter Pro, a .Net application I created when I was in secondary school, and did some high level refactoring to optimize it for .Net 4.0 and version 3 of my .Net class library. This was soon after I released <a href="http://blog.bn2vs.com/2010/02/15/bn-brute-force-hash-attacker-1-2-0-released/">a similar update</a> for BN+ Brute Force Hash Attacker, another of my old .Net apps. On top of the changes I made, and a very few new features I&#8217;ve added, the code is now publicly available under the terms of the GNU General Public License v3 or later <a href="http://bncpro.svn.sourceforge.net/viewvc/bncpro/">on SourceForge</a>. I waited with releasing this since I wanted the app to be compiled with the stable release of .Net framework, which was released a while back now.</p>
<p><strong>Changes in this release</strong></p>
<pre>* Use of <a href="http://wiki.bn2vs.com/BN%2B_Library">BN+ Library</a> 3.0.1
* Use of native components of .Net framework 4.0
* Implemented a new update platform
* Refactored namespaces and moved around a bunch of files
* Redesigned the about interface
* Redesigned the help menu
* Moved documentation to a wiki page
* Added ROT 5, ROT 13, ROT 18 and ROT 48 codecs
* Made the source code available under the GPL on SourceForge
</pre>
<p><strong>Downloads</strong></p>
<ul>
<li><a href="https://sourceforge.net/projects/bncpro/files/1.1.0/BN%2B%20Converter%20Pro.zip/download">Setup file (zip, windows installer, includes update platform)</a></li>
<li><a href="http://bncpro.svn.sourceforge.net/viewvc/bncpro/bin/Debug.tar.gz?view=tar">Executables tarball (latest version of the executables, straight from the SVN repo)</a></li>
<li><a href="http://bncpro.svn.sourceforge.net/viewvc/bncpro/">SVN repostory</a></li>
</ul>
<p><strong>Links</strong></p>
<ul>
<li><a href="https://sourceforge.net/projects/bncpro/">Project home</a></li>
<li><a href="http://www.binary-converter.com/">Documentation</a></li>
</ul>
<p>This is a screen shot of the previous version. This part of the  interface is pretty much unchanged.</p>
<p><a href="http://binary-converter.com"><img class="alignnone size-full wp-image-811" title="BN+ Converter Pro 1.0.6" src="http://blog.bn2vs.com/wp-content/uploads/2010/05/Bnc1.0.6.gif" alt="BN+ Converter Pro 1.0.6" width="517" height="299" /></a></p>
<p>This screenshot shows the redesigned about interface.</p>
<p><a href="http://www.binary-converter.com/"><img class="alignnone size-full wp-image-812" title="BN+ Converter Pro 1.1.0 about screen" src="http://blog.bn2vs.com/wp-content/uploads/2010/05/bncAbout.gif" alt="BN+ Converter Pro 1.1.0 about screen" width="601" height="417" /></a></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<pre><span class="hl slc">the terms of the GNU General Public License</span>
</pre>
</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F&amp;title=BN%2B+Converter+Pro+1.1.0+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F&amp;title=BN%2B+Converter+Pro+1.1.0+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F&amp;title=BN%2B+Converter+Pro+1.1.0+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F&amp;headline=BN%2B+Converter+Pro+1.1.0+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=BN%2B+Converter+Pro+1.1.0+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=BN%2B+Converter+Pro+1.1.0+released&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=BN%2B+Converter+Pro+1.1.0+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=BN%2B+Converter+Pro+1.1.0+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=BN%2B+Converter+Pro+1.1.0+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F&amp;title=BN%2B+Converter+Pro+1.1.0+released&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F05%2F01%2Fbn-converter-pro-1-1-0-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2010/05/01/bn-converter-pro-1-1-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Skynet released!</title>
		<link>http://blog.bn2vs.com/2010/01/30/skynet-released/</link>
		<comments>http://blog.bn2vs.com/2010/01/30/skynet-released/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 22:43:10 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Artificial intelligence]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[GA]]></category>
		<category><![CDATA[GALib]]></category>
		<category><![CDATA[Genetic Algorithm]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Skynet]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[The Code Project]]></category>
		<category><![CDATA[Travelling Salesman Problem]]></category>
		<category><![CDATA[TSP]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=686</guid>
		<description><![CDATA[Today I released the first public beta of Skynet, which is now at version 0.1.3. Skynet is an implementation of GALib with WPF GUI that solves the Travelling Salesman Problem (TSP) using Genetic Algorithms (GA). It&#8217;s completely open source and available under the GNU General Public License. Downloads Skynet 0.1.3.zip 99.4 KB Skynet 0.1.3 setup.zip [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2010/01/30/skynet-released/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Today I released the first public beta of Skynet, which is now at version 0.1.3. Skynet is an implementation of <a title="GALib" href="http://wiki.bn2vs.com/GALib">GALib</a> with WPF GUI that solves the Travelling Salesman  Problem (<a rel="nofollow" href="http://en.wikipedia.org/wiki/Travelling_salesman_problem">TSP</a>) using Genetic Algorithms (<a rel="nofollow" href="http://en.wikipedia.org/wiki/Genetic_algorithm">GA</a>). It&#8217;s completely open source and available  under the GNU General Public License.</p>
<p><strong>Downloads</strong></p>
<ul>
<li> <a rel="nofollow" href="https://sourceforge.net/projects/csgalib-tsp/files/Skynet%200.1.3/Skynet%200.1.3.zip/download">Skynet 0.1.3.zip</a> 99.4 KB</li>
<li> <a rel="nofollow" href="https://sourceforge.net/projects/csgalib-tsp/files/Skynet%200.1.3/Skynet%200.1.3%20setup.zip/download">Skynet 0.1.3 setup.zip</a> 331.3 KB</li>
<li> <a rel="nofollow" href="http://csgalib-tsp.svn.sourceforge.net/viewvc/csgalib-tsp.tar.gz?view=tar">Download GNU tarball</a> (latest  version of the source project, straight from SVN)</li>
</ul>
<p>You can also download the project code directly via SVN from the   SourceForge source code repository, at <a rel="nofollow" href="https://csgalib-tsp.svn.sourceforge.net/svnroot/csgalib-tsp">https://csgalib-tsp.svn.sourceforge.net/svnroot/csgalib-tsp</a>.   From a command line, you can call the following:  svn checkout  https://csgalib-tsp.svn.sourceforge.net/svnroot/csgalib-tsp</p>
<p><strong>Application features</strong></p>
<ul>
<li>Graphical WPF interface</li>
<li>Multiple selection algorithms</li>
<li>Pause, resume and cancellation support</li>
<li>Control over mutation ratio&#8217;s and elitism percentage</li>
<li>Optional removal of identical twins or individuals</li>
<li>&#8220;Take over the world&#8221; button</li>
</ul>
<p><strong>Background</strong></p>
<p>The idea for creating this application came to me after reading the  first part of <a rel="nofollow" href="http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&amp;tid=11657">Bio-Inspired Artificial  Intelligence</a> by Dario Floreano and Claudio Mattiussi. I figured I  needed to do an implementation of what I&#8217;ve read to test myself. I split  up the general GA code from the application itself and created <a title="GALib" href="http://wiki.bn2vs.com/GALib">GALib</a>, a small C#  Library that provides the scaffolding for Genetic Algorithm based  functionality. All work was done in my free time.</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/Skynet-application-interface.gif"><img class="alignnone size-full wp-image-687" title="Skynet application interface" src="http://blog.bn2vs.com/wp-content/uploads/2010/01/Skynet-application-interface.gif" alt="" width="600" height="574" /></a></p>
<p>See <a title="Skynet/Screenshots" href="http://wiki.bn2vs.com/Skynet/Screenshots">this page</a> for more screenshots.</p>
<p><strong>Using the application</strong></p>
<p>Although the application interface should be pretty straight forward to use, I&#8217;ve written some documentation, which can be found <a href="http://wiki.bn2vs.com/Skynet#Using_the_application">here</a>. If you have any questions, let me know <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>How it works</strong></p>
<p><a href="http://wiki.bn2vs.com/Skynet#How_it_works">This section on my wiki</a> explains how Skynet works as an implementation of <a title="GALib" href="http://wiki.bn2vs.com/GALib">GALib</a>. If you are  not familiar with how genetic algorithms work, you are advised to first  have a good look at <a rel="nofollow" href="http://en.wikipedia.org/wiki/Genetic_algorithm">this Wikipedia article</a> and related pages. This  section will introduce you to how GA logic specific to the TSP works in a  bottom-up fashion. For more information on the actual evolution, see <a title="GALib" href="http://wiki.bn2vs.com/GALib">GALib</a>. I&#8217;m also planning to write a Code Project article about this implementation of GALib.</p>
<p>This is a full dependency digram generated in a Visual Studio solution containing both the GALib and Skynet projects.</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-and-Skynet-dependency-graph.gif"><img class="alignnone size-full wp-image-688" title="[Click to enlarge] Skynet and GALib dependency diagram" src="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-and-Skynet-dependency-graph.gif" alt="Skynet and GALib dependency diagram" width="599" height="602" /></a></p>
<p><strong>Points of interest</strong></p>
<p>Since my main motivation for creating this application was exercise, I  learned a lot from building it. It&#8217;s my first decent C# application, as  well as the first time I&#8217;ve created one using WPF and the first time  I&#8217;ve done any GA programming (or AI in general). It also gave me the  chance to familiarize myself with some of the new things of .Net 4.0,  some profiling tools (see screenshot below), and have some fun with navigation based windows.  The biggest challenge in the application itself (so not counting <a title="GALib" href="http://wiki.bn2vs.com/GALib">GALib</a>), was  definitely creating the crossover algorithm for the Route individual  type. At first I simply took half of the connections of one parent, and  then the other half from the other parent, but I rewrote this to take  all common connections. Although the crossover algorithm works fine now,  it&#8217;s pretty heavy on the cpu, and limiting the maximum speed of the  application severely. If anyone finds a way to speed it up, be sure to  let me know :)</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/ants-performance-profiler.gif"><img class="alignnone size-full wp-image-689" title="[Click to enlarge] Profiling of Skynet" src="http://blog.bn2vs.com/wp-content/uploads/2010/01/ants-performance-profiler.gif" alt="Profiling of Skynet" width="603" height="411" /></a></p>
<p>I&#8217;ve been working on this application on an off for a month now, and have implemented everything I&#8217;ve planned and more. Although a lot of cool stuff could still be added, I&#8217;m quitting active development of both this application and GALib, so I can focus on new projects that allow me to further expand my understanding of AI.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F&amp;title=Skynet+released%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F&amp;title=Skynet+released%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F&amp;title=Skynet+released%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F&amp;headline=Skynet+released%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Skynet+released%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Skynet+released%21&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Skynet+released%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Skynet+released%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Skynet+released%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F&amp;title=Skynet+released%21&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F30%2Fskynet-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2010/01/30/skynet-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GALib 0.1 released</title>
		<link>http://blog.bn2vs.com/2010/01/24/galib-0-1-released/</link>
		<comments>http://blog.bn2vs.com/2010/01/24/galib-0-1-released/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 22:31:25 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Artificial intelligence]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Evolutionary Algortihm]]></category>
		<category><![CDATA[GA]]></category>
		<category><![CDATA[GALib]]></category>
		<category><![CDATA[Genetic Algorithm]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[TCP]]></category>
		<category><![CDATA[The Code Project]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=677</guid>
		<description><![CDATA[Yesterday I released GALib version 0.1, a small C# Library that provides the scaffolding for Genetic Algorithm based functionality. It&#8217;s completely open source and available under the GNU General Public License. (See other blog posts about GALib) You can download both the source and compiled .dll from SourceForge. I&#8217;ve done the effort to do some [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2010/01/24/galib-0-1-released/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Yesterday I released <a href="https://sourceforge.net/projects/csgalib/">GALib</a> version 0.1, a small C# Library that provides the scaffolding for Genetic Algorithm based functionality. It&#8217;s completely open source and available under the GNU General Public License. (<a href="http://blog.bn2vs.com/tag/galib/">See other blog posts about GALib</a>) You can download both the source and compiled .dll from <a href="https://sourceforge.net/projects/csgalib/">SourceForge</a>.</p>
<p>I&#8217;ve done the effort to do some core documentation, in the form of comments in the <a href="https://sourceforge.net/projects/csgalib/">source code</a>, and an article explaining the usage of the library that I&#8217;ve put both <a href="http://wiki.bn2vs.com/GALib">on my wiki</a> and <a href="http://www.codeproject.com/KB/recipes/galib.aspx">on The Code Project</a>.</p>
<p>Since my main motivation for creating this library was exercise, I learned a lot from building it. This is the first C# library I&#8217;ve ever written, as well as the first time I&#8217;ve done any GA programming (or AI in general). Abstracting the library in a way so that it can be used for GA in general was very interesting, and required me to expanded my knowledge of how to use interfaces and inheritance and use generics in a non-basic way for the first time.</p>
<p>I&#8217;m not planning to further develop this lib, although I might when I can re-use it for a future project. I hope to similarly release the first version of <a href="http://blog.bn2vs.com/tag/downloadlib/">DownloadLib</a>, which I&#8217;m having some lame multithreading issues with, before halfway through next week, after which I&#8217;ll start doing some development on <a href="http://semantic-mediawiki.org/wiki/Semantic_MediaWiki">Semantic MediaWiki</a>.</p>
<p><strong>Downloads</strong></p>
<ul>
<li><a rel="nofollow" href="https://sourceforge.net/projects/csgalib/files/GALib%200.1%20dll.zip/download">GALib 0.1 dll.zip</a> (11.1KB)</li>
<li><a rel="nofollow" href="https://sourceforge.net/projects/csgalib/files/GALib%200.1%20source.tar.gz/download">GALib 0.1 source.zip</a> (58.4 KB)</li>
<li><a rel="nofollow" href="http://download-lib.svn.sourceforge.net/viewvc/csgalib.tar.gz?view=tar">GNU tarball</a></li>
</ul>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F&amp;title=GALib+0.1+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F&amp;title=GALib+0.1+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F&amp;title=GALib+0.1+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F&amp;headline=GALib+0.1+released" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=GALib+0.1+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=GALib+0.1+released&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=GALib+0.1+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=GALib+0.1+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=GALib+0.1+released&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F&amp;title=GALib+0.1+released&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F24%2Fgalib-0-1-released%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2010/01/24/galib-0-1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GALib available now!</title>
		<link>http://blog.bn2vs.com/2010/01/19/galib-available-now/</link>
		<comments>http://blog.bn2vs.com/2010/01/19/galib-available-now/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 23:36:42 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[Artificial intelligence]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Class lirary]]></category>
		<category><![CDATA[GA]]></category>
		<category><![CDATA[GALib]]></category>
		<category><![CDATA[Genetic Algorithm]]></category>
		<category><![CDATA[GPL]]></category>
		<category><![CDATA[Library]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SourceForge]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=662</guid>
		<description><![CDATA[Over the past 2 weeks I&#8217;ve been putting time in creating a general purpose Genetic Algorithm (GA) library in C#. It provides the scaffolding for any GA based functionality. Although it&#8217;s not fully finished yet, it is now available under the GPL licence at SourceForge. What does it provide and can it do ATM? An [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2010/01/19/galib-available-now/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Over the past 2 weeks I&#8217;ve been putting time in creating a general purpose Genetic Algorithm (<a href="http://en.wikipedia.org/wiki/Genetic_algorithm">GA</a>) library in C#. It provides the scaffolding for any GA based functionality. Although it&#8217;s not fully finished yet, it is <a href="http://download-lib.svn.sourceforge.net/viewvc/csgalib/">now available</a> under the GPL licence at <a href="http://sourceforge.net/">SourceForge</a>.</p>
<p><strong>What does it provide and can it do ATM?</strong></p>
<ul>
<li>An abstract Individual class that can be inherited from to make your own individual type, with it&#8217;s own <a href="http://en.wikipedia.org/wiki/Mutation">mutation</a>, <a href="http://en.wikipedia.org/wiki/Crossover_%28genetic_algorithm%29">crossover</a>, initialization and <a href="http://en.wikipedia.org/wiki/Fitness_function">fitness functions</a> and <a href="http://en.wikipedia.org/wiki/Genotype">genotype</a>.</li>
<li>A <a href="http://download-lib.svn.sourceforge.net/viewvc/csgalib/Population.cs?view=markup">population class</a>, which is basically a List&lt;IndividualType&gt;, which enables you to do the actual GA evolution. The evolution is done on a background thread, and events keep you up to date by reporting every time a generation has evolved, a new fittest individual is found, or the evolution is complete due to reaching the maximum amount of generations, reaching the stagnation limit or being cancelled. For the evolution you can choose between rank based <a href="http://en.wikipedia.org/wiki/Selection_%28genetic_algorithm%29">selection</a>, truncated rank based selection, and roulette wheel selection. You can also set properties like the mutation ratio, and elitism percentage.</li>
</ul>
<p><strong>What still needs to be finished/added?</strong></p>
<ul>
<li>The library contains a IslandGroup class, allowing you to do simultaneous evolution on multiple &#8216;islands&#8217;. This class still needs to be finished though.</li>
<li>The Population class contains a method for <a href="http://en.wikipedia.org/wiki/Tournament_selection">tournament based selection</a>, but the code is not complete yet.</li>
<li>The performance of the library could probably be improved.</li>
<li>A lot of other neat things could be added, like multiple reproduction methods and varying genotype size support.</li>
</ul>
<p>This is a class diagram of the library as it is at the moment.</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-cd.gif"><img class="alignnone size-full wp-image-664" title="Class diagram of GALib by Jeroen De Dauw" src="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-cd.gif" alt="Class diagram of GALib by Jeroen De Dauw" width="600" height="580" /></a></p>
<p>I&#8217;m going to release the <a href="http://blog.bn2vs.com/2010/01/10/galib-with-tsp-implementation/">TSP implementation</a> I made with this lib on-line in a similar fashion, after the interface is fully finished. Also, once the library itself is finished, I&#8217;m going to create an article explaining how it works and should be used, and put it both on The Code Project and my wiki <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Resources</strong></p>
<ul>
<li><a href="http://download-lib.svn.sourceforge.net/viewvc/csgalib/">Project home @ SourceForge</a></li>
<li><a href="http://download-lib.svn.sourceforge.net/viewvc/csgalib/" target="_blank">SVN repository @ SourceForge</a></li>
<li><a href="http://blog.bn2vs.com/tag/galib/">Related posts</a></li>
</ul>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F&amp;title=GALib+available+now%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F&amp;title=GALib+available+now%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F&amp;title=GALib+available+now%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F&amp;headline=GALib+available+now%21" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=GALib+available+now%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=GALib+available+now%21&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=GALib+available+now%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=GALib+available+now%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=GALib+available+now%21&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F&amp;title=GALib+available+now%21&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F19%2Fgalib-available-now%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2010/01/19/galib-available-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GALib with TSP implementation</title>
		<link>http://blog.bn2vs.com/2010/01/10/galib-with-tsp-implementation/</link>
		<comments>http://blog.bn2vs.com/2010/01/10/galib-with-tsp-implementation/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 01:21:03 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[GA]]></category>
		<category><![CDATA[GALib]]></category>
		<category><![CDATA[Genetic Algorithm]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Skynet]]></category>
		<category><![CDATA[TSP]]></category>
		<category><![CDATA[Ttravelling Salesman Problem]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=650</guid>
		<description><![CDATA[Over the last week, I&#8217;ve been rewriting my Genetic Algorithm (GA) implementation of the Travelling Salesman Problem (TSP). I&#8217;ve rewritten pretty much everything, but the two most notable changes are: 1. I split the code into 2 projects: one holding the general GA code, which is now called GALib, and one holding the code specific [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2010/01/10/galib-with-tsp-implementation/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Over the last week, I&#8217;ve been rewriting my Genetic Algorithm (<a href="http://en.wikipedia.org/wiki/Genetic_algorithm">GA</a>) implementation of the Travelling Salesman Problem (<a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem" target="_blank">TSP</a>). I&#8217;ve rewritten pretty much everything, but the two most notable changes are:</p>
<p>1. I split the code into 2 projects: one holding the general GA code, which is now called GALib, and one holding the code specific to the TSP, now called <a href="http://en.wikipedia.org/wiki/Skynet_%28Terminator%29" target="_blank">Skynet</a> (lol <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). This allows for making any other GA implementation using GALib, even in .Net languages different from C#. The underneath diagram should give you a good idea of how the who thing works. The 4 most left classes are of Skynet, all remaining classes and interfaces are of GALib.</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP-dependencyDiagram.png.gif"><img class="alignnone size-full wp-image-651" title="Dependency diagram of a Visual Studio solution containing the GALib and TSP app (Skynet)" src="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP-dependencyDiagram.png.gif" alt="Dependency diagram of a Visual Studio solution containing the GALib and TSP app (Skynet)" width="603" height="333" /></a></p>
<p>2. I rewrote the genotype of the Route individual type, the core of the TSP implementation. Instead of having a list of integers, referring to cities, I now have a list of Connection, each containing 2 instances of Location. I&#8217;ve done this to allow smarter <a href="http://en.wikipedia.org/wiki/Crossover_%28genetic_algorithm%29">crossover</a>, decreasing the chance of not finding a better solution while it&#8217;s still in the converged search space significantly. As a result of this change, I also had to rewrite pretty much everything else of the Route class, including random initialization, mutation and fitness assessment. The biggest challenge here was preventing the creation of multiple loops in the crossover algorithm.</p>
<p>The interface of the TSP app (now called Skynet) also has seen quite some work. I figured out quite a lot of <a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation">WPF</a> stuff by further creating it. Some extra controls and progress indicators still need to be added though, and I also haven&#8217;t created the Cancel/Stop functionality.</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP.png"><img class="alignnone size-full wp-image-652" title="Skynet interface showing 42 cities arranged in a circle" src="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP.png" alt="Skynet interface showing 42 cities arranged in a circle" width="592" height="662" /></a></p>
<p>Although the algorithm is efficient in the way that it takes relatively few generations to find a close to optimal solution, there remain a few mayor performance issues. If I compare the speed of evolution (measured in generations) with similar applications tackling the TSP, there are those performing up to 3 orders of magnitude faster. Although the fastest of those are written in C++ or C, I should be able to significantly speed up my application. Tracking down resource eating parts of code will be one of my next steps in developing this app. Another possible issue is diversity of the population. I have the suspicion that the diversity shrinks pretty fast, resulting into evolution driven only by mutation. I&#8217;m not sure of this though, and also have to investigate how I can prevent this from happening.</p>
<p>Here you have a few screenshots of the app in action <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP-gen41.png"><img class="alignnone size-full wp-image-653" title="Skynet interface showing the evolved route between 42 cities after 41 generations." src="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP-gen41.png" alt="Skynet interface showing the evolved route between 42 cities after 41 generations." width="594" height="662" /></a></p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP-gen2-1470.png"><img class="alignnone size-full wp-image-654" title="Skynet interface showing the evolved route between 42 cities after 1470 generations." src="http://blog.bn2vs.com/wp-content/uploads/2010/01/GALib-TSP-gen2-1470.png" alt="Skynet interface showing the evolved route between 42 cities after 1470 generations." width="592" height="660" /></a></p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F&amp;title=GALib+with+TSP+implementation" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F&amp;title=GALib+with+TSP+implementation" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F&amp;title=GALib+with+TSP+implementation" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F&amp;headline=GALib+with+TSP+implementation" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=GALib+with+TSP+implementation&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=GALib+with+TSP+implementation&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=GALib+with+TSP+implementation&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=GALib+with+TSP+implementation&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=GALib+with+TSP+implementation&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F&amp;title=GALib+with+TSP+implementation&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F10%2Fgalib-with-tsp-implementation%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2010/01/10/galib-with-tsp-implementation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>My first genetic algorithm</title>
		<link>http://blog.bn2vs.com/2010/01/03/my-first-genetic-algorithm/</link>
		<comments>http://blog.bn2vs.com/2010/01/03/my-first-genetic-algorithm/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 06:04:36 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[GA]]></category>
		<category><![CDATA[Genetic Algorithm]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[TSP]]></category>
		<category><![CDATA[Ttravelling Salesman Problem]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=644</guid>
		<description><![CDATA[To practice some AI methods I&#8217;ve been reading about, I created a genetic algorithm (GA) implementation to tackle the travelling salesman problem (TSP). I decided to do this in C#, to practice myself in some more advanced aspects of the language, and mess some more around with the new stuff of .Net 4.0, and with [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2010/01/03/my-first-genetic-algorithm/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>To practice some AI methods I&#8217;ve been reading about, I created a <a href="http://en.wikipedia.org/wiki/Genetic_algorithm" target="_blank">genetic algorithm</a> (GA) implementation to tackle the <a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem" target="_blank">travelling salesman problem</a> (TSP). I decided to do this in C#, to practice myself in some more advanced aspects of the language, and mess some more around with the new stuff of .Net 4.0, and with WPF as interface to get a better grip on the basics of <a href="http://en.wikipedia.org/wiki/Windows_Presentation_Foundation" target="_blank">WPF</a> and <a href="http://en.wikipedia.org/wiki/XAML" target="_blank">XAML</a>.</p>
<p>I started with creating a general data structure for any GA algorithm (Classes Population and Individual, interface IIndividual and some others), and then added handling for the TSP problem by creating a Route class. This class holds the crossover, mutation and random initialization methods for routes. Each instance of Route, which derives from Individual and implements IIndividual, contains it&#8217;s own genotype, which is a List&lt;Int64&gt;. This list contains the numbers of the &#8216;cities&#8217; the &#8216;salesman&#8217; travels along. In the code behind my main window, I then create an instance of a Population&lt;Route&gt;, and do a calculation of the distances between all points, which is then stored in a static field of Route.</p>
<p>I&#8217;m going to put the complete project on <a href="http://sourceforge.net/" target="_blank">SourceForge</a> when it&#8217;s a little more finished. Although the algorithm is working it can still be optimized a lot (especially the genetic operations). Also, the interface is far from ready, and I&#8217;d like to do another simple implementation with the general GA structure to tackle some other problem.</p>
<p>In any case, here are some nice sceenshots <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_646" class="wp-caption alignnone" style="width: 529px"><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/tsp-genetic-algorithm-cities.gif"><img class="size-full wp-image-646" title="The travelling salesman problem - the dots represent cities." src="http://blog.bn2vs.com/wp-content/uploads/2010/01/tsp-genetic-algorithm-cities.gif" alt="" width="519" height="209" /></a><p class="wp-caption-text">The dots represent cities.</p></div>
<div id="attachment_647" class="wp-caption alignnone" style="width: 529px"><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/tsp-genetic-algorithm-evolution.gif"><img class="size-full wp-image-647" title="The travelling salesman problem - evolution of the route." src="http://blog.bn2vs.com/wp-content/uploads/2010/01/tsp-genetic-algorithm-evolution.gif" alt="The travelling salesman problem - evolution of the route." width="519" height="240" /></a><p class="wp-caption-text">The shortest route after several generations. The gray line represents an attempted, but failed, mutation or combination.</p></div>
<div id="attachment_648" class="wp-caption alignnone" style="width: 531px"><a href="http://blog.bn2vs.com/wp-content/uploads/2010/01/tsp-genetic-algorithm-shortest-path.gif"><img class="size-full wp-image-648" title="The travelling salesman problem - the shortest route." src="http://blog.bn2vs.com/wp-content/uploads/2010/01/tsp-genetic-algorithm-shortest-path.gif" alt="The travelling salesman problem - the shortest route." width="521" height="244" /></a><p class="wp-caption-text">After a while the shortest route, or at least one that&#39;s very close, is found.</p></div>
<p>.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F&amp;title=My+first+genetic+algorithm" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F&amp;title=My+first+genetic+algorithm" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F&amp;title=My+first+genetic+algorithm" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F&amp;headline=My+first+genetic+algorithm" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=My+first+genetic+algorithm&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=My+first+genetic+algorithm&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=My+first+genetic+algorithm&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=My+first+genetic+algorithm&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=My+first+genetic+algorithm&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F&amp;title=My+first+genetic+algorithm&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2010%2F01%2F03%2Fmy-first-genetic-algorithm%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2010/01/03/my-first-genetic-algorithm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quantum Bukkit app</title>
		<link>http://blog.bn2vs.com/2009/12/08/quantum-bukkit-app/</link>
		<comments>http://blog.bn2vs.com/2009/12/08/quantum-bukkit-app/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 01:44:16 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[42]]></category>
		<category><![CDATA[Bukkit]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=587</guid>
		<description><![CDATA[Yesterday I spend about an hour creating the most useless application I&#8217;ve ever come up with. The main motivation for this was proving to a friend that solving a certain problem can be achieved with an algorithm containing only 1 loop and 1 if else structure. (And no GoTo&#8217;s! :p) It was also a nice [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2009/12/08/quantum-bukkit-app/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Yesterday I spend about an hour creating the most useless application I&#8217;ve ever come up with. The main motivation for this was proving to a friend that solving a certain problem can be achieved with an algorithm containing only 1 loop and 1 if else structure. (And no GoTo&#8217;s! :p) It was also a nice opportunity to freshen up my C# skills and mess around a little more with the Beta 2 of Visual Studio 2010.</p>
<p>The application allows to generate a list containing random indexes of that list as values, and with a few special values. The application then allows you to find out whether by following the indexes route, you&#8217;ll end up with a special value (and which one), or get into an infinite loop. It also allows to slow down each step, enabling you to track the followed route.</p>
<p><a href="http://blog.bn2vs.com/wp-content/uploads/2009/12/qunatumBukkit.gif"><img class="alignnone size-full wp-image-588" title="Quantum Bukkit App" src="http://blog.bn2vs.com/wp-content/uploads/2009/12/qunatumBukkit.gif" alt="Quantum Bukkit App" width="602" height="260" /></a></p>
<p>You can has downloads:</p>
<ul>
<li><a href="http://code.bn2vs.com/viewtopic.php?mode=attach&amp;id=238" target="_blank">Application executable (requires .Net 2.0 or above)</a></li>
<li><a href="http://code.bn2vs.com/viewtopic.php?mode=attach&amp;id=240" target="_blank">Source code (Visual studio 2010 C# WinForms solution)</a></li>
</ul>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">It allows to generate a list containing random indexes of that list as values, and with a few special values. The application then allows you to find out whether by following the indexes route, you&#8217;ll end up with a special value (and which one), or get into an infinite loop. Also allows to slow down the steps and track the route.</div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F&amp;title=Quantum+Bukkit+app" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F&amp;title=Quantum+Bukkit+app" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F&amp;title=Quantum+Bukkit+app" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F&amp;headline=Quantum+Bukkit+app" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Quantum+Bukkit+app&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Quantum+Bukkit+app&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Quantum+Bukkit+app&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Quantum+Bukkit+app&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Quantum+Bukkit+app&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F&amp;title=Quantum+Bukkit+app&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F12%2F08%2Fquantum-bukkit-app%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/12/08/quantum-bukkit-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VISUG: Code contracts in .Net 4.0</title>
		<link>http://blog.bn2vs.com/2009/10/09/visug-code-contracts-in-net-4-0/</link>
		<comments>http://blog.bn2vs.com/2009/10/09/visug-code-contracts-in-net-4-0/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 11:49:04 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Contracts]]></category>
		<category><![CDATA[Meetings]]></category>
		<category><![CDATA[Testability]]></category>
		<category><![CDATA[VISUG]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=462</guid>
		<description><![CDATA[Yesterday I went to my first VISUG event. VISUG stands for Visual Studio User Group and is the independent professional user group for Microsoft Visual Studio users in Belgium. The presentation, titled &#8220;C# 4.0 and testability&#8221;, and given by Dino Esposito, addressed the importance of testability in applications, and how this is made easier with [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2009/10/09/visug-code-contracts-in-net-4-0/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Yesterday I went to my first VISUG event. VISUG stands for Visual Studio User Group and is the independent professional user group for Microsoft Visual Studio users in Belgium. The presentation, titled &#8220;C# 4.0 and testability&#8221;, and given by Dino Esposito, addressed the importance of testability in applications, and how this is made easier with code contracts.</p>
<p>Code Contracts provide a language-agnostic way to express coding assumptions in .NET programs. The contracts take the form of preconditions, postconditions, and object invariants. They act as checked documentation of your external and internal APIs. The contracts are used to improve testing via runtime checking, enable static contract verification (yay!), and documentation generation. In short, they bring the advantages of design-by-contract programming to all .NET programming languages.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F&amp;title=VISUG%3A+Code+contracts+in+.Net+4.0" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F&amp;title=VISUG%3A+Code+contracts+in+.Net+4.0" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F&amp;title=VISUG%3A+Code+contracts+in+.Net+4.0" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F&amp;headline=VISUG%3A+Code+contracts+in+.Net+4.0" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=VISUG%3A+Code+contracts+in+.Net+4.0&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=VISUG%3A+Code+contracts+in+.Net+4.0&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=VISUG%3A+Code+contracts+in+.Net+4.0&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=VISUG%3A+Code+contracts+in+.Net+4.0&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=VISUG%3A+Code+contracts+in+.Net+4.0&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F&amp;title=VISUG%3A+Code+contracts+in+.Net+4.0&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F10%2F09%2Fvisug-code-contracts-in-net-4-0%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/10/09/visug-code-contracts-in-net-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Net C# to VB + refactoring</title>
		<link>http://blog.bn2vs.com/2009/08/28/net-c-to-vb-refactoring/</link>
		<comments>http://blog.bn2vs.com/2009/08/28/net-c-to-vb-refactoring/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 23:20:03 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code horror]]></category>
		<category><![CDATA[DownloadLib]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Refactoring]]></category>
		<category><![CDATA[The Code Project]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=353</guid>
		<description><![CDATA[While translating some of the C# code of MyDownloader to VB.Net for the .Net download library, I&#8217;ve already come across quite some awkward code. IMHO, the underneath example could go into the code horrors section of The Code Project. &#160; &#160; &#160; &#160; private void RestartDownload&#40;&#41; &#160; &#160; &#160; &#160; &#123; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2009/08/28/net-c-to-vb-refactoring/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>While translating some of the C# code of <a href="http://www.codeproject.com/KB/IP/MyDownloader.aspx" target="_blank">MyDownloader</a> to VB.Net for the .Net download library, I&#8217;ve already come across quite some awkward code. IMHO, the underneath example could go into the <a href="http://www.codeproject.com/Feature/CodingHorrors.aspx" target="_blank">code horrors section</a> of <a href="http://www.codeproject.com" target="_blank">The Code Project</a>.</p>
<div class="codecolorer-container csharp default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> RestartDownload<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #6666cc; font-weight: bold;">int</span> currentTry <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Stream stream<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RemoteFileInfo newInfo<span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastError <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetState<span style="color: #008000;">&#40;</span>DownloaderState<span style="color: #008000;">.</span><span style="color: #0000FF;">Preparing</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; currentTry<span style="color: #008000;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; newInfo <span style="color: #008000;">=</span> defaultDownloadProvider<span style="color: #008000;">.</span><span style="color: #0000FF;">GetFileInfo</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ResourceLocation</span>, <span style="color: #0600FF; font-weight: bold;">out</span> stream<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception ex<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastError <span style="color: #008000;">=</span> ex<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>currentTry <span style="color: #008000;">&lt;</span> Settings<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span><span style="color: #008000;">.</span><span style="color: #0000FF;">MaxRetries</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetState<span style="color: #008000;">&#40;</span>DownloaderState<span style="color: #008000;">.</span><span style="color: #0000FF;">WaitingForReconnect</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thread<span style="color: #008000;">.</span><span style="color: #0000FF;">Sleep</span><span style="color: #008000;">&#40;</span>TimeSpan<span style="color: #008000;">.</span><span style="color: #0000FF;">FromSeconds</span><span style="color: #008000;">&#40;</span>Settings<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Default</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RetryDelay</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">while</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">finally</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetState<span style="color: #008000;">&#40;</span>DownloaderState<span style="color: #008000;">.</span><span style="color: #0000FF;">Prepared</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-style: italic;">// check if the file changed on the server</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>newInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">AcceptRanges</span> <span style="color: #008000;">||</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; newInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">LastModified</span> <span style="color: #008000;">&gt;</span> RemoteFileInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">LastModified</span> <span style="color: #008000;">||</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; newInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">FileSize</span> <span style="color: #008000;">!=</span> RemoteFileInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">FileSize</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">remoteFileInfo</span> <span style="color: #008000;">=</span> newInfo<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; StartSegments<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RequestedSegments</span>, stream<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>stream <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stream<span style="color: #008000;">.</span><span style="color: #0000FF;">Dispose</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RunSegments<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>ThreadAbortException<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">throw</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">catch</span> <span style="color: #008000;">&#40;</span>Exception ex<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lastError <span style="color: #008000;">=</span> ex<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SetState<span style="color: #008000;">&#40;</span>DownloaderState<span style="color: #008000;">.</span><span style="color: #0000FF;">EndedWithError</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#125;</span></div></div>
<p>Why? It uses breaks and returns in the middle of the code, like if C# is some lame generic language without selection structures. The use of the try-catch bloks also seems odd. Also have a look at the condition for the do while loop &#8211; lol. The only thing missing are a few GoTo statements, which would have convinced me to print this out and torture fellow geeks with <img src='http://blog.bn2vs.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I started off translating this literally, but got so annoyed by the bad coding practice I decided to attempt to rewrite it. I say &#8216;attempt&#8217;, cause code written like that is not easy to understand, esp for people who are used to &#8216;decent&#8217; structured code. I splitted the code into 2 subs instead of one, removed all breaks, returns, the insane do while true and put only the required code in try catches.</p>
<div class="codecolorer-container vbnet default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="vbnet codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> RestartDownload<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> tryNr <span style="color: #FF8000;">As</span> Int32 <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> stream <span style="color: #FF8000;">As</span> Stream<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> newInfo <span style="color: #FF8000;">As</span> RemoteFileInfo<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Dim</span> reachedMaxTries, hasError <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Boolean</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_lastError <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">SetState</span><span style="color: #000000;">&#40;</span>DownloadState.<span style="color: #0000FF;">Preparing</span><span style="color: #000000;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Try</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; newInfo <span style="color: #008000;">=</span> <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">ProtocolProvider</span>.<span style="color: #0000FF;">GetFileInfo</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">FileLocation</span>, stream<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Catch</span> ex <span style="color: #FF8000;">As</span> Exception<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_lastError <span style="color: #008000;">=</span> ex<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Try</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hasError <span style="color: #008000;">=</span> m_lastError <span style="color: #FF8000;">IsNot</span> <span style="color: #FF8000;">Nothing</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> hasError <span style="color: #FF8000;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tryNr <span style="color: #008000;">+=</span> <span style="color: #FF0000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; reachedMaxTries <span style="color: #008000;">=</span> tryNr &gt;<span style="color: #008000;">=</span> <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">Settings</span>.<span style="color: #0000FF;">MaxRetries</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> hasError <span style="color: #804040;">And</span> <span style="color: #804040;">Not</span> reachedMaxTries <span style="color: #FF8000;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">SetState</span><span style="color: #000000;">&#40;</span>DownloadState.<span style="color: #0000FF;">WaitingForReconnect</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Thread.<span style="color: #0000FF;">Sleep</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">Settings</span>.<span style="color: #0000FF;">RetryDelay</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">Loop</span> Until <span style="color: #804040;">Not</span> hasError Or reachedMaxTries<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> hasError <span style="color: #FF8000;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">SetState</span><span style="color: #000000;">&#40;</span>DownloadState.<span style="color: #0000FF;">EndedWithError</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">SetState</span><span style="color: #000000;">&#40;</span>DownloadState.<span style="color: #0000FF;">Prepared</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">RestartSegments</span><span style="color: #000000;">&#40;</span>newInfo, stream<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> RestartSegments<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> newInfo <span style="color: #FF8000;">As</span> RemoteFileInfo, <span style="color: #FF8000;">ByVal</span> stream <span style="color: #FF8000;">As</span> Stream<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> <span style="color: #804040;">Not</span> newInfo.<span style="color: #0000FF;">AcceptRanges</span> Or newInfo.<span style="color: #0000FF;">ModifyDateTime</span> &gt; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">FileInfo</span>.<span style="color: #0000FF;">ModifyDateTime</span> Or newInfo.<span style="color: #0000FF;">FileSize</span> &lt;&gt; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">FileInfo</span>.<span style="color: #0000FF;">FileSize</span> <span style="color: #FF8000;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m_fileInfo <span style="color: #008000;">=</span> newInfo<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">AttemptToStartSegements</span><span style="color: #000000;">&#40;</span>stream<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">If</span> stream <span style="color: #FF8000;">IsNot</span> <span style="color: #FF8000;">Nothing</span> <span style="color: #FF8000;">Then</span> stream.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #FF8000;">Me</span>.<span style="color: #0000FF;">RunSegments</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></div></div>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F&amp;title=.Net+C%23+to+VB+%2B+refactoring" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F&amp;title=.Net+C%23+to+VB+%2B+refactoring" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F&amp;title=.Net+C%23+to+VB+%2B+refactoring" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F&amp;headline=.Net+C%23+to+VB+%2B+refactoring" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=.Net+C%23+to+VB+%2B+refactoring&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=.Net+C%23+to+VB+%2B+refactoring&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=.Net+C%23+to+VB+%2B+refactoring&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=.Net+C%23+to+VB+%2B+refactoring&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=.Net+C%23+to+VB+%2B+refactoring&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F&amp;title=.Net+C%23+to+VB+%2B+refactoring&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F28%2Fnet-c-to-vb-refactoring%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/08/28/net-c-to-vb-refactoring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closing Zend and opening Visual Studio</title>
		<link>http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/</link>
		<comments>http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 01:37:23 +0000</pubDate>
		<dc:creator>Jeroen De Dauw</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Class lirary]]></category>
		<category><![CDATA[DownloadLib]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[The Code Project]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Zend Studio]]></category>

		<guid isPermaLink="false">http://blog.bn2vs.com/?p=334</guid>
		<description><![CDATA[Now the Google Summer of Code coding period has finished, I can divide my attention between multiple projects again. Since I&#8217;ve been doing PHP and JavaScript only for over 2 months now, I&#8217;m starting off with taking a PHP-break. This means I won&#8217;t do any development of mayor new features for Maps or Semantic Maps, [...]]]></description>
			<content:encoded><![CDATA[<div class='wpfblike' style='height: 40px;'><fb:like href='http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/' layout='default' show_faces='true' width='400' action='like' colorscheme='light' /></div><p>Now the <a href="http://blog.bn2vs.com/2009/04/26/google-summer-of-code-2009/" target="_blank">Google Summer of Code</a> coding period has finished, I can divide my attention between multiple projects again. Since I&#8217;ve been doing PHP and JavaScript only for over 2 months now, I&#8217;m starting off with taking a PHP-break. This means I won&#8217;t do any development of mayor new features for <a href="http://www.mediawiki.org/wiki/Extension:Maps#Description" target="_blank">Maps</a> or <a href="http://www.mediawiki.org/wiki/Extension:Semantic_Maps#Description" target="_blank">Semantic Maps</a>, and definitely won&#8217;t work on any other PHP project. Of course I&#8217;ll still ensure bugs get fixed for my mapping extensions, and help people out with code when needed, but that&#8217;s about it. So basically I&#8217;m closing my Zend Studio, which has become one of my most used applications in the last months, and starting my Visual Studio again. Now I think of it, this is really awkward. I used to start my VS practically every time I booted my computer for over a year, and then only opened it a handful of times in a 2 month period.</p>
<p>So, what am I going to work on now? One of my last projects before I started GSoC was a <a href="http://code.bn2vs.com/viewtopic.php?t=150" target="_blank">VB.Net background file downloader</a>, of which I released <a href="http://www.codeproject.com/KB/vb/FileDownloader.aspx" target="_blank">an article on The Code Project</a>, and later on created <a href="http://www.codeproject.com/KB/cs/BackgroundFileDownloader.aspx" target="_blank">a C# version</a>. I got quite some positive feedback on this project by people, although it was initially created with the sole purpose of helping that needed a simple downloader someone out, to improve my own skills, and to demonstrate how to create a simple to implement downloader. I&#8217;m now continuing this project, by rewriting it from scratch, to both add some mayor new features, and mess around with some multi-threading stuff I&#8217;ve been wanting to try out for months now.</p>
<p>The mayor new features that will be added are simultaneous downloads (the current classes only support one download at a time), segmented downloads (woot!), download priorities and bandwidth limitation options. This will require a nice OOP approach, with some more advanced multi-threading. I&#8217;m basing part of my code on <a href="http://www.codeproject.com/KB/IP/MyDownloader.aspx" target="_blank">MyDownloader</a>, an extremely nice C# downloader, which has quite some more functionality then what I&#8217;m doing. It&#8217;s more extensive then required for most people though, and not all that easy to implement. I also don&#8217;t really agree with some naming choices, and it lacks both code docs for devs that want to modify it, and devs that want to implement it. So clearly, I&#8217;ll put a lot of effort in keeping the new project as small and to-the-point as possible, and pay attention to easy of implementation, and usability. Another obvious difference is that this project is in VB.Net and not C#.Net. This has more advantages then disadvantages IMHO. If the project is compiled to a .dll or is used in a multi-project solution, it simply doesn&#8217;t matter what language it uses. A lot of casual programmers don&#8217;t know how to handle either, and the majority of these uses VB.Net, and not C#. And the ones that do know C# are more likely to know VB.Net then the other way around.</p>
<p>I&#8217;ve created a project on <a href="http://sourceforge.net" target="_blank">SourceForge</a> to host the code, and be able to commit to <a href="http://download-lib.svn.sourceforge.net/viewvc/download-lib/" target="_blank">the project&#8217;s SVN</a>. Since the project now contains multiple classes, I renamed it to <a href="https://sourceforge.net/projects/download-lib/" target="_blank">.Net DownloadLib</a>.</p>
<p>After that project I&#8217;m planing to put some real effort into my mapping extension for MediaWiki again, and possibly to have a look at Python and Ruby. When school starts again, somewhere half way through September, some new project opportunities will probably arise for me, but I guess I&#8217;ll see that then. I&#8217;m also looking forward to &#8216;learning to program&#8217; at school, which is destined to give me some great laughs. Luckily for me I&#8217;ll have to learn C++ at university, so I won&#8217;t be totally bored with it. I hope they don&#8217;t drive the low-level aspects of the language to far, since that&#8217;s pretty useless in today&#8217;s world IMHO.</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://digg.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F&amp;title=Closing+Zend+and+opening+Visual+Studio" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/digg.png" alt="Digg This" title="Digg This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.reddit.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F&amp;title=Closing+Zend+and+opening+Visual+Studio" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/reddit.png" alt="Reddit This" title="Reddit This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F&amp;title=Closing+Zend+and+opening+Visual+Studio" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/stumbleupon.png" alt="Stumble Now!" title="Stumble Now!" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://buzz.yahoo.com/buzz?targetUrl=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F&amp;headline=Closing+Zend+and+opening+Visual+Studio" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/yahoo_buzz.png" alt="Buzz This" title="Buzz This" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dzone.com/links/add.html?title=Closing+Zend+and+opening+Visual+Studio&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dzone.png" alt="Vote on DZone" title="Vote on DZone" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Closing+Zend+and+opening+Visual+Studio&amp;u=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://delicious.com/save?title=Closing+Zend+and+opening+Visual+Studio&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/delicious.png" alt="Bookmark this on Delicious" title="Bookmark this on Delicious" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Closing+Zend+and+opening+Visual+Studio&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Closing+Zend+and+opening+Visual+Studio&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F&amp;title=Closing+Zend+and+opening+Visual+Studio&amp;summary=&amp;source=" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/linkedin.png" alt="Share on LinkedIn" title="Share on LinkedIn" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.technorati.com/faves?add=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/technorati.png" alt="Bookmark this on Technorati" title="Bookmark this on Technorati" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.google.com/buzz/post?url=http%3A%2F%2Fblog.bn2vs.com%2F2009%2F08%2F21%2Fclosing-zend-and-opening-visual-studio%2F" ><img class="lightsocial_img" src="http://blog.bn2vs.com/wp-content/plugins/light-social/google_buzz.png" alt="Google Buzz (aka. Google Reader)" title="Google Buzz (aka. Google Reader)" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://blog.bn2vs.com/2009/08/21/closing-zend-and-opening-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
