<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Robert&#039;s WebLog</title>
	<atom:link href="http://robertsundstrom.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://robertsundstrom.wordpress.com</link>
	<description>What happens at runtime, stays at runtime.</description>
	<lastBuildDate>Thu, 29 Oct 2009 14:03:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='robertsundstrom.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d211efc0925f1771d3a69efe5882f45e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Robert&#039;s WebLog</title>
		<link>http://robertsundstrom.wordpress.com</link>
	</image>
			<item>
		<title>Sorting- and search algorithms</title>
		<link>http://robertsundstrom.wordpress.com/2009/10/28/sorting-and-search-algorithms/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/10/28/sorting-and-search-algorithms/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 00:55:16 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Search algorithms]]></category>
		<category><![CDATA[Sorting algorithms]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/10/28/sorting-and-search-algorithms/</guid>
		<description><![CDATA[I’m currently doing some work to prepare for my next exam in programming. The exam involves explaining and implementing algorithms, in particular sorting- and search algorithms. In this post I will present my two attempts of implementing one of each kind.
First we have a sorting algorithm. It is the traditional Bubble Sort. Well, I won’t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1514&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I’m currently doing some work to prepare for my next exam in programming. The exam involves explaining and implementing algorithms, in particular sorting- and search algorithms. In this post I will present my two attempts of implementing one of each kind.</p>
<p>First we have a sorting algorithm. It is the traditional <a href="http://en.wikipedia.org/wiki/Bubble_sort_algorithm">Bubble Sort</a>. Well, I won’t present any advantages or disadvantages but most of the sorting algorithms are fairly inefficient on large amount of data. The best way, I guess, is to combine different methods to make a good algorithm.</p>
<p>In bubble sort you simply step through each index and for each index you step backwards from the end to the current. Each time you then compare the items in the indices and swap if so.</p>
<p>This is my implementation in C#:</p>
<div style="overflow:auto;">
<pre class="code"><span style="color:blue;">public static void </span>BubbleSort(<span style="color:blue;">int</span>[] array)
{
    <span style="color:blue;">int </span>temp;

    <span style="color:green;">/* Step through all indices. */
    </span><span style="color:blue;">for </span>(<span style="color:blue;">int </span>i = <span style="color:brown;">0</span>; i &lt; array.Length; i++)
    {
        <span style="color:green;">/* Step through the indices backwards to index i. */
        </span><span style="color:blue;">for </span>(<span style="color:blue;">int </span>y = array.Length - <span style="color:brown;">1</span>; y &gt; i; y--)
        {
            <span style="color:green;">/* Swap items if item y is less than item i. */
            </span><span style="color:blue;">if </span>(array[y] &lt; array[i])
            {
                temp = array[y];

                array[y] = array[i];
                array[i] = temp;
            }
        }
    }
}</pre>
</div>
<p>With some modifications you could make it usable on other kinds of data too. This could be done by passing an IEnumerable&lt;T&gt; instead of an array. An array is an IEnumerable which is inherited by IEnumerable&lt;T&gt;, a generic interface.</p>
<p>However, although this is C#, implementing this algorithm in other languages is easy. There are no language or platform specific stuff in my implementation.</p>
<p>Moving on to the search algorithm. I have implemented a recursive version of <a href="http://en.wikipedia.org/wiki/Binary_search_algorithm">Binary Search</a>. </p>
<p>Basically, it cleaves the the list of sorted numbers in half and checks in which part it has a chance of finding the number to be searched for. This is done repeatedly until it has found the value.</p>
<p>Here’s the implementation:</p>
<div style="overflow:auto;">
<pre class="code"><span style="color:blue;">public static int </span>BinarySearch(<span style="color:blue;">this int</span>[] array, <span style="color:blue;">int </span>value, <span style="color:blue;">int </span>from, <span style="color:blue;">int </span>to)
{
    <font color="#0000ff">if</font>(from &lt; to)
    {
<span style="color:green;">        </span><span style="color:blue;">int </span>mid = (to + from) / <span style="color:brown;">2</span>;

        <span style="color:blue;">if </span>(array[mid] == value)
        {</pre>
<pre class="code"><span style="color:green;">            </span><span style="color:blue;">return </span>mid;
        }
<span style="color:green;"></span></pre>
<pre class="code"><span style="color:green;">        </span><span style="color:blue;">if </span>(array[mid] &gt; value)
        {
            <span style="color:blue;">return </span>BinarySearch(array, value, mid, to);
        }
        <span style="color:blue;">else if </span>(array[mid] &lt; value)
        {
          <span style="color:green;">   </span><span style="color:blue;">return </span>BinarySearch(array, value, from, mid);
        }
    }
<span style="color:green;"></span></pre>
<pre class="code"><span style="color:green;">    </span><span style="color:blue;">return </span>-<span style="color:brown;">1</span>;
}</pre>
<p>  <a href="http://11011.net/software/vspaste"></a></div>
<p>This implementation of the algorithm has some flaws, it will return the last occurence of a number if it finds any other than just one.&#160; <br />But per definition this should be enough because ‘2’ is ‘2’ and nothing else. Doesn’t matter if it is sorted.</p>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p><em>Updated: October 29th, 2009.</em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1514/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1514/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1514/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1514&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/10/28/sorting-and-search-algorithms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>Mitt liv med aspergers syndrom</title>
		<link>http://robertsundstrom.wordpress.com/2009/10/18/mitt-liv-med-aspergers-syndrom/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/10/18/mitt-liv-med-aspergers-syndrom/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 00:06:00 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[På svenska]]></category>
		<category><![CDATA[Asperger]]></category>
		<category><![CDATA[Asperger syndrom]]></category>
		<category><![CDATA[Aspergers syndrom]]></category>
		<category><![CDATA[autism]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/10/16/mitt-liv-med-aspergers-syndrom/</guid>
		<description><![CDATA[Jag är väldigt öppen när det gäller mig själv och mina egenheter. Jag vill uppmärksamma diagnosen Aspergers syndrom som jag har. Det är ett neuropsykiatriskt funktionshinder och även den mildaste formen av autism.
Aspergers syndrom är en diagnos som beskriver personer som bland annat har begränsad förmåga till att söka kontakt med andra människor, har specialintressen [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1496&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Jag är väldigt öppen när det gäller mig själv och mina egenheter. Jag vill uppmärksamma diagnosen <a href="http://sv.wikipedia.org/wiki/Aspergers_syndrom">Aspergers syndrom</a> som jag har. Det är ett neuropsykiatriskt funktionshinder och även den mildaste formen av autism.</p>
<p>Aspergers syndrom är en diagnos som beskriver personer som bland annat har begränsad förmåga till att söka kontakt med andra människor, har specialintressen som tar upp en stor del av deras uppmärksamhet och tid, kan ha svårigheter med att förstå och använda språk samt lätt att hamna i tvångsmässiga rutiner.</p>
<p>Jag föreslår att ni läser mer <a href="http://www.attention-riks.se/index.php/asperger-syndrom.html">här</a> på Riksförbundet Attentions websida om ni vill veta mer.</p>
<p>I det här inlägget vill jag dela med mig av min historia och berätta om hur jag har utvecklats genom åren.</p>
<h3>Från då till nu</h3>
<p>Det började tidigt så som jag har uppfattat det som. Man märkte redan så tidigt som i förskolan (brukar vara i den åldern) att jag hade svårigheter att umgås med andra barn. Först fick jag diagnosen DAMP, det som idag nästan är det samma som ADHD. Kort och gott betyder det brist på uppmärksamhet. Detta kanske för att jag då hade ett hett temperament samt att jag var en aning hyperaktiv. Jag hängde nog inte heller med så mycket i skolan och så för att jag var i “min egen värld”. Trots detta med den lilla begränsade kontakten med omvärlden så var jag var glad för uppmärksamhet. Inte på ett sådant sätt så att jag ville ta den ifrån andra med vilje. Jag kunde inte förstå hur andra tyckte och tänkte. Det var helt enkelt så att jag bara inte kunde förstå.    <br />Jag kunde babbla på om mina intressen och sånt som intresserade mig utan att skapa en dialog med andra personer. Ett väldigt vanligt drag hos personer med aspergers syndrom. Trots detta var jag också blyg. Speciellt bland folk som jag inte kände. Det tog dock inte så lång tid för mig att vänja mig och börja lita på personer när jag väl mött dem.</p>
<h4>Skolåren och min utveckling</h4>
<p>Detta har däremot lagt sig med åren. Jag blev lugnare på högstadiet.&#160; Jag blev faktiskt också mer reserverad då jag fick reda på min diagnos.    <br />Min mamma hade så klart vetat om det länge.&#160; För mig var det svårt även om jag då inte förstod vad det innebar att ha diagnosen. Jag har från den gången klassat mig själv som speciell men inte låtit mig bli stoppad av det.     <br />För att vara ärlig har jag emellanåt ignorerat den av rädsla och en viss skam. Det var inte lätt att i skolan att vara annorlunda. Något som jag förstod trots mitt då begränsade sociala sinne. Jag hatade också att använda ordet “handikapp” om mitt tillstånd samtidigt som jag önskade att var “normal”.</p>
<p>Också för att tillägga är att jag har gått i vanlig skola i hela mitt liv.    <br />Det har påverkat en hel del och det mesta positivt. Jag antar att jag inte hade kommit så långt som jag kommit nu om jag gått i specialklass.&#160; <br />Det var så sent som när jag började gymnasiet som jag började ge mig in i det sociala samspelet. Det är något som alla “normala” människor lär sig automatiskt under uppväxten och sedan bär i bakhuvudet men som är en börda för mig. Det är som om jag måste ligga ett steg före.     <br />Detta görs omedvetet. Ifrån mitt perspektiv är det en väldigt krävande process har jag kommit underfund med.&#160; <br />Det är en del av aspergers syndrom. Det händer idag att jag tycker att det är jobbigt i sociala situationer. Men jag ser dock inte det som något större hinder längre.</p>
<p>Under min uppväxt har jag också haft perioder med rädslor och tvångsrutiner.    <br />Dessa har oftast orsakats av fobier eller okunnande. När man ser tillbaka på dessa nu så kan man skratta åt det och undra hur man egentligen hamnade i de onda cirklarna. Som tur så händer inte detta längre.</p>
<p>Att jag har kommit så långt i min sociala och mentala utveckling har jag de människor runt omkring mig att tacka för. Sedan är det inte minst så att jag måste berömma mig själv för att ha vågat ta steget och själv velat förbättra mig. Jag kunde lika väl ha varit mer autistisk idag än vad jag är nu om inte jag blivit “tvingad” och väl vågat.</p>
<h4>Specialintressen m.m.</h4>
<p>Med mig har jag också haft den där drivkraften som jag fått av mina intressen. Liksom många andra “aspergare” har jag specialintressen.    <br />Dessa har varierat genom åren. Alltifrån tåg när jag var liten till det långlivade intresset för datorer och numera också programmering.     <br />Inte ovanligt bland aspergare. Det var också därför som jag valde att studera Software Engineering på <a href="http://www.bth.se/">BTH</a>. Dessutom är jag också intresserad av språk och kultur. Jag gillar att resa och se mig omkring, Idag tycker jag att det är väldigt kul att träffa folk.</p>
<p>Vi aspergare kännetecknas för just vår förmåga att sätta oss in i detaljer. Detta drivs till större delen av ens intressen. Det är både en fördel och nackdel i livet. Detta kompenseras i någon grad av att man kan ha problem med att se helheten på saker och ting. Vissa tolkar saker bokstavligen.    <br />Detta inkluderar saker som ordspråk och annat abstrakt. Jag har själv aldrig haft några större problem med det. Men sättet jag lär mig saker på påverkas av de här faktorerna.</p>
<h3>Slutligen…</h3>
<p>Det här var lite om mig då. </p>
<p>Till sist skulle jag vilja tacka alla som varit med mig de här åren.    <br />Min familj och mina vänner, en väldigt stor grupp!.     <br />Alla resor och personer som jag har mött så här långt har lämnat ett stort avtryck. Jag vill också tacka många andra som jag inte längre har någon kontakt med. Ni är också inräknade. </p>
<p>Speciellt tack till min polare/ledsagare Tobbe som har följt mig de senaste 6 åren. Du betyder så mycket för mig. Också mycket tack till Jesper, tysklärarinnan Evas pojk, som är min mentor i programutvecklingens underbara värld och lika så även han vän och moraliskt stöd.</p>
<p>Tack allihopa.</p>
<p>&#160;</p>
<p><em><strong>Uppdaterad:</strong> 091018</em></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1496/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1496&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/10/18/mitt-liv-med-aspergers-syndrom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>President Barack Obama gets awarded the Nobel Peace Prize</title>
		<link>http://robertsundstrom.wordpress.com/2009/10/09/president-barack-obama-gets-awarded-the-nobel-peace-prize/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/10/09/president-barack-obama-gets-awarded-the-nobel-peace-prize/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 16:27:57 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[awards]]></category>
		<category><![CDATA[Barack]]></category>
		<category><![CDATA[Nobel Peace Prize]]></category>
		<category><![CDATA[Nobel Prize]]></category>
		<category><![CDATA[Obama]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/10/09/president-barack-obama-awarded-the-nobel-peace-prize/</guid>
		<description><![CDATA[Today (October 9th, 2009) it was announced that this years recipient of the Nobel Peace Prize will be the sitting President of the United States, Barack Obama. That was a big surprise to the world because he only has been president for less than a year. Many think that it is too early but I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1493&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Today (October 9th, 2009) it was announced that this years recipient of the Nobel Peace Prize will be the sitting President of the United States, Barack Obama. That was a big surprise to the world because he only has been president for less than a year. Many think that it is too early but I think it is never too early for someone that shows his devotion for social policy in the world’s richest but yet unfairest country in the world. He has shown that there is need for a change. Do not forget what he has done in the international diplomacy to strengthen it and the cooperation between people. But we have yet a lot to expect from him. But again he certainly deserves it even if it may be to soon.&#160; </p>
<p>Congratulations to you Mr. President!</p>
<p>&#160;</p>
<p><strong>Committee’s words:</strong></p>
<p><em>&quot;for his extraordinary efforts to strengthen international diplomacy and cooperation between peoples&quot;</em></p>
<p><em></em></p>
<p>Profile at NobelPrize.org:</p>
<ul>
<li><a title="http://nobelprize.org/nobel_prizes/peace/laureates/2009/" href="http://nobelprize.org/nobel_prizes/peace/laureates/2009/">http://nobelprize.org/nobel_prizes/peace/laureates/2009/</a> </li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1493/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1493&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/10/09/president-barack-obama-gets-awarded-the-nobel-peace-prize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>A little tip: NTCore&#8217;s Homepage</title>
		<link>http://robertsundstrom.wordpress.com/2009/10/05/a-little-tip-ntcores-homepage/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/10/05/a-little-tip-ntcores-homepage/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 23:14:35 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Assembly]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[On the Web]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/?p=1490</guid>
		<description><![CDATA[It has been a while since I last wrote a blog post. Hopefully I will do it soon, but for now I want to inform you about a site that I visited today.
It&#8217;s NTCore&#8217;s Hompage by Daniel Pistelli.  A site that I think every developer that is interested in software and platform internals should visit. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1490&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It has been a while since I last wrote a blog post. Hopefully I will do it soon, but for now I want to inform you about a site that I visited today.</p>
<p>It&#8217;s <em><a href="http://www.ntcore.com/">NTCore&#8217;s Hompage</a> </em>by Daniel Pistelli.  A site that I think every developer that is interested in software and platform internals should visit. There you find articles, and even &#8220;free&#8221; software to use.</p>
<p>Check it out!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1490/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1490/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1490/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1490&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/10/05/a-little-tip-ntcores-homepage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>Random numbers in C++</title>
		<link>http://robertsundstrom.wordpress.com/2009/09/22/random-numbers-in-c/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/09/22/random-numbers-in-c/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 12:12:56 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/?p=1461</guid>
		<description><![CDATA[Here&#8217;s how you create seemly random numbers i C++. This will generate a random number from 1 to 10.


#include &#38;amp;amp;lt;ctime&#38;amp;amp;gt; // For time()

using namespace std;

void main()
{
srand(time(0));  // Initialize random number generator.
r = (rand() % 10) + 1;
}

For you legacy compiler users without namespace-support.

#include &#34;cstdlib&#34;;  // Legacy for for srand() and rand()

     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1461&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s how you create seemly random numbers i C++. This will generate a random number from 1 to 10.</p>
<pre class="brush: cpp;">

#include &amp;amp;amp;lt;ctime&amp;amp;amp;gt; // For time()

using namespace std;

void main()
{
srand(time(0));  // Initialize random number generator.
r = (rand() % 10) + 1;
}
</pre>
<p>For you legacy compiler users without namespace-support.</p>
<pre class="brush: cpp;">
#include &quot;cstdlib&quot;;  // Legacy for for srand() and rand()
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1461/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1461/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1461/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1461&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/09/22/random-numbers-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>Changes to the System.IO namespace in .NET Framework 4.0 BCL</title>
		<link>http://robertsundstrom.wordpress.com/2009/09/20/changes-to-the-system-io-namespace-in-net-framework-4-0-bcl/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/09/20/changes-to-the-system-io-namespace-in-net-framework-4-0-bcl/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 12:15:51 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CLR]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[.NET Framework]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/09/20/changes-to-the-system-io-namespace-in-net-framework-4-0/</guid>
		<description><![CDATA[These are not really any news for some of us but Microsoft has made some improvements to the classes in System.IO-namespace in the Base Class Library of the up-coming .NET Framework 4.0. New method-overloads that are returning IEnumerable&#60;T&#62; has been added for performance and usability. 
Here’s a list of the new overloads:
System.IO.File

public static IEnumerable&#60;string&#62;ReadLines(string path) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1457&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>These are not really any news for some of us but Microsoft has made some improvements to the classes in System.IO-namespace in the Base Class Library of the up-coming .NET Framework 4.0. New method-overloads that are returning IEnumerable&lt;T&gt; has been added for performance and usability. </p>
<p>Here’s a list of the new overloads:</p>
<h5>System.IO.File</h5>
<ul>
<li>public static IEnumerable&lt;string&gt;ReadLines(string path) </li>
<li>public static void WriteAllLines(string path, IEnumerable&lt;string&gt; contents) </li>
<li>public static void AppendAllLines(string path, IEnumerable&lt;string&gt; contents)</li>
</ul>
<h5>System.IO.Directory</h5>
<ul>
<li>public static Enumerable&lt;string&gt; EnumerateDirectories(string path) </li>
<li>public static IEnumerable&lt;string&gt; EnumerateFiles(string path) </li>
<li>public static IEnumerable&lt;string&gt; EnumerateFileSystemEntries(string path)</li>
</ul>
<h5>System.IO.DirectoryInfo</h5>
<ul>
<li>public IEnumerable&lt;DirectoryInfo&gt; EnumerateDirectories() </li>
<li>public IEnumerable&lt;FileInfo&gt; EnumerateFiles() </li>
<li>public IEnumerable&lt;FileSystemInfo&gt; EnumerateFileSystemInfos()</li>
</ul>
<p>&#160;</p>
<p>Code Capers has written an excellent blog post about this. You find it <a href="http://www.codecapers.com/2009/09/systemio-improvements-in-net-40.html">here</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1457/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1457/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1457/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1457&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/09/20/changes-to-the-system-io-namespace-in-net-framework-4-0-bcl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>Cross platform development with MonoDevelop 2.2</title>
		<link>http://robertsundstrom.wordpress.com/2009/09/14/cross-platform-development-with-monodevelop-2-2/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/09/14/cross-platform-development-with-monodevelop-2-2/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 09:40:39 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[Mono]]></category>
		<category><![CDATA[MonoDevelop]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/09/14/cross-platform-development-with-monodevelop-2-2-beta-1/</guid>
		<description><![CDATA[The Mono Team has now announced the first beta release of the new version (2.2) of their development tool Mono Develop. As the main motive of the Mono Framework is to provide as cross platform open-source implementation of the Common Language Runtime (CLR), the same standard as .NET, this version of MonoDevelop also supports more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1452&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The Mono Team has now announced the first beta release of the new version (2.2) of their development tool Mono Develop. As the main motive of the Mono Framework is to provide as cross platform open-source implementation of the <em>Common Language Runtime</em> (CLR), the same standard as .NET, this version of MonoDevelop also supports more platforms than previous versions. In this up-coming release MonoDevelop also supports Windows.&#160; So now you can develop .NET applications with MonoDevelop on any platform you want. Windows, Linux or Mac OS X. No need to switch to another system just stick with the one you feel comfortable with.</p>
<p>MonoDevelop now has an integrated debugger support, improved refactoring tools, code templates and on the fly formatting. Via add-ins you can now create ASP.NET MVC and Silverlight applications directly in MonoDevelop.</p>
<p>With MonoDevelop you can develop applications that run on various platforms including Windows, Linux, Mac OS X and iPhone. You can build graphical user interfaces using <em>Stetic, </em>an open-source visual designer for the cross platform GTK library via GTK#</p>
<p>Good work all you contributors out there! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#160;</p>
<p align="center"><a href="http://robertsundstrom.files.wordpress.com/2009/09/image.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="image" border="0" alt="image" src="http://robertsundstrom.files.wordpress.com/2009/09/image_thumb.png?w=240&#038;h=180" width="240" height="180" /></a><em>MonoDevelop on Windows</em>&#160;</p>
<p align="center"><a href="http://robertsundstrom.files.wordpress.com/2009/09/image1.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="image" border="0" alt="image" src="http://robertsundstrom.files.wordpress.com/2009/09/image_thumb1.png?w=240&#038;h=150" width="240" height="150" /></a><em>MonoDevelop on Mac OS X</em>&#160;</p>
</p>
<p><strong>Read more:</strong></p>
<ul>
<li><a title="http://tirania.org/blog/archive/2009/Sep-09.html" href="http://tirania.org/blog/archive/2009/Sep-09.html">http://tirania.org/blog/archive/2009/Sep-09.html</a> </li>
<li><a title="http://monodevelop.com/index.php?title=Download/What%27s_new_in_MonoDevelop_2.2" href="http://monodevelop.com/index.php?title=Download/What%27s_new_in_MonoDevelop_2.2">http://monodevelop.com/index.php?title=Download/What%27s_new_in_MonoDevelop_2.2</a> </li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1452/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1452/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1452/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1452&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/09/14/cross-platform-development-with-monodevelop-2-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Stack and Heap</title>
		<link>http://robertsundstrom.wordpress.com/2009/09/09/stack-and-heap/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/09/09/stack-and-heap/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 18:16:52 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Heap]]></category>
		<category><![CDATA[Memory Management]]></category>
		<category><![CDATA[Stack]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/09/09/stack-and-heap/</guid>
		<description><![CDATA[This short blog post is a short introduction to the stack and the heap. A friend told me that he did not understand the meaning of these and the best way of explaining it is writing it down. And in this way it also gets public.  
The stack is the place where variables are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1440&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This short blog post is a short introduction to the stack and the heap. A friend told me that he did not understand the meaning of these and the best way of explaining it is writing it down. And in this way it also gets public. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The stack is the place where variables are pushed when they are declared. Each time a function is called a new stack is created to store the variables declared in it. The stack is a data structure which as the name says stores data and operates as <em>last-in-first-out (LIFO)</em>. When initializing a primitive type such as <em>int</em> (an integer) the variable will be pushed on the stack and the memory will be allocated for it on the the <em>heap, </em>which just is a place dedicated for allocating memory. The variable is statically bound to its address. Talking about scopes, all variables are declared in a scope and when it ends the variables get popped from the stack. The memory gets deallocated in the same turn. At least when we are dealing with values.</p>
<h3></h3>
<h3>Reference variables</h3>
<p>Opposed to this is when you declare a reference variable, for instance a<em> class</em> or a<em> pointer</em>, which actually just get pushed on the stack with no data location bound to it. It is said to be a<em> null-reference</em>. To assign data to it you have to assign the address of an existing memory location on the heap. Typically with the help from other variables that contains an address. References and pointers may change and point to another object of the type that it belongs to. The memory allocated to a reference does not get deallocated at the same time as the variable is popped from the stack. The rest differ by language or platform.</p>
<h3>In programming languages</h3>
<p>Short about memory management on different platforms and programming languages:</p>
<ul>
<li>In C and C++ there are functions that can allocate memory on the heap for you. That is when you need to use pointers to refer to this memory location. The location allocated must be explicitly deallocated when it is no longer used (i.e. no references) or else it will cause a memory leak.      </li>
<li>Java and C# do not require the programmer to handle memory as in C/C++. Both the <em>Java Runtime</em> and the <em>Common Language Runtime (CLR)</em> provides a mechanism called a <em>garbage collector</em> which does it automatically. </li>
</ul>
<p>That was a little about the connection between the different types of variables and how they work with the memory, i.e. the heap.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1440/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1440/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1440/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1440&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/09/09/stack-and-heap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
		<item>
		<title>Windows 3.11 on a virtual machine</title>
		<link>http://robertsundstrom.wordpress.com/2009/09/07/windows-3-11-on-a-virtual-machine/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/09/07/windows-3-11-on-a-virtual-machine/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 23:51:20 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[MS-DOS]]></category>
		<category><![CDATA[Virtual Machines]]></category>
		<category><![CDATA[Windows 3.11]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/09/07/windows-3-11-in-a-virtual-machine/</guid>
		<description><![CDATA[The idea of installing Windows 3.11 came from my friend who wanted to try out some old legacy operating systems. He initially wanted to install NextSTEP on a virtual machine. NextSTEP from which he had experience from back home where his father had it installed on one of his computers. Although when he searched the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1428&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The idea of installing <a href="http://en.wikipedia.org/wiki/Windows_3.11">Windows 3.11</a> came from my friend who wanted to try out some old <em>legacy operating systems</em>. He initially wanted to install <a href="http://en.wikipedia.org/wiki/NextSTEP">NextSTEP</a> on a <em>virtual machine</em>. NextSTEP from which he had experience from back home where his father had it installed on one of his computers. Although when he searched the Internet for the files he came to think about Windows and asked me about the old versions. I then told him about the version 3.11, which was one of the early Windows-branded operating systems released. It is actually an <em>operating environment</em>, a GUI for <a href="http://en.wikipedia.org/wiki/MS-DOS">MS-DOS</a>, which is the real <em>operating system</em>.</p>
<p>However, my friend installed it and I wanted to try it too. That is when I got the idea of writing a little tutorial.</p>
<p>To successfully install Windows 3.11 you need to get <em>MS-DOS 7.10</em> and of course you need <em>Windows 3.11</em>. The full list of required stuff comes hereunder.</p>
<p>I assume that you know quite a lot about computers, but if you are no super-geek you won’t have any problems following these instructions anyway.</p>
<h4>Preparation</h4>
<p>This is the full list of things that you need:</p>
<ul>
<li><strong>MS-DOS 7.10</strong> <em>(ISO-image)</em> can be downloaded for free due to its licensing under the <em>GNU-GPL</em>. Just search for it and you’ll find it.</li>
<li><strong>Windows 3.11 </strong><em>(ISO-image)</em> is on the other hand copyrighted by law. Do not ask med where you can get it. You may also find it on the Internet if you search for it.<em> (Size: approx 11 MB)</em></li>
<li>You need any <strong>virtualization software</strong> that supports Windows as guest-OS. Try for example <em>Windows Virtual PC</em>, <em>Microsoft Virtual PC</em> or <em>VirtualBox</em> (cross-platform). All are available fro free &#8211; I use Windows Virtual PC on Windows 7. <em>(If you are planning to install Windows 3.11 on a physical machine you do not need this).</em></li>
</ul>
<h3>1. Preparing the VM</h3>
<p><em>Skip this if you are installing it on a physical machine. Observe that these instructions are not for any specific software.</em></p>
<p>Create a virtual machine. If needed specify the OS the virtual machine is going to run. Then create a <em>hard disk </em>with approximately 40 MB of space. I recommend <em>dynamic size</em> if available, but fixed size may work fine. Set the dedicated <em>RAM </em>to 10 MB. That will probably do fine. You may change it later if you need to.</p>
<p>Now <em>mount</em> the DOS-image as a drive and <em>start</em> the virtual machine. The installation will then boot automatically.</p>
<h3>2. Installing MS-DOS</h3>
<p>Time to install MS-DOS!</p>
<p>Once you have booted the disk a menu will appear. Select the first alternative by pressing the key 1.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc_thumb.png?w=444&#038;h=322" border="0" alt="Windows 3.11 - Windows Virtual PC" width="444" height="322" /></a></p>
<p>The setup will launch. Notice that you may use the mouse.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc2.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (2)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc2_thumb.png?w=444&#038;h=321" border="0" alt="Windows 3.11 - Windows Virtual PC (2)" width="444" height="321" /></a></p>
<p>The setup will ask if it is going to create a new partition for you. Click <em>Yes</em>.</p>
<p>After that it will ask you to reboot and again start the setup as you did before.</p>
<p>This time it will install MS-DOS on your computer. If it ask you if you want to write a new <em>MBR (Master Boot Record)</em> you click <em>Yes</em>. The installation will now start copying and installing the OS.</p>
<p>Reboot when install is complete.</p>
<p><em>Once finished you should dismount the image from the virtual drive!</em></p>
<p>MS-DOS will start.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc19.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (19)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc19_thumb.png?w=447&#038;h=321" border="0" alt="Windows 3.11 - Windows Virtual PC (19)" width="447" height="321" /></a></p>
<p>MS-DOS booted.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc8.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (8)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc8_thumb.png?w=448&#038;h=321" border="0" alt="Windows 3.11 - Windows Virtual PC (8)" width="448" height="321" /></a></p>
<h3>3. Installing Windows 3.11</h3>
<p>Mount the Windows 3.11 install-image and write <em>“D:\setup”</em> (without quotes) to install Windows.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc9.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (9)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc9_thumb.png?w=446&#038;h=321" border="0" alt="Windows 3.11 - Windows Virtual PC (9)" width="446" height="321" /></a></p>
<p>The install menu will launch. Press <em>Enter</em> to install.</p>
<p>Follow the instructions on the screen. The options provided in the installation are many and it is better to allow most of them.</p>
<p>The setup will ask you if you want to install <em>drivers </em>(known as plugins). Install the ones that are necessary. If your not sure about what drivers you should just install all of them.</p>
<p>The real install will launch shortly after. I promise you this will be done in a minute (or 2)!</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc14.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (14)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc14_thumb.png?w=444&#038;h=370" border="0" alt="Windows 3.11 - Windows Virtual PC (14)" width="444" height="370" /></a></p>
<p>First you provide some (pointless, in our case) info such as your name. You can leave the <em>Product Number</em> blank if you do not have one. Press <em>Continue</em>.</p>
<p>Files will then be copied to your hard drive, your virtual one.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc16.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (16)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc16_thumb.png?w=444&#038;h=370" border="0" alt="Windows 3.11 - Windows Virtual PC (16)" width="444" height="370" /></a></p>
<p>When prompted for network setup you should ignore the dialog by pressing <em>Continue</em>.</p>
<p><em>(I will probably write another tutorial for getting the network devices running.)</em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc17.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (17)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc17_thumb.png?w=444&#038;h=370" border="0" alt="Windows 3.11 - Windows Virtual PC (17)" width="444" height="370" /></a></p>
<p>Restart your computer when setup is complete.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc20.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (20)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc20_thumb.png?w=444&#038;h=319" border="0" alt="Windows 3.11 - Windows Virtual PC (20)" width="444" height="319" /></a></p>
<p>Your virtual machine will start and DOS is booting up. In DOS you then type <em>“win”</em> (again without quotes). Just like it was said in the previous screen. Windows 3.11 will now start.</p>
<p><a href="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc18.png" target="_blank"><img style="display:block;float:none;margin-left:auto;margin-right:auto;border-width:0;" title="Windows 3.11 - Windows Virtual PC (18)" src="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc18_thumb.png?w=444&#038;h=370" border="0" alt="Windows 3.11 - Windows Virtual PC (18)" width="444" height="370" /></a></p>
<p>Here you have it! Windows 3.11 successfully running on a virtual machine.</p>
<p>Remember that you will have to enter DOS and write &#8220;win&#8221; everytime you want to start Windows. There surely is some trick to autostart Windows without entering DOS. But I won&#8217;t get into it this time.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1428/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1428/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1428/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1428&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/09/07/windows-3-11-on-a-virtual-machine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc2_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (2)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc19_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (19)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc8_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (8)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc9_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (9)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc14_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (14)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc16_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (16)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc17_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (17)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc20_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (20)</media:title>
		</media:content>

		<media:content url="http://robertsundstrom.files.wordpress.com/2009/09/windows3-11windowsvirtualpc18_thumb.png" medium="image">
			<media:title type="html">Windows 3.11 - Windows Virtual PC (18)</media:title>
		</media:content>
	</item>
		<item>
		<title>Typecasting and type conversions in C#</title>
		<link>http://robertsundstrom.wordpress.com/2009/09/04/typecasting-and-type-conversions-in-c/</link>
		<comments>http://robertsundstrom.wordpress.com/2009/09/04/typecasting-and-type-conversions-in-c/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 00:27:46 +0000</pubDate>
		<dc:creator>Robert</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[c sharp]]></category>
		<category><![CDATA[type casts]]></category>
		<category><![CDATA[type conversion]]></category>

		<guid isPermaLink="false">http://robertsundstrom.wordpress.com/2009/09/04/typecasting-and-type-conversions-in-c/</guid>
		<description><![CDATA[Typecasts, or type conversions, is the name of the functionality which allows objects to converted into another form, another type of object. The syntax for these is primarily inherited from C/C++.
There are two scenarios involving typecasts:

When casting between different types in an inheritance hierarchy.
When calling a conversion operator.

These come like the ones in C/C++ in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1403&subd=robertsundstrom&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>Typecasts</em>, or <em>type conversions</em>, is the name of the functionality which allows objects to converted into another form, another type of object. The syntax for these is primarily inherited from C/C++.</p>
<p>There are two scenarios involving typecasts:</p>
<ol>
<li>When casting between different types in an inheritance hierarchy.</li>
<li>When calling a <em>conversion operator</em>.</li>
</ol>
<p>These come like the ones in C/C++ in two flavors: <em>implicit </em>and <em>explicit</em>.</p>
<h4>Implicit conversions</h4>
<p><strong> </strong>…are automatic and are carried out without any special notation. These also guarantee that no data will be lost during the conversion.</p>
<pre class="code"><span style="color:blue;">double </span>d = 2; <span style="color:green;">//Gives 2.0</span></pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<h4>Explicit conversions</h4>
<p>…are operations that need to be explicitly stated in code.</p>
<p>This is to make sure that you are aware of that the conversion is going give a unexpected result.</p>
<p>For instance you have double-to-int conversions where you will loose data. You have to state that you know that the decimal number will be rounded to the nearest integer.</p>
<pre class="code"><span style="color:blue;">double </span>d = 2.3;
<span style="color:blue;">int </span>i = (<span style="color:blue;">int</span>)d; <span style="color:green;">//Gives 2</span></pre>
<p>As you see you use the standard C notation with parenthesis, ( <em>&lt;type&gt;</em> ) .</p>
<p>You have to expect that an exception may be thrown if a type cannot be casted, especially with casts from <em>Object</em>. If you use an IDE such as Visual Studio you will probably be warned for eventual typecasts that will be unsuccessful before compiling your code.</p>
<p>But in our code everything seems to be in order.</p>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<h3>Define a conversion operator</h3>
<p>When defining your own class you may want to define your own conversion operators. These are defined as static methods with their own special syntax. The keywords<em> implicit</em>, <em>explicit</em> and <em>operator</em> are used.</p>
<p>Conversion operators are commonly used by classes in the .NET Framework Base Class Library. The primitive types have their own conversion operators to allow them to be converted into one another. These are seen in the samples above when turning an int into a double and vice versa.</p>
<p>Lets have a look at the syntax for defining the conversion operators.</p>
<p>Both samples take an<em> int</em> and cast it into an object of type <em>MyClass</em>. <em>MyClass</em> is also in this case the name of the declaring type.</p>
<h4>Implicit conversion operator</h4>
<pre class="code"><span style="color:blue;">public static implicit operator </span><span style="color:#2b91af;">MyClass</span>(<span style="color:blue;">int </span>value)
{
    <span style="color:blue;">return new </span><span style="color:#2b91af;">MyClass</span>(value);
}</pre>
<pre class="code"></pre>
<p>Using it:</p>
<pre class="code"></pre>
<pre class="code"><span style="color:#2b91af;">MyClass </span>x = 24;</pre>
<pre class="code"></pre>
<h4>Explicit conversion operator</h4>
<pre class="code"><span style="color:blue;">public static explicit operator </span><span style="color:#2b91af;">MyClass</span>(<span style="color:blue;">int </span>value)
{
    <span style="color:blue;">return new </span><span style="color:#2b91af;">MyClass</span>(value);
}</pre>
<pre class="code"></pre>
<p>Using it:</p>
<pre class="code"></pre>
<pre class="code"><span style="color:#2b91af;">MyClass </span>x = (<span style="color:#2b91af;">MyClass</span>)24;</pre>
<pre class="code"></pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<h3>The <em>as </em>keyword</h3>
<p>In C# there is a special way to do silent typecasts between types in the class hierarchy of a reference object. This makes use of the <em>as</em>-keyword.</p>
<pre class="code"><span style="color:blue;">object </span>x = <span style="color:#a31515;">"Foo"</span>;
<span style="color:blue;">string </span>y = x <span style="color:blue;">as </span><span style="color:#2b91af;">String</span>;   //Will succeed</pre>
<p>When trying to cast this object to a class that not is of the declared type or a base class of the type the result will be null.</p>
<pre class="code"><span style="color:#2b91af;">Random </span>z = x <span style="color:blue;">as </span><span style="color:#2b91af;">Random</span>;    //Will fail and result will be null</pre>
<p>So if it fails it will be <em>null</em> and no exceptions will be thrown. This is certainly useful in some cases.</p>
<h3>Conclusions</h3>
<p>In this short blog post you have been told a little about type conversion. It is pretty much the essentials.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/robertsundstrom.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/robertsundstrom.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/robertsundstrom.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/robertsundstrom.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/robertsundstrom.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/robertsundstrom.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/robertsundstrom.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/robertsundstrom.wordpress.com/1403/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/robertsundstrom.wordpress.com/1403/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/robertsundstrom.wordpress.com/1403/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=robertsundstrom.wordpress.com&blog=2482222&post=1403&subd=robertsundstrom&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://robertsundstrom.wordpress.com/2009/09/04/typecasting-and-type-conversions-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/309e0354c0d6be6a5bb40c47da547d88?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Robert</media:title>
		</media:content>
	</item>
	</channel>
</rss>