<?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>Just Enough Technology</title>
	<atom:link href="http://justenoughtechnology.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://justenoughtechnology.com</link>
	<description>The passion to see business leverage technology both powerfully and economically</description>
	<lastBuildDate>Wed, 17 Aug 2011 22:48:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Great Cartoon!</title>
		<link>http://justenoughtechnology.com/?p=329</link>
		<comments>http://justenoughtechnology.com/?p=329#comments</comments>
		<pubDate>Wed, 17 Aug 2011 22:48:00 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=329</guid>
		<description><![CDATA[Someone at the office sent this to me. I don’t know where it came from but it made me laugh! No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Someone at the office sent this to me. I don’t know where it came from but it made me laugh!</p>
<p><span id="more-329"></span>
<p><a href="http://justenoughtechnology.com/wp-content/uploads/2011/08/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://justenoughtechnology.com/wp-content/uploads/2011/08/image_thumb.png" width="677" height="637" /></a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<!-- end wp-tags-to-technorati -->



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=329</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam where art thou?</title>
		<link>http://justenoughtechnology.com/?p=324</link>
		<comments>http://justenoughtechnology.com/?p=324#comments</comments>
		<pubDate>Wed, 17 Aug 2011 22:44:44 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=324</guid>
		<description><![CDATA[&#8220;Spam will be a thing of the past in two years&#8217; time.&#8221; Bill Gates, BBC News, 2004 Bill Gates might not have actually said the quote about 640k RAM being enough for anyone, but he did say the above statement. Too bad it didn&#8217;t prove true. No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>&#8220;Spam will be a thing of the past in two years&#8217; time.&#8221; Bill Gates, BBC News, 2004</p>
<p>Bill Gates might not have actually said the quote about 640k RAM being enough for anyone, but he did say the above statement. Too bad it didn&#8217;t prove true.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<!-- end wp-tags-to-technorati -->



<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=324</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Work Table Woes</title>
		<link>http://justenoughtechnology.com/?p=321</link>
		<comments>http://justenoughtechnology.com/?p=321#comments</comments>
		<pubDate>Wed, 17 Aug 2011 03:56:45 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Help and Info]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=321</guid>
		<description><![CDATA[One of our premiere clients has an online store that we created for them using MS Commerce Server. The client’s ERP system is the system of record for product data and the orders placed online. Our MCSC (Commerce Server) web application interfaces with the source system through a set of stored procedures that were created [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=195' rel='bookmark' title='Another Security Breach'>Another Security Breach</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of our premiere clients has an online store that we created for them using MS Commerce Server. The client’s ERP system is the system of record for product data and the orders placed online. Our MCSC (Commerce Server) web application interfaces with the source system through a set of stored procedures that were created by and are maintained by another vendor. The “real” source system is in California while the web app is hosted by us in Florida. When web app was first deigned the other vendor recommended to the client that a local copy of the source database be created in Florida and they would synch the 2 systems through a proprietary mechanism they had developed. Our web application calls the aforementioned stored procedures to synch MSCS with the source data. We are bringing in product data inventory, pricing,etc. From the beginning there have been issues with the synching of data. These issues were intermittent and not a very big problem.</p>
<p>Now the system has grown considerably and there have been many new processes added that retrieve data from the 3rd party stored procedures. The number of hits on the web application has also grown considerably. Today this little problem has become a nightmare. BUT I found the culprit.</p>
<p><span id="more-321"></span>
<p>I had occasion to review the sprocs in question while debugging some of these synch issues. One day while calling one of the sprocs manually, it started returning different data on each call – for the same product SKU! As quickly as it started, the weird behavior ceased. “Wow”, I thought. “They must be doing some updates on the database or something”. And the synch issues became worse yet.</p>
<p>The other day, I really took a hard look at one of the sprocs that is at the core of one of the calls we make to get product data. I had to look twice to be sure I was seeing the code correctly. Throughout many of the stored procedures, the vendor had used permanent tables as temporary tables. Now we all know that temp tables can be performance problems and using a real table could increase performance ( although there are still compilation and stats issues). I had a theory, so I created a little app to prove it.</p>
<p>I created a console app that called and recalled the sproc passing the same product SKU again and again. The app simply logs that data returned from the sproc. When I ran the app, I got what I expected – no errors and the correct data. Then I fired up 5 instances of the app at the same time, each with its own SKU. What do you think happened? It’s OK, I’ll wait while you think. That’s right! The data was shared between app instances! Product 1 got product 2, 3 and 4’s data as well as its own. In addition there were a host of errors related to the creation and dropping of the work table.</p>
<p>Ok, so what did I learn? If it smells bad it probably is bad. We had data anomalies for a long time, though they were very intermittent until recently. Since the data came through the sprocs, we should have reviewed them earlier. The good news is now we have hard evidence of where the problem really lies. I don’t envy the other vendor when the client calls…</p>
<p>BTW, if you use real tables as temp tables, you want to use what is called&#160; a Process-Keyed table. This is simply a permanent table with one extra field which is the primary key. This key must be unique amongst all calling processes. The idea is that you add the key to the where clause when selecting from the table thereby guaranteeing you get the right data. Here’s a good article on the concept (and other concepts of sharing data in sprocs):</p>
<p><a href="http://www.sommarskog.se/share_data.html" target="_blank">http://www.sommarskog.se/share_data.html</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=195' rel='bookmark' title='Another Security Breach'>Another Security Breach</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=321</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding a file in TFS</title>
		<link>http://justenoughtechnology.com/?p=316</link>
		<comments>http://justenoughtechnology.com/?p=316#comments</comments>
		<pubDate>Tue, 16 Nov 2010 16:53:42 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Help and Info]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=316</guid>
		<description><![CDATA[Need to find a file in your TFS server? Don&#8217;t know what project a particular file is located in? Here&#8217;s how you can find a file in TFS using the command line tool. I would think this would be a little more straight-forward in VS 2005 and 2008, but it isn&#8217;t. You can&#8217;t do a [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Need to find a file in your TFS server? Don&#8217;t know what project a particular file is located in? Here&#8217;s how you can find a file in TFS using the command line tool. <span id="more-316"></span></p>
<p>I would think this would be a little more straight-forward in VS 2005 and 2008, but it isn&#8217;t. You can&#8217;t do a file name search in the GUI inside VS, but you can through the command line. to do the search:</p>
<ul>
<li> Open a Visual Studio Command Prompt</li>
<li> In the following, replace [filename] and [TfsServer] with the appropriate values and paste into the command window.<br />
tf dir $/*[filename] /recursive /server:http://[TfsServer]:8080</li>
<li> Supply any required credentials after running the command</li>
</ul>
<p>You will be shown all locations of the file in the TFS server.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=316</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find a String Between 2 Strings</title>
		<link>http://justenoughtechnology.com/?p=315</link>
		<comments>http://justenoughtechnology.com/?p=315#comments</comments>
		<pubDate>Thu, 20 May 2010 00:18:00 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Help and Info]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/find-a-string-between-2-strings/</guid>
		<description><![CDATA[Here’s a way to return a substring of string that is between 2 strings in C#. There are other options for doing this, such as RegEx, but this is clean and simple. // This search returns the substring between two strings, so // the first index is moved to the character just after the first [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=309' rel='bookmark' title='Create Singleton in C#'>Create Singleton in C#</a></li>
<li><a href='http://justenoughtechnology.com/?p=300' rel='bookmark' title='Title Case in C#'>Title Case in C#</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here’s a way to return a substring of string that is between 2 strings in C#. There are other options for doing this, such as <font color="#0000ff">RegEx</font>, but this is clean and simple.</p>
<pre class="csharpcode"><span class="rem">// This search returns the substring between two strings, so </span>
<span class="rem">// the first index is moved to the character just after the first string.</span>
<span class="kwrd">int</span> first = str.IndexOf(<span class="str">"$string1$"</span>) + <span class="str">"$string1$"</span>.Length;
<span class="kwrd">int</span> last = str.LastIndexOf(<span class="str">"$string2$"</span>);
<span class="kwrd">string</span> str2 = str.Substring(first, last - first);</pre>
<pre class="csharpcode">&nbsp;</pre>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c653d629-0af4-4c0d-8888-efc9394c6fd9" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/code" rel="tag">code</a>,<a href="http://technorati.com/tags/C%23" rel="tag">C#</a>,<a href="http://technorati.com/tags/code+sample" rel="tag">code sample</a>,<a href="http://technorati.com/tags/Visual+Studio" rel="tag">Visual Studio</a></div>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/C%23' rel='tag' target='_self'>C#</a>, <a class='technorati-link' href='http://technorati.com/tag/Code' rel='tag' target='_self'>Code</a>, <a class='technorati-link' href='http://technorati.com/tag/Code+Sample' rel='tag' target='_self'>Code Sample</a>, <a class='technorati-link' href='http://technorati.com/tag/Visual+Studio' rel='tag' target='_self'>Visual Studio</a></p>

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=309' rel='bookmark' title='Create Singleton in C#'>Create Singleton in C#</a></li>
<li><a href='http://justenoughtechnology.com/?p=300' rel='bookmark' title='Title Case in C#'>Title Case in C#</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=315</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Restore SQL Database</title>
		<link>http://justenoughtechnology.com/?p=313</link>
		<comments>http://justenoughtechnology.com/?p=313#comments</comments>
		<pubDate>Mon, 17 May 2010 22:13:44 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/restore-sql-database/</guid>
		<description><![CDATA[Restoring a SQL Server database from a backup is easy to accomplish in the SQL Server IDE. Well, sometimes. In the real world, I often need to restore a development database, but the restore fails because I cannot gain exclusive access to the database. Some developers will detach the database and reattach it to grab [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
<li><a href='http://justenoughtechnology.com/?p=309' rel='bookmark' title='Create Singleton in C#'>Create Singleton in C#</a></li>
<li><a href='http://justenoughtechnology.com/?p=300' rel='bookmark' title='Title Case in C#'>Title Case in C#</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Restoring a SQL Server database from a backup is easy to accomplish in the SQL Server IDE. Well, sometimes. In the real world, I often need to restore a development database, but the restore fails because I cannot gain exclusive access to the database. Some developers will detach the database and reattach it to grab exclusive access. If there are processes running frequently against the database, that may not work. Neither will killing all connections always work. The solution I’ve found is a short snippet of SQL to grab exclusive access, do the restore and then restore multi-user access. It looks like this:
<p>USE master &#8212; Must be connected to a different database</p>
<pre class="csharpcode"><span class="rem">-- Get exclusive access</span>
<span class="kwrd">ALTER</span> <span class="kwrd">DATABASE</span> XXXXXX_Stage  <span class="kwrd">SET</span> SINGLE_USER <span class="kwrd">WITH</span> <span class="kwrd">ROLLBACK</span> <span class="kwrd">IMMEDIATE</span>;

<span class="rem">-- Restore from disk</span>
<span class="rem">-- Note WITH REPLACE http://msdn.microsoft.com/en-us/library/ms178615.aspx</span>

<span class="kwrd">RESTORE</span> <span class="kwrd">DATABASE</span> XXXXXX_Stage  <span class="kwrd">FROM</span> <span class="kwrd">DISK</span> = <span class="str">'F:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\XXXXXX_Stage _20100505.bak'</span> <span class="kwrd">WITH</span> REPLACE

<span class="rem">-- Restore multi user access</span>
<span class="kwrd">ALTER</span> <span class="kwrd">DATABASE</span> XXXXXX_Stage <span class="kwrd">SET</span> MULTI_USER <span class="kwrd">WITH</span> <span class="kwrd">ROLLBACK</span> <span class="kwrd">IMMEDIATE</span>;</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Note the WITH ROLLBACK clauses. You should take a production database down and make sure all transactions have completed. Then do a restore through the IDE. If you use the code above, you may lose some transactions or logs. This usually doesn’t matter in a test environment.</p>
<p>Have fun!</p>
<p>Technorati Tags: <a href="http://technorati.com/tags/SQL Server" rel="tag">SQL Server</a>,<a href="http://technorati.com/tags/SQL" rel="tag">SQL</a>,<a href="http://technorati.com/tags/Code Sample" rel="tag">Code Sample</a>,<a href="http://technorati.com/tags/Database" rel="tag">Database</a>,<a href="http://technorati.com/tags/Server" rel="tag">Server</a>,<a href="http://technorati.com/tags/backup" rel="tag">backup</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Code' rel='tag' target='_self'>Code</a>, <a class='technorati-link' href='http://technorati.com/tag/Code+Sample' rel='tag' target='_self'>Code Sample</a>, <a class='technorati-link' href='http://technorati.com/tag/Database' rel='tag' target='_self'>Database</a>, <a class='technorati-link' href='http://technorati.com/tag/SQL' rel='tag' target='_self'>SQL</a>, <a class='technorati-link' href='http://technorati.com/tag/SQL+Server' rel='tag' target='_self'>SQL Server</a></p>

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
<li><a href='http://justenoughtechnology.com/?p=309' rel='bookmark' title='Create Singleton in C#'>Create Singleton in C#</a></li>
<li><a href='http://justenoughtechnology.com/?p=300' rel='bookmark' title='Title Case in C#'>Title Case in C#</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=313</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snippet Designed for VS 2008 and VS 2010</title>
		<link>http://justenoughtechnology.com/?p=293</link>
		<comments>http://justenoughtechnology.com/?p=293#comments</comments>
		<pubDate>Sun, 16 May 2010 22:42:07 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Add-in]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=293</guid>
		<description><![CDATA[I love code snippets. Way back in the early VB days, I created add-ins for the IDE that allowed me to create and save an array of short snippets of code and automatically insert them into the code window. I like to use snippets for things that I either don&#8217;t use often enough to remember, [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=309' rel='bookmark' title='Create Singleton in C#'>Create Singleton in C#</a></li>
<li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I love code snippets. Way back in the early VB days, I created add-ins for the IDE that allowed me to create and save an array of short snippets of code and automatically insert them into the code window. I like to use snippets for things that I either don&#8217;t use often enough to remember, or to quickly enter templates for things I use a  lot to save time. Visual Studio .Net has a Snippet Manager and lets you create snippets in XML, but there is no built-in editor. There are a couple of editors available, some stand-alone and at least one called Snippet Designer that is integrated into the IDE. <span id="more-293"></span>Snippet Designer gives you an explorer to find snippets on your drive and a nice editor for creating and saving snippets. One nice feature is you can highlight a section of code and save it as a snippet. Quick and easy. The designer allows you to quickly mark the replacement sections of the code set other properties and will create the &#8220;surround&#8221; type of snippet. Here&#8217;s a screentshot:</p>
<div class="wp-caption alignnone" style="width: 810px"><img title="Snippet Designer" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=SnippetDesigner&amp;DownloadId=102428" alt="Snippet Designer" width="800" height="500" /><p class="wp-caption-text">The Snippet Desginer IDE</p></div>
<p>I like this tool. I have had a few small issues with getting the tool to index alternate snippet folders, but that is a small thing compared to its usefulness. Try it. I think you might like it as much as I do.</p>
<p>Snippet Designer can be downloaded from <a title="Snippet Designer" href="http://snippetdesigner.codeplex.com/" target="_blank">http://snippetdesigner.codeplex.com/</a></p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Add-in' rel='tag' target='_self'>Add-in</a>, <a class='technorati-link' href='http://technorati.com/tag/Code' rel='tag' target='_self'>Code</a>, <a class='technorati-link' href='http://technorati.com/tag/Programming' rel='tag' target='_self'>Programming</a>, <a class='technorati-link' href='http://technorati.com/tag/Software+Development' rel='tag' target='_self'>Software Development</a>, <a class='technorati-link' href='http://technorati.com/tag/Tools' rel='tag' target='_self'>Tools</a>, <a class='technorati-link' href='http://technorati.com/tag/Visual+Studio' rel='tag' target='_self'>Visual Studio</a></p>

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=309' rel='bookmark' title='Create Singleton in C#'>Create Singleton in C#</a></li>
<li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=293</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Singleton in C#</title>
		<link>http://justenoughtechnology.com/?p=309</link>
		<comments>http://justenoughtechnology.com/?p=309#comments</comments>
		<pubDate>Tue, 11 May 2010 04:02:57 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[Architecture and Design]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=309</guid>
		<description><![CDATA[One of the most basic and most useful object patterns is the Singleton design pattern. A Singleton is a class of which there will only be one instance created at any time. All users of the Singleton class will all use the same instance. This is great for a wide range of applications such as [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
<li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=300' rel='bookmark' title='Title Case in C#'>Title Case in C#</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the most basic and most useful object patterns is the Singleton design pattern. A Singleton is a class of which there will only be one instance created at any time. All users of the Singleton class will all use the same instance. This is great for a wide range of applications such as cached values and lookups or utilities that execute quickly. The Design Patterns book by Gamma et al . describes the structure of a basic Singleton. We&#8217;ll describe how to create one in C#. </p>
<p> <span id="more-309"></span>
<p>The classic approach to creating a Singleton looks like this:    </p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> SingletonGamma
 {
      <span class="kwrd">private</span> <span class="kwrd">static</span> SingletonGamma instance;
      <span class="kwrd">private</span> SingletonGamma()  { }

      <span class="kwrd">public</span> <span class="kwrd">static</span> SingletonGamma Instance
     {
         get </pre>
<pre class="csharpcode">         {
            <span class="kwrd">if</span> (instance == <span class="kwrd">null</span>) { instance = <span class="kwrd">new</span> SingletonGamma(); }
            <span class="kwrd">return</span> instance;
         }
     }
 } </pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>
  </p>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>The basic approach is&#160; to create a private constructor and an Instance method that returns the current instance if available, or returns a new instance if there is no current instance. We call that &quot;lazy instantiation&quot;. The problem with this approach in C# is that it is not strictly thread-safe. That is, it is possible for 2 threads to create separate instances is some circumstances. This is not what we are looking to do. This approach does have an advantage in that there is a hook-point to do post-instantiation processing if required. In .Net though, this is not the approach usually recommended</p>
<p>The following example takes advantage of the better handling of variable ambiguity in .Net (vs. C++) to create a thread-safe Singleton:</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">sealed</span> <span class="kwrd">class</span> SingletonCSharp
    {
        <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">readonly</span> Singleton instance = <span class="kwrd">new</span> SingletonCSharp();

        <span class="kwrd">private</span> SingletonCSharp() { }

        <span class="kwrd">public</span> <span class="kwrd">static</span> SingletonCSharp Instance
        {
            get
            {
                <span class="kwrd">return</span> instance;
            }
        }
    }</pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>
  <br />This is the preferred approach in C# and is adequate for most programs. There are other approaches that allow for more flexibility and still maintain thread safety, but they introduce unnecessary complexity for most programs. Note the read only instance property that can only be set during instantiation and the sealed keyword that prevents inheritance of the class which could introduce unwanted side effects, such as secondary instances. This is a simple and straightforward approach to the design pattern. The only downside is the lack of flexibility to have non-standard constructors. For most applications, that will not be an issue.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Code' rel='tag' target='_self'>Code</a>, <a class='technorati-link' href='http://technorati.com/tag/Design' rel='tag' target='_self'>Design</a>, <a class='technorati-link' href='http://technorati.com/tag/Programming' rel='tag' target='_self'>Programming</a>, <a class='technorati-link' href='http://technorati.com/tag/Software+Development' rel='tag' target='_self'>Software Development</a>, <a class='technorati-link' href='http://technorati.com/tag/Tips' rel='tag' target='_self'>Tips</a>, <a class='technorati-link' href='http://technorati.com/tag/Visual+Studio' rel='tag' target='_self'>Visual Studio</a></p>

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
<li><a href='http://justenoughtechnology.com/?p=313' rel='bookmark' title='Restore SQL Database'>Restore SQL Database</a></li>
<li><a href='http://justenoughtechnology.com/?p=300' rel='bookmark' title='Title Case in C#'>Title Case in C#</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=309</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Title Case in C#</title>
		<link>http://justenoughtechnology.com/?p=300</link>
		<comments>http://justenoughtechnology.com/?p=300#comments</comments>
		<pubDate>Thu, 06 May 2010 03:05:31 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=300</guid>
		<description><![CDATA[Here a quick snippet to convert text to Title Case in C# that uses the TextInfo class. Note that strings with all caps will not be converted, so convert to lower case first. // Defines the string with mixed casing. string myString = "this iS a StrIng with MIXED CaSe"; // Create a TextInfo based [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Here a quick snippet to convert text to Title Case in C# that uses the TextInfo class. Note that strings with all caps will not be converted, so convert to lower case first.</p>
<pre name="code" class="c-sharp">
// Defines the string with mixed casing.
string myString = "this iS a StrIng with MIXED CaSe";

// Create a TextInfo based on the "en-US" culture.
TextInfo tInfo = new CultureInfo("en-US", false).TextInfo;

// Changes a string to titlecase.
// Note the ToLower(), needed to convert words in all caps like MIXED
Console.WriteLine("\"{0}\" to titlecase: {1}", myString, tInfo.ToTitleCase(myString.ToLower()));

//Result: This Is A String With Mixed Case
Console.ReadLine();
</pre>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<p><!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:TrackMoves /> <w:TrackFormatting /> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF /> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> <w:SplitPgBreakAndParaMark /> <w:DontVertAlignCellWithSp /> <w:DontBreakConstrainedForcedTables /> <w:DontVertAlignInTxbx /> <w:Word11KerningPairs /> <w:CachedColBalance /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math" /> <m:brkBin m:val="before" /> <m:brkBinSub m:val="&#45;-" /> <m:smallFrac m:val="off" /> <m:dispDef /> <m:lMargin m:val="0" /> <m:rMargin m:val="0" /> <m:defJc m:val="centerGroup" /> <m:wrapIndent m:val="1440" /> <m:intLim m:val="subSup" /> <m:naryLim m:val="undOvr" /> </m:mathPr></w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"   DefSemiHidden="true" DefQFormat="false" DefPriority="99"   LatentStyleCount="267"> <w:LsdException Locked="false" Priority="0" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Normal" /> <w:LsdException Locked="false" Priority="9" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="heading 1" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8" /> <w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9" /> <w:LsdException Locked="false" Priority="39" Name="toc 1" /> <w:LsdException Locked="false" Priority="39" Name="toc 2" /> <w:LsdException Locked="false" Priority="39" Name="toc 3" /> <w:LsdException Locked="false" Priority="39" Name="toc 4" /> <w:LsdException Locked="false" Priority="39" Name="toc 5" /> <w:LsdException Locked="false" Priority="39" Name="toc 6" /> <w:LsdException Locked="false" Priority="39" Name="toc 7" /> <w:LsdException Locked="false" Priority="39" Name="toc 8" /> <w:LsdException Locked="false" Priority="39" Name="toc 9" /> <w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption" /> <w:LsdException Locked="false" Priority="10" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Title" /> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font" /> <w:LsdException Locked="false" Priority="11" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtitle" /> <w:LsdException Locked="false" Priority="22" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Strong" /> <w:LsdException Locked="false" Priority="20" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Emphasis" /> <w:LsdException Locked="false" Priority="59" SemiHidden="false"    UnhideWhenUsed="false" Name="Table Grid" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text" /> <w:LsdException Locked="false" Priority="1" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="No Spacing" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 1" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 1" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 1" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 1" /> <w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision" /> <w:LsdException Locked="false" Priority="34" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="List Paragraph" /> <w:LsdException Locked="false" Priority="29" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Quote" /> <w:LsdException Locked="false" Priority="30" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Quote" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 1" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 1" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 1" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 1" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 1" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 2" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 2" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 2" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 2" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 2" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 2" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 2" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 2" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 2" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 3" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 3" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 3" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 3" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 3" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 3" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 3" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 3" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 3" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 4" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 4" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 4" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 4" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 4" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 4" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 4" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 4" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 4" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 5" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 5" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 5" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 5" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 5" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 5" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 5" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 5" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 5" /> <w:LsdException Locked="false" Priority="60" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Shading Accent 6" /> <w:LsdException Locked="false" Priority="61" SemiHidden="false"    UnhideWhenUsed="false" Name="Light List Accent 6" /> <w:LsdException Locked="false" Priority="62" SemiHidden="false"    UnhideWhenUsed="false" Name="Light Grid Accent 6" /> <w:LsdException Locked="false" Priority="63" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6" /> <w:LsdException Locked="false" Priority="64" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6" /> <w:LsdException Locked="false" Priority="65" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 1 Accent 6" /> <w:LsdException Locked="false" Priority="66" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium List 2 Accent 6" /> <w:LsdException Locked="false" Priority="67" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6" /> <w:LsdException Locked="false" Priority="68" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6" /> <w:LsdException Locked="false" Priority="69" SemiHidden="false"    UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6" /> <w:LsdException Locked="false" Priority="70" SemiHidden="false"    UnhideWhenUsed="false" Name="Dark List Accent 6" /> <w:LsdException Locked="false" Priority="71" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Shading Accent 6" /> <w:LsdException Locked="false" Priority="72" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful List Accent 6" /> <w:LsdException Locked="false" Priority="73" SemiHidden="false"    UnhideWhenUsed="false" Name="Colorful Grid Accent 6" /> <w:LsdException Locked="false" Priority="19" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis" /> <w:LsdException Locked="false" Priority="21" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis" /> <w:LsdException Locked="false" Priority="31" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference" /> <w:LsdException Locked="false" Priority="32" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Intense Reference" /> <w:LsdException Locked="false" Priority="33" SemiHidden="false"    UnhideWhenUsed="false" QFormat="true" Name="Book Title" /> <w:LsdException Locked="false" Priority="37" Name="Bibliography" /> <w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading" /> </w:LatentStyles> </xml><![endif]--><!--  /* Font Definitions */  @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:1; 	mso-generic-font-family:roman; 	mso-font-format:other; 	mso-font-pitch:variable; 	mso-font-signature:0 0 0 0 0 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-520092929 1073786111 9 0 415 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0in; 	margin-right:0in; 	margin-bottom:10.0pt; 	margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:Calibri; 	mso-fareast-theme-font:minor-latin; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:8.5in 11.0in; 	margin:1.0in 1.0in 1.0in 1.0in; 	mso-header-margin:.5in; 	mso-footer-margin:.5in; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --><!--[if gte mso 10]> <mce:style><!   /* Style Definitions */  table.MsoNormalTable 	{mso-style-name:"Table Normal"; 	mso-tstyle-rowband-size:0; 	mso-tstyle-colband-size:0; 	mso-style-noshow:yes; 	mso-style-priority:99; 	mso-style-qformat:yes; 	mso-style-parent:""; 	mso-padding-alt:0in 5.4pt 0in 5.4pt; 	mso-para-margin-top:0in; 	mso-para-margin-right:0in; 	mso-para-margin-bottom:10.0pt; 	mso-para-margin-left:0in; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:"Times New Roman"; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} --> <!--[endif]--></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: green;">// Defines the string with mixed casing.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: blue;">string</span><span style="font-size: 10pt; font-family: &amp;amp;amp;"> myString = <span style="color: #a31515;">&#8220;this iS a StrIng with MIXED CaSe&#8221;</span>;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: green;">// Create a TextInfo based on the &#8220;en-US&#8221; culture.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: #2b91af;">TextInfo</span><span style="font-size: 10pt; font-family: &amp;amp;amp;"> tInfo = <span style="color: blue;">new</span> <span style="color: #2b91af;">CultureInfo</span>(<span style="color: #a31515;">&#8220;en-US&#8221;</span>, <span style="color: blue;">false</span>).TextInfo;</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: green;">// Changes a string to titlecase. </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: green;">// Note the ToLower(), needed to convert words in all caps like MIXED</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: #2b91af;">Console</span><span style="font-size: 10pt; font-family: &amp;amp;amp;">.WriteLine(<span style="color: #a31515;">&#8220;\&#8221;{0}\&#8221; to titlecase: {1}&#8221;</span>, myString, tInfo.ToTitleCase(myString.ToLower()));</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp;"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"><span style="font-size: 10pt; font-family: &amp;amp;amp; color: green;">//Result: This Is A String With Mixed Case</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; line-height: 115%; font-family: &amp;amp;amp; color: #2b91af;">Console</span><span style="font-size: 10pt; line-height: 115%; font-family: &amp;amp;amp;">.ReadLine();</span></p>
</div>

<!-- start wp-tags-to-technorati 1.02 -->

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=315' rel='bookmark' title='Find a String Between 2 Strings'>Find a String Between 2 Strings</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=300</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eco-Friendly PC Disposal</title>
		<link>http://justenoughtechnology.com/?p=289</link>
		<comments>http://justenoughtechnology.com/?p=289#comments</comments>
		<pubDate>Wed, 31 Mar 2010 14:47:45 +0000</pubDate>
		<dc:creator>Dave Ranck</dc:creator>
				<category><![CDATA[Help and Info]]></category>
		<category><![CDATA[Resources]]></category>
		<category><![CDATA[Ecology]]></category>
		<category><![CDATA[Help]]></category>

		<guid isPermaLink="false">http://justenoughtechnology.com/?p=289</guid>
		<description><![CDATA[What do you do with old PCs, cell phones and other e-devices? Staples has an eco-friendly disposal program. Dell products are free as are cell phones and some other devices. Other PCs, laptops cost about $10 US. They also destroy the data on the drives. Be friendly to the planet when you dispose of old [...]


Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=195' rel='bookmark' title='Another Security Breach'>Another Security Breach</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p class="UIIntentionalStory_Message"><span class="UIStory_Message">What do you do with old PCs, cell phones and  other e-devices? Staples has an eco-friendly disposal program. Dell  products are free as are cell phones and some other devices. Other PCs,  laptops cost about $10 US. They also destroy the data on the drives.</span></p>
<p>Be  friendly to the planet when you dispose of old PCs!</p>
<p class="UIIntentionalStory_Message"><span class="UIStory_Message"><a title="Staples.com® EcoEasy. Make a difference. We'll make it easy." href="http://www.staples.com/sbd/cre/marketing/ecoeasy/index2.html" target="_blank">http://www.staples.com/sbd/cre/marketing/ecoeasy/index2.html</a><br /></span></p>
<p> </p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">
<h3 class="UIIntentionalStory_Message"><span class="UIStory_Message">What do you do with old PCs, cell phones and  other e-devices? Staples has a eco-friendly disposal program. Dell  products are free as are cell phones and some other devices. Other PCs,  laptops cost about $10 US. They also destroy the data on the drives.
<p> </p>
<p>Be  friendly to the planet when you dispose of old PCs!</p>
<p></span></h3>
</div>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/Ecology' rel='tag' target='_self'>Ecology</a>, <a class='technorati-link' href='http://technorati.com/tag/Help' rel='tag' target='_self'>Help</a>, <a class='technorati-link' href='http://technorati.com/tag/Resources' rel='tag' target='_self'>Resources</a></p>

<!-- end wp-tags-to-technorati -->



<p>Related posts:<ol><li><a href='http://justenoughtechnology.com/?p=195' rel='bookmark' title='Another Security Breach'>Another Security Breach</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://justenoughtechnology.com/?feed=rss2&#038;p=289</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

