<?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>Jason Barkes Practical Development</title>
	<atom:link href="http://jbarkes.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jbarkes.wordpress.com</link>
	<description>Practical software engineering examples, advice and solutions derived from years of real-world experience.</description>
	<lastBuildDate>Tue, 08 Nov 2011 04:34:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jbarkes.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jason Barkes Practical Development</title>
		<link>http://jbarkes.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jbarkes.wordpress.com/osd.xml" title="Jason Barkes Practical Development" />
	<atom:link rel='hub' href='http://jbarkes.wordpress.com/?pushpress=hub'/>
		<item>
		<title>MOSS 2007 vs. WSS 3.0</title>
		<link>http://jbarkes.wordpress.com/2011/01/16/moss-2007-vs-wss-3-0/</link>
		<comments>http://jbarkes.wordpress.com/2011/01/16/moss-2007-vs-wss-3-0/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 01:36:04 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Q&A]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=601</guid>
		<description><![CDATA[Question: &#8220;What is the difference between MOSS 2007 and WSS 3.0? Should we spend the money for SharePoint 2007 or is WSS 3.0 sufficient?&#8221; Answer: This is a common question for organizations looking to implement a Microsoft-based online collaboration system. The basic answer is Windows SharePoint Services 3.0 (WSS) provides a collaboration foundation with a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=601&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Question</strong>:<br />
&#8220;What is the difference between MOSS 2007 and WSS 3.0? Should we spend the money for SharePoint 2007 or is WSS 3.0 sufficient?&#8221;</p>
<p>     <img src="http://jbarkes.files.wordpress.com/2011/01/mossvswss.png?w=600" alt="MOSS vs. WSS" /></p>
<p><strong>Answer</strong>:<br />
This is a common question for organizations looking to implement a Microsoft-based online collaboration system. The basic answer is Windows SharePoint Services 3.0 (WSS) provides a collaboration foundation with a variety of features including a web-based portal, document collaboration, etc. and Microsoft Office SharePoint Server 2007 (MOSS) builds on WSS by providing several additional enterprise features.</p>
<p>The best way to understand the difference is to evaluate the additional features provided by MOSS. <a href="http://www.milesconsultingcorp.com/SharePoint-Portal-2007-Version-Comparison-between-MOSS2007-and-WSS3.aspx">This article</a> provides a good feature comparison.</p>
<p>I have implemented both MOSS and WSS-only solutions for a number of organizations and although WSS is nice and will work, if you can afford MOSS (or SharePoint Server 2010) I would strongly recommend it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/601/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/601/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/601/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=601&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2011/01/16/moss-2007-vs-wss-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>

		<media:content url="http://jbarkes.files.wordpress.com/2011/01/mossvswss.png" medium="image">
			<media:title type="html">MOSS vs. WSS</media:title>
		</media:content>
	</item>
		<item>
		<title>Data Storage in SharePoint 2007</title>
		<link>http://jbarkes.wordpress.com/2011/01/14/data-storage-in-sharepoint-2007/</link>
		<comments>http://jbarkes.wordpress.com/2011/01/14/data-storage-in-sharepoint-2007/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 05:25:39 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Data Storage]]></category>
		<category><![CDATA[Q & A]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=587</guid>
		<description><![CDATA[Question: &#8220;Where is the data and the documents stored when I create a document library in SharePoint 2007?&#8221; Answer: The meta-data (library columns) and the files themselves (BLOBs) are stored in the SQL Server database associated with the specific web application. The databases can be viewed and managed in Central Admin -&#62; Application Management -&#62; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=587&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Question</strong>:<br />
&#8220;Where is the data and the documents stored when I create a document library in SharePoint 2007?&#8221;</p>
<p><strong>Answer</strong>:<br />
The meta-data (library columns) and the files themselves (BLOBs) are stored in the SQL Server database associated with the specific web application.</p>
<p>The databases can be viewed and managed in Central Admin -&gt; Application Management -&gt; Content Databases.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/587/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/587/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/587/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=587&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2011/01/14/data-storage-in-sharepoint-2007/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>
	</item>
		<item>
		<title>ESPN Ticker in PowerPoint</title>
		<link>http://jbarkes.wordpress.com/2010/12/31/espn-ticker-in-powerpoint/</link>
		<comments>http://jbarkes.wordpress.com/2010/12/31/espn-ticker-in-powerpoint/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 22:39:40 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PowerPoint]]></category>
		<category><![CDATA[Samples]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=561</guid>
		<description><![CDATA[Throughout my career, I have made countless presentations and almost every single one of them has been delivered with Microsoft PowerPoint. I am a huge sports fan and watch a lot of ESPN and have always liked the ticker that appears at the bottom of the screen. I figured it would be interesting to have [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=561&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Throughout my career, I have made countless presentations and almost every single one of them has been delivered with Microsoft PowerPoint.  I am a huge sports fan and watch a lot of ESPN and have always liked the ticker that appears at the bottom of the screen.</p>
<p><img src="http://jbarkes.files.wordpress.com/2010/12/espntickerscreencap.png?w=600" alt="ESPN Ticker" /></p>
<p>I figured it would be interesting to have an ESPN-like ticker at the bottom of my presentation and although it&#8217;s not appropriate for all audiences, it is pretty cool.</p>
<p>It works by handling internal PowerPoint events through macro code (hit Alt-F11 to view the code editor) and reads the tabs and messages at runtime from a XML file in the same directory as the presentation.  Please note that I&#8217;ve only tested this with PowerPoint 2007, but it should work with 2010 and probably 2003.</p>
<p><strong>A few quick notes</strong>:<br />
1. You need to install EventGen12 add-in, which redirects PowerPoint events to actual presentations.  http://officeone.mvps.org/eventgen/eventgen.html</p>
<p>2.  Make sure you <strong>enable macros</strong> when prompted in PowerPoint.</p>
<p>3. The code that performs the work relies on the ticker shapes in the presentation to be named in a particular way, so it&#8217;s generally easiest to simply copy an existing slide from the sample and then make your content changes.  But, if you&#8217;d like to change them, there&#8217;s also a &#8216;NameShape&#8217; macro included as well.</p>
<p>4. The speed of the ticker is controlled by adjusting the &#8216;timer_interval&#8217; value in &#8216;ticker_msgs.xml&#8217;.</p>
<p><a href="http://dl.dropbox.com/u/2224072/ESPNTickerPowerPointSample.zip">Download Complete Sample</a> (includes source code, sample presentation and XML)</p>
<p>A <strong>quick video demonstration</strong> of how it looks in action.</p>
<p><span style="text-align:center; display: block;"><a href="http://jbarkes.wordpress.com/2010/12/31/espn-ticker-in-powerpoint/"><img src="http://img.youtube.com/vi/t7s15vE8lZg/2.jpg" alt="" /></a></span><br />
<a href="http://dl.dropbox.com/u/2224072/ESPNTickerPowerPointSample.zip">Download Complete Sample</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/561/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/561/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=561&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2010/12/31/espn-ticker-in-powerpoint/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>

		<media:content url="http://jbarkes.files.wordpress.com/2010/12/espntickerscreencap.png" medium="image">
			<media:title type="html">ESPN Ticker</media:title>
		</media:content>
	</item>
		<item>
		<title>Finally Traded my iPhone for an Android</title>
		<link>http://jbarkes.wordpress.com/2010/07/31/finally-traded-my-iphone-for-an-android/</link>
		<comments>http://jbarkes.wordpress.com/2010/07/31/finally-traded-my-iphone-for-an-android/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 02:14:13 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">https://jbarkes.wordpress.com/2010/07/31/finally-traded-my-iphone-for-an-android/</guid>
		<description><![CDATA[I have been waiting for a compelling Android device for almost a year and I finally find it &#8211; I am now the proud owner of a Samgsung S. Although I&#8217;m still in the honeymoon stage, I have to say I&#8217;m impressed with both the device and OS. The Android SDK looks interesting as well [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=560&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been waiting for a compelling Android device for almost a year and I finally find it &#8211; I am now the proud owner of a Samgsung S.</p>
<p>Although I&#8217;m still in the honeymoon stage, I have to say I&#8217;m impressed with both the device and OS.</p>
<p>The Android SDK looks interesting as well and could be fun.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/560/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/560/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/560/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=560&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2010/07/31/finally-traded-my-iphone-for-an-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Read a Binary File in C++</title>
		<link>http://jbarkes.wordpress.com/2010/02/17/how-to-read-a-file-in-c/</link>
		<comments>http://jbarkes.wordpress.com/2010/02/17/how-to-read-a-file-in-c/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 05:20:18 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[Binary]]></category>
		<category><![CDATA[Cpp]]></category>
		<category><![CDATA[Read File]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=540</guid>
		<description><![CDATA[The following code shows how to read a binary file in C++. This is a quick example and doesn&#8217;t contain much error handling and if you&#8217;re using Visual Studio, make sure you set the appropriate character set: Right-click on your project in the Solution Explorer and click Properties. Select Configuration Properties -&#62; General. Set the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=540&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code shows how to read a binary file in C++.  This is a quick example and doesn&#8217;t contain much error handling and if you&#8217;re using Visual Studio, make sure you set the appropriate character set:</p>
<p>Right-click on your project in the <strong>Solution Explorer</strong> and click <strong>Properties</strong>.<br />
Select <strong>Configuration Properties</strong> -&gt; <strong>General</strong>.<br />
Set the <strong>Character Set</strong> to <strong>Use Multi-Byte Character Set</strong>.</p>
<p><pre class="brush: csharp; toolbar: true;">
///////////////////////////////////////////////////////////////////////////////
// A quick example of reading a binary file in C++.
//
// 2010 Jason Barkes - http://jbarkes.wordpress.com
///////////////////////////////////////////////////////////////////////////////

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;tchar.h&gt;

int _tmain(int argc, _TCHAR* argv[])
{
    FILE *file;
    char *fileName;
    int   fileSize;
    char *readBuffer;

    // Set the filename (could also get from a command-line parameter)
    fileName = &quot;c:\\samples\\binary.jpg&quot;;

    // Open the specified file in binary mode (&quot;rb&quot;)
    file = fopen(fileName, &quot;rb&quot;);

    // If the file wasn't opened successfully, print an error and close
    if(file == NULL)
    {
        perror(&quot;Failed to open file for read access.&quot;);
        return 1;
    }

    // Determine the file size
    fseek(file, 0L, SEEK_END);
    fileSize = ftell(file);
    rewind(file);

    // Allocate the read buffer
    readBuffer = (char *)malloc(fileSize);

    // Read the file's data into the read buffer
    long read = fread(readBuffer, 1, fileSize, file);

    // Do something with the data
    // ...

    // Free allocated memory and close the file
    free(readBuffer);
    fclose(file);

    // Exit program
    return 0;
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/540/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/540/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/540/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=540&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2010/02/17/how-to-read-a-file-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Drawing Dynamic Shapes in Silverlight 3</title>
		<link>http://jbarkes.wordpress.com/2010/01/03/drawing-dynamic-shapes-in-silverlight-3/</link>
		<comments>http://jbarkes.wordpress.com/2010/01/03/drawing-dynamic-shapes-in-silverlight-3/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 12:08:47 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Boundary Detection]]></category>
		<category><![CDATA[Custom Drawing]]></category>
		<category><![CDATA[Drag Drop]]></category>
		<category><![CDATA[Dynamic Shapes]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[HitTest]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=444</guid>
		<description><![CDATA[This is a quick demonstration that focuses on some of the geometric shape drawing features that are available in Silverlight and how to use those features in code. Live Demo: Drawing Dynamic Silverlight Shapes The following code excerpts show the highlights of performing the primary shape drawing functions: Dynamic shape creation Sizing calculations Brushes Dynamic [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=444&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a quick demonstration that focuses on some of the geometric shape drawing features that are available in Silverlight and how to use those features in code.</p>
<p><strong>Live Demo: </strong><a href="http://dl.dropbox.com/u/2224072/SL010.html" target="_blank">Drawing Dynamic Silverlight Shapes</a><br />
<a href="http://dl.dropbox.com/u/2224072/SL010.html" target="_blank"><img src="http://jbarkes.files.wordpress.com/2010/01/blog-sldrawing01.png?w=600" alt="Live Demo" /></a></p>
<p>The following code excerpts show the highlights of performing the primary shape drawing functions:</p>
<ul>
<li>Dynamic shape creation</li>
<li>Sizing calculations</li>
<li>Brushes</li>
<li>Dynamic event handlers</li>
<li>Shape re-sizing</li>
<li>Shape movement</li>
</ul>
<p><pre class="brush: csharp; toolbar: true;">
/// &lt;summary&gt;
/// Draws the desired geometrical shape.  This quick example app uses
/// ellipses and rectangles, but others would work here as well.
/// &lt;/summary&gt;
private void DrawShape(Shape shape, SolidColorBrush brush)
{
    double x = 0.0, y = 0.0;

    // These calcs are required to handle sizing in any direction
    if (_ptStart.X &gt; _mX)
    {
        shape.Width = _ptStart.X - _mX;
        x = _mX;
    }
    else
    {
        shape.Width = _mX - _ptStart.X;
        x = _ptStart.X;
    }

    if (_ptStart.Y &gt; _mY)
    {
        shape.Height = _ptStart.Y - _mY;
        y = _mY;
    }
    else
    {
        shape.Height = _mY - _ptStart.Y;
        y = _ptStart.Y;
    }

    // Set the brushes
    shape.Fill = brush;
    shape.StrokeThickness = 1;
    shape.Stroke = _whiteBrush;

    // Set the shape's coordinates
    shape.SetValue(Canvas.LeftProperty, x);
    shape.SetValue(Canvas.TopProperty, y);

    if (_shapeLast != null)
    {
        LayoutRoot.Children.Remove(_shapeLast);
    }

    // Set the name, tooltip and add the event handlers
    shape.Name = &quot;DynamicShape&quot; + _shapeCount.ToString();
    ToolTipService.SetToolTip(shape, shape.Name + &quot;\r\n&quot; + shape.GetType().ToString());

    shape.MouseEnter += new MouseEventHandler(shape_MouseEnter);
    shape.MouseLeave += new MouseEventHandler(shape_MouseLeave);
    shape.MouseLeftButtonDown += new MouseButtonEventHandler(shape_MouseLeftButtonDown);
    shape.MouseLeftButtonUp += new MouseButtonEventHandler(shape_MouseLeftButtonUp);

    // Add the shape to the canvas
    _shapeLast = shape;
    _shapeCount++;
    LayoutRoot.Children.Add(shape);
}
</pre></p>
<p><pre class="brush: csharp; toolbar: true;">
/// &lt;summary&gt;
/// This is where the shapes are drawn, resized and moved.
/// &lt;/summary&gt;
private void LayoutRoot_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
{
    // Update mouse coordinates
    _mX = e.GetPosition(sender as UIElement).X;
    _mY = e.GetPosition(sender as UIElement).Y;
    ctlCoords.Text = &quot;(&quot; + _mX + &quot; ,&quot; + _mY + &quot;)&quot;;

    // If enabled, add event info to the console
    if (chkTrackMouse.IsChecked == true)
    {
        AddConsoleMsg(&quot;LayoutRoot_MouseMove: X=&quot; + _mX + &quot;, Y=&quot; + _mY);
    }

    // Perform a hittest to make sure we're operating within the bounds of our
    // drawing surface
    IEnumerable&lt;UIElement&gt; elements;
    elements = VisualTreeHelper.FindElementsInHostCoordinates(
        new Point(_mX, _mY), ctlBounds as UIElement);

    if (elements.Any())
    {
        // If enabled, draw the gridlines
        if (chkGridlines.IsChecked == true)
        {
            DrawGridlines();
        }

        // If enabled, draw an ellipse
        if (_isLeftMouseButtonDown == true &amp;&amp; _isDrawEllipse)
        {
            Ellipse ellipse = new Ellipse();
            DrawShape(ellipse, _brushes[_randBrush.Next(0,_brushes.Count)]);
        }

        // If enabled, draw a rectangle
        if (_isLeftMouseButtonDown == true &amp;&amp; _isDrawRect)
        {
            Rectangle rect = new Rectangle();
            DrawShape(rect, _brushes[_randBrush.Next(0, _brushes.Count)]);
        }

        // If enabled, draw a line
        if (_isLeftMouseButtonDown == true &amp;&amp; _isDrawLine)
        {
            Line line = new Line();
            DrawLine(line);
        }

        // If a shape is moving
        if (_isShapeMoving)
        {
            double x = _mX - _shapeMove.Width / 2;
            double y = _mY - _shapeMove.Height / 2;

            // Move the shape
            _shapeMove.SetValue(Canvas.LeftProperty, x);
            _shapeMove.SetValue(Canvas.TopProperty, y);
        }
    }
    else
    {
        // We're outside of the bounds of our drawing surface so remove the gridlines
        RemoveGridlines();
    }
}
</pre></p>
<p>You can download the full source here: <a href="http://dl.dropbox.com/u/2224072/DrawingDynamicSilverlightShapesDemo.zip">Drawing Dynamic Silverlight Shapes Demo</a>.  This requires Visual Studio 2008 and Silverlight 3 development tools (Expression Blend is not <em>required</em> but would be useful as well).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/444/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=444&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2010/01/03/drawing-dynamic-shapes-in-silverlight-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>

		<media:content url="http://jbarkes.files.wordpress.com/2010/01/blog-sldrawing01.png" medium="image">
			<media:title type="html">Live Demo</media:title>
		</media:content>
	</item>
		<item>
		<title>Deep Copy / Clone Objects in Silverlight with C#</title>
		<link>http://jbarkes.wordpress.com/2009/12/28/deep-copy-clone-in-silverlight-with-c/</link>
		<comments>http://jbarkes.wordpress.com/2009/12/28/deep-copy-clone-in-silverlight-with-c/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 05:28:32 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Clone]]></category>
		<category><![CDATA[Deep Copy]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[Serialization]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=417</guid>
		<description><![CDATA[The following code will add an extension method to Silverlight 3 based C# code to perform a deep copy of a custom object.  This templated method uses the MemoryStream serialization/deserialization technique, but will not work with UIElement members or derivatives.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=417&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following code will add an extension method to Silverlight 3 based C# code to perform a deep copy of a custom object.  This templated method uses the MemoryStream serialization/deserialization technique, but will not work with UIElement members or derivatives.</p>
<p><pre class="brush: csharp;">
public static class ExtensionMethods
{
       public static T DeepCopy&lt;T&gt;(this T oSource)
       {
              T oClone;

              DataContractSerializer dcs = new DataContractSerializer(typeof(T));

              using (MemoryStream ms = new MemoryStream())
              {
                     dcs.WriteObject(ms, oSource);
                     ms.Position = 0;
                     oClone = (T)dcs.ReadObject(ms);
              }

              return oClone;
       }
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/417/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/417/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/417/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=417&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2009/12/28/deep-copy-clone-in-silverlight-with-c/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>
	</item>
		<item>
		<title>Basketball Play Designer in Silverlight 3</title>
		<link>http://jbarkes.wordpress.com/2009/12/12/basketball-play-designer-in-silverlight-3/</link>
		<comments>http://jbarkes.wordpress.com/2009/12/12/basketball-play-designer-in-silverlight-3/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 03:57:46 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Basketball]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Dynamic Controls]]></category>
		<category><![CDATA[Play Editor]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[UI]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=373</guid>
		<description><![CDATA[Silverlight is an exciting new technology that provides a cool platform for building EMBED&#8217;able applications and complete web sites using Visual Studio and Expression Blend. There are numerous features that are worth exploring, but my favorite is the seperation of the UI/UX and the implementation, along with Expression Blend. Being a C#/C++ software guy with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=373&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Silverlight is an exciting new technology that provides a cool platform for building EMBED&#8217;able applications and complete web sites using Visual Studio and Expression Blend.  There are numerous features that are worth exploring, but my favorite is the seperation of the UI/UX and the implementation, along with Expression Blend.</p>
<p>Being a C#/C++ software guy with some graphical design skills, this is a perfect match.  In this article, we&#8217;ll create the start of a Silverlight application for designing basketball plays.  The finished product&#8217;s looks can change quite a bit, but the functionality remains the same:</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://jbarkes.files.wordpress.com/2009/12/court01.png" target="_blank"><img src="http://jbarkes.files.wordpress.com/2009/12/court01_th.png?w=600" alt="Standard Court - Click for Larger Image" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://jbarkes.files.wordpress.com/2009/12/court02.png" target="_blank"><img src="http://jbarkes.files.wordpress.com/2009/12/court02_th.png?w=600" alt="Abstract Court - Click for Larger Image" /></a></p>
<p>In the first video clip you will learn how to create the project in Visual Studio and the static visual layout in Expression Blend.</p>
<span style="text-align:center; display: block;"><a href="http://jbarkes.wordpress.com/2009/12/12/basketball-play-designer-in-silverlight-3/"><img src="http://img.youtube.com/vi/L8ZgpP3F9gI/2.jpg" alt="" /></a></span>
<p>In part 2, you will learn how to create and wire up dynamic controls and event handlers and create the associated C# code.</p>
<span style="text-align:center; display: block;"><a href="http://jbarkes.wordpress.com/2009/12/12/basketball-play-designer-in-silverlight-3/"><img src="http://img.youtube.com/vi/uN4GFTAy8lw/2.jpg" alt="" /></a></span>
<p>The next steps for this application will be presented in an upcoming article and include:</p>
<ul>
<li>Drag and drop animation</li>
<li>Better styling (buttons, etc)</li>
<li>Passing and dribbling</li>
<li>Record and playback</li>
<li>Save plays and play templates (e.g., ‘2-3 zone’)</li>
</ul>
<p><a href="http://dl.dropbox.com/u/2224072/SilverlightBasketballSample.zip" target="_blank">Download Source: SilverlightBasketballSample.zip (316KB)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/373/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/373/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/373/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=373&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2009/12/12/basketball-play-designer-in-silverlight-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>

		<media:content url="http://jbarkes.files.wordpress.com/2009/12/court01_th.png" medium="image">
			<media:title type="html">Standard Court - Click for Larger Image</media:title>
		</media:content>

		<media:content url="http://jbarkes.files.wordpress.com/2009/12/court02_th.png" medium="image">
			<media:title type="html">Abstract Court - Click for Larger Image</media:title>
		</media:content>
	</item>
		<item>
		<title>A Quick Line Counter in C++</title>
		<link>http://jbarkes.wordpress.com/2009/12/11/a-quick-line-counter-in-c/</link>
		<comments>http://jbarkes.wordpress.com/2009/12/11/a-quick-line-counter-in-c/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 06:28:59 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Samples]]></category>
		<category><![CDATA[Cpp]]></category>
		<category><![CDATA[MFC]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=348</guid>
		<description><![CDATA[A quick source code line counter written in C++.  This project uses the Microsoft Foundation Classes (MFC), along with the standard C++ libraries. It could use some additional features and more advanced error handling, but it is fairly complete. One quick note (that several have brought to my attention), the percentages do not usually add up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=348&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A quick source code line counter written in C++.  This project uses the <a href="http://msdn.microsoft.com/en-us/library/d06h2x6e%28VS.80%29.aspx" target="_blank">Microsoft Foundation Classes (MFC)</a>, along with the standard C++ libraries.  It could use some additional features and more advanced error handling, but it is fairly complete.  One quick note (that several have brought to my attention), the percentages do not usually add up to 100% &#8211; that is because of the use of integers instead of floating point types, which essentially rounds down.  The code is available below.</p>
<p><img src="http://jbarkes.files.wordpress.com/2009/12/winloccounter.png?w=600" alt="Windows Line Counter Screenshot" /></p>
<p><a href="http://click.officeliveemail.com/?ju=fe4d1c78706303747411&amp;ls=fdf1177370660475731d7570&amp;m=fef012797d6206&amp;l=fec51c7677610478&amp;s=fe1f13737263007d771d79&amp;jb=fef617747c6207&amp;t=" target="_blank">Download Source: WinLocCounterSample.zip (216KB)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/348/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/348/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/348/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=348&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2009/12/11/a-quick-line-counter-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>

		<media:content url="http://jbarkes.files.wordpress.com/2009/12/winloccounter.png" medium="image">
			<media:title type="html">Windows Line Counter Screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Iterate Directories &amp; Files in C++</title>
		<link>http://jbarkes.wordpress.com/2009/12/09/iterate-directories-files-in-c/</link>
		<comments>http://jbarkes.wordpress.com/2009/12/09/iterate-directories-files-in-c/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 10:02:00 +0000</pubDate>
		<dc:creator>Jason Barkes</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Win32]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://jbarkes.wordpress.com/?p=338</guid>
		<description><![CDATA[In standard (non-managed) C++ on the Windows platform, traversing a directory / folder tree recursively can be accomplished via the Win32 API.  The following listing is a simple example that displays the name of each file.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=338&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In standard (non-managed) C++ on the Windows platform, traversing a directory / folder tree recursively can be accomplished via the Win32 API.  The following listing is a simple example that displays the name of each file.</p>
<p><pre class="brush: cpp;">
#include &lt;windows.h&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
#include &lt;stack&gt;
#include &lt;iostream&gt;

using namespace std;

// Recursive directory traversal using the Win32 API
bool ListFiles(wstring path, wstring mask, vector&lt;wstring&gt;&amp; files)
{
	HANDLE hFind = INVALID_HANDLE_VALUE;
	WIN32_FIND_DATA fdata;
	wstring fullpath;
	stack&lt;wstring&gt; folders;
	folders.push(path);
	files.clear();
	
	while (!folders.empty())
	{
		path = folders.top();
		fullpath = path + L”\\” + mask;
		folders.pop();

		hFind = FindFirstFile(fullpath.c_str(), &amp;fdata);

		if (hFind != INVALID_HANDLE_VALUE)
		{
			do
			{
				if (wcscmp(fdata.cFileName, L”.”) != 0 &amp;&amp;
                    wcscmp(fdata.cFileName, L”..”) != 0)
				{
					if (fdata.dwFileAttributes &amp; FILE_ATTRIBUTE_DIRECTORY)
					{
						folders.push(path + L”\\” + fdata.cFileName);
					}
					else
					{
						files.push_back(path + L”\\” + fdata.cFileName);
					}
				}
			}
			while (FindNextFile(hFind, &amp;fdata) != 0);
		}

		if (GetLastError() != ERROR_NO_MORE_FILES)
		{
			FindClose(hFind);

			return false;
		}

		FindClose(hFind);
		hFind = INVALID_HANDLE_VALUE;
	}

	return true;
}

int main(int argc, char* argv[])
{
	vector&lt;wstring&gt; files;

	if (ListFiles(L”C:\\source”, L”*”, files))
	{
		for (vector&lt;wstring&gt;::iterator iter = files.begin(); iter != files.end(); ++iter)
		{
			wcout &lt;&lt; iter-&gt;c_str() &lt;&lt; endl;
		}
	}

	return false;
}
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbarkes.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbarkes.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbarkes.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbarkes.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbarkes.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbarkes.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbarkes.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbarkes.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbarkes.wordpress.com&amp;blog=10142064&amp;post=338&amp;subd=jbarkes&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbarkes.wordpress.com/2009/12/09/iterate-directories-files-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6005c3bf4a892284529409a066c852ac?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jason Barkes</media:title>
		</media:content>
	</item>
	</channel>
</rss>
