<?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>Geek Scrapbook</title>
	<atom:link href="http://www.geekscrapbook.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geekscrapbook.com</link>
	<description>The .Net developer&#039;s everyday how-to guide.</description>
	<lastBuildDate>Sun, 22 May 2011 01:57:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Cash Tracker is Now on the Web!</title>
		<link>http://www.geekscrapbook.com/2011/05/21/cash-tracker-is-now-on-the-web/</link>
		<comments>http://www.geekscrapbook.com/2011/05/21/cash-tracker-is-now-on-the-web/#comments</comments>
		<pubDate>Sun, 22 May 2011 01:54:38 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker Online]]></category>
		<category><![CDATA[Code Release]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2011/05/21/cash-tracker-is-now-on-the-web/</guid>
		<description><![CDATA[Have you ever wanted to feel confident with your finances? Have you ever wondered how making changes to your lifestyle would affect your livelihood over time? These were the things I wanted to know over two years ago. I didn’t care about all the fancy accounting terms associated with personal finances. I just wanted to [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to feel confident with your finances? Have you ever wondered how making changes to your lifestyle would affect your livelihood over time? These were the things I wanted to know over two years ago. I didn’t care about all the fancy accounting terms associated with personal finances. I just wanted to know things like (for example) whether my family’s spending habits were acceptable or not or whether we could afford to go on a summer vacation or subscribe to a new magazine.</p>
<p>Cash Tracker is a tool I built to help answer these questions more quickly than pencil-and-paper ever could. Cash Tracker not a budgeting application per-se. Instead, it begins by answering the most basic of questions—how much money <em>will</em> I have in a month, 6 months, or a year—in the simplest way possible.</p>
<p>Cash Tracker Online is a first step at bringing the tool I made for myself to the general public. Getting started is easy! First, go to <a href="http://www.cashtrackeronline.com">www.cashtrackeronline.com</a> (a secure website that will keep your information safe and private) and click the button that says ‘Register Now’. The site will guide you through registering and “tracking” your first bank account.</p>
<p>Once you have your first account being “tracked”, you can start adding recurrences (these are usually either bills or pay checks). The site will automatically start predicting your financial future using projected data points (such as your projected high and low balances over the next year). As you add more income and expenses, your “Account Balance Over Time” graph will allow you to visualize your financial state over the next year.</p>
<p>In the next few weeks I will publish some more articles showing just how powerful Cash Tracker Online can be. In the meantime, head on over to <a href="http://www.cashtrackeronline.com">www.cashtrackeronline.com</a> to take your finances for a spin!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2011/05/21/cash-tracker-is-now-on-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CashTrackerOnline.com Beta Launch</title>
		<link>http://www.geekscrapbook.com/2011/05/21/cashtrackeronline-com-beta-launch/</link>
		<comments>http://www.geekscrapbook.com/2011/05/21/cashtrackeronline-com-beta-launch/#comments</comments>
		<pubDate>Sun, 22 May 2011 01:30:42 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker Online]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2011/05/21/cashtrackeronline-com-beta-launch/</guid>
		<description><![CDATA[After a three days spent acquiring a new hosting space, migrating some websites from one place to another, and working out some kinks, Cash Tracker Online is finally available for public use. Just go to: https://www.cashtrackeronline.com and click the ‘Register Now’ button to get started. Over the next month or so I’ll be working on [...]]]></description>
			<content:encoded><![CDATA[<p>After a three days spent acquiring a new hosting space, migrating some websites from one place to another, and working out some kinks, Cash Tracker Online is finally available for public use. Just go to: <a href="https://www.cashtrackeronline.com">https://www.cashtrackeronline.com</a> and click the ‘Register Now’ button to get started. </p>
<p>Over the next month or so I’ll be working on some new features and cosmetic changes to make the tool easier to use and understand. Stay tuned for the beta’s elevator pitch.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2011/05/21/cashtrackeronline-com-beta-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turning a WordPress Blog into a Book: Part One</title>
		<link>http://www.geekscrapbook.com/2011/05/18/turning-a-wordpress-blog-into-a-book-part-one/</link>
		<comments>http://www.geekscrapbook.com/2011/05/18/turning-a-wordpress-blog-into-a-book-part-one/#comments</comments>
		<pubDate>Thu, 19 May 2011 03:09:54 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2011/05/18/turning-a-wordpress-blog-into-a-book-part-one/</guid>
		<description><![CDATA[Lately my lovely wife has been asking me to help her in the task of turning her blog (a WordPress installation like this one that I maintain for her) into a book. It’s a pretty daunting task, since her blog would easily surpass 1,000 pages if printed. After a few days of trying out different [...]]]></description>
			<content:encoded><![CDATA[<p>Lately my lovely wife has been asking me to help her in the task of turning her blog (a WordPress installation like this one that I maintain for her) into a book. It’s a pretty daunting task, since her blog would easily surpass 1,000 pages if printed. After a few days of trying out different services and trying a variety of search terms, I just couldn’t find a good match for her blog. </p>
<p>Most services that turn blogs into books either require you to use one of the big hosting sites (like yourblog.wordpress.com), and of those that will take a simple WordPress XML export, the only one I could find that could handle the enormous file was a site called <a href="http://www.fastpencil.com" target="_blank">FastPencil</a>. A problem that was universal, though, was finding a service that would import the file AND retain some semblance of layout in regard to pictures and text, block-quotes, centering, etc.</p>
<p>Then I discovered a project called <a href="http://xhtml-css.com/wptex/" target="_blank">WPTEX</a>. It is a collection of PHP scripts that asks a few questions and then converts (or, attempts to convert) a WordPress blog to LaTeX, which can in turn be converted to a PDF using PDFLaTeX. The only problem was WPTEX didn’t really do a graceful job with my wife’s blog, which is rich in pictures and special formatting.</p>
<p>By this time I had enough information to decide to forge out on my own. I started by writing some C# that would read a WordPress export file (quick and dirty-like) into some data structures. Then I went off looking for an HTML-to-LaTeX converter online. I discovered <a href="http://johnmacfarlane.net/pandoc/try" target="_blank">Pandoc</a>. After installing the Haskell-based markup converter, I started using it to convert my wife’s post titles and content to LaTeX. It was a brilliant success. I then wrote some code to recognize when it needed to download an image to include in the book and to strip out the obvious hyperlinks. Now we’re in the process of manually doing a lot of the centering and layout changes that were so cumbersome using those online services. To my surprise, LaTeX has been very easy to work with. In part two I’ll cover some of the (did I say dirty?) code that made it all come together.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2011/05/18/turning-a-wordpress-blog-into-a-book-part-one/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upcoming Launch: www.cashtrackeronline.com</title>
		<link>http://www.geekscrapbook.com/2011/05/18/upcoming-launch-www-cashtrackeronline-com/</link>
		<comments>http://www.geekscrapbook.com/2011/05/18/upcoming-launch-www-cashtrackeronline-com/#comments</comments>
		<pubDate>Thu, 19 May 2011 02:45:09 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker Online]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2011/05/18/upcoming-launch-www-cashtrackeronline-com/</guid>
		<description><![CDATA[The last 8 months have been pretty busy for me. I had the usual business of year-end (perks of running a tax-related product team) and then some. My energetic 2-year-old daughter is almost enough to keep me from posting at all, but I’m here now to announce (mostly to myself) that I’m back in the [...]]]></description>
			<content:encoded><![CDATA[<p>The last 8 months have been pretty busy for me. I had the usual business of year-end (perks of running a tax-related product team) and then some. My energetic 2-year-old daughter is almost enough to keep me from posting at all, but I’m here now to announce (mostly to myself) that I’m back in the hunt. I have scheduled the last steps to launching <a href="http://www.cashtrackeronline.com">www.cashtrackeronline.com</a> and hope to do so in the next month (pending a hosting upgrade among other things). </p>
<p>I don’t plan to advertise the project anywhere but here and perhaps on facebook to my friends, so chances are I’ll be the only user for quite some time while I work out the kinks in what I consider a limited but stable beta. And honestly, that is okay. I am producing the tool as a favor to myself alone, a selfish indulgence. If it becomes something people really <em>want</em>, then great. If not, my purposes are still served.</p>
<p>Anyway, here is the run-down (straight from my personal OneNote notebook!) of things that need to be done before launch:</p>
<ul>
<li>Get CTO up and running on <a href="http://www.cashtrackeronline.com">www.cashtrackeronline.com</a> via GoDaddy hosting and MS SQL database
<ul>
<li>Upgrade to Ultimate Hosting
<ul>
<li>Upgrade to 4GH to get SQL Server 08
<ul>
<li>Have to contact support (question sent in, awaiting a response) </li>
</ul>
</li>
</ul>
</li>
<li>Domain setup/assigned </li>
<li>SSL Certificate setup/assign </li>
<li>Project files uploaded </li>
<li>Database schema scripted w/ sample data </li>
<li>Third party binaries uploaded </li>
<li>Test and fix anything I missed </li>
</ul>
</li>
<li>Add a registration page (keeping it simple, just ask for username (e-mail), display name, and password for now) </li>
</ul>
<p>Once that is all worked out, I’ll focus on new functionality. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2011/05/18/upcoming-launch-www-cashtrackeronline-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CashTrackerOnline.com Sneak Peek</title>
		<link>http://www.geekscrapbook.com/2010/09/03/cashtrackeronline-com-sneak-peek/</link>
		<comments>http://www.geekscrapbook.com/2010/09/03/cashtrackeronline-com-sneak-peek/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 18:55:41 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker Online]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/09/03/cashtrackeronline-com-sneak-peek/</guid>
		<description><![CDATA[Here’s a preview of the account tracker I’m working on. I filled it with my own account data to make it look realistic (and because I’m migrating my own finances from the Windows app to the new framework), which is why most of the actual names and numbers are blurred out. Enjoy! &#160;]]></description>
			<content:encoded><![CDATA[<p>Here’s a preview of the account tracker I’m working on. I filled it with my own account data to make it look realistic (and because I’m migrating my own finances from the Windows app to the new framework), which is why most of the actual names and numbers are blurred out. Enjoy!</p>
<p>&#160;</p>
<p><a href="http://www.geekscrapbook.com/wp-content/uploads/2010/09/screenshot.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="screenshot" border="0" alt="screenshot" src="http://www.geekscrapbook.com/wp-content/uploads/2010/09/screenshot_thumb.png" width="768" height="870" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/09/03/cashtrackeronline-com-sneak-peek/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CashTrackerOnline.com Weekly Development Update &#8211; 9/2/2010</title>
		<link>http://www.geekscrapbook.com/2010/09/02/cashtrackeronline-com-weekly-development-update-922010/</link>
		<comments>http://www.geekscrapbook.com/2010/09/02/cashtrackeronline-com-weekly-development-update-922010/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 01:34:43 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker Online]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/09/02/cashtrackeronline-com-weekly-development-update-922010/</guid>
		<description><![CDATA[I’ve spent a lot of time working on CashTrackerOnline.com in the past few days, and the done list is starting to outnumber the to-do list. Newly-initiated members of the done list are: Logic for budget accuracy calculations (just a method right now, no actual implementation on the site yet) CRUD for recurrences (and a slick [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve spent a lot of time working on CashTrackerOnline.com in the past few days, and the done list is starting to outnumber the to-do list. Newly-initiated members of the done list are:</p>
<ol>
<li>Logic for budget accuracy calculations (just a method right now, no actual implementation on the site yet)</li>
<li>CRUD for recurrences (and a slick interface to boot—I’m really enjoying working with these DevExpress controls)</li>
<li>Account balance projection chart</li>
</ol>
<p>So, that leaves the following stragglers on my to-do list before the first release (likely to be labeled an alpha—not all features are there, not everything works):</p>
<ul>
<li>Actual implementation of the budget accuracy calculations (displayed as % error)</li>
<li>Logic/implementation for budget adjustment suggestions</li>
<li>CRUD for manual entry and adjustments</li>
<li>GUI work</li>
<li>Data export</li>
<li>Wizardry for new users to introduce them to key elements of the app</li>
</ul>
<p>I’m really excited about where things are going with this project, to the point that I don’t think the Windows version of this project is going to be able to keep up with all the great features. I’ll tune in again next Thursday at the latest for another update on this (probably sooner). I should have some real web hosting by then, so I’m pushing hard to get a release out in the next two weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/09/02/cashtrackeronline-com-weekly-development-update-922010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CashTrackerOnline.com Updates</title>
		<link>http://www.geekscrapbook.com/2010/08/31/cashtrackeronline-com-updates/</link>
		<comments>http://www.geekscrapbook.com/2010/08/31/cashtrackeronline-com-updates/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 05:02:12 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker Online]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/31/cashtrackeronline-com-updates/</guid>
		<description><![CDATA[I’ve been making some progress on the web project over the past few days. I’ve only got the steam for an hour or two each day, but since the last update I’ve accomplished a few things: Worked out web and data hosting (thanks boss). GoDaddy just doesn’t give me enough control over things to go [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been making some progress on the web project over the past few days. I’ve only got the steam for an hour or two each day, but since the last update I’ve accomplished a few things:</p>
<ol>
<li>Worked out web and data hosting (thanks boss). GoDaddy just doesn’t give me enough control over things to go that route with any real web applications (although they’re great at hosting this blog!)</li>
<li>Decided on some controls I’m licensed for through work. They aren’t free, but if you want to debug through any source code I make available you can install a trial. I decided quality was more important than making the code super easy to share in this case.</li>
<li>CRUD finished for accounts.</li>
<li>Some back-end work done on recurrences/transactions.</li>
<li>Balance calculations are working.</li>
</ol>
<p>Immediately next on my list are:</p>
<ul>
<li>Logic for budget accuracy calculations (this one’s a new idea)</li>
<li>Logic for budget adjustment suggestions (based on the accuracy calculations, also a new idea)</li>
<li>CRUD for recurrences/manual entry/adjustments.</li>
<li>Account balance projection chart</li>
<li>More time spent on GUI design</li>
<li>Data export functionality</li>
<li>Process to drive new users to the most useful functionality right away so they see the real benefits over time (following the visualize, control, predict pattern):</li>
<ul>
<li>Set up an account with recurrences to visualize the current state of the account</li>
<li>Use transactional adjustments to correct the budget with actual figures</li>
<li>Modify budget (recurrences) based on suggestions (control)</li>
<li>Using an established budget and calculations based on the average error margin, allow the website to predict the most accurate balance curve possible over the next year</li>
</ul>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/31/cashtrackeronline-com-updates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CashTrackerOnline.com Weekly Development Summary</title>
		<link>http://www.geekscrapbook.com/2010/08/26/cashtrackeronline-com-weekly-development-summary/</link>
		<comments>http://www.geekscrapbook.com/2010/08/26/cashtrackeronline-com-weekly-development-summary/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 17:36:23 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Cash Tracker Online]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/26/cashtrackeronline-com-weekly-development-summary/</guid>
		<description><![CDATA[This will be the first of a series of weekly updates about the Cash Tracker Online project. I’m happy with the progress I have made so far. I have a lot of the groundwork laid, but it will still be a few weeks before the initial version is ready to be published. Here’s the summary… [...]]]></description>
			<content:encoded><![CDATA[<p>This will be the first of a series of weekly updates about the Cash Tracker Online project.</p>
<p>I’m happy with the progress I have made so far. I have a lot of the groundwork laid, but it will still be a few weeks before the initial version is ready to be published. Here’s the summary…</p>
<p><strong>Finished Work</strong></p>
<ol>
<li>Domain purchased </li>
<li>Database Schema tentatively complete </li>
<li>Website project created </li>
<li>Simple Logo produced </li>
<li>Default / login screen working </li>
<li>Error handling in place, notifications of problems being routed correctly </li>
<li>Maintenance mode working </li>
<li>Dashboard “shell” built </li>
<li>Accounts summary pane on dashboard finished </li>
</ol>
<p><strong>Needed Before Release</strong></p>
<ol>
<li>A place to host the website and database (being worked out, should have this soon) </li>
<li>Make a decision on whether to use some third party controls and which ones </li>
<li>CRUD (Create, Read, Update, &amp; Delete) for:
<ul>
<li>Accounts </li>
<li>Recurrences </li>
<li>Manual Entry </li>
<li>Recurrence adjustments </li>
</ul>
</li>
<li>Balance calculations </li>
<li>Account projections </li>
<li>Graphical visuals </li>
<li>Data export </li>
</ol>
<p> <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="LogoSmall" border="0" alt="LogoSmall" src="http://www.geekscrapbook.com/wp-content/uploads/2010/08/LogoSmall_thumb.png" width="240" height="64" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/26/cashtrackeronline-com-weekly-development-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CashTrackerOnline.com Domain Purchased</title>
		<link>http://www.geekscrapbook.com/2010/08/23/cashtrackeronline-com-domain-purchased/</link>
		<comments>http://www.geekscrapbook.com/2010/08/23/cashtrackeronline-com-domain-purchased/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 01:14:48 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Cash Tracker Online]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/23/cashtrackeronline-com-domain-purchased/</guid>
		<description><![CDATA[I’ve decided to go ahead with the online version of Cash Tracker. I purchased and parked the domain on my personal hosting account today. You can view the “coming soon” splash page here. I’ve also decided to convert Cash Tracker to a web project before implementing any of the new features. I think the development [...]]]></description>
			<content:encoded><![CDATA[<p> I’ve decided to go ahead with the online version of <a href="http://www.geekscrapbook.com/cash-tracker" target="_blank">Cash Tracker</a>. I purchased and parked the domain on my personal hosting account today. You can view the “coming soon” splash page <a href="http://www.cashtrackeronline.com" target="_blank">here</a>. I’ve also decided to convert Cash Tracker to a web project before implementing any of the new features. I think the development will be much faster-paced because programming for the web is my strong suit. Also, the tool will be much more accessible on the web, and version control will be much easier to implement (no more converting .tfx files to a new version because of a schema change). </p>
<p>I already have the database all laid out on paper, and I will make database diagrams and code samples available as I finish them. At some point I may be forced to stop posting source code for the sake of security, but until I start collecting sensitive data (right now the data I track can’t be tied to anyone or any actual accounts), I will continue to post code here.</p>
<p>  <img title="CTComingSoon" border="0" alt="CTComingSoon" src="http://www.geekscrapbook.com/wp-content/uploads/2010/08/CTComingSoon_thumb.jpg" width="1000" height="465" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/23/cashtrackeronline-com-domain-purchased/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen Tracker Upgrade Available</title>
		<link>http://www.geekscrapbook.com/2010/08/19/screen-tracker-upgrade-available/</link>
		<comments>http://www.geekscrapbook.com/2010/08/19/screen-tracker-upgrade-available/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 18:37:26 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Code Release]]></category>
		<category><![CDATA[Screen Tracker]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/19/screen-tracker-upgrade-available/</guid>
		<description><![CDATA[I have just released a Screen Tracker update. I’ll get the source code uploaded at some point. In the mean-time, here is the new feature list: Improved interface: Allows you to select the recording area from a list of pre-defined options Allows you to move the window around to “frame” your recording area The window [...]]]></description>
			<content:encoded><![CDATA[<p>I have just released a Screen Tracker update. I’ll get the source code uploaded at some point. In the mean-time, here is the new feature list:</p>
<ul>
<li>Improved interface:
<ul>
<li>Allows you to select the recording area from a list of pre-defined options </li>
<li>Allows you to move the window around to “frame” your recording area </li>
<li>The window containing the recording area stays on top, so you always know what you’re recording </li>
</ul>
</li>
<li>AVI files are now compressed using the WM3 video codec, resulting in far smaller file size </li>
<li>Frame rate is now throttled at 25 frames-per-second, resulting in somewhat-smaller file size </li>
<li>Ability to overwrite files when saving. </li>
<li>Progress bar shows save progress while exporting the AVI file. </li>
</ul>
<p>If you already have Screen Tracker, you should get the update the next time you use it. If you don’t have it yet, just click the Screen Tracker link under “Downloads” or go to the <a href="http://www.geekscrapbook.com/screen-tracker" target="_blank">Screen Tracker</a> page to install the latest release.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/19/screen-tracker-upgrade-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Screen Tracker Download Available</title>
		<link>http://www.geekscrapbook.com/2010/08/16/screen-tracker-download-available/</link>
		<comments>http://www.geekscrapbook.com/2010/08/16/screen-tracker-download-available/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 02:12:18 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Code Release]]></category>
		<category><![CDATA[Screen Tracker]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/16/screen-tracker-download-available/</guid>
		<description><![CDATA[The Screen Tracker tool is now available. View the Screen Tracker page for details. There’s also a new download link for it on the menu to the right. Screen Tracker is still very rough around the edges. Immediate improvements to be made are: Progress bar when saving the .avi file (a piece of cake, but [...]]]></description>
			<content:encoded><![CDATA[<p>The Screen Tracker tool is now available. View the <a href="http://www.geekscrapbook.com/screen-tracker" target="_blank">Screen Tracker</a> page for details. There’s also a new download link for it on the menu to the right. Screen Tracker is still very rough around the edges. Immediate improvements to be made are:</p>
<ol>
<li>Progress bar when saving the .avi file (a piece of cake, but time-consuming to implement)</li>
<li>Use a compressed format (the current file-sizes are enormous!)</li>
<li>A resizable “recording area” instead of the X, Y, Height, and Width boxes.</li>
<li>A “quality” radio button that increases performance at the expense of frame-rate (and maybe even the image quality)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/16/screen-tracker-download-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cash Tracker 0.9 (beta) Now Available for Download</title>
		<link>http://www.geekscrapbook.com/2010/08/16/cash-tracker-0-9-beta-now-available-for-download/</link>
		<comments>http://www.geekscrapbook.com/2010/08/16/cash-tracker-0-9-beta-now-available-for-download/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 00:30:05 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker]]></category>
		<category><![CDATA[Code Release]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/16/cash-tracker-0-9-beta-now-available-for-download/</guid>
		<description><![CDATA[After several months of testing/tweaking, I have released a beta version of Cash Tracker. I believe it to be a stable product at this point that is simply lacking in some extra features. You can go to the Cash Tracker page to download and install using Click-Once. I have also made the latest source code [...]]]></description>
			<content:encoded><![CDATA[<p>After several months of testing/tweaking, I have released a beta version of Cash Tracker. I believe it to be a stable product at this point that is simply lacking in some extra features. You can go to the <a href="http://www.geekscrapbook.com/cash-tracker" target="_blank">Cash Tracker</a> page to download and install using Click-Once. I have also made the latest source code available on that page. Feel free to leave comments with any feature requests.</p>
<p><strong>The Roadmap      <br /></strong>I believe I am the only person who uses Cash Tracker on a consistent basis, but I’ve found the application so useful that I’m going to plow ahead until I’m satisfied. So, for the Cash Tracker 1.0 release I plan to unveil some big new features. Plus, I’ve determined to create an online version of the tool. Here are the steps needed to proceed to that point:</p>
<ol>
<li>Add most or all of the features on the upcoming features list </li>
<li>Acquire a catchy web domain name and SSL certificate </li>
<li>Possibly re-brand Cash Tracker under a different name for the web (i.e. whatever catchy domain name I find) </li>
<li>Port the Windows project to a data-driven website project using ASP.NET and SQL Server technologies</li>
</ol>
<p><strong>Contributions</strong>     <br />If you’d like to contribute to the project, just <a href="mailto:dave@geekscrapbook.com" target="_blank">drop me an email</a>; I’ll be happy to set up a source control server. The project doesn’t really need funding beyond a web domain and SSL certificate purchase, but an extra pair of coding hands would definitely accelerate the release timeline.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/16/cash-tracker-0-9-beta-now-available-for-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coming Soon! Screen Tracker: A Video Screen Capture Tool Built Using C# and .NET</title>
		<link>http://www.geekscrapbook.com/2010/08/16/coming-soon-screen-tracker-a-video-screen-capture-tool-built-using-c-and-net/</link>
		<comments>http://www.geekscrapbook.com/2010/08/16/coming-soon-screen-tracker-a-video-screen-capture-tool-built-using-c-and-net/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 20:09:19 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker]]></category>
		<category><![CDATA[Screen Tracker]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/16/coming-soon-screen-tracker-a-video-screen-capture-tool-built-using-c-and-net/</guid>
		<description><![CDATA[It’s been a while since I worked on anything I’d consider “hobby code” on my own time. Recently, I had an idea for a utility that will require me to produce a library that will record video capture from the screen. I won’t say what it is, because if I can pull it off I [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been a while since I worked on anything I’d consider “hobby code” on my own time. Recently, I had an idea for a utility that will require me to produce a library that will record video capture from the screen. I won’t say what it is, because if I can pull it off I will probably be visiting a patent office first. However, as I learn more about video capture (and audio capture as well), I will package up what I’ve produced into utilities that may be useful for someone else.</p>
<p><strong>So what goodies do you have for us?      <br /></strong>The tool I will post (most likely tonight or tomorrow, under the name Screen Tracker) will do the following:</p>
<ol>
<li>Record frames from the screen or a portion of the screen to a working directory. </li>
<li>Compile the frames into an AVI formatted video file. </li>
</ol>
<p>And my upcoming feature wish-list:</p>
<ol>
<li>Audio recording (either through the computer itself or via a microphone, maybe both) </li>
<li>The ability to add an .mp3 or .wav audio track </li>
</ol>
<p>Audio/video is not a world I am well-versed in, so don’t hold your breath on the wish-list <img src='http://www.geekscrapbook.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Just hope my great idea motivates me to make useful tools for you.</p>
<p><strong>Cash Tracker going Beta      <br /></strong>I’ve been using my latest version of <a href="http://www.geekscrapbook.com/cash-tracker">Cash Tracker</a> for a while, now, and it’s been working beautifully for me. I will probably post the most recent code and installer tonight or tomorrow as well. It’s ready for beta status, so I’ll update that designation as well (and maybe someone else will actually start using it!).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/16/coming-soon-screen-tracker-a-video-screen-capture-tool-built-using-c-and-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connection Timeout Using LINQ DataContext</title>
		<link>http://www.geekscrapbook.com/2010/08/13/connection-timeout-using-linq-datacontext/</link>
		<comments>http://www.geekscrapbook.com/2010/08/13/connection-timeout-using-linq-datacontext/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 16:23:48 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[LINQ]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/08/13/connection-timeout-using-linq-datacontext/</guid>
		<description><![CDATA[For a while now, I’ve had a website that was sporadically encountering the following error: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. My Research On the website in question, I use [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now, I’ve had a website that was sporadically encountering the following error:</p>
<blockquote><p>Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.</p>
</blockquote>
<p><strong>My Research      <br /></strong>On the website in question, I use LINQ-to-SQL heavily to perform data operations. Naturally, I suspected that I wasn’t disposing of my DataContext objects correctly, causing me to exceed the number of connections available in the pool. After doing a little research on the subject, I read in several articles (some by folks who are much more knowledgeable than myself) that I shouldn’t have to dispose of them. They all said the following code is just fine:</p>
<blockquote><pre class="code"><span style="color: #2b91af">CORDataContext </span>mcon = <span style="color: blue">new </span><span style="color: #2b91af">CORDataContext</span>();
<span style="color: #2b91af">COR_Employee </span>emp = mcon.COR_Employees.FirstOrDefault();</pre>
</blockquote>
<p>In fact, I should be able to put that into an infinite loop and never get the exception I was encountering. According to the experts, LINQ is not only smart enough to automatically open and close the connection for me, but also smart enough to dispose of the object when I’m done. No need for a “using” around my code or even a Connection.Close().</p>
<p><strong>An Exception to the Rule</strong></p>
<p>I noticed, though, that my code was slightly different. In my specific setup, I have a central database and a LOT of other databases I might want to connect to. So, to take advantage of connection pooling more, I always connect to the central database first and change to whatever catalog I need to access. In doing so, it is necessary to manually open the connection, like the following:</p>
<blockquote>
<pre class="code"><span style="color: #2b91af">CORDataContext </span>mcon = <span style="color: blue">new </span><span style="color: #2b91af">CORDataContext</span>();mcon.Connection.Open(); mcon.Connection.ChangeDatabase(<span style="color: #a31515">&quot;OtherDB&quot;</span>);
<span style="color: #2b91af">COR_Employee </span>emp = mcon.COR_Employees.FirstOrDefault();</pre>
</blockquote>
<p><strong>My Testing</p>
<p></strong>I began to theorize that manually opening the connection in this way <strong>keeps the connection alive</strong> after I’ve run my query. I confirmed the belief by trying to run the following code:</p>
<blockquote>
<pre class="code"><span style="color: blue">for </span>(<span style="color: blue">int </span>i = 0; i &lt; 1000; i++) {

    <span style="color: #2b91af">CORDataContext </span>mcon = <span style="color: blue">new </span><span style="color: #2b91af">CORDataContext</span>();
    <span style="color: #2b91af">COR_Employee </span>emp = mcon.COR_Employees.FirstOrDefault();
    mcon.Connection.Open();
    mcon.Connection.ChangeDatabase(<span style="color: #a31515">&quot;OtherDB&quot;</span>);

    <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&quot;&quot; </span>+ (i + 1) + <span style="color: #a31515">&quot; / 1000&quot;</span>);
}</pre>
</blockquote>
<p>I got the exception after 230 or so connections. By default there are 100 connections available in the pool, but the garbage collector kicked in and helped give me a buffer before I ran out. So, from that I can conclude that manually opened DataContext connections will stay open until the connection is closed or the DataContext is disposed.</p>
<p><strong>The Solution</strong></p>
<p>Once I fully understood the problem, the fix was common sense:</p>
<blockquote>
<pre class="code"><span style="color: blue">for </span>(<span style="color: blue">int </span>i = 0; i &lt; 1000; i++) {

    <span style="color: blue">using </span>(<span style="color: #2b91af">CORDataContext </span>mcon = <span style="color: blue">new </span><span style="color: #2b91af">CORDataContext</span>()) {
        <span style="color: #2b91af">COR_Employee </span>emp = mcon.COR_Employees.FirstOrDefault();
        mcon.Connection.Open();
        mcon.Connection.ChangeDatabase(<span style="color: #a31515">&quot;OtherDB&quot;</span>);

        <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&quot;&quot; </span>+ (i + 1) + <span style="color: #a31515">&quot; / 1000&quot;</span>);
    }
}</pre>
</blockquote>
<p>Adding a “using” to automatically dispose of my DataContext did the trick, and this loop now finishes in about 3 seconds (even with the overhead of writing to the console). I hope this helps someone else, because it’s been plaguing me for weeks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/08/13/connection-timeout-using-linq-datacontext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seeing the Big Picture While Getting Caught Up in the Details</title>
		<link>http://www.geekscrapbook.com/2010/03/07/seeing-the-big-picture-while-getting-caught-up-in-the-details/</link>
		<comments>http://www.geekscrapbook.com/2010/03/07/seeing-the-big-picture-while-getting-caught-up-in-the-details/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 01:43:05 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/03/07/seeing-the-big-picture-while-getting-caught-up-in-the-details/</guid>
		<description><![CDATA[I’ve always wanted to know how things work. By the time I learned to talk I was asking my mother things she couldn’t answer: Me: “How does the car go?” Mom: “I press the gas pedal and it goes.” Me: “What does the gas pedal do that makes the car go?” Mom: “I don’t know, [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve always wanted to know how things work. By the time I learned to talk I was asking my mother things she couldn’t answer:</p>
<blockquote><p>Me: “How does the car go?”</p>
<p>Mom: “I press the gas pedal and it goes.”</p>
<p>Me: “What does the gas pedal do that makes the car go?”</p>
<p>Mom: “I don’t know, ask your father.”</p>
</blockquote>
<p>I probably had 5-10 conversations like that per day from the age of 3 until the age of 12. I was (and always have been) thinking about <strong>the details</strong>.</p>
<p>I define <strong>seeing the details</strong> as being able to look at something and dissect it into its smallest parts. This is a valuable skill for any programmer, and, I believe is what separates people who should learn to code from those who might be better off avoiding it. I had far too many classmates who were in it for the money, but had no passion or thirst for understanding. That drive is a key determining factor about someone’s future in software development. Seeing the details in my job means being able to mentally translate an assignment into code, including all the edge-conditions, so I can accurately estimate how long a project will need for completion. Seeing the details means being able to predict potential problems in January while the team is planning instead of getting caught off guard in June while we’re coding. It even means not writing the bugs other developers might. Yes, seeing the details is a valuable skill in software development, and I don’t see that changing anytime soon.</p>
<p>I never was a big picture kind of person growing up. I made passable grades on my papers in school because I could make really wonderful points, but I had trouble making everything from the first sentence to the last cohesive. Instead, my papers ended up often containing a few somewhat related ideas with an underwhelming effort to tie them together. As it turns out, while seeing the details is an important skill in software development, the converse is equally true; being able to let go of fine details and see <strong>the big picture</strong> is necessary for anyone who is more than just a code-monkey.</p>
<p>I define <strong>seeing the big picture</strong> as being able to look at something and understand not just how it <strong><em>can or does</em></strong> work, but how it <strong><em>could and should</em></strong> work. Seeing the big picture also means being able to look at something and understand how it should coexist and cooperate with other things. This is a valuable skill for anyone who wants to be more than a programmer. It separates people who should get a coding job and just take their annual pay increase from those who should attempt to scale the ladder.</p>
<p>I really believe that to be a truly successful leader in software development both of these skills are a must. One or the other just won’t do. Those who can only see the big picture can be great managers of small or open-ended projects, but without being able to see the details a project manager must rely on his developers to understand what a project will cost. Alternatively, those who can’t see past the details are wonderful programmers, but without seeing the big picture a developer must rely on his manager for direction. In my opinion, someone who has both skills can be a great leader and an invaluable asset, adding efficiency to an entire department.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/03/07/seeing-the-big-picture-while-getting-caught-up-in-the-details/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serializing Data with System.Runtime.Serialization.DataContractSerializer</title>
		<link>http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-runtime-serialization-datacontractserializer/</link>
		<comments>http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-runtime-serialization-datacontractserializer/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 15:16:57 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker]]></category>
		<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-runtime-serialization-datacontractserializer/</guid>
		<description><![CDATA[Last time we discussed Serializing Data with System.Xml.Serialization.XmlSerializer. We will be using the same sample solution for this article. With .Net 3.5, Microsoft released the DataContractSerializer. It has a variety of uses, but at the very least it’s an improvement over the XmlSerializer. In Cash Tracker we started out by using the XmlSerializer to save [...]]]></description>
			<content:encoded><![CDATA[<p>Last time we discussed <a href="http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-xml-serialization-xmlserializer/" target="_blank">Serializing Data with System.Xml.Serialization.XmlSerializer</a>. We will be using the same sample solution for this article.</p>
<p>With .Net 3.5, Microsoft released the DataContractSerializer. It has a variety of uses, but at the very least it’s an improvement over the XmlSerializer. In <a href="http://www.geekscrapbook.com/cash-tracker" target="_blank">Cash Tracker</a> we started out by using the XmlSerializer to save files, but quickly found it inadequate, the reason being XmlSerializer does not play well with <strong>mixed access properties</strong>. </p>
<p>For an example, let’s look again at our Person class:</p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">Person </span>{
    <span style="color: blue">public string </span>FirstName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">public string </span>LastName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">public string </span>Initials { <span style="color: blue">get</span>; <span style="color: blue">private set</span>; }

    <span style="color: blue">private </span>Person() {
    }
    <span style="color: blue">public </span>Person(<span style="color: blue">string </span>first, <span style="color: blue">string </span>last) {
        <span style="color: blue">this</span>.FirstName = first;
        <span style="color: blue">this</span>.LastName = last;

        <span style="color: blue">this</span>.Initials = <span style="color: #2b91af">String</span>.Format(<span style="color: #a31515">&quot;{0}.{1}.&quot;</span>, FirstName[0], LastName[0]);
    }
}</pre>
<pre class="code"><font face="Tahoma">Notice I’ve added a new property with a private mutator. Also, I added a constructor to take advantage of the new property and made my default constructor private. Now when we try to serialize using the XmlSerializer we get an error:</font></pre>
<blockquote>
<p>Unable to generate a temporary class (result=1).<br />
    <br />error CS0200: Property or indexer &#8216;Person.Initials&#8217; cannot be assigned to &#8212; it is read only</p>
</blockquote>
<p><strong>What to do?</strong></p>
<p>In .Net 3.5, to get around this problem, <a href="http://connect.microsoft.com/VisualStudio/feedback/details/96882/xmlserializer-does-not-handle-properties-with-mixed-access-modifiers" target="_blank">Microsoft suggests using the DataContractSerializer</a>, so we will investigate switching to the new technology here. First, we need a reference to System.Runtime.Serialization:</p>
<p><a href="http://www.geekscrapbook.com/wp-content/uploads/2010/03/image2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.geekscrapbook.com/wp-content/uploads/2010/03/image_thumb2.png" width="400" height="451" /></a> </p>
<p>Once that’s done it’s actually pretty simply converting our old code. The new code looks like this:</p>
<pre class="code"><span style="color: blue">static void </span>XmlSerializePerson(<span style="color: #2b91af">Person </span>myPerson, <span style="color: blue">string </span>fileName) {
    <span style="color: #2b91af">DataContractSerializer </span>xs = <span style="color: blue">new </span><span style="color: #2b91af">DataContractSerializer</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">Person</span>));

    <span style="color: blue">using </span>(<span style="color: #2b91af">FileStream </span>fs = <span style="color: blue">new </span><span style="color: #2b91af">FileStream</span>(fileName, <span style="color: #2b91af">FileMode</span>.Create, <span style="color: #2b91af">FileAccess</span>.Write)) {
        xs.WriteObject(fs, myPerson);
    }
}

<span style="color: blue">static </span><span style="color: #2b91af">Person </span>XmlDeserializePerson(<span style="color: blue">string </span>fileName) {
    <span style="color: #2b91af">DataContractSerializer </span>xs = <span style="color: blue">new </span><span style="color: #2b91af">DataContractSerializer</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">Person</span>));

    <span style="color: blue">using </span>(<span style="color: #2b91af">FileStream </span>fs = <span style="color: blue">new </span><span style="color: #2b91af">FileStream</span>(fileName, <span style="color: #2b91af">FileMode</span>.Open, <span style="color: #2b91af">FileAccess</span>.Read)) {
        <span style="color: blue">return </span>(<span style="color: #2b91af">Person</span>)xs.ReadObject(fs);
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>Notice we simply re-used the old methods, changing the object and methods used to serialize our Person. Our code will now execute as expected:</p>
<p><a href="http://www.geekscrapbook.com/wp-content/uploads/2010/03/image3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.geekscrapbook.com/wp-content/uploads/2010/03/image_thumb3.png" width="400" height="269" /></a> </p>
<p><strong>Download the Solution</strong></p>
<p><strong></strong></p>
<p>You can download a zip file of the solution by clicking the link below.</p>
<p><a href="http://www.geekscrapbook.com/wp-content/uploads/2010/03/DataContractSerializerDemo.zip" target="_blank">DataContractSerializerDemo.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-runtime-serialization-datacontractserializer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serializing Data with System.Xml.Serialization.XmlSerializer</title>
		<link>http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-xml-serialization-xmlserializer/</link>
		<comments>http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-xml-serialization-xmlserializer/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 14:55:42 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Code Samples]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-xml-serialization-xmlserializer/</guid>
		<description><![CDATA[Serializing objects is often a useful way to save the state of an application. Let’s take a look at doing this using the XmlSerializer object. Class: Person Below is a simple class Person. My person has a name and an age: public class Person { public string FirstName { get; set; } public string LastName [...]]]></description>
			<content:encoded><![CDATA[<p>Serializing objects is often a useful way to save the state of an application. Let’s take a look at doing this using the XmlSerializer object.</p>
<p><strong>Class: Person</strong></p>
<p>Below is a simple class Person. My person has a name and an age:</p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">Person </span>{
    <span style="color: blue">public string </span>FirstName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }
    <span style="color: blue">public string </span>LastName { <span style="color: blue">get</span>; <span style="color: blue">set</span>; }

    <span style="color: blue">public </span>Person() {
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p>The XmlSerializer requires that I leave an empty constructor in my class. I can make the constructor private if I don’t want it used for other things. Now, let’s create an instance of a Person.</p>
<pre class="code"><span style="color: blue">class </span><span style="color: #2b91af">Program </span>{
    <span style="color: blue">static void </span>Main(<span style="color: blue">string</span>[] args) {
        <span style="color: #2b91af">Person </span>myPerson = <span style="color: blue">new </span><span style="color: #2b91af">Person</span>();
        myPerson.FirstName = <span style="color: #a31515">&quot;John&quot;</span>;
        myPerson.LastName = <span style="color: #a31515">&quot;Smith&quot;</span>;
    }
}</pre>
<p><strong>How to serialize our class</strong></p>
<p>I will add a couple methods now to handle serializating and deserializing myPerson.</p>
<pre class="code"><span style="color: blue">static void </span>XmlSerializePerson(<span style="color: #2b91af">Person </span>myPerson, <span style="color: blue">string </span>fileName) {
    <span style="color: #2b91af">XmlSerializer </span>xs = <span style="color: blue">new </span><span style="color: #2b91af">XmlSerializer</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">Person</span>));

    <span style="color: blue">using </span>(<span style="color: #2b91af">FileStream </span>fs = <span style="color: blue">new </span><span style="color: #2b91af">FileStream</span>(fileName, <span style="color: #2b91af">FileMode</span>.Create, <span style="color: #2b91af">FileAccess</span>.Write)) {
        xs.Serialize(fs, myPerson);
    }
}

<span style="color: blue">static </span><span style="color: #2b91af">Person </span>XmlDeserializePerson(<span style="color: blue">string </span>fileName) {
    <span style="color: #2b91af">XmlSerializer </span>xs = <span style="color: blue">new </span><span style="color: #2b91af">XmlSerializer</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">Person</span>));

    <span style="color: blue">using </span>(<span style="color: #2b91af">FileStream </span>fs = <span style="color: blue">new </span><span style="color: #2b91af">FileStream</span>(fileName, <span style="color: #2b91af">FileMode</span>.Open, <span style="color: #2b91af">FileAccess</span>.Read)) {
        <span style="color: blue">return </span>(<span style="color: #2b91af">Person</span>)xs.Deserialize(fs);
    }
}</pre>
<p><strong>Code in action</strong></p>
<p>Now, saving myPerson is simple:</p>
<pre class="code"><span style="color: blue">static void </span>Main(<span style="color: blue">string</span>[] args) {
    <span style="color: #2b91af">Person </span>myPerson = <span style="color: blue">new </span><span style="color: #2b91af">Person</span>();
    myPerson.FirstName = <span style="color: #a31515">&quot;John&quot;</span>;
    myPerson.LastName = <span style="color: #a31515">&quot;Smith&quot;</span>;

    XmlSerializePerson(myPerson, <span style="color: #a31515">@&quot;C:\MyPerson.xml&quot;</span>);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>Let’s take a look at the resulting XML:</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot;<span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Person </span><span style="color: red">xmlns:xsi</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://www.w3.org/2001/XMLSchema-instance</span>&quot; <span style="color: red">xmlns:xsd</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://www.w3.org/2001/XMLSchema</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">FirstName</span><span style="color: blue">&gt;</span>John<span style="color: blue">&lt;/</span><span style="color: #a31515">FirstName</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">LastName</span><span style="color: blue">&gt;</span>Smith<span style="color: blue">&lt;/</span><span style="color: #a31515">LastName</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Person</span><span style="color: blue">&gt;</span></pre>
<p>Now, let’s deserialize our person and display its data:</p>
<pre class="code"><span style="color: blue">static void </span>Main(<span style="color: blue">string</span>[] args) {
    <span style="color: #2b91af">Person </span>myPerson = XmlDeserializePerson(<span style="color: #a31515">@&quot;C:\MyPerson.xml&quot;</span>);

    <span style="color: #2b91af">Console</span>.WriteLine(<span style="color: #a31515">&quot;Name: &quot; </span>+ myPerson.LastName + <span style="color: #a31515">&quot;, &quot; </span>+ myPerson.FirstName);
    <span style="color: #2b91af">Console</span>.ReadLine();
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>The result:</p>
<p><a href="http://www.geekscrapbook.com/wp-content/uploads/2010/03/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.geekscrapbook.com/wp-content/uploads/2010/03/image_thumb1.png" width="400" height="269" /></a> </p>
<p>As you can see, the XmlSerializer did its job.</p>
<p><strong>Download the Solution</strong></p>
<p>You can download a zip file of the solution by clicking the link below.</p>
<p><a href="http://www.geekscrapbook.com/wp-content/uploads/2010/03/XmlSerializerDemo.zip" target="_blank">XmlSerializerDemo.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/03/06/serializing-data-with-system-xml-serialization-xmlserializer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cash Tracker (pre-alpha) Now Available for Download</title>
		<link>http://www.geekscrapbook.com/2010/03/05/cash-tracker-alpha-now-available-for-download/</link>
		<comments>http://www.geekscrapbook.com/2010/03/05/cash-tracker-alpha-now-available-for-download/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 03:38:15 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker]]></category>
		<category><![CDATA[Code Release]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/03/05/cash-tracker-alpha-now-available-for-download/</guid>
		<description><![CDATA[I’m happy to announce there’s now a somewhat usable version of Cash Tracker available for download. Click here to get it! It’s really rough; I’m giving it a version of 0.7. I don’t have any error handling in place, so if you put the wrong values into the tracker it will probably scream at you [...]]]></description>
			<content:encoded><![CDATA[<p>I’m happy to announce there’s now a somewhat usable version of Cash Tracker available for download. <strong><a href="http://www.geekscrapbook.com/cashtrackerinstall/publish.htm" target="_blank">Click here to get it!</a></strong></p>
<p>It’s really rough; I’m giving it a version of 0.7. I don’t have any error handling in place, so if you put the wrong values into the tracker it will probably scream at you and then die. If you’re not a geek you probably want to wait at least until version 0.9 gets released. Until then, I’m probably not going to settle on a reliable file type, so .tfx files saved before 0.9 probably won’t be compatible with later versions.</p>
<p>For a current list of features, check the Cash Tracker’s <a href="http://www.geekscrapbook.com/cash-tracker" target="_blank">main page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/03/05/cash-tracker-alpha-now-available-for-download/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing Cash Tracker</title>
		<link>http://www.geekscrapbook.com/2010/03/05/announcing-cash-tracker/</link>
		<comments>http://www.geekscrapbook.com/2010/03/05/announcing-cash-tracker/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 04:13:14 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Cash Tracker]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/03/05/announcing-cash-tracker/</guid>
		<description><![CDATA[I’ve undertaken a personal project in my spare time. It’s a personal finance application I’m calling Cash Tracker. You can read the technical details on the Cash Tracker page. The idea for Cash Tracker came to me when I was trying to find an easy way track my own finances. I wanted something I could [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve undertaken a personal project in my spare time. It’s a personal finance application I’m calling <strong>Cash Tracker</strong>. You can read the technical details on the <a href="http://www.geekscrapbook.com/cash-tracker/" target="_blank">Cash Tracker page</a>.</p>
<p>The idea for Cash Tracker came to me when I was trying to find an easy way track my own finances. I wanted something I could put my income and bills into and get a simple projection of my account balance throughout the year. Then, if I didn’t mind making adjustments later to reconcile (thus improving the projections as time goes by), I wanted to be able to enter a manual transaction here and there, too. But my main focus was <strong>keeping it simple</strong>. So, I wrote a very simple program that reads in a set of recurrences (bills, income) and transactions (non-recurring expenses or adjustments to bills/income). Then, it displays a set of numbers that are designed to help give me peace of mind about the future, like my project low and high balances for the year. To help me reconcile with my balance at the bank as the year goes on, I had the program output a running total I could open in Excel and compare with the bank.</p>
<p>Right now, that’s pretty much all the Cash Tracker does. <strong>It’s ugly</strong>, but it works as well as I need it to and keeps me from worrying about my finances. The project I’m undertaking is to bring Cash Tracker from “personal helper” to “helper to a lot of people” by making it easier for people to use who can’t write code or format a flat file correctly; people who don’t know what a CSV file is or what XML looks like. And, of course, I want to bring the Cash Tracker to other people like me who just don’t want to waste time on a “big” personal finance application, but still want to feel secure financially and have some numbers to support themselves with. I’m doing this solely because my Cash Tracker has helped me organize my own finances <strong>so much </strong>over the past 3 months.</p>
<p>I think Cash Tracker will appeal to many people because it makes maintaining finances so painless. Now that I have all my income and expenses into the program, it takes me just a few minutes every week or two to make the current projected balance line up with my actual balance. That includes the time I spend editing <strong>ugly, tab-delimited files</strong>. I am sure I can speed up the process even more.</p>
<p>So, the goal right now is to get the Cash Tracker into a form that other people can actually use. Eventually, I’d like to get it to “auto-magical” status, which would look something like this:</p>
<ol>
<li>Select your financial institution </li>
<li>Enter your login credentials </li>
<li>Hit “Track It!” </li>
<li>&lt;magic&gt; </li>
<li>View a list of your regular expenses and income, your projected high and low balances this year, your projected balance for any date in the future, etc. </li>
</ol>
<p>We’re talking <strong>zero maintenance</strong>. I believe we can get there, but we’re going to take baby steps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/03/05/announcing-cash-tracker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IHttpHandler and IRequiresSessionState</title>
		<link>http://www.geekscrapbook.com/2010/03/04/ihttphandler-and-irequiressessionstate/</link>
		<comments>http://www.geekscrapbook.com/2010/03/04/ihttphandler-and-irequiressessionstate/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 01:25:35 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.geekscrapbook.com/2010/03/04/ihttphandler-and-irequiressessionstate/</guid>
		<description><![CDATA[If your web application relies on session to persist the user’s state and you’ve ever tried writing your own HTTP handler, you’ve probably run into an error: “Session state is not available in this context”. Thankfully, there is a simple remedy. In your class definition you need to implement the interface System.Web.SessionState.IRequiresSessionState. Once you’ve done [...]]]></description>
			<content:encoded><![CDATA[<p>If your web application relies on session to persist the user’s state and you’ve ever tried writing your own HTTP handler, you’ve probably run into an error: “Session state is not available in this context”. Thankfully, there is a simple remedy. </p>
<p>In your class definition you need to implement the interface <a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.irequiressessionstate.aspx" target="_blank">System.Web.SessionState.IRequiresSessionState</a>. Once you’ve done that you’ll find yourself magically able to use session once more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geekscrapbook.com/2010/03/04/ihttphandler-and-irequiressessionstate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

