<?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>All Things IT Blog &#187; C# Programming</title>
	<atom:link href="http://www.enusbaum.com/blog/category/c-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.enusbaum.com/blog</link>
	<description>My little nerded out corner of the Internets!</description>
	<lastBuildDate>Thu, 11 Feb 2010 04:54:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ApocBot &#8212; I feel I owe everyone an update!</title>
		<link>http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/</link>
		<comments>http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 19:31:02 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Magic Online]]></category>
		<category><![CDATA[Magic Online Bot]]></category>
		<category><![CDATA[MTGO]]></category>
		<category><![CDATA[MTGO Bot]]></category>
		<category><![CDATA[Open Source MTGO Bot]]></category>
		<category><![CDATA[SmartBot]]></category>
		<category><![CDATA[Trade Bot]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=359</guid>
		<description><![CDATA[Well, it seems my little post on my MTGO trading bot as generated some interest, so I felt I should at least give an update on the status.

Basic Trade functionality is completed

Trade x for y (i.e. 4 Uncommons for 1 Rare)
Buy/Sell x for x (i.e. 6 Rares for 1 Ticket or 1 Ticket for 6 Rares)


Smart [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it seems my little post on my MTGO trading bot as generated some interest, so I felt I should at least give an update on the status.</p>
<ul>
<li>Basic Trade functionality is completed
<ul>
<li>Trade x for y (i.e. 4 Uncommons for 1 Rare)</li>
<li>Buy/Sell x for x (i.e. 6 Rares for 1 Ticket or 1 Ticket for 6 Rares)</li>
</ul>
</li>
<li>Smart Bot functionality is 70% Completed</li>
</ul>
<p>Currently ApocBot is able to correctly identify cards that are selected during a trade and quote the stored price for the cards.  So far, so good!</p>
<p>Want some more info? <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><span id="more-359"></span></p>
<p>Okay, so here&#8217;s the big announce. I&#8217;m going to open source the Basic Trade functionality. I think it&#8217;s something that&#8217;s really fundamental and should have been included in the MTGO client to begin with. To that, I think it&#8217;s stilly to charge for such a basic function after writing it. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So now to answer some obvious questions:</p>
<p><strong>Q: ZOMG! You&#8217;re going to open source it?!</strong></p>
<p>A: Yes. ApocBot will be the first free, open source MTGO trade bot <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Q: What license will it be released under?</strong></p>
<p>A: I&#8217;m going to release it under GPL v3</p>
<p><strong>Q: When?!</strong></p>
<p>A: It&#8217;ll be available on this site by January 1st, 2010 <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;ll need some beta testers to use it before I release the source, just to make sure I&#8217;m not going to cause more problems than good. I&#8217;ll send out a call for that within the coming weeks.</p>
<p><strong>Q: What about SmartBot functionality?</strong></p>
<p>A: I&#8217;m still working on SmartBot and to be honest, it has been more trouble than it&#8217;s worth. I&#8217;ll make a decision on that as soon as I think it&#8217;s at a functional point. Because I&#8217;m currently working full time, I&#8217;m only able to dedicate a couple hours a week to ApocBot so this might take a bit. Part of me open sorucing ApocBot in the first place is so the community can begin development of such a plugin or enhancement.</p>
<p><strong>Q: What will I need to develop ApocBot?</strong></p>
<p>A: ApocBot is written in Microsoft C# and you will need Microsoft Visual Studio 2008 (with .NET 3.5) to develop. And Magic: The Gathering Online.. of course <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So that&#8217;s that! What&#8217;s funny is I was mulling this post around in my head and how to handle a MTGO bot that I knew (a) wouldn&#8217;t make a ton of money and (b) should really be free anyways.</p>
<p>Please feel free to e-Mail me or leave any questions you might have here on this post and I&#8217;ll be more vigilant in getting back to everyone.</p>
<p>Cheers! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/&amp;title=ApocBot+%26%238212%3B+I+feel+I+owe+everyone+an+update%21" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/&amp;title=ApocBot+%26%238212%3B+I+feel+I+owe+everyone+an+update%21" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+ApocBot+%26%238212%3B+I+feel+I+owe+everyone+an+update%21+@+http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2009/12/10/apocbot-i-feel-i-owe-everyone-an-update/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Coming Soon &#8212; Magic The Gathering Online Smart Bot!</title>
		<link>http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/</link>
		<comments>http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 20:57:04 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[General Software]]></category>
		<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Automated Trading]]></category>
		<category><![CDATA[Magic Online]]></category>
		<category><![CDATA[Magic Online Bot]]></category>
		<category><![CDATA[Magic The Gathering Online]]></category>
		<category><![CDATA[MTGO]]></category>
		<category><![CDATA[Smart Bot]]></category>
		<category><![CDATA[Trading Bot]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=347</guid>
		<description><![CDATA[I thought I&#8217;d take the opportunity to update my blog here to talk about what I&#8217;ve been working on lately, as it would appear that my free projects of WWWinamp and the Discogs API are no longer updated  
I&#8217;ve been working on my first retail product and I&#8217;m really excited about it!

After trying to [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d take the opportunity to update my blog here to talk about what I&#8217;ve been working on lately, as it would appear that my free projects of WWWinamp and the Discogs API are no longer updated <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&#8217;ve been working on my first retail product and I&#8217;m really excited about it!</p>
<p><span id="more-347"></span></p>
<p>After trying to secure a 3rd party trading bot for Magic The Gathering Online (MTGO) v3 from Wizards of the Coast (WotC), I decided it was time to strike out on my own and write one. A lot of people had done so already using automation software (like AutoIT), but I went the path of a more professional software development environment and wrote it in .NET using C# and WCF.</p>
<p>WCF you ask? Yep! I don&#8217;t want to dive into the details too much at the moment but it will revolve around a central data hub providing real time updates to users of the application (vs. having to download and deploy a new version every time an update is published from WotC). There will be a bunch of good features as well!</p>
<p>I wanted to poll people on pricing though. I&#8217;ve seen prices for &#8216;Simple&#8217; Magic Online trading bots for anywhere from $99 to $399! And to that, I haven&#8217;t even been able to find the price of a &#8216;Smart Bot&#8217; anywhere, as it seems the people who build them keep the software to themselves.</p>
<p>What I&#8217;m thinking about doing is setting up a monthly pricing model. Here&#8217;s the matrix:</p>
<table border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td width="160" valign="top"><strong>Bot Type</strong></td>
<td width="160" valign="top"><strong>1-Month (Monthly)</strong></td>
<td width="160" valign="top"><strong>12-Month (Yearly)</strong></td>
<td width="160" valign="top"><strong>Lifetime</strong></td>
</tr>
<tr>
<td width="160" valign="top">Trade Bot</td>
<td width="160" valign="top">$5 USD</td>
<td width="160" valign="top">$50 USD</td>
<td width="160" valign="top">$199 USD</td>
</tr>
<tr>
<td width="160" valign="top">Smart Bot</td>
<td width="160" valign="top">$15 USD</td>
<td width="160" valign="top">$150 USD</td>
<td width="160" valign="top">$399 USD</td>
</tr>
</tbody>
</table>
<p> <strong>Trade Bot:</strong> Your basic Magic Online trading bot. &#8220;Buying/Selling x Cards for x Tickets&#8221; or &#8220;Trading x Uncommons for x Rares&#8221;</p>
<p><strong>Smart Bot:</strong> Each card in your library can be assigned a specific price. You&#8217;re running a Virtual Store on Magic Online.</p>
<p>Some features I&#8217;m working on for the Smart Bot will be:</p>
<ul>
<li>User Credit System (and ability to create Credit Network spanning multiple bots)</li>
<li>Interactive Website Showing Sales History / Income Information</li>
</ul>
<p>I&#8217;m offering a time based licensing because I think it&#8217;s the most fair pricing structure for this type of software. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So I&#8217;m curious to hear back from anyone who stumbles across this blog post! I want to hear features and requests you would have for such a piece of software! I know Magic Trading bots are a shadey business at best, but I wanted to try to make a legitamite alternative to having to pay a lot of money up front for a piece of software you might not like.</p>
<p>I&#8217;ll try to post some screen shots of the bot in action while I&#8217;m testing it. I&#8217;m really excited about this project! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/&amp;title=Coming+Soon+%26%238212%3B+Magic+The+Gathering+Online+Smart+Bot%21" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/&amp;title=Coming+Soon+%26%238212%3B+Magic+The+Gathering+Online+Smart+Bot%21" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Coming+Soon+%26%238212%3B+Magic+The+Gathering+Online+Smart+Bot%21+@+http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2009/09/14/coming-soon-magic-the-gathering-online-smart-bot/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>.NET StringBuilder &#8212; Fast, but not as fast as you think!</title>
		<link>http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/</link>
		<comments>http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/#comments</comments>
		<pubDate>Thu, 28 May 2009 20:18:47 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Microsoft .NET 3.0 / WinFX]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[.NET Optimization]]></category>
		<category><![CDATA[.NET Profiler]]></category>
		<category><![CDATA[.NET Profiling]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C# Optimization]]></category>
		<category><![CDATA[C# String Concatenation]]></category>
		<category><![CDATA[C# String Manipulation]]></category>
		<category><![CDATA[C# Strings]]></category>
		<category><![CDATA[StringBuilder]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=294</guid>
		<description><![CDATA[StringBuilder: Friend or Foe?]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a situation where I was tasked to profile some .NET code and do some optimizations anywhere hot spots popped up. I was amazed to find out that one of the BIGGEST offenders in our code block was a simple call to <strong>StringBuilder.Append(char)</strong>. I had to take a step back and scratch my head and wonder if my profiler was confused.</p>
<p>I re-ran some tests using the <strong>StopWatch</strong> class to hard code some metrics into the application and they also confirmed the findings. What&#8217;s up? How could a class that everyone says you can use to your hearts content when it came to string concatenation was failing me?</p>
<p>Turns out, it was a mix of misuse and a common misconception about the <a title="MSDN Documentation -- StringBuilder Class" href="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.text.stringbuilder.aspx','MSDN+Documentation+--+StringBuilder+Class')" onclick="return TrackClick('http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.text.stringbuilder.aspx','MSDN+Documentation+--+StringBuilder+Class')" target="_blank">StringBuilder Class</a>.</p>
<p><span id="more-294"></span></p>
<p>One of the first things you learn while picking up .NET is that the <a title="MSDN Documentation -- StringBuilder Class" href="http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.text.stringbuilder.aspx','MSDN+Documentation+--+StringBuilder+Class')" onclick="return TrackClick('http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.text.stringbuilder.aspx','MSDN+Documentation+--+StringBuilder+Class')" target="_blank">StringBuilder Class</a> is your friend when it comes to concatenating large strings in memory. It beats the pants off of <a title="MSDN Documentation -- String.Concat Method" href="http://msdn.microsoft.com/en-us/library/system.string.concat.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.string.concat.aspx','MSDN+Documentation+--+String.Concat+Method')" target="_blank">String.Concat</a> and <a title="MSDN Documentation -- String.Format Method" href="http://msdn.microsoft.com/en-us/library/system.string.format.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Fsystem.string.format.aspx','MSDN+Documentation+--+String.Format+Method')" target="_blank">String.Format</a>, while also being a mutable object in the Framework utilizing an in-memory buffer.</p>
<p>I used <a title="Homepage -- JetBrains dotTrace Profiler" href="http://www.jetbrains.com/profiler/" onclick="return TrackClick('http%3A%2F%2Fwww.jetbrains.com%2Fprofiler%2F','Homepage+--+JetBrains+dotTrace+Profiler')" target="_blank">JetBrains dotTrace</a> to help profile the application and it was very evident from the get-go that StringBuilder was causing the whole process to slow down.</p>
<p>The nature of my application was basically reading in a text buffer 1 character as a time, and using the <strong>StringBuilder</strong> as an output buffer. So for a 1k file, The method <strong>Append(char)</strong> would be called 1024 times. A 600k file would call <strong>Append(char)</strong> 614,400 times.</p>
<p>So why was I getting burned in execution time? The issue turned out to be two fold.</p>
<p>First, there&#8217;s overhead cost to the call. I don&#8217;t care how lightweight your method is, if you&#8217;re calling it <span style="text-decoration: underline;"><strong>SIX HUNDRED THOUSAND TIMES</strong></span>, it&#8217;s going to take a bit. Let alone a method who handles a string buffer in memory and string manipulation. So basically, no matter how fast StringBuilder actually is, it&#8217;s not a free call and you should consider the fact that the call still has overhead when architecting your solution.</p>
<p>Architecture brings me to my second point. While writing each character individually made sense initally, it seems that it was just lazy <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  The optimized route would have been calling Append with a SUBSTRING of the input buffer, this way we avoid the overhead of multiple calls by writing all the neccisary data in one big blob.</p>
<p>So 600,000 calls to <strong>StringBuilder.Append(char)</strong> becomes only a few hundred calls to <strong>StringBuilder.Append(string.Substring(start, count))</strong>. Sure, the Substring Virtual Method itself has overhead, but it&#8217;s still less than the thousands of calls to <strong>Append(char)</strong> that we&#8217;re saving ourself <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Conclusion?</p>
<p>StringBuilder is fast, but it&#8217;s not free. Take this into consideration when utilizing it while appending large data sets in small chunks. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Cheers!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/&amp;title=.NET+StringBuilder+%26%238212%3B+Fast%2C+but+not+as+fast+as+you+think%21" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/&amp;title=.NET+StringBuilder+%26%238212%3B+Fast%2C+but+not+as+fast+as+you+think%21" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+.NET+StringBuilder+%26%238212%3B+Fast%2C+but+not+as+fast+as+you+think%21+@+http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2009/05/28/net-stringbuilder-fast-but-not-as-fast-as-you-think/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Example Huffman Compression Routine in C#</title>
		<link>http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/</link>
		<comments>http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/#comments</comments>
		<pubDate>Fri, 22 May 2009 21:17:04 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Data Compression]]></category>
		<category><![CDATA[Deflate]]></category>
		<category><![CDATA[GZip]]></category>
		<category><![CDATA[Huffman Coding]]></category>
		<category><![CDATA[Huffman Compression]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/?p=285</guid>
		<description><![CDATA[This last week I decided to sit down and hash out a simple Huffman compression routine using C#. I&#8217;d never created a compression routine before from scratch (my past implementations were static for the sake of time savings), so I fleshed one out. I know that many examples exist elsewhere on the net&#8230;. but they [...]]]></description>
			<content:encoded><![CDATA[<p>This last week I decided to sit down and hash out a simple Huffman compression routine using C#. I&#8217;d never created a compression routine before from scratch (my past implementations were static for the sake of time savings), so I fleshed one out. I know that many examples exist elsewhere on the net&#8230;. but they all seemed overly complicated and up their own ass <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>I had a couple goals in mind while creating my routine:</p>
<p><strong>1. KEEP IT SIMPLE</strong> &#8212; A lot of routines out there WORK, but their code is too overly complicated for their own good. This over complication leads to slowness which brings me to my next goal <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  It should be a simple class that accepts input data, with simple public accessors that are easy to understand even for the novice developer (sorry folks, no asynchronous delegates). <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><strong>2. MAKE IT FAST</strong> &#8212; When dealing with large amounts of data in C#, especially when running it through an algorithm, it&#8217;s all too easy to use all the handy built in virtual methods or using other build in tools which make coding easier with speed being the sacrifice. Die hard C++ developers will point to these routines as C#&#8217;s downfall as a legitimate language when it comes to data intensive tasks.</p>
<p><span id="more-285"></span></p>
<p>The class I came up with is pretty simple. I use a Generic List to store a collection of &#8220;Leaf&#8221; objects, which have several basic attributes that help not only identify its value but also its place in the tree. Using this method, I was able to utilize the built in methods of the List object (I know, for shame&#8230;. but it&#8217;s easier in this instance) by firing off anonymous delegates for searches and comparators. I&#8217;m not terribly worried about using these virtual methods here only because the creation and encoding of the tree is usually the smallest task in the process <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The encoding and decoding is where I decided to focus on optimizations since this is where the BULK of the work is done. The .NET Framework has several methods that make working with binary data easy. You can use the Convert.ToString() method which allows you to pass in a BASE option, thus allowing you to convert any character to it&#8217;s binary representation. My original implementation used that method and the end result as embarrassingly slow <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>I went back to the drawing board and thought to myself, &#8220;If I had to re-write this in C++, how would I handle the encoding?&#8221; Duh, I&#8217;d be using bitwise operators up the wazoo! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After some recoding and pulling my hair out for a couple of hours, I was able to re-write the routine using bit operations and it works! On top of all that, it&#8217;s fast as all get out! My current benchmarks had it encoding a 1MB data set in under 1 second with ~50% compression. Not too shabby! Of course, compression ratios will vary depending on how normalized the input data set is.</p>
<p>Now I&#8217;m sure there&#8217;s some question you have on your mind and I&#8217;ll try to address them now:</p>
<p><strong>Q: Does it use a lot of memory?</strong></p>
<p><strong>A:</strong> You bet your sweet ass it does! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Seriously though, it&#8217;s only the method in which I setup the class that requires the memory. I establish an input buffer within the class that you can write the &#8216;raw&#8217; data to, which is then read from during encoding. In addition, during encoding I create an output buffer in memory where the &#8216;encoded&#8217; data is written. So it stands to reason that if you&#8217;re encoding 100MB of data, this routine can easily gobble up 200MB of RAM or more. The rule of thumb I found was File Size * 4 would be the memory requirement. There&#8217;s optimizations you can make that would lower the memory footprint (like, build the frequency table without buffering then read the input 1 byte at a time, say from a file), but I felt that would over complicate the solution and make it too focused for one specific instance. The current implementation is kept general for a reason <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Q: Could this be done faster in C++?</strong></p>
<p><strong>A:</strong> Yes, probably&#8230;. but not much faster. Although the code is written in C#, at run time the IL is compiled to x86. The bit operations we&#8217;re using would compile the exact same as a C++ routine (XOR is XOR, I don&#8217;t care what language you&#8217;re using). In addition, the encoding of the data itself is only using primitive native types which limits any cross language differences. In fact, you can paste the encode and decode routines into C++ and they work! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Your only speed improvement might be in the generation of the tree itself&#8230; but even then, that&#8217;s super small overhead when compared with the amount of data you&#8217;re probably compressing.</p>
<p>Of course, all that applied to the Encoding (Compression) side of the house, the decompression routine is pretty slow (about 3 seconds per 1MB of decompressed data) and could probably use some more optimizations.</p>
<p><strong>Q: Is this any better than using the built in GZip or Deflate classes available in System.IO.Compression?</strong></p>
<p><strong>A:</strong> It&#8217;s not even close to being in competition with those routines <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  This is really just a proof of concept for BASIC Huffman Coding, which doesn&#8217;t take into account advanced features of modern compression routines such as pattern or content mapping. This routine is slower (especially in decompression), so I wouldn&#8217;t go making anything like this your #1 choice for a compression routine if others are available <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  So use this for educational purposes only.</p>
<p><strong>Q: What version of the .NET Framework will this work with?</strong></p>
<p><strong>A:</strong> The code here was written in Visual Studio 2008 targeting .NET 3.5. I use some Framework 3.5 specific things (such as object initializers), but nothing that would make conversion difficult. I avoided LINQ only because I&#8217;m not entirely sold on the idea and I still like using anonymous delegates. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  This code could be converted to Framework 2.0 with minor changes and possibly Framework 1.1, but that might require a little more effort.</p>
<p><strong>Q: What is the format used to store the compressed data?</strong></p>
<p><strong>A:</strong> I encode the decompression information within the final output stream. The output format is like this:</p>
<p>Bytes 0 &#8211; 8: Final Output Size (Not used, but there as a checksum if needed in the future)</p>
<p>Byte 9: Number of Bytes in the Decode Dictionary</p>
<p>Bytes 10 &#8211; n: Decode Dictionary</p>
<p>Between the Decode Dictionary and the actual data I add the characters &#8220;BCD&#8221; (which stands for <strong>B</strong>inary <strong>C</strong>oded <strong>D</strong>ata). This lets me know where the dictionary ends and the actual coded data begins. It helped during debugging and I figure it&#8217;d help anyone else out there as well while working with this routine <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Q: What&#8217;s with the essay? Just give me the code!</strong></p>
<p><strong>A:</strong> Fine! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Seriously though, the only reason I&#8217;m doing such a long write-up on the code is to help people who are perhaps beginning to look into this sort of code for the first time and might have questions on why I did things a certain way. Understanding WHY the code was written helps understand how it operates.</p>
<p>So that&#8217;s the high and low of it! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Hope this helps someone out and if you have any questions, please feel free to leave a comment!</p>
<p>Cheers! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Huffman.zip</strong> &#8211; <a title="Huffman Coding in C#" href="http://www.enusbaum.com/blog/wp-content/uploads/Huffman.zip" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2Fblog%2Fwp-content%2Fuploads%2FHuffman.zip','Huffman+Coding+in+C%23')">Download</a> (3k)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/&amp;title=Example+Huffman+Compression+Routine+in+C%23" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/&amp;title=Example+Huffman+Compression+Routine+in+C%23" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Example+Huffman+Compression+Routine+in+C%23+@+http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2009/05/22/example-huffman-compression-routine-in-c/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>A new version of WWWinamp is coming&#8230; I SWEAR!</title>
		<link>http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/</link>
		<comments>http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 04:00:42 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Microsoft .NET 3.0 / WinFX]]></category>
		<category><![CDATA[WWWinamp]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/</guid>
		<description><![CDATA[Hello Everyone!
I&#8217;m currently working on the latest version of WWWinamp after taking another hiatus from the project in order to clear my head and work on some other fun things such as the previously mentioned XNA projects   
The next version of WWWinamp will be targeted for the .NET 3.5 Framework and you will [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Everyone!</p>
<p>I&#8217;m currently working on the latest version of WWWinamp after taking another hiatus from the project in order to clear my head and work on some other fun things such as the <a href="http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2Fblog%2F2007%2F12%2F28%2F2d-wndrpong-using-the-microsoft-xna-game-studio-v20%2F','2D+WndrPong%21+using+the+Microsoft+XNA+Game+Studio+v2.0%21')" title="2D WndrPong! using the Microsoft XNA Game Studio v2.0!" target="_blank">previously mentioned</a> XNA projects  <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The next version of WWWinamp will be targeted for the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=333325FD-AE52-4E35-B531-508D977D32A6&amp;displaylang=en" onclick="return TrackClick('http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyID%3D333325FD-AE52-4E35-B531-508D977D32A6%26amp%3Bdisplaylang%3Den','Microsoft+.NET+Framework+3.5')" title="Microsoft .NET Framework 3.5" target="_blank">.NET 3.5 Framework</a> and you will need to have it installed on your machine in order to run WWWinamp. Most of the changes in this version are behind the scenes and will probably be transparent to you, the user. BUT, some visible changes in the upcoming version of WWWinamp 4.2 will be:</p>
<ul>
<li><strong>Automatic Version Checking for new releases of WWWinamp </strong></li>
<li><strong>Ability to enable or disable Automatic Version Checking  </strong></li>
<li><strong>Ability to enable or disable Windows Vista warning message<br />
</strong></li>
<li><strong>Improved performance under load</strong></li>
</ul>
<p>I know, nothing earth shattering on the horizon. &#8220;Why is this?&#8221; you might as. Well, the honest reason is that I haven&#8217;t received any bug reports with issues that weren&#8217;t related to a misconfiguration or user error. This is a good thing! It means that WWWinamp is stable and there aren&#8217;t any horrible bugs that continue to nag users. The downside to this is that because WWWinamp is pretty feature rich as is, I&#8217;m running low on ideas that could be implemented.</p>
<p>An idea I&#8217;ve tossed about and am thinking about trying out is creating a WWWinamp .NET assembly for user within your own Windows or ASP.NET applications developed using the .NET framework. The assembly would handle the media library and searching of the library so you wouldn&#8217;t have to code your own database and file searching routines, as well as handling the unmanaged code required to interface with <a href="http://www.winamp.com/" onclick="return TrackClick('http%3A%2F%2Fwww.winamp.com%2F','WinAmp+--+It+really+whips+the+llamas+ass%21')" title="WinAmp -- It really whips the llamas ass!" target="_blank">Winamp</a> (if it&#8217;s running locally on the WWWinamp machine) or communicating via WCF to a remote instance of WWWinamp running the WCF daemon.</p>
<p>I think that between the WWWinamp Server and my proposed WWWinamp Assembly, that&#8217;d give both advanced and novice users full control over their setup. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>As I mentioned in a <a href="http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2Fblog%2F2007%2F12%2F05%2Fwwwinamp-is-being-converted-to-net-framework-v35%2F','WWWinamp+is+being+converted+to+.NET+Framework+v3.5%21')" title="WWWinamp is being converted to .NET Framework v3.5!" target="_blank">previous post</a>, I&#8217;ve moved WWWinamp into Visual Studio 2008 with Team Foundation Server. Within the latest version of Visual Studio 2008 there is a set of <a href="http://blogs.msdn.com/fxcop/archive/2007/02/28/announcing-visual-studio-code-metrics.aspx" onclick="return TrackClick('http%3A%2F%2Fblogs.msdn.com%2Ffxcop%2Farchive%2F2007%2F02%2F28%2Fannouncing-visual-studio-code-metrics.aspx','Announcing+Visual+Studio+Code+Metrics%21')" title="Announcing Visual Studio Code Metrics!" target="_blank">code analysis tools</a> which calculate such items as Code Maintainability and Cyclomatic Complexity. I ran it on WWWinamp and it scored the following:</p>
<p><strong>Maintainability Index:</strong> 83 (out of 100)</p>
<p><strong>Cyclomatic Complexity:</strong> 636</p>
<p><strong>Depth of Inheritance:</strong> 7</p>
<p><strong>Class Coupling:</strong> 151</p>
<p><strong>Lines of Code:</strong> 1,829 (!!)</p>
<p>After over a year, I think WWWinamp has gotten better and continues to improve with every version!</p>
<p>Big thanks to everyone for their support and keep your eyes peeled here for the latest version of WWWinamp!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/&amp;title=A+new+version+of+WWWinamp+is+coming%26%238230%3B+I+SWEAR%21" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/&amp;title=A+new+version+of+WWWinamp+is+coming%26%238230%3B+I+SWEAR%21" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+A+new+version+of+WWWinamp+is+coming%26%238230%3B+I+SWEAR%21+@+http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2008/01/21/a-new-version-of-wwwinamp-is-coming-i-swear/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>2D WndrPong! using the Microsoft XNA Game Studio v2.0!</title>
		<link>http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/</link>
		<comments>http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 00:28:04 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[Gaming]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[Microsoft XNA]]></category>
		<category><![CDATA[2D Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Game Programming]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Pong!]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/</guid>
		<description><![CDATA[I decided to take some time this weekend to sit down and learn what I could about the latest release of Microsoft&#8217;s XNA Game Studio. I started out with a book I purchased called Microsoft XNA Game Studio Creators Guide, which turned out to be a terrible book. Most of the examples in this book [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to take some time this weekend to sit down and learn what I could about the latest release of Microsoft&#8217;s <a href="http://www.xna.com/" onclick="return TrackClick('http%3A%2F%2Fwww.xna.com%2F','Link+--+Microsoft+XNA+Game+Studio+Website')" title="Link -- Microsoft XNA Game Studio Website" target="_blank">XNA Game Studio</a>. I started out with a book I purchased called <a href="http://www.amazon.com/Microsoft%C2%AE-Game-Studio-Creators-Guide/dp/007149071X/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1198886266&amp;sr=8-1" onclick="return TrackClick('http%3A%2F%2Fwww.amazon.com%2FMicrosoft%25C2%25AE-Game-Studio-Creators-Guide%2Fdp%2F007149071X%2Fref%3Dpd_bbs_sr_1%3Fie%3DUTF8%26amp%3Bs%3Dbooks%26amp%3Bqid%3D1198886266%26amp%3Bsr%3D8-1','Link+to+the+worst+book+on+XNA+ever+printed%2C+ever.')" title="Link to the worst book on XNA ever printed, ever." target="_blank">Microsoft XNA Game Studio Creators Guide</a>, which turned out to be a terrible book. Most of the examples in this book assume that you&#8217;re starting with a project the book provides on a Website, which already has hundreds of lines of code, custom shaders and everything built in&#8230; without even explaining how the code is working in the background.</p>
<p>After fumbling around with that for an hour or so an only succeeding in creating a small square on the screen, I headed over to Microsoft.com to see if any MSDN articles might exist to help me along in my &#8216;ground up&#8217; learning of XNA.  I was pleasantly surprised when I found a great article titled &#8220;<a href="http://msdn2.microsoft.com/en-us/library/bb203893.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Fbb203893.aspx','Best+Starter+Article+ever+for+XNA+%3A%29')" title="Best Starter Article ever for XNA :)" target="_blank">Your First Game: Microsoft XNA Game Studio in 2D</a>&#8220;. This was EXACTLY what I was looking for as it starts from the ground up, assuming the reader has never done game programming before, let alone 3D game programming. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The example provided my Microsoft in this article is a simple 2D Texture of a cat that bounces around the window. I was so pleased with the ease of coding this, I thought to myself, &#8220;Heck, how hard could it be to recreate Pong?&#8221; <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  So I set upon my task.</p>
<p>Several hours and many Coca-Cola bottles later I had not only my first XNA game <a href="http://www.enusbaum.com/blog//blog/wp-content/uploads/2007/12/wndrpong.thumbnail.gif" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2Fblog%2F%2Fblog%2Fwp-content%2Fuploads%2F2007%2F12%2Fwndrpong.thumbnail.gif','2D+WndrPong%21+running+in+Windows')" title="2D WndrPong! running in Windows" target="_blank" rel="lightbox[69]">running in Windows</a>, but after purchasing the XNA Creators Club annual subscription from the XBox Live! marketplace for $99, I had it <a href="http://www.enusbaum.com/blog//blog/wp-content/uploads/2007/12/wndrpong_tv.jpg" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2Fblog%2F%2Fblog%2Fwp-content%2Fuploads%2F2007%2F12%2Fwndrpong_tv.jpg','2D+WndrPong%21+running+on+the+XBox+360%21')" title="2D WndrPong! running on the XBox 360!" target="_blank" rel="lightbox[69]">running on my XBox 360</a> as well <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I decided to take a little extra time and add a debug information screen as well as a small welcome screen <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Controls (PC):</strong></p>
<p>Up/Down for Player 1 Paddle (Left): Q/A</p>
<p>Up/Down for Player 2 Paddle (Right): Up Arrow/Down Arrow</p>
<p>Debug Information: F1</p>
<p><strong>Controls (XBox 360):</strong></p>
<p>Up/Down for Player 1 Paddle (Left): Left Thumbstick on Player 1 Remote</p>
<p>Up/Down for Player 2 Paddle (Right): Left Thumbstick on Player 2 Remote</p>
<p>I did run into a couple of &#8216;gotchas!&#8217; while working with Game Studio. The major one I had trouble with was when you&#8217;re developing for the XBox 360 you have to account for <a href="http://en.wikipedia.org/wiki/Overscan" onclick="return TrackClick('http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FOverscan','Link+--+Wikipedia+Article+on+Overscan')" title="Link -- Wikipedia Article on Overscan" target="_blank">overscan</a> on the Television and have your game render within the &#8216;<a href="http://en.wikipedia.org/wiki/Safe_area" onclick="return TrackClick('http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FSafe_area','Link+--+Wikipedia+Article+on+Safe+Area')" title="Link -- Wikipedia Article on Safe Area" target="_blank">Safe Area</a>&#8216;. I noticed that when I was playing my Pong! game on my LCD TV at 720p, the edges of the game were cut off and it looked like it was stretched past the borders of my TV. After asking the fine folks in #XNA on IRC about this issue, they were able to help me out. Now I have my Pong! game account for this by setting up an XBox 360 macro which pads the edges of the play area by 50 pixels.</p>
<p>I&#8217;m including the Source Code for my version of Pong! which I&#8217;ve titled, &#8220;2D WndrPong!&#8221;. You can work in XNA Game Studio for free using <a href="http://msdn2.microsoft.com/en-us/express/aa975050.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Fexpress%2Faa975050.aspx','Link+--+Microsoft.com+Visual+C%23+2005+Express+Edition')" title="Link -- Microsoft.com Visual C# 2005 Express Edition" target="_blank">Visual C# 2005 Express Edition</a> along with <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DF80D533-BA87-40B4-ABE2-1EF12EA506B7&amp;displaylang=en" onclick="return TrackClick('http%3A%2F%2Fwww.microsoft.com%2Fdownloads%2Fdetails.aspx%3FFamilyId%3DDF80D533-BA87-40B4-ABE2-1EF12EA506B7%26amp%3Bdisplaylang%3Den','Link+--+Microsoft.com+XNA+Game+Studio+2.0+Install')" title="Link -- Microsoft.com XNA Game Studio 2.0 Install" target="_blank">XNA Game Studio 2.0</a> <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  To deploy your games to an XBox 360, you must pair your XBox with your PC  (using the &#8220;XNA Game Studio Device Center&#8221; tool)  then you must purchase an XNA Creators Club Membership from the XBox 360 Marketplace. I believe the prices are $49.99 for 3 Months, $99.99 for a year. I opted for the entire year since I know it&#8217;s going to take me some time to learn <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Baby Steps <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>2D WndrPong! Source Code</strong> &#8211; <a href="http://www.enusbaum.com/blog//blog/wp-content/uploads/2007/12/2d_wndrpong.zip" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2Fblog%2F%2Fblog%2Fwp-content%2Fuploads%2F2007%2F12%2F2d_wndrpong.zip','Link+--+Download+Link+to+2D+WndrPong%21')" title="Link -- Download Link to 2D WndrPong!" target="_blank">Download</a> (36k)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/&amp;title=2D+WndrPong%21+using+the+Microsoft+XNA+Game+Studio+v2.0%21" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/&amp;title=2D+WndrPong%21+using+the+Microsoft+XNA+Game+Studio+v2.0%21" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+2D+WndrPong%21+using+the+Microsoft+XNA+Game+Studio+v2.0%21+@+http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2007/12/28/2d-wndrpong-using-the-microsoft-xna-game-studio-v20/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WWWinamp is being converted to .NET Framework v3.5!</title>
		<link>http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/</link>
		<comments>http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 05:17:32 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[WWWinamp]]></category>
		<category><![CDATA[.NET 2008]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Team Foundation Server 2008]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/</guid>
		<description><![CDATA[Yep, it's true!
I've spent the last week or so playing around with the .NET Framework v3.5 and I really like what I see. Microsoft has also put a lot of work into Team Foundation Server 2008 as well. I've setup a Virtual Machine using Virtual PC here running Team Foundation Server 2008 on Windows 2003 [...]]]></description>
			<content:encoded><![CDATA[<p>Yep, it's true!</p>
<p>I've spent the last week or so playing around with the .NET Framework v3.5 and I really like what I see. Microsoft has also put a lot of work into Team Foundation Server 2008 as well. I've setup a Virtual Machine using Virtual PC here running Team Foundation Server 2008 on Windows 2003 Server R2 and was able to get WWWinamp imported + converted without issue!</p>
<p><img src='http://www.enusbaum.com/blog/wp-content/uploads/zoomer.files/66/tile0-0-0.jpg' alt='WWWinamp in Team Foundation Server 2008' /></p>
<p>One thing I have noticed is that TFS does take up quite a bit of resources. I had to kick my VM up to 2GB of RAM in order for it to handle and build WWWinamp without hitting the swap file. Something to keep in mind moving forward I suppose. I'd imagine a large installation of TFS would require something along the lines of a Quad Core CPU with at least 4GB RAM.</p>
<p>There are several features in .NET 3.5 that I plan on implementing in WWWinamp right off the bat:</p>
<ul>
<li><a href="http://msdn2.microsoft.com/en-us/library/bb384062(VS.90).aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Fbb384062%28VS.90%29.aspx','MSDN+--+Article+on+C%23+Object+Initializers+in+.NET+3.5')" title="MSDN -- Article on C# Object Initializers in .NET 3.5" target="_blank">Object Initializers</a> - This will really help clean up the already massive code base. It'll also speed things up a bit <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><a href="http://msdn2.microsoft.com/en-us/library/bb545961(VS.90).aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Fbb545961%28VS.90%29.aspx','MSDN+Article+--+Embedded+Manifests+in+C%23+.NET+3.5')" title="MSDN Article -- Embedded Manifests in C# .NET 3.5" target="_blank">Embedded Manifest</a> - A feature I'm surprised they didn't implement with the release of .NET 3.0. Now the .manifest file will be embedded into WWWinamp, so you won't have the extra file handing around if you run Windows Vista <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li><a href="http://msdn2.microsoft.com/en-us/library/bb383977(VS.90).aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Fbb383977%28VS.90%29.aspx','MSDN+Article+--+Extension+Methods+in+C%23+.NET+3.5')" title="MSDN Article -- Extension Methods in C# .NET 3.5" target="_blank">Extension Methods</a> - Again, this will help clean up the code base and make things faster. I imagine it'll take up a little more memory, but these days RAM is abundant <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>Now, I see LinQ and I'm trying to figure out it's role in everything. I think it'll make DB communication easier but I'm not a fan of the anonymous data types and implicit local variables. I think it could lead to some sloppy coding methodology if not kept in check.</p>
<p>I think it's handy that you can now run a SQL like statement on a generic, but I'm wondering what sets this apart from the <a href="http://msdn2.microsoft.com/en-us/library/fh1w7y8z.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Ffh1w7y8z.aspx','MSDN+Article+--+FindAll+method+in+C%23+.NET+2.0')" title="MSDN Article -- FindAll method in C# .NET 2.0" target="_blank">FindAll</a> method that already exists in <a href="http://msdn2.microsoft.com/en-us/library/system.collections.generic.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Fsystem.collections.generic.aspx','MSDN+Article+--+System.Collections.Generics+in+C%23+.NET+2.0')" title="MSDN Article -- System.Collections.Generics in C# .NET 2.0" target="_blank">System.Collection.Generics</a>. It does make it easier though to search through a Generic Collection for a developer who doesn't have a solid grasp on delegates.</p>
<p>So, all that said, things are moving along. I'll keep you all updated on the progress and please, send in those feature requests! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/&amp;title=WWWinamp+is+being+converted+to+.NET+Framework+v3.5%21" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/&amp;title=WWWinamp+is+being+converted+to+.NET+Framework+v3.5%21" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+WWWinamp+is+being+converted+to+.NET+Framework+v3.5%21+@+http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2007/12/05/wwwinamp-is-being-converted-to-net-framework-v35/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WWWinamp Feedback Requested</title>
		<link>http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/</link>
		<comments>http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 05:04:26 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[WWWinamp]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Feedback]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/</guid>
		<description><![CDATA[I started tapping away at the WWWinamp source the other night and was curious if there are any features you guys, the users, would like to see added? I've been trying to think up new ideas but I'm not sure if they'd even be helpful.
So basically, I'm asking help for what to put in the [...]]]></description>
			<content:encoded><![CDATA[<p>I started tapping away at the WWWinamp source the other night and was curious if there are any features you guys, the users, would like to see added? I've been trying to think up new ideas but I'm not sure if they'd even be helpful.</p>
<p>So basically, I'm asking help for what to put in the next version. If you could leave a comment with any of the following, that'd REALLY help out! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li>What feature would you like to see added to WWWinamp?</li>
<li>Is there any nagging bug or weird behavior you would like fixed?</li>
</ul>
<p>I'm currently fiddling around with Visual Studio 2008 right now and am looking into the benefits C# 3.5 offers over 2.0, which the current release of WWWinamp is based upon.</p>
<p>Thanks for your feedback and support everyone! I look forward to your responses! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/&amp;title=WWWinamp+Feedback+Requested" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/&amp;title=WWWinamp+Feedback+Requested" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+WWWinamp+Feedback+Requested+@+http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2007/12/02/wwwinamp-feedback-requested/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Discogs.com API Assembly for .NET Applications v1.0 Build 2876</title>
		<link>http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/</link>
		<comments>http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 06:02:09 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[Discogs API]]></category>
		<category><![CDATA[General Software]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/</guid>
		<description><![CDATA[Hello Everyone!
I'm very pleased to bring you the latest build of the Discogs.com API Assembly  
This version bring more error handling reguarding the Cover Art routines as well as the ability to now specify your own Discogs.com API key   This is not a REQUIRED field, and if you do not specify an [...]]]></description>
			<content:encoded><![CDATA[<p>Hello Everyone!</p>
<p>I'm very pleased to bring you the latest build of the Discogs.com API Assembly <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This version bring more error handling reguarding the Cover Art routines as well as the ability to now specify your own Discogs.com API key <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This is not a REQUIRED field, and if you do not specify an API Key value it will default to the API key I've already registered for the Assembly. I figured this would be the easiest way for people to use it.</p>
<p>Some have expressed their concern on the daily usage limits that are imposed. To clarify these limits, as stated on the API information page, the daily limits are 5,000 requests per day, PER IP. This means each person using the API Key can use it up to 5,000 times per day. So no worries on gobbling up all available tries! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you still want to register for your own API Key, you can do so <a href="http://www.discogs.com/users/api_key" onclick="return TrackClick('http%3A%2F%2Fwww.discogs.com%2Fusers%2Fapi_key','Discogs.com+--+Register+for+an+API+Key')" title="Discogs.com -- Register for an API Key" target="_blank">here</a>!</p>
<p>So, to recap the changes in this version:</p>
<ul>
<li>Better Error Handling in <strong>GetCoverArt()</strong> method
<ul>
<li>Will return a blank 1x1 Bitmap if an Exception is thrown.</li>
</ul>
</li>
<li>Better Error Handling in <strong>SaveCoverArt()</strong> method
<ul>
<li>Will return FALSE if an Exception is thrown while trying to save the file</li>
</ul>
</li>
<li>Able to now specify your own API Key (<strong>API_KEY</strong>). If you do not specify one, it will use a default API Key (which works just fine!)</li>
</ul>
<p>Cheers!</p>
<p><strong>Discogs.com API Assembly for .NET Applications v1.0 Build 2876</strong> - <a href="http://www.enusbaum.com/Discogs/DiscogsAPI_10b2876.zip" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2FDiscogs%2FDiscogsAPI_10b2876.zip','Download+Discogs.com+API+Assembly+for+.NET+Applications%21')" title="Download Discogs.com API Assembly for .NET Applications!" target="_blank">Download</a> (9k)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/&amp;title=Discogs.com+API+Assembly+for+.NET+Applications+v1.0+Build+2876" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/&amp;title=Discogs.com+API+Assembly+for+.NET+Applications+v1.0+Build+2876" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Discogs.com+API+Assembly+for+.NET+Applications+v1.0+Build+2876+@+http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2007/11/16/discogscom-api-assembly-for-net-applications-v10-build-2876/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Discogs.com API Assembly for .NET Applications v1.0 Build 2871</title>
		<link>http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/</link>
		<comments>http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 01:20:48 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[Discogs API]]></category>
		<category><![CDATA[General Programming]]></category>
		<category><![CDATA[General Software]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[C# Assembly]]></category>
		<category><![CDATA[C# Example]]></category>
		<category><![CDATA[Cover Art]]></category>
		<category><![CDATA[Discogs]]></category>
		<category><![CDATA[Discogs.com]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/</guid>
		<description><![CDATA[Greetings Everyone!
I've been working on the Discogs.com API Assembly for  .NET Applications now for a couple days and have been able to make some progress. It's now a bit more stable as well a a tiny bit easier to use.
I took some time and added a DEBUG class. This class allows you to find [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings Everyone!</p>
<p>I've been working on the Discogs.com API Assembly for  .NET Applications now for a couple days and have been able to make some progress. It's now a bit more stable as well a a tiny bit easier to use.</p>
<p>I took some time and added a DEBUG class. This class allows you to find out what's happening within the Discogs.com Assembly if you start to have issues! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This new class has two properties:</p>
<ul>
<li><strong>Verbose (bool)</strong> - If set to TRUE, Verbose logging will be enabled allowing you to get more precise detail on what is going on within the Assembly. Otherwise, only exceptions will be logged.</li>
<li><strong>Log (string)</strong> - This is a string containing the current debug log.</li>
</ul>
<p>Also, it has one Method:</p>
<ul>
<li><strong>LogEvent (string sEvent)</strong> - Logs the value passed in to the debug log. This way you can use the same debug log from your own applications <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Should help make things a little easier.</li>
</ul>
<p>New in this version as well is better error handling in the event of 404's or an Artist/Release isn't found. Before if you requested something that didn't exist, the Assembly kinda crapped out while trying to deserialize the (non-existent) XML <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  This has all been fixed.</p>
<p>I'm also including a small example program (with source code) on how to use the Discogs.com API Assembly. I've coded the example in C#, so sorry to all those VB.NET developers out there! <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If one of you guys would like to translate it to VB.NET, I'd be more than happy to post it here as well.</p>
<p>If you do not already have Microsoft Visual Studio installed, no worries! Microsoft provides a free version for C# development called Visual C# Express and you can get it <a href="http://msdn2.microsoft.com/en-us/express/aa700756.aspx" onclick="return TrackClick('http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Fexpress%2Faa700756.aspx','Download+Microsoft+Visual+C%23+Express')" title="Download Microsoft Visual C# Express" target="_blank">here</a> over at Microsoft.com. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You will need to update the Reference to the Discogs.com API Assembly. It currently points to where I had it setup on my local machine. <img src='http://www.enusbaum.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Any and all feedback is appreciated!</p>
<p>Cheers!</p>
<p><strong>Discogs.com API Assembly for .NET Applications v1.0 Build 2871</strong> - <a href="http://www.enusbaum.com/Discogs/DiscogsAPI_10b2871.zip" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2FDiscogs%2FDiscogsAPI_10b2871.zip','Download+Discogs.com+API+Assembly+for+.NET+Applications%21')" title="Download Discogs.com API Assembly for .NET Applications!" target="_blank">Download</a> (9k)</p>
<p><strong>Discogs.com API Assembly Example Application (with Source)</strong> - <a href="http://www.enusbaum.com/Discogs/DiscogsAPI_Example.zip" onclick="return TrackClick('http%3A%2F%2Fwww.enusbaum.com%2FDiscogs%2FDiscogsAPI_Example.zip','Download+Discogs.com+API+Assembly+Example+Application')" title="Download Discogs.com API Assembly Example Application" target="_blank">Download</a> (10k)</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/&amp;title=Discogs.com+API+Assembly+for+.NET+Applications+v1.0+Build+2871" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/&amp;title=Discogs.com+API+Assembly+for+.NET+Applications+v1.0+Build+2871" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Discogs.com+API+Assembly+for+.NET+Applications+v1.0+Build+2871+@+http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.enusbaum.com/blog/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.enusbaum.com/blog/2007/11/12/discogscom-api-assembly-for-net-applications-v10-build-2871/feed/</wfw:commentRss>
		<slash:comments>-2</slash:comments>
		</item>
	</channel>
</rss>
