<?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>Winter&#039;s Fall &#187; Programming</title>
	<atom:link href="http://wintersfall.westernesse.net/category/computers/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://wintersfall.westernesse.net</link>
	<description>Geekery. Imitating. Life.</description>
	<lastBuildDate>Sun, 11 Apr 2010 21:45:23 +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>kontron pitx-sp</title>
		<link>http://wintersfall.westernesse.net/2010/04/06/kontron-pitx-sp/</link>
		<comments>http://wintersfall.westernesse.net/2010/04/06/kontron-pitx-sp/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 19:41:44 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=270</guid>
		<description><![CDATA[Well, my Kontron pITX-SP 1.6GHz board finally came. This is the souped up version of the 1.1GHz board that I evaluated in February. This version in addition to being clocked 500MHz faster also features a bootable microSD socket, and two &#8230; <a href="http://wintersfall.westernesse.net/2010/04/06/kontron-pitx-sp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, my <a href="http://us.kontron.com/products/boards+and+mezzanines/embedded+sbc/pitx+25+sbc/pitxsp.html" target="_blank">Kontron pITX-SP</a> 1.6GHz board finally came. This is the souped up version of the 1.1GHz board that I evaluated in February. This version in addition to being clocked 500MHz faster also features a bootable microSD socket, and two SATA ports. Read on for more info about the board and getting debian up and running on it.</p>
<p><span id="more-270"></span>As is typical of everything in the embedded world getting an OS up on the board presented a few challenges. I knew that I wanted to run debian on the board, I just had to figure out how to get it installed on to the microSD card. I picked up a 4GB class 4 card for the purposes of loading the OS and evaluating the board. Since there was no optical disk drive connected that ruled out the typical route of burning a debian install image. I couldn&#8217;t find a USB flash drive that I could format that was of sufficient size to load the install image on to. That left me with the option of putting the install image on a CF card using a USB CF card reader. Then, I booted the system with this drive and everything worked as though it would have with a USB flash drive. The only downside was the slow speed of the older CF card.</p>
<p>The install appeared to be going great, I got everything setup and I was ready for a reboot. So, I rebooted the system and I got nothing. Well technically I got the word &#8220;grub&#8221; printed on the screen and that was it. Thinking I had dorked something up I re-installed again, double checking everything. Same result! So, I decided to disconnect the USB CF card reader and try to boot up that way. Now I got even less! Just a flashing cursor. This told me that GRUB had some how gotten dorked up. So, I rewrote the installer image to CF card and booted up in rescue mode. I mounted my /boot partition by issuing mount /dev/mmcblk0p1 /boot. I looked at /boot/grub/device.map and I saw my problem immediately. My device.map read:</p>
<pre>(hd0)   /dev/sda
(hd1)   /dev/mmcblk0</pre>
<p>It was thinking that /dev/sda was my first disk, and that mmcblk0 was my second. It installed the MBR on /dev/sda (which is what was screwing up my CF card after the install), but didn&#8217;t create a partition for /boot. Which is why I only got &#8220;GRUB&#8221; on my screen. So, I changed the device map to reflect the true state of my system, and re-did a grub-install specifying the device map. Rebooted the system and I got a grub menu as I expected but still couldn&#8217;t boot! The grub menu was still pointing to (hd1) for the kernel image. A quick edit of the boot parameters and I was booting.</p>
<p>After a bit of frustration everything is up and going. So, now it is time to get my packages installed and make sure I can run the embedded app on this board! I&#8217;ll post some more benchmarks at a later date. I am expecting good performance given what I saw with the 1.1GHz board.</p>
<p class="signatureImage" style="display: none;"><img src="http://wintersfall.westernesse.net/wp-content/themes/twentyten/images/Sig.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2010/04/06/kontron-pitx-sp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>making it DRY-er</title>
		<link>http://wintersfall.westernesse.net/2009/10/22/making-it-dry-er/</link>
		<comments>http://wintersfall.westernesse.net/2009/10/22/making-it-dry-er/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 04:05:30 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=254</guid>
		<description><![CDATA[I am a huge fan of DRY (don&#8217;t repeat yourself). It has the obvious perk of making code easier to read and comprehend. There are also other benefits that are less obvious. Most people apply this principle to code for &#8230; <a href="http://wintersfall.westernesse.net/2009/10/22/making-it-dry-er/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I am a huge fan of DRY (don&#8217;t repeat yourself). It has the obvious perk of making code easier to read and comprehend. There are also other benefits that are less obvious.</p>
<p><span id="more-254"></span></p>
<p>Most people apply this principle to code for decomposition and overlook the actual data being stored. However, this should not be the case! Performance can suffer greatly when we aren&#8217;t diligent in making our data as DRY as possible.</p>
<p>When dealing with software where objects have a long lifetime the cost of construction gets ammortized to the point of non-existenince. However, for short lived objects the construction/destruction my consume the majority of the objects lifecycle. For these types of objects keeping things DRY is very important. I&#8217;ll discuss a case where DRYing out an object has very real performance consequences.</p>
<p>One example, would be using an object as identifiers for data objects. Take the following code as an example:</p>
<pre class="brush: cpp">
CBaseState *statePtr = NULL; // CBaseState is the base class for all state variables
statePtr = stateList[0]; // stateList is a std::vector<CBaseState*>

// every CBaseState has an ID field of type CBaseID, this is used to ID different states at runtime
// CPositionXID is derived from CBaseID
if (statePtr->GetID() == CPositionXID())
{
   printf("We have a XPosition state\n");
}
</pre>
<p>The class CBaseID is defined as:</p>
<pre class="brush: cpp">
class CBaseID
{
   StateEnum StateType;
   int ID[8];
   std::string IDString;
}
</pre>
<p>The equality operator checks the StateType and ID fields for equality. The IDString is a textual representation of the StateType and ID array. The IDString member is only used for display purposes in the debugger, and never referenced in the program.</p>
<p>The program creates 380,000,000+ instances of CBaseID derived classes during a typical processing run. Due to the creation of IDString the std::string constructor/destructor consumes 12% of the processing time! A simple change to DRY out the class yielded a 12% reduction in run-time.</p>
<p>The take away, don&#8217;t repeat data unnecessarily! If you can say something using one declaration, don&#8217;t use two. Make your tools work smarter, not harder.</p>
<p class="signatureImage" style="display: none;"><img src="http://wintersfall.westernesse.net/wp-content/themes/twentyten/images/Sig.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2009/10/22/making-it-dry-er/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the &#8220;empty&#8221; toolbox</title>
		<link>http://wintersfall.westernesse.net/2009/10/22/the-empty-toolbox/</link>
		<comments>http://wintersfall.westernesse.net/2009/10/22/the-empty-toolbox/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 23:56:56 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=242</guid>
		<description><![CDATA[If you wouldn&#8217;t trust a carpenter who did know what was in his toolbox work on your house, why do you let developers who don&#8217;t know what tools they have work on your code? When you convince a manager to &#8230; <a href="http://wintersfall.westernesse.net/2009/10/22/the-empty-toolbox/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you wouldn&#8217;t trust a carpenter who did know what was in his toolbox work on your house, why do you let developers who don&#8217;t know what tools they have work on your code?</p>
<p><span id="more-242"></span></p>
<p>When you convince a manager to purchase an expensive development tool you should be committed to learning what the tool is, and what it can do for you. Recently I&#8217;ve been looking at some code that a developer worked on long and hard. He attempted to make performance an important issue. The performance of this application is absolutely critical, as it is a vital step in processing data collected by field operations. The field personnel need to know in short order if their data is complete so they can demobilize. This becomes very important when you are in a line of work that has a $3,000 per day field cost. The developer who is no longer with the company convinced his manager that he needed IBM&#8217;s QuantifyPlus package. His manager saw a valid case for the purchase since there were known memory leaks in the problem, and the code base was in excess of 150,000 lines of code.</p>
<p>After getting this new tool, and sharpening it he set to work eliminating those pesky memory leaks. With the immediate fire extinguished a manager would have hoped that the developer took some time to figure out what other tools where added to his toolbox. Sadly, that developer did not do so. The true tragedy is that this expensive tool set included a performance analysis tool in addition to the memory analysis tool.</p>
<p>After having the code base in fresh hands for 18-months the software package is now capable of more robust processing operations, and runs in 1/2 the time that it used to. Further to that, the new developers armed with a toolbox that they know the contents of are striving to decrease the runtime even further.</p>
<p>Remember developers you are craftsmen, a craftsmen is nothing if they don&#8217;t know their tools. Sure, some of you may say that everything&#8217;s a nail for your hammer. But know what hammers you have, the 16lb sledge hammer is a poor fit for hanging that $5,000 piece of art in the hallway.</p>
<p>A future series of articles will discuss some of the steps the developers took to save so much processing time.</p>
<p class="signatureImage" style="display: none;"><img src="http://wintersfall.westernesse.net/wp-content/themes/twentyten/images/Sig.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2009/10/22/the-empty-toolbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>project update</title>
		<link>http://wintersfall.westernesse.net/2009/03/04/project-update/</link>
		<comments>http://wintersfall.westernesse.net/2009/03/04/project-update/#comments</comments>
		<pubDate>Wed, 04 Mar 2009 21:53:38 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=204</guid>
		<description><![CDATA[So, I&#8217;ve been running down the list of features that I want in my system backup application. I&#8217;ve decided that this is the must implement feature list: Full system backup (i.e. support bare metal restore) Hourly backups of changed files &#8230; <a href="http://wintersfall.westernesse.net/2009/03/04/project-update/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been running down the list of features that I want in my system backup application. I&#8217;ve decided that this is the must implement feature list:</p>
<ul>
<li>Full system backup (i.e. support bare metal restore)</li>
<li>Hourly backups of changed files (kept for 24 hours)</li>
<li>Daily tag of changed files</li>
<li>Weekly full system backups</li>
<li>Backup at system shutdown</li>
<li>Restore selected revision of a file</li>
</ul>
<p>This system will have two components, the client component that performs the system backup. The second component is a server component. The server will most likely be implemented on a distribution of Linux (perhaps using Ubuntu server as a starting point). I will initially write a client for the Windows operating system (targeting XP first, and then extending with functionality provided by Vista and 7). Eventually a client will be developed that runs on Linux systems using LVM.</p>
<p>As a side note, there a few new tweaks to the blog thanks to playing with jQuery. A few more will be coming in the little while.</p>
<p class="signatureImage" style="display: none;"><img src="http://wintersfall.westernesse.net/wp-content/themes/twentyten/images/Sig.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2009/03/04/project-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>software project</title>
		<link>http://wintersfall.westernesse.net/2009/03/02/software-project/</link>
		<comments>http://wintersfall.westernesse.net/2009/03/02/software-project/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 05:41:23 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=200</guid>
		<description><![CDATA[Work has been keeping me ridiculously busy lately, but I&#8217;m starting to formulate plans for my next side project. I think I am going to develop a volume shadow copy backup system. The system will be similar to TimeMachine but &#8230; <a href="http://wintersfall.westernesse.net/2009/03/02/software-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Work has been keeping me ridiculously busy lately, but I&#8217;m starting to formulate plans for my next side project. I think I am going to develop a volume shadow copy backup system. The system will be similar to TimeMachine but witha  few significant changes. I am working out the details. But, I&#8217;m going to employ Volume Shadow Copy Service to provide my consistent in place snapshots.</p>
<p class="signatureImage" style="display: none;"><img src="http://wintersfall.westernesse.net/wp-content/themes/twentyten/images/Sig.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2009/03/02/software-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C#</title>
		<link>http://wintersfall.westernesse.net/2009/01/13/c/</link>
		<comments>http://wintersfall.westernesse.net/2009/01/13/c/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 03:47:47 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=157</guid>
		<description><![CDATA[I have been playing with C# for the last few days and I am really starting to like it more. Implementing Singletons are so easy compared to some of the other languages. Additionally the runtime reflection that the .Net framework &#8230; <a href="http://wintersfall.westernesse.net/2009/01/13/c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been playing with C# for the last few days and I am really starting to like it more. Implementing Singletons are so easy compared to some of the other languages. Additionally the runtime reflection that the .Net framework provides is quite nice! I&#8217;ll have to post some fun C# code in the next couple of days.</p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2009/01/13/c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>on multiple runtimes</title>
		<link>http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/</link>
		<comments>http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 05:41:14 +0000</pubDate>
		<dc:creator>tallganglyguy</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[heap]]></category>
		<category><![CDATA[msvc]]></category>
		<category><![CDATA[runtime]]></category>

		<guid isPermaLink="false">http://wintersfall.westernesse.net/?p=137</guid>
		<description><![CDATA[When a DLL links against a different runtime library than your executable things are bound to go awry. We recently ran into the fun behaviour of having multiple heaps in a program. Somehow a project got built using one C &#8230; <a href="http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When a DLL links against a different runtime library than your executable things are bound to go awry.</p>
<p><span id="more-137"></span>We recently ran into the fun behaviour of having multiple heaps in a program. Somehow a project got built using one C run-time for the executable, and a DLL dependency got built using a different C run-time. Since, this change was not known to me, I didn&#8217;t flag it as a possible cause of the problem to the developer. Even the developer didn&#8217;t remember changing the runtime libraries.</p>
<p>The fun started as this. The DLL contained the definition of a couple of classes. Let&#8217;s call them CDataStream and CDataObject. CDataStream has a function called getNextObject() with the return type CDataObject*. The fun starts when the object is created on the heap created by the DLL&#8217;s run-time, and then you attempt to delete the object in the executable. Since the executable is using a different heap it obviously can&#8217;t delete the object returned by getNextObject(). This zapped about 8 hours of time from the developer before he finally realized what was going on.</p>
<p>No bonus points are awarded to those who point out that these sorts of problems are sovled by COM. Since this is legacy code that has been in place for several years, a rewrite can&#8217;t be justified.</p>
]]></content:encoded>
			<wfw:commentRss>http://wintersfall.westernesse.net/2008/12/14/on-multiple-runtimes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
