<?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>Program &#38; Design &#187; C#</title>
	<atom:link href="http://programanddesign.com/category/cs/feed/" rel="self" type="application/rss+xml" />
	<link>http://programanddesign.com</link>
	<description>Tips, tricks, tutorials, and tools on programming &#38; web design</description>
	<lastBuildDate>Sat, 24 Dec 2011 21:44:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JSON Prettifier</title>
		<link>http://programanddesign.com/cs/json-prettifier/</link>
		<comments>http://programanddesign.com/cs/json-prettifier/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 23:13:50 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=377</guid>
		<description><![CDATA[This is a simple class I wrote to nicely format a JSON string. Just call it with JsonFormatter.PrettyPrint(yourJsonString) public static class JsonFormatter &#123; &#160; &#160; public static string Indent = &#34; &#160; &#160;&#34;; &#160; &#160; public static void AppendIndent&#40;StringBuilder sb, int count&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; for &#40;; count &#62; 0; --count&#41; [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/json-prettifier/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Subtracting Sets</title>
		<link>http://programanddesign.com/cs/subtracting-sets/</link>
		<comments>http://programanddesign.com/cs/subtracting-sets/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 05:00:02 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=369</guid>
		<description><![CDATA[A couple times now I've wanted to subtract one set (`HashSet`) from another. `HashSet` has a method ExceptWith that does just this, except that it modifies the current set in place. What if you don't want that? You need to copy it first. Or you could use Linq's Except method, except that it returns `IEnumerable` [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/subtracting-sets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>String Slice</title>
		<link>http://programanddesign.com/cs/string-slice/</link>
		<comments>http://programanddesign.com/cs/string-slice/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 21:56:56 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=357</guid>
		<description><![CDATA[Here's an extension method to slice strings in C#, similar to Python's slice notation. public static string Slice&#40;this string str, int? start = null, int? end = null, int step = 1&#41; &#123; &#160; &#160; if &#40;step == 0&#41; throw new ArgumentException&#40;&#34;Step size cannot be zero.&#34;, &#34;step&#34;&#41;; &#160; &#160; if &#40;start == null&#41; start = [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/string-slice/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to deep-copy/clone an object</title>
		<link>http://programanddesign.com/cs/how-to-deep-copyclone-an-object/</link>
		<comments>http://programanddesign.com/cs/how-to-deep-copyclone-an-object/#comments</comments>
		<pubDate>Mon, 06 Sep 2010 00:24:08 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=354</guid>
		<description><![CDATA[The easiest way to deep copy an object is to serialize and deserialize it. Here's an example from a project I'm working on: &#91;Serializable&#40;&#41;&#93; public class Board :ICloneable, ISerializable &#123; &#160; &#160; // ... &#160; &#160; object ICloneable.Clone&#40;&#41; &#160; &#160; &#123; &#160; &#160; &#160; &#160; return this.Clone&#40;&#41;; &#160; &#160; &#125; &#160; &#160; public Board Clone&#40;&#41; [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/how-to-deep-copyclone-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thread-Safe Observable List for WPF</title>
		<link>http://programanddesign.com/cs/thread-safe-observable-list-for-wpf/</link>
		<comments>http://programanddesign.com/cs/thread-safe-observable-list-for-wpf/#comments</comments>
		<pubDate>Sat, 08 May 2010 05:21:18 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=344</guid>
		<description><![CDATA[I'm probably posting this too early; I haven't had a chance to extensively test it yet but I basically just locked every function down, and made any method that actually modifies the list run on the main thread so that notifications can be sent. It ought to work class ObservableList&#60;T&#62; : IList&#60;T&#62;, INotifyCollectionChanged where T [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/thread-safe-observable-list-for-wpf/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Observable Priority Queue</title>
		<link>http://programanddesign.com/cs/observable-priority-queue/</link>
		<comments>http://programanddesign.com/cs/observable-priority-queue/#comments</comments>
		<pubDate>Thu, 06 May 2010 21:10:35 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.net-4.0]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=333</guid>
		<description><![CDATA[Just started playing around with WPF in VS 2010. They have this ObservableCollection class which you can bind to your DataGrid or ListControl and then when you add or remove items from it, the control is refreshed automatically. However, I wanted to use my PriorityQueue class that I posted about earlier, so I modified it [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/observable-priority-queue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Human-readable file size in C#</title>
		<link>http://programanddesign.com/cs/human-readable-file-size-in-c-2/</link>
		<comments>http://programanddesign.com/cs/human-readable-file-size-in-c-2/#comments</comments>
		<pubDate>Sun, 02 May 2010 21:01:16 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[readable]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=327</guid>
		<description><![CDATA[&#160; &#160; &#160; &#160; static string ReadableFileSize&#40;double size, int unit=0&#41; &#160; &#160; &#160; &#160; &#123; &#160; &#160; &#160; &#160; &#160; &#160; string&#91;&#93; units = &#123; &#34;B&#34;, &#34;KB&#34;, &#34;MB&#34;, &#34;GB&#34;, &#34;TB&#34;, &#34;PB&#34;, &#34;EB&#34;, &#34;ZB&#34;, &#34;YB&#34; &#125;; &#160; &#160; &#160; &#160; &#160; &#160; while&#40;size &#62;= 1024&#41; &#123; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; size /= [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/human-readable-file-size-in-c-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple Priority Queue in C#</title>
		<link>http://programanddesign.com/cs/a-simple-priority-queue-in-cs/</link>
		<comments>http://programanddesign.com/cs/a-simple-priority-queue-in-cs/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 19:59:33 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[priority queue]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=322</guid>
		<description><![CDATA[using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace QueueSpace &#123; &#160; &#160; public class PriorityQueue&#60;TValue&#62; : PriorityQueue&#60;TValue, int&#62; &#123; &#125; &#160; &#160; public class PriorityQueue&#60;TValue, TPriority&#62; where TPriority : IComparable &#160; &#160; &#123; &#160; &#160; &#160; &#160; private SortedDictionary&#60;TPriority, Queue&#60;TValue&#62;&#62; dict = new SortedDictionary&#60;TPriority, Queue&#60;TValue&#62;&#62;&#40;&#41;; &#160; &#160; &#160; &#160; public int Count &#123; get; [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/a-simple-priority-queue-in-cs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.NET Dock Panel</title>
		<link>http://programanddesign.com/cs/net-dock-panel/</link>
		<comments>http://programanddesign.com/cs/net-dock-panel/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 22:46:45 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[winforms]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=309</guid>
		<description><![CDATA[Apparently .NET does not come with any dock widget, like the ones used for the Toolbox and Properties window in Visual Studio. However, there is a freely available one on sourceforge called DockPanel Suite. Unfortunately, it seems to lack any sort of documentation! This little code snippet below should be enough to get you started [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/net-dock-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Blocking Queue</title>
		<link>http://programanddesign.com/cs/c-blocking-queue/</link>
		<comments>http://programanddesign.com/cs/c-blocking-queue/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 04:37:26 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[multi-threaded]]></category>
		<category><![CDATA[producer-consumer]]></category>

		<guid isPermaLink="false">http://programanddesign.com/?p=306</guid>
		<description><![CDATA[If you're writing a threaded application in C# and you need to wait until a resource becomes available, you can use this class. Very handy for producer/consumer scenarios. public class BlockingQueue&#60;T&#62; &#123; &#160; &#160; Queue&#60;T&#62; que = new Queue&#60;T&#62;&#40;&#41;; &#160; &#160; Semaphore sem = new Semaphore&#40;0, Int32.MaxValue&#41;; &#160; &#160; public void Enqueue&#40;T item&#41; &#160; &#160; [...]]]></description>
		<wfw:commentRss>http://programanddesign.com/cs/c-blocking-queue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

