<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Fun with .NET and SQL Server</title>
	<atom:link href="http://3poundmass.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://3poundmass.wordpress.com</link>
	<description>Web development with Microsoft technologies</description>
	<lastBuildDate>Sun, 27 Jan 2008 06:45:14 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='3poundmass.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2805b4590a6176927c643ea7efc58167?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Fun with .NET and SQL Server</title>
		<link>http://3poundmass.wordpress.com</link>
	</image>
			<item>
		<title>.NET Framework 3.5 Reference Poster</title>
		<link>http://3poundmass.wordpress.com/2008/01/27/net-framework-35-reference-poster/</link>
		<comments>http://3poundmass.wordpress.com/2008/01/27/net-framework-35-reference-poster/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 06:45:14 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/?p=97</guid>
		<description><![CDATA[This slick .NET 3.5 reference poster is available as a free download from MSDN.  It lists the most commonly used types and namespaces in the framework, and makes a great addition to any .NET developer&#8217;s workspace:

It&#8217;s getting harder and harder to keep up with .NET&#8217;s continutally expanding scope, but this poster makes a handy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=97&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This slick <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7b645f3a-6d22-4548-a0d8-c2a27e1917f8&amp;DisplayLang=en">.NET 3.5 reference poster</a> is available as a <b>free download</b> from MSDN.  It lists the most commonly used <b>types and namespaces</b> in the framework, and makes a great addition to any .NET developer&#8217;s workspace:</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7b645f3a-6d22-4548-a0d8-c2a27e1917f8&amp;DisplayLang=en" title=".NET 3.5 Reference Poster"><img src="http://3poundmass.files.wordpress.com/2007/12/dotnet-poster.png" alt=".NET 3.5 Poster" style="border:1px solid #dddddd;" /></a></p>
<p>It&#8217;s getting harder and harder to keep up with <a href="http://asp.net/downloads/3.5-extensions/">.NET&#8217;s continutally expanding scope</a>, but this poster makes a handy reminder of what&#8217;s available, with information on which classes were added in .NET 3.0, and which were introduced in 3.5.</p>
<p>A broad cross-section is covered across all areas of the .NET Framework:</p>
<ul>
<li>ASP.NET</li>
<li>WinForms and WPF</li>
<li>Communications and Workflow</li>
<li>Data, XML and LINQ</li>
<li>Fundamentals</li>
</ul>
<p><u><b>Printing</b></u></p>
<p>The hi-res version is Microsoft <a href="http://en.wikipedia.org/wiki/XML_Paper_Specification">XPS</a> format, so if you&#8217;re not using Vista or Office 2007 then you might want the <a href="http://www.microsoft.com/whdc/xps/viewxps.mspx">Microsoft XPS Viewer</a>. Also, for &#8216;easy printing&#8217;, there&#8217;s a 16 page 4&#215;4 version, but remember: &#8217;some assembly is required if you choose this print method&#8217;, so remember to ask an adult for help with the scissors.</p>
<p>My local print shop printed and laminated the PDF version onto A1, which is easily hi-res enough and looks great.</p>
<p><u><b>Other .NET Reference Posters</b></u></p>
<p>There are other reference posters on MSDN, in particular I like the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=811d8ad6-8d48-4684-b08c-686462d58a56&amp;DisplayLang=en">Silverlight Developer Reference</a>, and <b>keyboard shortcuts for Visual Studio 2008</b>, available for both <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e5f902a8-5bb5-4cc6-907e-472809749973&amp;DisplayLang=en">C# </a>and <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=255b8cf1-f6bd-4b55-bb42-dd1a69315833&amp;DisplayLang=en">Visual Basic</a>.</p>
<p>(Thanks to <a href="http://blogs.msdn.com/cbowen/archive/2007/12/09/got-tech-posters.aspx">Chris Bowen</a> for the tip off.)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/97/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/97/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=97&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2008/01/27/net-framework-35-reference-poster/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>

		<media:content url="http://3poundmass.files.wordpress.com/2007/12/dotnet-poster.png" medium="image">
			<media:title type="html">.NET 3.5 Poster</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server 2008 will have IntelliSense</title>
		<link>http://3poundmass.wordpress.com/2007/11/30/sql-server-2008-will-have-intellisense/</link>
		<comments>http://3poundmass.wordpress.com/2007/11/30/sql-server-2008-will-have-intellisense/#comments</comments>
		<pubDate>Fri, 30 Nov 2007 02:59:36 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[sql server 2008]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/11/30/sql-server-2008-will-have-intellisense/</guid>
		<description><![CDATA[With so many exciting new features in Visual Studio 2008 to play with, I haven&#8217;t had much time to look at the preview releases of SQL Server 2008, alias Katmai.  The last I heard was there wouldn&#8217;t be much new stuff for developers, just features for DBAs and BI analysts with a few performance [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=94&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>With so many exciting <a href="http://weblogs.asp.net/scottgu/archive/2007/11/19/visual-studio-2008-and-net-3-5-released.aspx">new features in Visual Studio 2008</a> to play with, I haven&#8217;t had much time to look at the preview releases of <strong>SQL Server 2008</strong>, alias Katmai.  The last I heard was there wouldn&#8217;t be much new stuff for developers, just features for <strong>DBAs</strong> and <strong>BI analysts</strong> with a few performance optimisations thrown in.</p>
<p>The previous upgrade, SQL Server 2000 to 2005, was a huge step forward for developers and added <strong>significant advances</strong> like CLR integration, SQL Server Management Objects (SMO), Integration Services (SSIS) and a native XML data type; as well as T-SQL enhancements like Common Table Expressions (CTEs), structured error handling with try/catch, pivot, apply, top(n) and row_number.</p>
<p>So I was surprised to see how much new stuff is packed into the latest <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=3BF4C5CA-B905-4EBC-8901-1D4C1D1DA884&amp;displaylang=en">SQL Server 2008 CTP release</a>, even, finally, <strong>IntelliSense for Management Studio</strong>, which was much anticipated but conspicuously absent from 2005:</p>
<p><a href="http://3poundmass.files.wordpress.com/2007/11/sql2008-intellisense.png" title="SQL Server 2008 IntelliSense"><img src="http://3poundmass.files.wordpress.com/2007/11/sql2008-intellisense.png" alt="SQL Server 2008 IntelliSense" /></a></p>
<p>Also notice the new <strong>collapsible code regions</strong>, just like you get in Visual Studio.  Editing T-SQL has never been such fun!  Although, you have to feel a bit sorry for RedGate, whose <a href="http://www.red-gate.com/products/sql_prompt/index.htm">SQL Prompt</a> plug-in has been filling the auto-completion gap for the last few years.</p>
<p>The groovy new features don&#8217;t end with IntelliSense, there are plenty more being sneaked into SQL 2008.  I&#8217;ll be looking at more soon.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2f3poundmass.wordpress.com%2f2007%2f11%2f30%2fsql-server-2008-will-have-intellisense%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2f3poundmass.wordpress.com%2f2007%2f11%2f30%2fsql-server-2008-will-have-intellisense%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/94/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/94/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=94&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/11/30/sql-server-2008-will-have-intellisense/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>

		<media:content url="http://3poundmass.files.wordpress.com/2007/11/sql2008-intellisense.png" medium="image">
			<media:title type="html">SQL Server 2008 IntelliSense</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2f3poundmass.wordpress.com%2f2007%2f11%2f30%2fsql-server-2008-will-have-intellisense%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>MCPD Web Developer exam 70-547 hints and tips</title>
		<link>http://3poundmass.wordpress.com/2007/11/22/mcpd-web-developer-exam-70-547-hints-and-tips/</link>
		<comments>http://3poundmass.wordpress.com/2007/11/22/mcpd-web-developer-exam-70-547-hints-and-tips/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 07:35:30 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[mcpd]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/11/22/mcpd-web-developer-exam-70-547-hints-and-tips/</guid>
		<description><![CDATA[Following my post about studying toward MCPD certification, I&#8217;ve now taken the exam and am pleased to say I passed with a good score.  The exam 70-547 is about designing and developing web applications using ASP.NET 2.0.  It focuses on the full software development lifecycle and covers planning, architecture, design, testing and deployment, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=91&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Following my post about <a href="http://3poundmass.wordpress.com/2007/08/19/exam-70-547-mcpd-web-developer/">studying toward MCPD certification</a>, I&#8217;ve now taken the exam and am pleased to say I passed with a good score.  The exam <a href="http://www.microsoft.com/learning/exams/70-547.mspx">70-547</a> is about designing and developing web applications using ASP.NET 2.0.  It focuses on the full <strong>software development lifecycle</strong> and covers planning, architecture, design, testing and deployment, where as the prerequisite MCTS exams cover more of the actual <strong>coding and implementation</strong> details.</p>
<p>My main study guide was the official Microsoft Press book, <a href="http://www.amazon.com/MCPD-Self-Paced-Training-Exam-70-547/dp/0735623406/">MCPD Self-Paced Training Kit (Exam 70-547)</a>.   It covered the syllabus thoroughly enough to get me through the exam, but like most similar books <strong>wasn&#8217;t much fun to read</strong>.  It&#8217;s over 700 pages, and after the first few hundred the content starts to get fairly monotonous.  It&#8217;s also difficult to skim because you might miss something <strong>essential</strong> for the exam.   If you&#8217;re an experienced developer then you might not learn much, but if you&#8217;re new to coding then you should find plenty of useful information about broader areas of software development, such as <strong>architecture, data modelling and unit testing</strong>.</p>
<p>A lot of the testing chapters read like an advert for <strong>Visual Studio Team System</strong> (VSTS) and aggressively promote its unit testing and web load testing capabilities.  There&#8217;s nothing wrong with that, it&#8217;s a Microsoft exam after all, but you will need <strong>Visual Studio Team Test</strong> if you want to work through the practical exercises (an evaluation version is available).  The unit testing in VSTS is impressive, but doesn&#8217;t seem to offer much over the freely available <a href="http://www.nunit.org/">NUnit</a>.  The web load testing on the other hand is invaluable.</p>
<p>My best advice for the book is to read it in <strong>short frequent bursts</strong>.  Try to read a little bit every day and you&#8217;ll easily work through it, so don&#8217;t be intimidated.  If you find yourself slacking, just register for the exam and you&#8217;ll soon become motivated.  And remember to use the <strong>15% exam discount</strong> voucher that comes with the book.</p>
<p>My other study resource, which I also used for the MCTS exams, was the <a href="http://www.measureup.com/catalog/exam.aspx?vid=5&amp;cid=MCPD&amp;tid=13">practice test</a> from <strong>MeasureUp.</strong> The questions are very relevant to the actual exam, and helped highlight areas to focus my study.  The most useful feature is that every answer has an <strong>explanation</strong>, so if you get one wrong you can see why and hopefully fill a gap in your knowledge.</p>
<p>The exam isn&#8217;t easy, but many questions appeal to <strong>common sense</strong> as well as technical expertise, and there aren&#8217;t any trick questions.  There&#8217;s more than enough time to work through the 40 multiple-choice questions, so be careful to read each one closely and <strong>don&#8217;t panic</strong>.  Some questions ask you to pick more than one answer so follow the instructions carefully.  The passing score is 700 out of 1000.</p>
<p>According to Microsoft&#8217;s statistics there are <strong>only 2,147</strong> MCPD web developers <strong>worldwide</strong>, so if you want to improve your skills, stand out in the job market, or negotiate a promotion then certification could be a <strong>great career move</strong>.</p>
<p>My next goal is MCTS certification for <strong>SQL Server</strong> and exam <a href="http://www.microsoft.com/learning/exams/70-431.mspx">70–431</a>. Then it shouldn&#8217;t be too long before the next generation of <strong>.NET 3.5</strong> MCTS are available.</p>
<p>Let me know your experiences of studying of taking the MCPD exams in the comments below.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/91/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/91/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=91&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/11/22/mcpd-web-developer-exam-70-547-hints-and-tips/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>
	</item>
		<item>
		<title>Finding orphaned stored procedures and user-defined functions in SQL Server</title>
		<link>http://3poundmass.wordpress.com/2007/11/22/finding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server/</link>
		<comments>http://3poundmass.wordpress.com/2007/11/22/finding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 02:49:14 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/11/22/finding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server/</guid>
		<description><![CDATA[I&#8217;m currently working on a group of ASP.NET 2.0 websites deployed across about thirty countries.  The local flagship site runs on an upgraded version of the original code, and I&#8217;m now in the process of bringing all the other sites onto the new improved version.
Over time, new features have been introduced to the site, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=90&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m currently working on a group of <strong>ASP.NET 2.0 websites</strong> deployed across about <strong>thirty countries</strong>.  The local flagship site runs on an upgraded version of the original code, and I&#8217;m now in the process of bringing all the other sites onto the new improved version.</p>
<p>Over time, new features have been introduced to the site, and old ones removed.  Consequently the <strong>SQL Server database</strong> now contains many <strong>redundant tables</strong> that aren&#8217;t used.  So, before cascading out the current schema to the other countries, it&#8217;s time for a clean up.</p>
<p>I managed to identify about 60 tables that aren&#8217;t used by the application and can safely can be dropped or archived.  However, I&#8217;m now left with <strong>hundreds of stored procedures</strong> (SPs) and user-defined functions (UDFs) that were associated with these tables, which can also be removed.</p>
<p>The problem was how to find these <strong>orphaned objects</strong>.  My first approach was a small .NET <strong>console application </strong>which uses <a href="http://technet.microsoft.com/en-us/library/ms162169.aspx">SQL Server Management Objects</a> (SMO).  It loops through all SPs and UDFs and finds any that have <strong>no dependencies</strong>.</p>
<pre style="margin:0;"><span style="color:blue;">public</span> <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">string</span>&gt; FindOrphans()</pre>
<pre style="margin:0;">{</pre>
<pre style="margin:0;">    <span style="color:#2b91af;">Server</span> server = <span style="color:blue;">new</span> <span style="color:#2b91af;">Server</span>(<span style="color:#a31515;">"."</span>);</pre>
<pre style="margin:0;">    <span style="color:#2b91af;">Database</span> db = server.Databases[<span style="color:#a31515;">"MyDatabase"</span>];</pre>
<pre style="margin:0;">    <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">string</span>&gt; orphans = <span style="color:blue;">new</span> <span style="color:#2b91af;">List</span>&lt;<span style="color:blue;">string</span>&gt;();</pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;">    <span style="color:green;">// get list of SPs</span></pre>
<pre style="margin:0;">    <span style="color:#2b91af;">UrnCollection</span> urns = <span style="color:blue;">new</span> <span style="color:#2b91af;">UrnCollection</span>();</pre>
<pre style="margin:0;">    <span style="color:blue;">foreach</span> (<span style="color:#2b91af;">StoredProcedure</span> sp <span style="color:blue;">in</span> db.StoredProcedures)</pre>
<pre style="margin:0;">    {</pre>
<pre style="margin:0;">        <span style="color:green;">// exclude these objects</span></pre>
<pre style="margin:0;">        <span style="color:blue;">if</span> (sp.IsSystemObject) <span style="color:blue;">continue</span>;</pre>
<pre style="margin:0;">        <span style="color:blue;">if</span> (sp.Name.StartsWith(<span style="color:#a31515;">"aspnet_"</span>)) <span style="color:blue;">continue</span>;</pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;">        urns.Add(sp.Urn);</pre>
<pre style="margin:0;">    }</pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;">    <span style="color:green;">// get dependencies</span></pre>
<pre style="margin:0;">    <span style="color:#2b91af;">DependencyWalker</span> dw = <span style="color:blue;">new</span> <span style="color:#2b91af;">DependencyWalker</span>(server);</pre>
<pre style="margin:0;">    <span style="color:#2b91af;">DependencyTree</span> tree = dw.DiscoverDependencies(urns, <span style="color:blue;">true</span>);</pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;">    <span style="color:green;">// find all objects without any dependencies</span></pre>
<pre style="margin:0;">    <span style="color:#2b91af;">DependencyTreeNode</span> node = tree.FirstChild;</pre>
<pre style="margin:0;">    <span style="color:blue;">do</span> {</pre>
<pre style="margin:0;">        <span style="color:blue;">if</span> (!node.HasChildNodes)</pre>
<pre style="margin:0;">        {</pre>
<pre style="margin:0;">            <span style="color:blue;">string</span> name = <span style="color:blue;">new</span> <span style="color:#2b91af;">Urn</span>(node.Urn).GetAttribute(<span style="color:#a31515;">"Name"</span>);</pre>
<pre style="margin:0;">            orphans.Add(name);</pre>
<pre style="margin:0;">        }</pre>
<pre style="margin:0;">        node = node.NextSibling;</pre>
<pre style="margin:0;">    } <span style="color:blue;">while</span> (node != <span style="color:blue;">null</span>);</pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;">    <span style="color:blue;">return</span> orphans;</pre>
<pre style="margin:0;">}</pre>
<p>This works fine, and helped satisfy my current obsession with SMO.  But it&#8217;s a bit awkward, and not easily <strong>portable or modifiable</strong>, to have this pure database operation wrapped up in an executable.  So I looked into doing the same thing with just a <strong>TSQL query</strong>.</p>
<pre style="margin:0;"><span style="color:green;">-- Find all SPs and UDFs have no dependencies</span></pre>
<pre style="margin:0;"><span style="color:blue;">select</span></pre>
<pre style="margin:0;">    <span style="color:blue;">object_name</span>(obj.[object_id]) <span style="color:blue;">as </span>[orphaned_object_name],</pre>
<pre style="margin:0;">    obj.type_desc <span style="color:blue;">as </span>[object_type],</pre>
<pre style="margin:0;">    <span style="color:#a31515;">'DROP ' </span>+</pre>
<pre style="margin:0;">    <span style="color:blue;">case </span>obj.type_desc</pre>
<pre style="margin:0;">        <span style="color:blue;">when </span><span style="color:#a31515;">'SQL_STORED_PROCEDURE' </span><span style="color:blue;">then </span><span style="color:#a31515;">'PROCEDURE'</span></pre>
<pre style="margin:0;">        <span style="color:blue;">else </span><span style="color:#a31515;">'FUNCTION'</span></pre>
<pre style="margin:0;">    <span style="color:blue;">end</span></pre>
<pre style="margin:0;">    + <span style="color:#a31515;">' [' </span>+ <span style="color:blue;">object_name</span>(obj.[object_id]) + <span style="color:#a31515;">']'</span></pre>
<pre style="margin:0;"><span style="color:blue;">from</span></pre>
<pre style="margin:0;">    sys.objects obj</pre>
<pre style="margin:0;">    <span style="color:blue;">left join </span>(<span style="color:blue;">select distinct </span>[object_id] <span style="color:blue;">from </span>sys.sql_dependencies) dep</pre>
<pre style="margin:0;">        <span style="color:blue;">on </span>obj.object_id = dep.object_id</pre>
<pre style="margin:0;"><span style="color:blue;">where</span></pre>
<pre style="margin:0;">    type_desc <span style="color:blue;">in </span>(<span style="color:#a31515;">'SQL_STORED_PROCEDURE'</span>,<span style="color:#a31515;">'SQL_SCALAR_FUNCTION'</span>,<span style="color:#a31515;">'SQL_TABLE_VALUED_FUNCTION'</span>)</pre>
<pre style="margin:0;">    <span style="color:blue;">and object_name</span>(obj.[object_id]) <span style="color:blue;">not like </span><span style="color:#a31515;">'aspnet_%'</span></pre>
<pre style="margin:0;">    <span style="color:blue;">and </span>dep.object_id <span style="color:blue;">is null</span></pre>
<pre style="margin:0;"><span style="color:blue;">order by</span></pre>
<pre style="margin:0;">    obj.type_desc, <span style="color:blue;">object_name</span>(obj.[object_id])</pre>
<p>The query works by checking for dependencies in the <strong>catalog view</strong> <a href="http://msdn2.microsoft.com/en-us/library/ms174402.aspx">sys.sql_dependencies</a>.  This, I think, is a neater solution.  I also included an <strong>auto-generated column</strong> that writes the SQL drop the SP or UDF, which I copied and executed.</p>
<p>Now, if only I could find a quick way to check for dependencies between my application&#8217;s <strong>data access layer </strong>and the database&#8230;</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2f3poundmass.wordpress.com%2f2007%2f11%2f22%2ffinding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2f3poundmass.wordpress.com%2f2007%2f11%2f22%2ffinding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/90/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/90/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/90/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/90/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/90/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=90&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/11/22/finding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2f3poundmass.wordpress.com%2f2007%2f11%2f22%2ffinding-orphaned-stored-procedures-and-user-defined-functions-in-sql-server%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Easy Localization using Factory Methods in .NET</title>
		<link>http://3poundmass.wordpress.com/2007/10/04/easy-localization-using-factory-methods-in-net/</link>
		<comments>http://3poundmass.wordpress.com/2007/10/04/easy-localization-using-factory-methods-in-net/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 03:10:31 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/10/04/easy-localization-using-factory-methods-in-net/</guid>
		<description><![CDATA[ASP.NET 2.0 has some great localization features that make it easy to build multilingual web applications.  The problem comes when you need different business logic for different countries, maybe to validate a local address or calculate shipping costs.  You somehow need to get the application to behave differently based on a country code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=81&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>ASP.NET 2.0 has some great <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/ASP2local.asp">localization features</a> that make it easy to build multilingual web applications.  The problem comes when you need different business logic for different countries, maybe to validate a local address or calculate shipping costs.  You somehow need to get the application to behave differently based on a country code or the thread&#8217;s <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.currentculture(VS.71).aspx">current culture</a> setting.</p>
<p>For simple variations you can use separate configuration settings for each country.  For example, a regular expression in web.config to validate a local telephone number.  But if the logic is more complex then you might need a different plan.</p>
<p>An obvious approach is to use conditional switch/select-case statements, like this:</p>
<pre style="margin:0;"><span style="color:blue;">switch</span> (countryCode)</pre>
<pre style="margin:0;">{</pre>
<pre style="margin:0;"><span style="color:blue;">   case</span> <span style="color:#a31515;">"FR"</span>:</pre>
<pre style="margin:0;">      <span style="color:green;">/* Logic for France */</span></pre>
<pre style="margin:0;">   <span style="color:blue;">case</span> <span style="color:#a31515;">"US"</span>:</pre>
<pre style="margin:0;">      <span style="color:green;">/* Logic for USA */</span></pre>
<pre style="margin:0;">}</pre>
<p>But for large applications this can quickly get unwieldy and difficult to manage.  Adding a new country means finding every switch statement and adding a new case.</p>
<p>Instead, a good solution is the <a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory Method</a> design pattern.  It makes your application much easier to maintain, and adding new countries is easy.   Here&#8217;s a quick example that extends the idea of validating local postcode formats.</p>
<p><strong>Class Diagram</strong></p>
<p>These are the classes used, described below in more detail.</p>
<p><img src="http://3poundmass.files.wordpress.com/2007/08/classdiagram1.png" alt="Abstract method" style="border:1px solid black;" /></p>
<p><strong>Step 1</strong></p>
<p>Create an <a href="http://msdn2.microsoft.com/en-us/library/sf985hc5(VS.80).aspx">abstract class</a> for performing local validation called <em>LocalValidatorBase</em>.  This is a base class which can&#8217;t be instantiated.   Add a method signature <em>IsValidPostcode</em> that takes a string and returns a boolean. Classes for various countries can now derive from <em>LocalValidatorBase</em> and override <em>IsValidPoscode</em> with custom validation logic.</p>
<p>(The <em>LocalValidatorBase</em> class can contain logic to share between all the subclasses, but if this isn&#8217;t necessary then you can create an <a href="http://msdn2.microsoft.com/en-us/library/87d83y5b(VS.80).aspx">interface</a> instead of an abstract class called something like <em>ILocalValidator</em>.)</p>
<p><strong>Step 2</strong></p>
<p>Derive two local validation classes from <em>LocalValidationBase</em> called <em>LocalValidatorAU</em> and <em>LocalValidatorDE</em>, one for Australia and one for Germany.  In each, override <em>IsValidPoscode</em> to perform country-specific logic for validating a postcode, maybe by checking the string length or matching against a <a href="http://support.microsoft.com/kb/308252">regular expression</a>.  The details aren&#8217;t important here.</p>
<p><strong>Step 3</strong></p>
<p>Create a factory class to return the correct validator object for the current country setting.  Add a static/shared factory method called <em>GetLocalValidator</em> that returns a <em>LocalValidatorBase</em> class.  The magic of <a href="http://msdn2.microsoft.com/en-us/library/ms173152(VS.80).aspx">polymorphism</a> means this method can return any class derived from <em>LocalValidatorBase</em>.  Use a switch statement, or some other conditional logic, to return a new instance of <em>LocalValidatorDE</em> or <em>LocalValidatorAU</em> depending on a country code parameter or the thread&#8217;s <a href="http://msdn2.microsoft.com/en-us/library/system.globalization.cultureinfo.currentculture.aspx">current culture</a> name.</p>
<p><strong>Step 4</strong></p>
<p>That&#8217;s all there is to it.  You can now call the factory method to get the correct validator object for the current country.</p>
<pre style="margin:0;"><span style="color:green;">' call the factory method to get a concrete validator</span></pre>
<pre style="margin:0;"><span style="color:blue;">Dim</span> validator <span style="color:blue;">As</span> LocalValidatorBase = _</pre>
<pre style="margin:0;">  LocalValidatorFactory.GetLocalValidator()</pre>
<pre style="margin:0;"></pre>
<pre style="margin:0;"><span style="color:blue;">Dim</span> isValid <span style="color:blue;">As</span> <span style="color:blue;">Boolean</span> = validator.IsValidPostcode(<span style="color:#a31515;">"12345"</span>)</pre>
<p>The validation success depends on the rules in the object returned by <em>GetLocalValidator</em>, which will be different depending on the current country.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/81/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/81/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=81&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/10/04/easy-localization-using-factory-methods-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>

		<media:content url="http://3poundmass.files.wordpress.com/2007/08/classdiagram1.png" medium="image">
			<media:title type="html">Abstract method</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading other people&#8217;s .NET code</title>
		<link>http://3poundmass.wordpress.com/2007/08/27/reading-other-peoples-net-code/</link>
		<comments>http://3poundmass.wordpress.com/2007/08/27/reading-other-peoples-net-code/#comments</comments>
		<pubDate>Mon, 27 Aug 2007 08:38:35 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[codeplex]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[vb.net]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/08/27/reading-other-peoples-net-code/</guid>
		<description><![CDATA[One thing that makes HTML easy to learn is the abundance of examples. You can go to any old website and view the source to see how it&#8217;s put together, or look through templates on a site like Open Source Web Design or Open Source Templates. It&#8217;s easy find examples of good (and bad) practice.
Scott Hanselman&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=73&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>One thing that makes HTML easy to learn is the abundance of examples. You can go to any old website and view the source to see how it&#8217;s put together, or look through templates on a site like <a href="http://www.oswd.org/">Open Source Web Design</a> or <a href="http://opensourcetemplates.org/">Open Source Templates</a>. It&#8217;s easy find examples of good (and bad) practice.</p>
<p>Scott Hanselman&#8217;s article <a href="http://www.hanselman.com/blog/ReadingToBeABetterDeveloperTheCoding4FunDevKit.aspx">Reading to Be a Better Developer</a> got me wondering why we don&#8217;t do this more with <strong>.NET code</strong>, and the problem for me seems to be finding good code examples. Scott recommends looking at the <a href="http://www.codeplex.com/C4FDevKit">Coding4Fun Developer Kit</a>, but I wanted something more specific to web development.</p>
<p>So here are a few places I found ASP.NET source code that&#8217;s worth studying and learning from.</p>
<p><strong>Microsoft Enterprise Library</strong></p>
<p>A great place to start is the <a href="http://msdn2.microsoft.com/en-us/practices/bb190359.aspx">application blocks</a> in Microsoft&#8217;s <a href="http://www.microsoft.com/downloads/details.aspx?familyid=4c557c63-708f-4280-8f0c-637481c31718&amp;displaylang=en">Enterprise Library</a>. These are application service components designed to follow Microsoft best practices and include modules for caching, cryptography, data access, exception handling, logging, policy injection, security and validation.</p>
<p><strong>Website Starter Kits</strong></p>
<p>Another good place to look is the <a href="http://www.asp.net/downloads/starter-kits/">ASP.NET Starter Kit Websites</a>, a collection of working ASP.NET demos that can be examined or built on. They cover DotNetNuke, e-commerce with PayPal, blogging, project time management, media library and plenty more.</p>
<p><strong>Codeplex</strong></p>
<p>Lastly <a href="http://www.codeplex.com/">Codeplex</a>, Microsoft&#8217;s open source project hosting site. There&#8217;s so much goodness here it&#8217;s hard know where to start, so try browsing the most popular or active projects to start. Here are the top ten that caught my eye:</p>
<ul>
<li><span><a href="http://www.codeplex.com/blogengine">BlogEngine.NET</a><br />
Full featured blog engine targeted at .NET developers. It is light weight and very simple to modify and extend.</span></li>
<li><a href="http://www.codeplex.com/umbraco">Umbraco</a><br />
Simple, flexible and friendly ASP.NET CMS</li>
<li><a href="http://www.codeplex.com/DinnerNow">DinnerNow</a><br />
Sample marketplace application designed to demonstrate how you can develop a connected application using IIS7, ASP.NET Ajax Extensions, Linq, WCF, WF, WPF, Powershell, and the .NET Compact Framework.</li>
<li><a href="http://www.codeplex.com/CKS">Community Kit for SharePoint</a><br />
<span>Set of best practices, templates, Web Parts, tools, and source code for creating a community website based on SharePoint.<br />
</span></li>
<li><span><a href="http://www.codeplex.com/FacebookToolkit">Facebook Developer Toolkit</a> and <a href="http://www.codeplex.com/FacebookNET">Facebook.NET</a><br />
.NET wrappers and libraries for the Facebook API.</span></li>
<li><span><a href="http://www.codeplex.com/DbEntry">DbEntry.Net</a><br />
Lightweight, high performance Object Relational Mapping (ORM) database access compnent for .NET 2.0.</span></li>
<li><span><a href="http://www.codeplex.com/publicdomain">PublicDomain</a><br />
</span><span>.NET</span><span> packages for time zone support, logging, dynamic code evaluation, GAC API, unzipping, RSS, Atom, OPML, screen scraping, and utilities for strings, arrays and cryptography.</span></li>
<li><span><a href="http://www.codeplex.com/ASPNETRSSToolkit">ASP.NET RSS Toolkit</a><br />
Gives ASP.NET applications the ability to consume and publish to RSS feeds.</span></li>
<li><a href="http://www.codeplex.com/NGenerics">NGenerics</a><br />
Class library providing generic data structures and algorithms not implemented in the standard .NET framework</li>
<li><a href="http://www.codeplex.com/htmlagilitypack">Html Agility Pack</a><br />
Agile HTML parser that builds a read/write DOM and supports plain XPath or XSLT. The parser is very tolerant with &#8220;real world&#8221; malformed HTML. The object model is very similar to System.Xml, but for HTML documents.</li>
</ul>
<p>If you know any other places to find good quality .NET source code then please leave a comment.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/73/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/73/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/73/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/73/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/73/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=73&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/08/27/reading-other-peoples-net-code/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>
	</item>
		<item>
		<title>Fun Google Searches</title>
		<link>http://3poundmass.wordpress.com/2007/08/24/fun-google-searches/</link>
		<comments>http://3poundmass.wordpress.com/2007/08/24/fun-google-searches/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 08:58:25 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/08/24/fun-google-searches/</guid>
		<description><![CDATA[It&#8217;s amazing how much cool stuff you can do with some of the lesser known Google Search features:

Calculate the most remarkable formula in mathematics
e ^ (pi * i)
Measure very big distances in very small mesurements
1 light year in angstroms
Embiggen your vocabulary
define:euphonious
Find sequels
site:imdb.com rocky 1..5
Bring the Romans into the Information Age
MMVII in binary
Find ebooks
ext:pdf c# guidelines
Find [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=66&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s amazing how much cool stuff you can do with some of the lesser known <strong>Google Search</strong> features:</p>
<ul>
<li>Calculate the most remarkable formula in mathematics<br />
<a href="http://www.google.com/search?q=e+%5E+%28pi+*+i%29">e ^ (pi * i)</a></li>
<li>Measure very big distances in very small mesurements<br />
<a href="http://www.google.com/search?q=1+light+year+in+angstroms">1 light year in angstroms</a></li>
<li>Embiggen your vocabulary<br />
<a href="http://www.google.com/search?q=define%3Aeuphonious">define:euphonious</a></li>
<li>Find sequels<br />
<a href="http://www.google.com/search?q=site%3Aimdb.com+rocky+1..5">site:imdb.com rocky 1..5</a></li>
<li>Bring the Romans into the Information Age<br />
<a href="http://www.google.com/search?q=MMVII+in+binary">MMVII in binary</a></li>
<li>Find ebooks<br />
<a href="http://www.google.com/search?q=ext%3Apdf+c%23+guidelines">ext:pdf c# guidelines</a></li>
<li>Find reviews of the greatest films ever made<br />
<a href="http://www.google.com/movies?q=movie:The+Karate+Kid">movie:The Karate Kid</a></li>
<li>Wish you&#8217;d bought ten years ago<br />
<a href="http://www.google.com/search?q=stocks%3AMSFT">stocks:MSFT</a></li>
<li>Get a four day forecast for your business <s>jolly</s> trip<br />
<a href="http://www.google.com/search?q=weather%3ASingapore">weather:Singapore</a></li>
<li>Find &#8216;interesting articles&#8217;<br />
<a href="http://www.google.com/search?q=allinanchor%3Ainteresting+article">allinanchor: interesting article</a></li>
<li>Perform complex baking calculations<br />
<a href="http://www.google.com/search?q=10+teaspoon+%2B+5+tablespoons+in+cups">10 teaspoon + 5 tablespoons in cups</a></li>
<li>Will the strange imported chocolate make you fat?<br />
<a href="http://www.google.com/search?q=700+kilojoules+in+kilocalories">700 kilojoules in kilocalories</a></li>
<li>Was that <em>ducks are hazards</em> in the classroom?<br />
<a href="http://www.google.com/search?q=%22Pink+Floyd%22+No+*+in+the+classroom">&#8220;Pink Floyd&#8221; no * in the classroom</a></li>
<li>Check out <s>criminally offensive</s> your favourite tunes<br />
<a href="http://www.google.com/search?q=music%3AMichael+Bolton">music:Michael Bolton</a></li>
<li>Plan your holiday finances<br />
<a href="http://www.google.com/search?q=currency+of+Estonia+in+Peruvian+money">currency of Estonia in Peruvian money</a></li>
</ul>
<p>Got any more?</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/66/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/66/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/66/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/66/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/66/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=66&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/08/24/fun-google-searches/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>
	</item>
		<item>
		<title>Task List comments in Visual Studio</title>
		<link>http://3poundmass.wordpress.com/2007/08/23/task-list-comments-in-visual-studio/</link>
		<comments>http://3poundmass.wordpress.com/2007/08/23/task-list-comments-in-visual-studio/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 02:46:18 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/08/23/task-list-comments-in-visual-studio/</guid>
		<description><![CDATA[Here&#8217;s a quick Visual Studio tip.  You can embed useful notes and reminders in code using Task List comments like this:
// TODO: fix catastrophic memory leak
These notes will automatically appear in the Visual Studio Task List, which you can open with the shortcut Ctrl+W, T or by selecting View &#8211; Task List from the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=68&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Here&#8217;s a quick <strong>Visual Studio</strong> tip.  You can embed useful notes and reminders in code using <a href="http://msdn2.microsoft.com/en-US/library/zce12xx2(VS.80).aspx">Task List comments</a> like this:</p>
<pre style="margin:0;"><span style="color:green;">// TODO: fix catastrophic memory leak</span></pre>
<p>These notes will automatically appear in the Visual Studio <a href="http://msdn2.microsoft.com/en-us/library/170k1bbs(VS.80).aspx">Task List</a>, which you can open with the shortcut <strong>Ctrl+W, T</strong> or by selecting <strong>View &#8211; Task List</strong> from the main menu bar.</p>
<p><img src="http://3poundmass.files.wordpress.com/2007/08/vs-task-list.png" alt="Visual Studio Task List" /></p>
<p>Visual Studio also supports two other comment tokens, HACK and UNDONE.  You can even <a href="http://msdn2.microsoft.com/en-US/library/ekwz6akh(VS.80).aspx">add your own custom comment tokens</a> in:</p>
<p><strong>Options &#8211; Environment &#8211; Task List</strong>.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/68/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/68/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=68&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/08/23/task-list-comments-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>

		<media:content url="http://3poundmass.files.wordpress.com/2007/08/vs-task-list.png" medium="image">
			<media:title type="html">Visual Studio Task List</media:title>
		</media:content>
	</item>
		<item>
		<title>If the code and the comments disagree, then both are probably wrong</title>
		<link>http://3poundmass.wordpress.com/2007/08/22/if-the-code-and-the-comments-disagree-then-both-are-probably-wrong/</link>
		<comments>http://3poundmass.wordpress.com/2007/08/22/if-the-code-and-the-comments-disagree-then-both-are-probably-wrong/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 05:16:24 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/08/22/if-the-code-and-the-comments-disagree-then-both-are-probably-wrong/</guid>
		<description><![CDATA[Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.
— Donald Knuth
I recently wrote some code commenting guidelines to explain why comments are [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=63&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><q>Let us change our traditional attitude to the construction of programs. Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.</q><br />
— Donald Knuth</p>
<p>I recently wrote some <a href="http://3poundmass.wordpress.com/2007/07/26/coding-guidelines-commenting/">code commenting guidelines</a> to explain why comments are usually a Good Thing. Some intelligent and good looking people agreed with me, while others insisted sharing incoherent and rambling opinions.</p>
<p><a href="http://madskristensen.dk/">Mads Kristensen</a> rightly pointed out that, &#8220;If [comments] are good, then the code is also good&#8221;. Some people took this to mean that if a piece of code has good comments, then it&#8217;s also guaranteed to be of the very finest quality. There&#8217;ll always be exceptions. Code with good comments can easily be mutilated by a placement student or twisted beyond sanity by a crazed Perl developer. But good comments are often correlated with good code when the software is built by a good developer.</p>
<p>How about this one, &#8220;code should be written in a way that doesn’t require commenting&#8221;. Close, but wrong. Code should be written is such a way that it doesn&#8217;t require commenting <em>to explain how it works</em>. My original article wasn&#8217;t about refactoring, but if you have a block of code with a comment then sometimes it makes sense to <a href="http://www.refactoring.com/catalog/extractMethod.html">extract it into its own method</a>. If it still isn&#8217;t clear then try <a href="http://www.refactoring.com/catalog/renameMethod.html">renaming the method</a>. If you think you need a comment to note assumptions then state them explicitly by <a href="http://www.refactoring.com/catalog/introduceAssertion.html">introducing an assertion</a>. If there&#8217;s still any uncertainty then use comments. Explain obscure optimizations or special algorithms. Explain <em>why</em> you&#8217;re code does what it does.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/63/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/63/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/63/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/63/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/63/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=63&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/08/22/if-the-code-and-the-comments-disagree-then-both-are-probably-wrong/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert table to CSV string in SQL Server</title>
		<link>http://3poundmass.wordpress.com/2007/08/22/convert-table-to-csv-string-in-sql-server/</link>
		<comments>http://3poundmass.wordpress.com/2007/08/22/convert-table-to-csv-string-in-sql-server/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 03:20:45 +0000</pubDate>
		<dc:creator>Ciz</dc:creator>
				<category><![CDATA[.net]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://3poundmass.wordpress.com/2007/08/22/convert-table-to-csv-string-in-sql-server/</guid>
		<description><![CDATA[There doesn&#8217;t seem to be a native function in SQL Server to collapse a table of row values into a comma-separated string, for example:
Animal
Llama
Manatee
Pygmy Marmoset
Okapi
Result CSV: &#8220;Llama, Manatee, Pygmy Marmoset, Okapi&#8221;
In mySQL there&#8217;s a built-in aggregate function called group_concat, but no equivalent in SQL Server unless you build your own .NET function, like in this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=60&subd=3poundmass&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There doesn&#8217;t seem to be a native function in <strong>SQL Server</strong> to collapse a table of row values into a comma-separated string, for example:</p>
<p><strong><u>Animal</u></strong><br />
Llama<br />
Manatee<br />
Pygmy Marmoset<br />
Okapi</p>
<p><strong>Result CSV:</strong> &#8220;Llama, Manatee, Pygmy Marmoset, Okapi&#8221;</p>
<p>In <a href="http://www.mysql.com/">mySQL</a> there&#8217;s a built-in aggregate function called <a href="http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat">group_concat</a>, but no equivalent in SQL Server unless you build your own .NET function, like in this TechNet article <a href="http://technet.microsoft.com/en-us/library/ms131056.aspx">Invoking CLR User-Defined Aggregate Functions</a>.  That&#8217;s quite a chunk of coding and is restricted to SQL Server 2005 or later, so here&#8217;s a handy SQL snippet that does a similar job without the fuss.</p>
<p><span style="color:blue;">select</span> Name <span style="color:blue;">from</span> Animal</p>
<p><span style="color:blue;">declare</span> @csv <span style="color:blue;">varchar</span>(<span style="color:magenta;">max</span>)<br />
<span style="color:blue;">select</span> @csv = <span style="color:magenta;">coalesce</span>(@csv + &#8216;, &#8216;, &#8221;) + Name <span style="color:blue;">from</span> Animal<br />
<span style="color:blue;">select</span> @csv</p>
<p>If you use the code regularly then consider creating a <a href="http://technet.microsoft.com/en-us/library/ms177499.aspx">scalar user-defined function</a> (UDF) that returns the <strong>CSV</strong> string as varchar.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/3poundmass.wordpress.com/60/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/3poundmass.wordpress.com/60/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/3poundmass.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/3poundmass.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/3poundmass.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/3poundmass.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/3poundmass.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/3poundmass.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/3poundmass.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/3poundmass.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/3poundmass.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/3poundmass.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=3poundmass.wordpress.com&blog=1414400&post=60&subd=3poundmass&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://3poundmass.wordpress.com/2007/08/22/convert-table-to-csv-string-in-sql-server/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/854caec0d85c0fd2a8f1e10559a35ebe?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Ciz</media:title>
		</media:content>
	</item>
	</channel>
</rss>