<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Stuff I couldn't find with Google</title>
	<atom:link href="http://jimbobmcgee.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimbobmcgee.wordpress.com</link>
	<description>Stuff that I couldn't find using Google, that I eventually worked out for myself and so I posted here, in case other people are also looking</description>
	<lastBuildDate>Tue, 03 Jan 2012 19:48:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jimbobmcgee.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Stuff I couldn't find with Google</title>
		<link>http://jimbobmcgee.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jimbobmcgee.wordpress.com/osd.xml" title="Stuff I couldn&#039;t find with Google" />
	<atom:link rel='hub' href='http://jimbobmcgee.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Alternative to %RANDOM% in Windows batch files</title>
		<link>http://jimbobmcgee.wordpress.com/2012/01/03/alternative-to-random-in-windows-batch-files/</link>
		<comments>http://jimbobmcgee.wordpress.com/2012/01/03/alternative-to-random-in-windows-batch-files/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 19:44:11 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/?p=19</guid>
		<description><![CDATA[So, it turns out, the %RANDOM% environment variable isn&#8217;t random. It&#8217;s very much time based. On my XP box, it appears to generate a number that changes every second. What&#8217;s worse is that it&#8217;s very much deterministic — in most cases, the generated number will be 13 greater than the last number generated. Not that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=19&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So, it turns out, the <code>%RANDOM%</code> environment variable isn&#8217;t random. It&#8217;s very much time based. On my XP box, it appears to generate a number that changes every second. What&#8217;s worse is that it&#8217;s very much deterministic — in most cases, the generated number will be 13 greater than the last number generated.</p>
<p>Not that I was using it for anything crypto-related, you understand, but the time-based thing does present a problem if you are using it in Scheduled Tasks. Particularly if you are using it to create unique, random temporary file names in two Scheduled Tasks that run at the same time.</p>
<p>Of course, this isn&#8217;t news. It&#8217;s an <a href="http://blogs.msdn.com/b/oldnewthing/archive/2010/06/17/10026183.aspx">old new thing</a>. But it was new to me and caused me to screw something up that I shouldn&#8217;t have and so on and so forth</p>
<p>Instead, we should pull random data from the <a href="http://en.wikipedia.org/wiki/Entropy_%28computing%29">system entropy</a>, akin to *NIX&#8217;s <code>/dev/random</code> device. After doing some digging, it appears that what *NIX &#8216;stores&#8217; in <code>/dev/random</code>, Windows &#8216;stores&#8217; in the registry, a binary <code>Seed</code> value in the <code>HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\RNG</code> key. Of course it does.</p>
<p>We can get to that in Windows batch files, with the <code>REG.EXE</code> command-line utility, usually found in the <code>C:\Windows\system32</code> folder):</p>
<blockquote style="width:415px;overflow:auto;">
<pre>"%SYSTEMROOT%\system32\reg.exe" query HKLM\Software\Microsoft\Cryptography\RNG /v Seed</pre>
</blockquote>
<p>That gets us some version info and the binary data, in some nicely-formatted table, e.g&#8230;</p>
<blockquote style="width:415px;overflow:auto;">
<pre>! REG.EXE VERSION 3.0

HKEY_LOCAL_MACHINE\software\microsoft\cryptography\rng
    Seed        REG_BINARY      CC577B9D245DB08D34EC20C75B80CDF36822ACFB13F3FAD640F426948F5A05F1E9C956A8DB58F565CC6A1D2A947F93B38DA425D02D49BF30622FD8E7CFDBF63366A2357361C76ABA68720A04F28E7C4D</pre>
</blockquote>
<p>&#8230;which we can parse with <code>FOR /f</code> and convert to a similar 0-32767, like so:</p>
<blockquote style="width:415px;overflow:auto;">
<pre>FOR /f "usebackq tokens=3 skip=4" %%A IN (`"%SYSTEMROOT%\system32\reg.exe" query HKLM\Software\Microsoft\Cryptography\RNG /v Seed`) DO SET RND=%%A
SET /a RND=0x%RND:~0,4% %% 32768</pre>
</blockquote>
<p>The environment variable <code>%RND%</code> now contains a random number.</p>
<p>If you need a large quantity of random numbers, you may be concerned with repeated calls depleting the system entropy pool. This is a possibility, of course, but may be mitigated by keeping the last retrieved entropy data in an environment variable, extracting the first two bytes when you need to, removing those bytes from the data and refilling the entropy variable when it is empty. Something like this should do the trick</p>
<blockquote style="width:415px;overflow:auto;">
<pre>:get_random
IF NOT DEFINED ENTROPY FOR /f "usebackq tokens=3 skip=4" %%A IN (`"%SYSTEMROOT%\system32\reg.exe" query HKLM\Software\Microsoft\Cryptography\RNG /v Seed`) DO SET ENTROPY=%%A
SET /a RND=0x%ENTROPY:~0,4% %% 32768
SET ENTROPY=%ENTROPY:~4%
GOTO :EOF</pre>
</blockquote>
<p>Of course, this doesn&#8217;t seem to work on Windows Server 2008 R2 (surprise, surprise), as the <code>HKLM...RNG\Seed</code> value does not seem to exist in the registry (or at least cannot be read by <code>REG.EXE</code>), so I expect that means it doesn&#8217;t work in Vista or Win7, either. The closest alternative is the <code>Seed</code> value in the <code>HKLM\System\RNG</code> key, but that does not seem to update after reading, so is next to useless for this purpose.</p>
<p>The only alternative I have in Windows Server 2008 R2 is to invoke PowerShell (which is installed by default on our builds) to get a similar binary value, instead of <code>REG.EXE</code>. While you could instantiate an <code>RNGCryptoServiceProvider</code> object and call <code>GetBytes</code> on a suitably large byte array, it may just be sufficient to invoke <code>Guid.NewGuid</code> one or more times, instead (remembering to escape parentheses properly):</p>
<blockquote style="width:415px;overflow:auto;">
<pre>FOR /f "usebackq" %%A IN (`"%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command [System.Guid]::NewGuid^(^).ToString^('N'^)`) DO SET RND=%%A</pre>
</blockquote>
<p>That said, if you have PowerShell, you might want to consider doing your script in that instead, if you can get past its awful, awful syntax&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=19&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2012/01/03/alternative-to-random-in-windows-batch-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
		<item>
		<title>Uninstalling SQL Server 2008 fails with &#8220;Value cannot be null. Parameter name: sddlForm&#8221;</title>
		<link>http://jimbobmcgee.wordpress.com/2011/08/15/uninstalling-sql-server-2008-fails-with-value-cannot-be-null-parameter-name-sddlform/</link>
		<comments>http://jimbobmcgee.wordpress.com/2011/08/15/uninstalling-sql-server-2008-fails-with-value-cannot-be-null-parameter-name-sddlform/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 19:18:53 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[sddlform]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[uninstall]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/?p=20</guid>
		<description><![CDATA[I came across this annoying error while trying to remove SQL Server 2008 from our Windows XP desktop Sysprep image.  I found a Microsoft Connect article which gave some brief but ultimately unhelpful advice relating to an error reading the Group SID when uninstalling FileStream. That said, it did get me on to FileStream.  Looking through [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=20&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I came across this annoying error while trying to remove SQL Server 2008 from our Windows XP desktop Sysprep image.  I found a <a title="Microsoft Connect post" href="http://connect.microsoft.com/SQLServer/feedback/details/587143/sql-2008-uninstall-value-cannot-be-null-sddlform" target="_blank">Microsoft Connect</a> article which gave some brief but ultimately unhelpful advice relating to an error reading the Group SID when uninstalling FileStream.</p>
<p>That said, it did get me on to FileStream.  Looking through the Detail.txt file in the relevant dated subfolder of the C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log folder, I could see that the error was due to the uninstaller trying to remove permissions on the FileStream share that was created when I installed SQL Server 2008, originally.  From Administrative Tools &gt;&gt; Computer Management &gt;&gt; Shared Folders &gt;&gt; Shares, I tried to add the correct group permissions to the <code>{INSTANCENAME}</code> FileStream share, but it didn&#8217;t seem to make any difference to the uninstaller.</p>
<p>In the end, I got around it by editing the registry.  Opening regedit.exe from the Start &gt;&gt; Run window, I browsed to my instance&#8217;s registry branch, at <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.{INSTANCENAME}\MSSQLServer</code> and renamed the FileStream key to something arbitrary (I used &#8220;<code>__FileStream</code>&#8220;, but I expect you could use anything the installer wasn&#8217;t expecting).</p>
<p>Now when I ran the uninstaller, it couldn&#8217;t find the necessary registry branch, so assumed FileStream was uninstalled, skipped right over the step and completed successfully.  Then, I right-clicked the {INSTANCENAME} share in Computer Manager and clicked &#8220;Stop Sharing&#8221;.</p>
<p>I will post if I experience any issues with the desktop image, having performed this workaround.  In the meantime, hope this helps someone out there.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=20&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2011/08/15/uninstalling-sql-server-2008-fails-with-value-cannot-be-null-parameter-name-sddlform/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
		<item>
		<title>Redirection of command output &#8212; a scrollable alternative to &#124;more</title>
		<link>http://jimbobmcgee.wordpress.com/2009/07/30/redirection-of-command-output-a-scrollable-alternative-to-more/</link>
		<comments>http://jimbobmcgee.wordpress.com/2009/07/30/redirection-of-command-output-a-scrollable-alternative-to-more/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 00:01:08 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/?p=16</guid>
		<description><![CDATA[I&#8217;m sure many Linux people already know this, but I discovered it today and figured I&#8217;d keep it on hand for when I need it again (that&#8217;s what this blog is for, after all).  I knew it was possible to redirect output to a file using &#62;, redirect input from a file using &#60; and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=16&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure many Linux people already know this, but I discovered it today and figured I&#8217;d keep it on hand for when I need it again (that&#8217;s what this blog is for, after all).  I knew it was possible to redirect output to a file using <code>&gt;</code>, redirect input from a file using <code>&lt;</code> and chain the output of one command as the input of another using <code>|</code> but I didn&#8217;t know it was possible to redirect the output of a command (or series of commands) using <code>&lt;(...)</code> too.</p>
<p>I&#8217;m used to doing things like <code>ls -lrt | more</code> to page the results of a directory listing, for example, but as a Windows user, I&#8217;m too used to being able to scroll my terminal (or command prompt) output to go back and forward and you just can&#8217;t do that in a pure terminal like I have been dealing with recently.</p>
<p>Enter the <code>&lt;(...)</code> construct:</p>
<p style="padding-left:30px;"><code>vi &lt;(ls -lrt)</code></p>
<p>Now the output of <code>ls -lrt</code> is redirected to the vi editor as some kind of pseudo-file.  I can page up and down to my heart&#8217;s content.</p>
<p>I also discovered the <code>du</code> and <code>comm</code> utilities today (told you I was new) and using a combination of all of them can now compare the size of folders under two separate parents:</p>
<p style="padding-left:30px;"><code>vi &lt;(comm &lt;(cd /dir1; du .) &lt;(cd /dir2; du .))</code></p>
<p>This changes the current directory to /dir1, spools the size of all subfolders to a pseudo-file, changes the current directory to /dir2, spools the size of all subfolders to another pseudo-file, spools the comparison of the two pseudo-files to a third pseudo-file and shows that file in vi, for me to look around.</p>
<p>Perfect for eyeballing the results of a local rsync.  It took a whole batch file to do the same last time I tried in Windows.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=16&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2009/07/30/redirection-of-command-output-a-scrollable-alternative-to-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
		<item>
		<title>Database Project Deployment &#8212; An introduction to the DependencyList</title>
		<link>http://jimbobmcgee.wordpress.com/2008/09/26/database-project-deployment-an-introduction-to-the-dependencylist/</link>
		<comments>http://jimbobmcgee.wordpress.com/2008/09/26/database-project-deployment-an-introduction-to-the-dependencylist/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 02:11:11 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/?p=7</guid>
		<description><![CDATA[Recently, I have been working with Database Projects within Visual Studio 2005 (yes, I&#8217;m set in my ways &#8212; I haven&#8217;t got around to VS2008 yet!!).  I like the ability to source control my creation scripts and stored procedures and I&#8217;m happy to use the VS IDE to write my SQL code and running individual [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=7&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been working with Database Projects within Visual Studio 2005 (yes, I&#8217;m set in my ways &#8212; I haven&#8217;t got around to VS2008 yet!!).  I like the ability to source control my creation scripts and stored procedures and I&#8217;m happy to use the VS IDE to write my SQL code and running individual scripts against multiple development Database References is a breeze.</p>
<p>However, deploying the finished scripts to a production database is a bit of a nightmare.  Essentially, if each script file represents a single database object, you have to ensure that you run them all in the correct order &#8212; especially if you have foreign key constraints (you do <em>have</em> foreign key constraints, don&#8217;t you?!).  Ordering all these scripts manually is a royal pain.</p>
<p>After the second or third time of being stuck in this situation, I decided enough is enough and set about writing a small app to do the job for me.  The results of this formed the mighty DependencyList.</p>
<p><span id="more-7"></span></p>
<p>The DependencyList is a class I have written that can be accessed and modified like a regular List&lt;T&gt; but also allows you to determine that certain items are dependent on each other.  During the enumeration process, using GetEnumerator or foreach, the dependencies of such items are always yielded first.</p>
<p>To assist with this (and promote possible extension to additional collections), I started out with a basic interface:</p>
<blockquote>
<pre>public interface IDependencyCollection&lt;T&gt; : ICollection&lt;T&gt;
{
    void AddDependencies(T item, params T[] dependsOnItems);
    void AddDependencies(int index, params int[] dependsOnIndices);
    void RemoveDependencies(T item, params T[] noLongerDependsOnItems);
    void RemoveDependencies(int index, params int[] noLongerDependsOnIndices);
    void ClearDependencies();
}</pre>
</blockquote>
<p>This determines that I will use basic ICollection principals, so the class is familiar to implementors but I have added the means to add and remove dependencies, based on value or index.</p>
<p>My basic means to determine dependencies is to declare a child class that provides a Yield method and contains a YieldingDelegate, which is a delegate with the same method signature as the Yield method.  I&#8217;ve chosen to make this a private child, with internal members, because it is not necessary for implementors to see/use this child class outside of the DependencyList context.  Laziness is responsible for my not wrapping my fields in properties and other such &#8216;good practice&#8217; coding, but I figure that, since it is a private class, why add the overhead of a property get/set method call?</p>
<p>It is also important that an item is not yielded more than once per enumeration, so I have also added a private enum, which defines the three states of an item; not yielded, yielding and yielded.  The Yield process is only really concerned with &#8216;not yielded&#8217; and &#8216;yielded&#8217;; &#8216;yielding&#8217; state is primarily used in debugging to detect circualar dependencies:</p>
<blockquote>
<pre>public class DependencyList&lt;T&gt; : IDependencyCollection&lt;T&gt;, IList&lt;T&gt;
{
    private delegate IEnumerable&lt;T&gt; YielderDelegate();
    private enum YieldState { None = 0, Yielding, Yielded }

    private class DependencyListNode
    {
        internal readonly T value;
        internal DependencyListNode(T value) { this.value = value; }
        internal YielderDelegate Yielding;
        internal YieldState state = YieldState.None;
        internal void ClearYielding() { Yielding = null; }

        internal IEnumerable&lt;T&gt; Yield() { ... }
    }

    ...
}</pre>
</blockquote>
<p>The Yield method is responsible for checking the yield state and, if None, checking the YielderDelegate.  If the YielderDelegate is not null, it invokes the YielderDelegate.  After the YielderDelegate is finished, the Yield method yields its own value:</p>
<blockquote>
<pre>internal IEnumerable&lt;T&gt; Yield()
{
    if (state == YieldState.None)
    {
        state = YieldState.Yielding;

        if (Yielding != null)
        {
            IEnumerable&lt;T&gt; e = Yielding();
            foreach (T t in e) yield return t;
        }

        yield return value;

        state = YieldState.Yielded;
    }
}</pre>
</blockquote>
<p>My DependencyList class can now be fleshed out with the IList and IDependencyCollection interface implementations. As you will see I&#8217;ve not tried to reinvent the wheel as far as the basic List functionality goes; instead I add a List of DependencyListNodes to the class and expose it using the IList interface:</p>
<blockquote>
<pre>public class DependencyList&lt;T&gt; : IDependencyCollection&lt;T&gt;, IList&lt;T&gt;
{
    ...

    private readonly List&lt;DependencyListNode&gt; nodes = new List&lt;DependencyListNode&gt;();

    #region IList&lt;T&gt; members
    public void Insert(int index, T item)
    {
        nodes.Insert(index, new DependencyListNode(item));
    }
    public int IndexOf(T item)
    {
        for (int i = 0; i &lt; nodes.Count; i++)
            if (Equals(nodes[i].value, item)) return i;

        return -1;
    }
    public void RemoveAt(int index) { nodes.RemoveAt(index); }
    ...
    #endregion

    #region ICollection&lt;T&gt; members
    public void Add(T item) { nodes.Add(new DependencyListNode(item)); }
    public void Clear() { nodes.Clear(); }
    public int Count { get { return nodes.Count; } }
    ...
    #endregion

    ...
}</pre>
</blockquote>
<p>(Note that I&#8217;ve not included the entire interface implementation here, but you should be able to get the idea.)</p>
<p>Next up is to add the IDependencyCollection implementation.  This is the key method behind how this class works.  Adding a dependency to a dependent item is a case of adding the Yield method of the item that must be yielded first, to the YielderDelegate of the dependent item.  Since the YielderDelegate is always invoked before the node&#8217;s value is yielded, the net effect is a recursion of Yield methods, in the order of dependency:</p>
<blockquote>
<pre>public class DependencyList&lt;T&gt; : IDependencyCollection&lt;T&gt;, IList&lt;T&gt;
{
    ...

    public void AddDependencies(int index, params int[] dependsOnIndexes)
    {
        if (dependsOnIndexes == null) throw new ArgumentNullException("dependsOnIndexes");
        if (index &lt; 0 || index &gt;= nodes.Count) throw new ArgumentOutOfRangeException(
            "index",
            index,
            "Index out of range"
        );
        foreach (int i in dependsOnIndexes)
            if (i &lt; 0 || i &gt;= nodes.Count) throw new ArgumentOutOfRangeException(
            "dependsOnIndexes",
            i,
            "Index out of range"
        );

        foreach (int i in dependsOnIndexes) nodes[index].Yielding += nodes[i].Yield;
    }

    ...
}</pre>
</blockquote>
<p>(Again, I&#8217;ve not fleshed out all methods here &#8212; RemoveDependencies(int, params int[]) is the same, except for the delegate assignment operator += becomes -=, and the ClearDependencies method invokes DependencyListNode.ClearYielding for all nodes, which sets the YielderDelegates back to null.  The value-based Add/Remove methods simply use IndexOf to find the first index of a value and then supplies said index to the Add/Remove methods shown).</p>
<p>The final step in the DependencyList is to implement the GetEnumerator() method.  This is similar to the Yield method of the DependencyListNode; the inner nodes List is, itself, enumerated and each node&#8217;s Yield method is called.  This causes the Yield/YielderDelegate recursion to occur for all nodes with dependencies.  Nodes without dependencies are simply yielded when they are enumerated in the nodes List.  I also ensure that only one enumerator can run at once, with a basic boolean check.  This is because I have to reset all the node states to YieldState.None, before I enumerate the nodes List:</p>
<blockquote>
<pre>public class DependencyList&lt;T&gt; : IDependencyCollection&lt;T&gt;, IList&lt;T&gt;
{
    ...

    public IEnumerator&lt;T&gt; GetEnumerator()
    {
        if (enumerating) throw new InvalidOperationException("Only one enumerator can run at a time");
        enumerating = true;

        foreach (DependencyListNode node in nodes) node.state = YieldState.None;

        for (int i = 0; i &lt; nodes.Count; i++)
        {
            IEnumerable&lt;T&gt; e = nodes[i].Yield();
            foreach (T t in e) yield return t;
        }

        enumerating = false;
    }

    ...
}</pre>
</blockquote>
<p>Now my DependencyList class is complete, I can move on to the Database Project Deployer.</p>
<p>This consists of a basic form, with input folder and output file dialogue boxes.  For added functionality, I&#8217;ve also included a multi-select list box which is populated with all the SQL files found in the input folder.  The user can choose to include/exclude certain files using this list box:</p>
<div id="attachment_8" class="wp-caption aligncenter" style="width: 460px"><a href="http://jimbobmcgee.files.wordpress.com/2008/09/databaseprojectdeployer01.jpg"><img class="size-large wp-image-8" title="databaseprojectdeployer01" src="http://jimbobmcgee.files.wordpress.com/2008/09/databaseprojectdeployer01.jpg?w=450&#038;h=210" alt="The Database Project Deployer main window" width="450" height="210" /></a><p class="wp-caption-text">The Database Project Deployer main window</p></div>
<p>When the user clicks the OK button, each selected file is added to a new class called the ScriptGenerator.  This class is responsible for parsing each SQL file, adding it to a DependencyList and determining if it has any dependencies on any other SQL file.  This class works on a single assumption that each SQL file corresponds to a given database object and that the name of the file is the name of the database object it creates, e.g. &#8216;table1.sql&#8217;.  It is not case sensitive.</p>
<p>The ScriptGenerator consists of a DependencyList&lt;string&gt;, which stores the contents of the SQL files and a Dictionary&lt;string, int&gt;, which maps the object name (taken from the filename) against its indexed position in the DependencyList.  It exposes two public methods, AddSqlFile(string) and Generate(string).</p>
<blockquote>
<pre>public class ScriptGenerator
{
    private readonly DependencyList&lt;string&gt; sqlList = new DependencyList&lt;string&gt;();
    private readonly Dictionary&lt;string, int&gt; nameIndexes = new Dictionary&lt;string, int&gt;();

    public void AddSqlFile(string sqlFilePath)
    {
        string fileName = Path.GetFileNameWithoutExtension(sqlFilePath).ToLowerInvariant();
        using (StreamReader reader = new StreamReader(sqlFilePath))
        {
            sqlList.Add(reader.ReadToEnd());
            nameIndexes.Add(fileName, sqlList.Count - 1);
        }
    }

    public void Generate(string outputFilePath)
    {
        ResolveDependencies();
        using (StreamWriter writer = new StreamWriter(outputFilePath))
        {
            foreach (string sql in sqlList)
            {
                writer.WriteLine(sql);
                writer.WriteLine();
                writer.Flush();
            }
        }
    }

    ...
}</pre>
</blockquote>
<p>The observant amongst you might have noticed the ResolveDependencies() method tucked into Generate.  This is the key part of the ordering system, as it is responsible for adding the dependencies within the DependencyList.  It does this simply by index-looping through DependencyList, using for and looping through the stored keys, trying to find that key within the SQL at that indexed position in the DependencyList.  There is an additional caveat to this process, namely that there are a number of different ways to write SQL files &#8212; the object names may be repeated and qualified by spaces, square brackets, quote marks, periods, etc.  To mitigate this, I have added a basic private struct to store the various qualifiers I have identified (there may be more) and looped through an array of them during each key check.  The private Qualifier struct looks much like this:</p>
<blockquote>
<pre>public class ScriptGenerator
{
    ...

    private struct Qualifier
    {
        internal static readonly Qualifier[] QUALIFIERS = new Qualifier[] {
            new Qualifier('"', '"'),
            new Qualifier('[', ']'),
            new Qualifier(' ', ' '),
            new Qualifier(' ', '('),
            new Qualifier(')', ' '),
            new Qualifier(')', '('),
            new Qualifier('.', '.'),
            new Qualifier('.', '('),
            new Qualifier('.', ' '),
            new Qualifier('(', ')')
        };

        private readonly char start;
        private readonly char end;

        internal Qualifier(char start, char end)
        {
            this.start = start;
            this.end = end;
        }

        internal string Qualify(string str)
        {
            return string.Concat(start, str, end);
        }
    }

    ...
}</pre>
</blockquote>
<p>The ResolveDependencies method looks like this:</p>
<blockquote>
<pre>public class ScriptGenerator
{
    ...
    private void ResolveDependencies()
    {
        for (int s = 0; s &lt; sqlList.Count; s++)
        {
            string sql = sqlList[s]
                .ToLowerInvariant()
                .Replace(Environment.NewLine, "\n")
                .Replace('\t', ' ');

            foreach (string key in nameIndexes.Keys)
                foreach (Qualifier q in Qualifier.QUALIFIERS)
                    if (s != nameIndexes[key] &amp;&amp; sql.Contains(q.Qualify(key)))
                    {
                        sqlList.AddDependencies(s, nameIndexes[key]);
                        break;
                    }
        }
    }
    ...
}</pre>
</blockquote>
<p>The end result is that all the SQL files are ordered appropriately and spooled to a single output script that can be executed on the target database with far less effort that all those separate scripts.  Obviously, your mileage may vary, depending on how you&#8217;ve written your SQL code, although most ordering errors can be resolved by adding suitable Qualifiers and remembering that it is just a dumb string.Contains(string) call that determines dependencies.  I&#8217;m sure there are better ways to parse object names from the SQL code, but this suits my needs in 99% of cases.</p>
<p>For those of you that don&#8217;t want to attempt to extrapolate all the missing code from above, I have zipped up the source and binary forms and make them available below for your convenience.  Note that I will not support the source or binaries and assume no liability for anything whatsoever.  For those of you with license concerns, consider the license as &#8216;use the app and DependencyList class however and wherever you like, but don&#8217;t sell it as a database script deployment tool&#8217;.  Does that seem fair?</p>
<ul>
<li><a href="http://files.jimbobmcgee.com/wordpress/DatabaseProjectDeployer.zip">Database Project Deployer Binaries</a></li>
<li><a href="http://files.jimbobmcgee.com/wordpress/DatabaseProjectDeployer_src.zip">Database Project Deployer Source</a></li>
</ul>
<p>Hope this helps with future Database Projects&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=7&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2008/09/26/database-project-deployment-an-introduction-to-the-dependencylist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>

		<media:content url="http://jimbobmcgee.files.wordpress.com/2008/09/databaseprojectdeployer01.jpg?w=450" medium="image">
			<media:title type="html">databaseprojectdeployer01</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle service crashes on OracleConnection.Open()</title>
		<link>http://jimbobmcgee.wordpress.com/2008/03/04/oracle-service-crashes-on-oracleconnectionopen/</link>
		<comments>http://jimbobmcgee.wordpress.com/2008/03/04/oracle-service-crashes-on-oracleconnectionopen/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 14:52:15 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/?p=6</guid>
		<description><![CDATA[We recently had a situation here where the opening of a .NET connection to an Oracle 10g database caused the entire database to crash. This was indicated by the Event Log entry: The OracleService&#60;SID&#62; service terminated unexpectedly. It has done this &#60;n&#62; time(s). For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. This was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=6&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We recently had a situation here where the opening of a .NET connection to an Oracle 10g database caused the entire database to crash.  This was indicated by the Event Log entry:</p>
<blockquote>
<pre>The OracleService&lt;SID&gt; service terminated unexpectedly.
It has done this &lt;n&gt; time(s).

For more information, see Help and Support Center at 

http://go.microsoft.com/fwlink/events.asp.</pre>
</blockquote>
<p>This was using some library code that we had developed and used successfully on numerous occasions, so it had us truly stumped.</p>
<p>After much soul-searching, one of my colleagues eventually narrowed it down to the length of the .NET project name.  The project, when compiled, created a EXE file that had a really long name, which caused Oracle to shit bricks.</p>
<p>Wonderful.  I hate how Oracle has such a problem with large object names.</p>
<p>Also, I&#8217;d love to know how an Oracle DBA would approach such a failure.  How would it even be recorded?  There are so many different log files in a standard Oracle installation that I really wonder where you might begin?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jimbobmcgee.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jimbobmcgee.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=6&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2008/03/04/oracle-service-crashes-on-oracleconnectionopen/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
		<item>
		<title>Service configuration error &#8211; Event ID 5000 (ioibmurhynrxkw0zxkyrvfn0boyyufow)</title>
		<link>http://jimbobmcgee.wordpress.com/2007/09/26/service-configuration-error-event-id-5000-ioibmurhynrxkw0zxkyrvfn0boyyufow/</link>
		<comments>http://jimbobmcgee.wordpress.com/2007/09/26/service-configuration-error-event-id-5000-ioibmurhynrxkw0zxkyrvfn0boyyufow/#comments</comments>
		<pubDate>Wed, 26 Sep 2007 20:05:02 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/2007/09/26/service-configuration-error-event-id-5000-ioibmurhynrxkw0zxkyrvfn0boyyufow/</guid>
		<description><![CDATA[I was recently bugged by an error in a Windows Service I was developing that, when deployed an started, immediately stopped. My log files showed nothing, which suggested that the exception was happening before my logging and exception handlers started. Examining the Application Event Log, I found the following error: Event Type: ErrorEvent Source: .NET [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=5&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was recently bugged by an error in a Windows Service I was developing that, when deployed an started, immediately stopped.  My log files showed nothing, which suggested that the exception was happening before my logging and exception handlers started.</p>
<p>Examining the Application Event Log, I found the following error:</p>
<p><code>Event Type:	ErrorEvent<br />
Source:		.NET Runtime 2.0 Error Reporting<br />
Event Category:	None<br />
Event ID:	5000<br />
Date:		26/09/2007<br />
Time:		20:17:53<br />
User:		N/A<br />
Computer:	theDeploymentServer<br />
Description:<br />
EventType clr20r3, P1 theService.exe, P2 1.0.0.0, P3 46fa9f5d, P4 system.configuration, P5 2.0.0.0, P6 4333ae78, P7 1a2, P8 136, P9 ioibmurhynrxkw0zxkyrvfn0boyyufow, P10 NIL.<br />
For more information, see Help and Support Center at<br />
<a href="http://go.microsoft.com/fwlink/events.asp">http://go.microsoft.com/fwlink/events.asp</a>.</code></p>
<p>Not the most helpful of errors, but I could see the system.configuration entry, so I started with the theService.exe.config file, emptying the file of any meaningful data and adding it back in piece by piece until I recreated the error.</p>
<p>The error occurred on the following appSetting entry:</p>
<p><code><font color="#993300"><font color="#0000ff">&lt;</font>add <font color="#ff0000">key</font><font color="#0000ff">=</font><font color="#000000">"<font color="#0000ff">PluginsFolder</font>"</font> <font color="#ff0000">value</font><font color="#0000ff">=</font><font color="#000000">"<font color="#0000ff">C:\Program Files (x86)\A<font color="#000000">&amp;</font>B\theService\</font>"</font><font color="#0000ff"> /&gt;</font></font></code></p>
<p>I realised that the appSetting contained an ampersand (&amp;) witin its value, I realised that ampersand is a reserved character in XML and so the .NET configuration parser couldn&#8217;t validate the .config file.</p>
<p>To resolve this I replaced the ampersand with its XML-compliant counterpart (&amp;amp;), so the key now read:</p>
<p><code><font color="#993300"><font color="#0000ff">&lt;</font>add <font color="#ff0000">key</font><font color="#0000ff">=</font><font color="#000000">"<font color="#0000ff">PluginsFolder</font>"</font> <font color="#ff0000">value</font><font color="#0000ff">=</font><font color="#000000">"<font color="#0000ff">C:\Program Files (x86)\A<font color="#ff0000">&amp;amp;</font>B Company\theService\</font>"</font><font color="#0000ff"> /&gt;</font></font></code></p>
<p>Granted this looks a little weird but it solved the problem!</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jimbobmcgee.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jimbobmcgee.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=5&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2007/09/26/service-configuration-error-event-id-5000-ioibmurhynrxkw0zxkyrvfn0boyyufow/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
		<item>
		<title>Excessive recompilations when using VirtualPathProvider</title>
		<link>http://jimbobmcgee.wordpress.com/2007/09/20/excessive-recompilations-when-using-virtualpathprovider/</link>
		<comments>http://jimbobmcgee.wordpress.com/2007/09/20/excessive-recompilations-when-using-virtualpathprovider/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 03:42:45 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/2007/09/20/excessive-recompilations-when-using-virtualpathprovider/</guid>
		<description><![CDATA[This is a quick pointer for anyone implementing a VirtualPathProvider in their ASP.NET applications. I&#8217;ve read a number of tutorials on VPPs but none really touched on this issue. If you do not implement a method for VirtualPathProvider.GetFileHash(...), calls to this method will return null/Nothing. If this happens, ASP.NET&#8217;s build/compile system doesn&#8217;t remember that it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=4&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a quick pointer for anyone implementing a <code>VirtualPathProvider</code> in their ASP.NET applications.  I&#8217;ve read a number of tutorials on VPPs but none really touched on this issue.</p>
<p>If you do not implement a method for <code>VirtualPathProvider.GetFileHash(...)</code>, calls to this method will return <code>null</code>/<code>Nothing</code>.</p>
<p>If this happens, ASP.NET&#8217;s build/compile system doesn&#8217;t remember that it has already compiled the file and attempts to do so again.  After 15 compiles, the AppDomain is unloaded and the application restarts.  This can cause major irritation, particularly with performance, as the recompiles take time.</p>
<p>To get around it in my app, I am overriding GetFileHash to return a string concatenation of the VirtualFile&#8217;s name and Last Modified Date.  If anyone knows of a better hash, then please let me know.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jimbobmcgee.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jimbobmcgee.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=4&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2007/09/20/excessive-recompilations-when-using-virtualpathprovider/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
		<item>
		<title>Reinstating the GUI login page</title>
		<link>http://jimbobmcgee.wordpress.com/2007/09/20/reinstating-the-gui-login-page/</link>
		<comments>http://jimbobmcgee.wordpress.com/2007/09/20/reinstating-the-gui-login-page/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 03:31:09 +0000</pubDate>
		<dc:creator>jimbobmcgee</dc:creator>
				<category><![CDATA[Fedora 7 on Playstation 3]]></category>

		<guid isPermaLink="false">http://jimbobmcgee.wordpress.com/2007/09/20/reinstating-the-gui-login-page/</guid>
		<description><![CDATA[Having just completed a 5-hour install process I, spent another two hours trying to fix up an issue I had with the login screen. Having messed about with the options on the Login Screen, I inadvertently configured the X Server to try to login to a XDMCP server, by setting the startup server to Chooser. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=3&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Having just completed a 5-hour install process I, spent another two hours trying to fix up an issue I had with the login screen.</p>
<p>Having messed about with the options on the Login Screen, I inadvertently configured the X Server to try to login to a XDMCP server, by setting the startup server to Chooser.</p>
<p>When I rebooted, I couldn&#8217;t find any XDMCP servers, so I couldn&#8217;t login.  I thought I&#8217;d try booting to a terminal mode, only to find that the kboot loader loaded Fedora if I left the keyboard idle for too long (about three seconds0).</p>
<p>Eventually I found out that I could get to a terminal from the XDMCP screen by pressing CTRL+ALT+F1.  After that, I could log in as root and edit the GDM config file with VIM:<br />
<code>vi /etc/gdm/custom.conf</code><br />
allowed me to edit the file, so I scrolled down to the [servers] section and changed the entry from:<br />
<code><br />
[servers]<br />
0=Chooser<br />
</code><br />
to:<br />
<code><br />
[servers]<br />
0=Standard<br />
</code><br />
After rebooting, the regular login screen was displayed.</p>
<p>I&#8217;ve learned two things from this:</p>
<ol>
<li>CTRL+ALT+F1 opens a terminal from the login screen</li>
<li>I&#8217;m not going to mess with the startup screen again (I don&#8217;t even know what an XDMCP server is, let alone why I might want one!)</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/jimbobmcgee.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/jimbobmcgee.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jimbobmcgee.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jimbobmcgee.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jimbobmcgee.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jimbobmcgee.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jimbobmcgee.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jimbobmcgee.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jimbobmcgee.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jimbobmcgee.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jimbobmcgee.wordpress.com&amp;blog=1754189&amp;post=3&amp;subd=jimbobmcgee&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jimbobmcgee.wordpress.com/2007/09/20/reinstating-the-gui-login-page/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/94968b765a66598d1aa14cd113e1b5b2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jimbobmcgee</media:title>
		</media:content>
	</item>
	</channel>
</rss>
