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

<channel>
	<title>Bugfree.dk - Ronnie Holm&#039;s blog &#187; Tip</title>
	<atom:link href="http://www.bugfree.dk/blog/tag/tip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bugfree.dk/blog</link>
	<description>Not anti-anything, just pro-quality</description>
	<lastBuildDate>Wed, 08 Sep 2010 13:57:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using VS linked files for strong naming assemblies</title>
		<link>http://www.bugfree.dk/blog/2009/02/17/using-vs-linked-files-for-strong-naming-assemblies/</link>
		<comments>http://www.bugfree.dk/blog/2009/02/17/using-vs-linked-files-for-strong-naming-assemblies/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 21:43:39 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2009/02/17/using-vs-linked-files-for-strong-naming-assemblies/</guid>
		<description><![CDATA[Visual Studio has the ability to add a file as a link, making other parts of Visual Studio believe the file is actually located where it&#8217;s added. One useful application of the link feature is for signing assemblies by way of a key file. Signing an assembly using a digital signature may serve one or [...]]]></description>
			<content:encoded><![CDATA[<p>Visual Studio has the ability to add a file as a link, making other parts of Visual Studio believe the file is actually located where it&#8217;s added. One useful application of the link feature is for signing assemblies by way of a key file. Signing an assembly using a digital signature may serve one or more purposes: It&#8217;s a precondition for deploying an assembly to the Global Assembly Cache (GAC), sharing an assembly among applications, and making <a href="http://msdn.microsoft.com/en-us/library/fdhkd3a5.aspx">side-by-side execution</a> possible. Also, signing an assembly is useful for asserting its integrity, GAC deployed or otherwise.
</p>
<p>The reason for bringing up the linked file feature in conjunction with assembly signing is that to me the feature seems particularly well-suited for linking one and only key file into multiple Visual Studio projects. Yet people seem to be unaware of the feature and so common approaches to signing is to either create a new key file for each assembly &#8212; most likely because Visual Studio makes it so easy to create a new key file from the Project Settings dialog &#8212; or signing assemblies by creating one key file and then copy/paste it to other projects in the solution.
</p>
<p>Below is an example from the GAC showcasing how assemblies related to <a href="http://research.microsoft.com/en-us/projects/pex/">Pex</a> naturally go together and are therefore signed using the same key (they share 76a274db078248c8, their public key token). The same goes for  assemblies relating to other Microsoft products, such as the ones comprising a particular version of the .Net framework (because of the side-by-side execution, different versions of .Net framework assemblies are signed using different keys). So why not apply the same principle to what you deploy to the GAC?</p>
<p><img src="http://www.bugfree.dk/blog/wp-content/uploads/2009/02/example-of-public-key-from-the-gac.png" /></p>
<p>While using the same key (copy or not) makes it possible to differentiate your assemblies from everyone else and for your <a href="http://en.csharp-online.net/.NET_CLR_Components%E2%80%94Assembly_Names">four-part assembly name</a> in web.config and spread around the code to be uniform &#8212; SharePoint developers often need to provide the four-part name for their assemblies to other parts of the solution &#8212; copying the key around is still a violation of the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY principle</a> and as such is indicative of a <a href="http://martinfowler.com/bliki/CodeSmell.html">code smell</a>. More importantly, using the link feature of Visual Studio, there&#8217;s no reason to keep the bad smell around.
</p>
<p>Assuming you&#8217;ve already created a solution (in Visual Studio 2008) and added a project to it, the way to share a key file is to first create one by right clicking a project in Solution Explorer and selecting Properties. Now click the Signing tab and check the Sign the assembly check box. The dropdown lets you create a new key file by selecting New and filling out the information in the Create Name Key window. Alternatively, a key file is created using <a href="http://msdn.microsoft.com/en-us/library/k5b5tt23.aspx">sn.exe</a>, the strong name utility that comes with the <a href="http://blogs.msdn.com/windowssdk/archive/2008/09/25/winsdk-in-vs2008-sp1-patch-what-changed.aspx">Microsoft Windows SDK</a>. On my machine, sn.exe is located in C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin and is invoked like so:
</p>
<pre>
    > sn -k MySharedKeyPair.snk
</pre>
</p>
<p>How the key file is created isn&#8217;t particularly relevant to the rest of this post. Just make sure to place the key file in a common location, e.g., the top-level directory holding the Visual Studio solution file. Now go to Solution Explorer, right click on your project, and select Add existing Item. Then locate the key file within the solution directory and make sure to click the arrow on the Add button and select Add as Link. Note how the file is added to the project and marked by an arrow indicating it&#8217;s a link:</p>
<p style="margin: 0px; padding: 0px;">
<img style="float:left;" src="http://www.bugfree.dk/blog/wp-content/uploads/2009/02/add-existing-item-as-link.png" />&nbsp;&nbsp;&nbsp;<img style="float:" src="http://www.bugfree.dk/blog/wp-content/uploads/2009/02/linked-file-in-solution-explorer.png" />
</p>
<p>Returning to the Signing tab and selecting the dropdown, it now includes the linked key file. Don&#8217;t mind the absolute path; once you select MySharedKeyPair.snk, Visual Studio converts the path to a relative one (close and reopen the Signing tab and see for yourself). Also note that if you select Browse, the key file you select is copied to the project folder and added to the project as a regular file.</p>
<p><img src="http://www.bugfree.dk/blog/wp-content/uploads/2009/02/select-linked-file-in-signing-tab-of-project-properties.png" /></p>
<p>Another way to associate a key file with an assembly is through the <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblykeyfileattribute.aspx">AssemblyKeyFile</a> attribute. The attribute instructs the compiler of where to look for the key file and, although not used by the runtime, the attribute is included in the assembly along with any other attribute for everyone to see.</p>
<p><img src="http://www.bugfree.dk/blog/wp-content/uploads/2009/02/key-file-attribute-in-assembly-info.png" /></p>
<p>Using AssemblyKeyFile is probably the simplest approach to sharing a key file between projects, but now compiling the assembly results in a compiler warning as displayed above. The <a href="http://msdn.microsoft.com/en-us/library/xh3fc3x0(VS.80).aspx">use of the AssemblyKeyFile attribute has been deprecated</a> by Microsoft because it may lead to you inadvertently disclosing sensitive information through the embedded path and because working with a relative path may confuse users and the build system (the relative path is retained in the assembly, though). However, it appears AssemblyKeyFile is still the preferred way for MS to sign their assemblies. Inspecting a couple of .Net 3.5 assemblies with Reflector, here&#8217;s what their AssemblyKeyFile looks like:
</p>
<pre class="prettyprint lang-cs">
    [assembly: AssemblyKeyFile(@"f:\\dd\\tools\\devdiv\\EcmaPublicKey.snk")]
    [assembly: AssemblyKeyFile(@"f:\\dd\\tools\\devdiv\\35MSSharedLib1024.snk")]
    [assembly: AssemblyKeyFile(@"f:\\dd\\tools\\devdiv\\FinalPublicKey.snk")]
    …
</pre>
<p>To come full circle, the question of how Visual Studio, or rather MSBuild, actually signs an assembly using the information provided in the Properties dialog (real file or link) remains to be answered. Since a Visual Studio project file acts as input to MSBuild, we can see what&#8217;s going on under the hood of MSBuild by invoking a compile from the command line. On my machine <a href="http://msdn.microsoft.com/en-us/library/ms164311.aspx">msbuild.exe</a> is located in C:\Windows\Microsoft.NET\Framework\v3.5 and assuming you have a console window open with its current directory set to the directory of your project file, msbuild is invoked like so:
</p>
<pre>
    > msbuild /verbosity:diagnostic &gt; log.txt
</pre>
</p>
<p>Bring up log.txt in your favorite editor and eventually you&#8217;ll come across where <a href="http://msdn.microsoft.com/en-us/library/78f4aasd.aspx">csc.exe</a>, the C# compiler, is invoked:</p>
<p><img src="http://www.bugfree.dk/blog/wp-content/uploads/2009/02/key-file-and-msbuild.png" /></p>
<p>As you might have guessed, MSBuild carries over the location of the key file by passing the /keyfile argument to csc.exe.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2009/02/17/using-vs-linked-files-for-strong-naming-assemblies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increasing VMWare disk size</title>
		<link>http://www.bugfree.dk/blog/2007/03/22/increasing-vmware-disk-size/</link>
		<comments>http://www.bugfree.dk/blog/2007/03/22/increasing-vmware-disk-size/#comments</comments>
		<pubDate>Thu, 22 Mar 2007 19:47:21 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2007/03/22/increasing-vmware-disk-size/</guid>
		<description><![CDATA[I recently increased my VMWare disk image size from 10 to 15 GB. It was actually less problematic than I thought, although VMWare doesn&#8217;t support the process end to end. The steps you have to go through are: Locate vmware-vdiskmanager.exe which, on my machine, is in C:\Program Files\VMware\VMware Workstation. Using the examples here together with [...]]]></description>
			<content:encoded><![CDATA[<p>I recently increased my VMWare disk image size from 10 to 15 GB. It was actually less problematic than I thought, although VMWare doesn&#8217;t support the process end to end. </p>
<p>The steps you have to go through are:</p>
<ol>
<li>Locate <a href="http://www.vmware.com/support/ws45/doc/disks_vdiskmanager_ws.html">vmware-vdiskmanager.exe</a> which, on my machine, is in C:\Program Files\VMware\VMware Workstation.</li>
<li>Using the examples <a href="http://www.vmware.com/support/ws45/doc/disks_vdiskmanager_eg_ws.html">here</a> together with the /? switch, the program can be invokes like:
<pre>
vmware-vdiskmanager.exe -x 15GB "path to image.vmdk"
</pre>
<p>to make the new image 15 GB of size. During the enlargement process the tool creates a temporary copy the image, so you must have sufficient space on your host environment for this. Also note that this example doesn&#8217;t preallocate disk space. What this means is that although the size is logically increased to 15 GB, the image doesn&#8217;t initially grow larger on disk.</li>
<li>Now the image can contain 15 GB of data, but the guest operation system doesn&#8217;t automatically pick up the change in disk size. If you boot Windows, it&#8217;ll tell you the disk size is 10 GB, the size the disk had when Windows was installed on it. Therefore, we need to use PartitionMagic or simular tool to make Windows adjust as discribed <a href="http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647">here</a>.
</ol>
<p>All in all the process took roughly 80 minutes on my laptop. Unfortunately, it didn&#8217;t make Visual Studio 2005 run any faster than on the W2k3 server running out of disk space. I guess the dramatic slowdown is just a necessary evil of running Visual Studio 2005 in a virtualized environment on a laptop as the development environment is not the fastest running on native hardware either.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2007/03/22/increasing-vmware-disk-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The su of Windows</title>
		<link>http://www.bugfree.dk/blog/2007/02/25/the-su-of-windows/</link>
		<comments>http://www.bugfree.dk/blog/2007/02/25/the-su-of-windows/#comments</comments>
		<pubDate>Sun, 25 Feb 2007 09:58:11 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2007/02/25/the-su-of-windows/</guid>
		<description><![CDATA[On Linux based system, it&#8217;s a common idiom to impersonate the root user whenever you have to perform a privileged operation. This is typically accomplished using the su command, which, although used less frequently, has a Windows equivalent, called runat.exe. runat.exe turned out to be quite useful when I had to do some work with [...]]]></description>
			<content:encoded><![CDATA[<p>On Linux based system, it&#8217;s a common idiom to impersonate the root user whenever you have to perform a privileged operation. This is typically accomplished using the <code>su</code> command, which, although used less frequently, has a Windows equivalent, called <code>runat.exe</code>. </p>
<p><code>runat.exe</code> turned out to be quite useful when I had to do some work with MS SQL 2005 Server, Analysis Service. The thing with Analysis Service is that it&#8217;s <a href="http://msdn2.microsoft.com/en-us/library/ms144288.aspx">Windows authentication only</a>, whereas MS SQL 2005 Server supports <a href="http://msdn2.microsoft.com/en-us/library/ms144284.aspx">mixed mode authentication</a>.</p>
<p>My only option for getting in touch with Analysis Service was using SQL Server Management Studio by impersonating an existing Windows user, who is allowed access to Analysis Service (I didn&#8217;t have the option of creating a new account on the machine running Analysis Service and the machine wasn&#8217;t allowed to trust the domain my desktop computer was on (it&#8217;s a tough world out there)).</p>
<p>So, using <code>runat.exe</code>, I ran the command below (on one line, from a shortcut), in effect causing the display of a prompt asking for the password for my_impersonated_user. Upon entering the password <code>sqlwb.exe</code> starts up as if it was run from the local my_impersonated_user account. </p>
<pre>
C:\\Windows\\System32\\runas.exe /user:my_impersonated_user
"c:\\Program Files\\Microsoft SQL Server\\90\\Tools\\
Binn\\VSShell\\Common7\\IDE\\sqlwb.exe"
</pre>
<p>For the command to succeed my_impersonated_user have to be a user on the local machine with a username and password identical to the user that is allowed access to MS SQL 2005 Server/Analysis service. </p>
<p>Now Windows lets you logon to Analysis Service even if your local machine is on a different domain than the MS SQL 2005 Server.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2007/02/25/the-su-of-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cogan&#8217;s rules to better email</title>
		<link>http://www.bugfree.dk/blog/2007/01/23/cogans-rules-to-better-email/</link>
		<comments>http://www.bugfree.dk/blog/2007/01/23/cogans-rules-to-better-email/#comments</comments>
		<pubDate>Tue, 23 Jan 2007 17:54:46 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Process]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2007/01/23/cogans-rules-to-better-email/</guid>
		<description><![CDATA[Don&#8217;t you just hate it when you send an email to someone and then patiently wait for a reply never to show up. Quite often because the email quickly moved so far down the inbox that it&#8217;s now mentally gone. Or how about those people who always hit &#8220;new&#8221; when they really should&#8217;ve hit &#8220;reply&#8221;. [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t you just hate it when you send an email to someone and then patiently wait for a reply never to show up. Quite often because the email quickly moved so far down the inbox that it&#8217;s now mentally gone. Or how about those people who always hit &#8220;new&#8221; when they really should&#8217;ve hit &#8220;reply&#8221;.</p>
<p>What to do about those people? Force them to read up on <a href="http://www.ssw.com.au/ssw/Standards/Rules/RulesToBetterEmail.aspx">Adam Cogan&#8217;s rules to better email</a>, of course.</p>
<p>My favorite one is probably rule #2, the one about moving email from your inbox to a special folder when you&#8217;ve replied to or otherwise handled it. This way, items in your inbox can be considered a task list. </p>
<p>Also, #43 about not sending email immediately because you&#8217;ll often think of something you missed is a good one. Unfortunately, delayed sending isn&#8217;t supported by most public web mail providers.</p>
<p><b>Update: July 26</b>: Inspired by David Allen&#8217;s <a href="http://www.davidco.com">Getting Things Done</a>, this <a href="http://video.google.com/videoplay?docid=973149761529535925&#038;hl=en">Inbox Zero</a> Google Tech Talk video details a slightly different approach for managing email. Also, the <a href="http://todotxt.com/">Todo.txt</a> site, co-created by <a href="http://lifehacker.com/">Lifehacker</a> <a href="http://ginatrapani.org/">Gina Trapani</a>, argues that using your inbox as a todo list is a bad habit and proposes a simpler solution.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2007/01/23/cogans-rules-to-better-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to efficiently consume a podcast</title>
		<link>http://www.bugfree.dk/blog/2006/11/25/how-to-efficiently-consume-a-podcast/</link>
		<comments>http://www.bugfree.dk/blog/2006/11/25/how-to-efficiently-consume-a-podcast/#comments</comments>
		<pubDate>Sat, 25 Nov 2006 17:13:17 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2006/11/25/how-to-efficiently-consume-a-podcast/</guid>
		<description><![CDATA[How often do you find yourself listening to or viewing podcasts from ITConversations, .Net Rocks, Channel 9, or dnrTV? Now, how often do you crank up your playback speed? I&#8217;ve been conducting some un-scientific experiments with increasing the playback speed with Media Player (only supports 1.5x) and my mp3-player (supports variable speed). My conclusion is [...]]]></description>
			<content:encoded><![CDATA[<p>How often do you find yourself listening to or viewing podcasts from <a href="http://www.itconversations.com">ITConversations</a>, <a href="http://dotnetrocks.com">.Net Rocks</a>, <a href="http://channel9.msdn.com">Channel 9</a>, or <a href="http://dnrtv.com">dnrTV</a>?</p>
<p>Now, how often do you crank up your playback speed? </p>
<p>I&#8217;ve been conducting some un-scientific experiments with increasing the playback speed with <a href="http://www.microsoft.com/windows/windowsmedia/player/10/default.aspx">Media Player</a> (only supports 1.5x) and my <a href="http://www.web-shoppen.dk/web-shoppen/displayProduct.jsp?link=kelkoo&#038;displayProduct=0FFAF4BCAA266CE8BB63954C9F71EAF6">mp3-player</a> (supports variable speed).</p>
<p>My conclusion is that listening to or viewing a podcast at about 1.5x the original speed is really the optimal trade-off between time consumption, not stressing the brain, and still be able to comprehend the contents.</p>
<p>And I save 15 minutes of every hour consuming podcasts. </p>
<p>Just make sure you don&#8217;t start speaking 1.5x faster because you listen to too many podcasts.</p>
<p><b>Update, August 6, 2007</b>: <a href="http://www.stevepavlina.com/blog/2007/08/overclock-your-audio-learning">Steve Pavlina</a> describes many of the same thoughts, although he&#8217;s an advocate of a much higher speed. Steve&#8217;s blog entry mentions that &#8220;&#8230; in the latest version of Windows Media Player, click the arrow below “Now Playing.”  Then click Enhancements -> Show Play Speed Settings&#8221; as a way to bring up a speed slider. </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/11/25/how-to-efficiently-consume-a-podcast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CVS merge bit me</title>
		<link>http://www.bugfree.dk/blog/2006/09/24/cvs-merge-bid-me/</link>
		<comments>http://www.bugfree.dk/blog/2006/09/24/cvs-merge-bid-me/#comments</comments>
		<pubDate>Sun, 24 Sep 2006 09:42:48 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2006/09/24/cvs-merge-bid-me/</guid>
		<description><![CDATA[I&#8217;m currently managing the merge operations for a CVS repository with a branch layout looking partly as follows: At some point in the past HEAD branched into B1, which subsequently branched into B1.1. Then development on B1 completed and it was merged back into HEAD so a release branch B2 could be created. B1.1, however, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently managing the merge operations for a CVS repository with a branch layout looking partly as follows:</p>
<p><img id="image15" height=140 alt=cvs_merge.GIF src="http://www.bugfree.dk/blog/wp-content/uploads/2006/09/cvs_merge.GIF" /></p>
<p>At some point in the past HEAD branched into B1, which subsequently branched into B1.1. Then development on B1 completed and it was merged back into HEAD so a release branch B2 could be created. B1.1, however, kept living its separate life for a while, because the features added aren&#8217;t to be released until with release branch B5. This also goes for the changes made to B3, so it makes sense for B1.1 to be merged into B3.</p>
<p>As a result, I just spend a few hours on tracking down a merge issue resulting from this merge, because a change made in B1 wasn&#8217;t present in B3 after B1.1 was merged into this branch. I finally figured out why: suppose a line is removed in B1 before the spin-off of B1.1. After that the very same line is added back in. Now when B1.1 is merged into B3, the line is removed again. There is no merge conflict at this point, because from CVS&#8217; point of view it&#8217;s a clean merge.</p>
<p>It seems obvious what happened when looking at the diagram, but when you&#8217;re working with a large repository with lots of modified files and you&#8217;re merging code not written by yourself, this sort of indirect change propagation may inevitably bite you as well.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/09/24/cvs-merge-bid-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powertools from SysInternals</title>
		<link>http://www.bugfree.dk/blog/2006/09/17/powertools-from-sysinternals/</link>
		<comments>http://www.bugfree.dk/blog/2006/09/17/powertools-from-sysinternals/#comments</comments>
		<pubDate>Sun, 17 Sep 2006 13:26:57 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2006/09/17/powertools-from-sysinternals/</guid>
		<description><![CDATA[I use the SysInternals tools (now acquired by the Empire). The ones I use most often are: PageDefrag PageDefrag uses advanced techniques to provide you what commercial defragmenters cannot: the ability for you to see how fragmented your page file and Registry hives are, and to defragment them. In addition, it defragments event log files [...]]]></description>
			<content:encoded><![CDATA[<p>I use the <a href="http://www.sysinternals.com/">SysInternals</a> tools (now acquired by the <a href="http://microsoft.com">Empire</a>). The ones I use most often are:</p>
<ul>
<li><a href="http://www.sysinternals.com/utilities/pagedefrag.html">PageDefrag</a><br />
<blockquote><p>
PageDefrag uses advanced techniques to provide you what commercial defragmenters cannot: the ability for you to see how fragmented your page file and Registry hives are, and to defragment them. In addition, it defragments event log files and Windows 2000/XP hibernation files [...].
</p></blockquote>
<p>Has the ability to run at the next or every boot (that&#8217;s how it gets exclusive access to the system files).  Running it every time I boot typically adds 10-20 seconds to my boot time, but I guess it depends on how often you boot, the amount of physical memory, and what kind of applications you run.</p>
<li><a href="http://www.sysinternals.com/utilities/contig.html">Contig</a><br />
<blockquote><p>
Contig is a single-file defragmenter that attempts to make files contiguous on disk. It’s perfect for quickly optimizing files that are continuously becoming fragmented, or that you want to ensure are in as few fragments as possible.
</p></blockquote>
<p>Also has a recursive switch, so you can specify C:\ as the starting point and it&#8217;ll defragment its way through your entire drive.</p>
<li><a href="http://www.sysinternals.com/utilities/shareenum.html">ShareEnum</a><br />
<blockquote><p>
When you run ShareEnum it uses NetBIOS enumeration to scan all the computers within the domains accessible to it, showing file and print shares and their security settings.
</p></blockquote>
<p>A worthy replacement for Network Neighborhood, although it sometimes is not able to find any shares, although I know there&#8217;s quite a few out there. </p>
<li><a href="http://www.sysinternals.com/utilities/autoruns.html">Autoruns</a><br />
<blockquote><p>
This utility, which has the most comprehensive knowledge of auto-starting locations of any startup monitor, shows you what programs are configured to run during system boot or login, and shows you the entries in the order Windows processes them. These programs include ones in your startup folder, Run, RunOnce, and other Registry keys.
</p></blockquote>
<p>On my computer, it takes longer for Windows to become responsive after log on than it takes Windows to boot and display the log on screen, because Windows loads a ton of software, fills up the systray, and starts various services I really don&#8217;t need. </p>
<p>Services such as Remote Registry for accessing the registry across the network, Windows Image Acquisition for popping up a dialog box when I scan an image on the scanner I don&#8217;t have, or Windows Zero Configuration for managing the WLAN access I never use. </p>
<p>Those services are all on by default and can be disabled using AutoRuns (or using Control panel => Administrative tools => Services).</p>
<li><a href="http://www.sysinternals.com/utilities/processexplorer.html">Process Explorer</a><br />
<blockquote><p>
The Process Explorer display consists of two sub-windows. The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in: if it is in handle mode you&#8217;ll see the handles that the process selected in the top window has opened; if Process Explorer is in DLL mode you&#8217;ll see the DLLs and memory-mapped files that the process has loaded. Process Explorer also has a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded.
</p></blockquote>
<p>The quote speaks for itself.
</ul>
<p>There&#8217;s a lot more tools where these came from. Among the ones I use less frequently are FileMon and Regmon for real-time monitoring of file system and registry access, respectively. Also, I use TCPView as a more user friendly replacement for the netstat command.</p>
<p>Finally, take a look at <a href="http://www.dnrtv.com/default.aspx?showID=35">dnrTV</a>, where <a href="http://www.hanselman.com/blog/">Scott Hanselman</a> recently showed off some of these tools.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/09/17/powertools-from-sysinternals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query transform with MSSQL server</title>
		<link>http://www.bugfree.dk/blog/2006/09/15/query-transformation-with-mssql-server/</link>
		<comments>http://www.bugfree.dk/blog/2006/09/15/query-transformation-with-mssql-server/#comments</comments>
		<pubDate>Fri, 15 Sep 2006 19:55:12 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2006/09/15/query-transformation-with-mssql-server/</guid>
		<description><![CDATA[Ever found yourself struggling with a big chuck of embedded SQL failing on you? Oftentimes because of a trivial, but hard to spot, syntax (or semantic) error introduced as part of your dynamic query composition process. Typically, you&#8217;d target your frustration at the debugger and insert a breakpoint around the problematic part of your code [...]]]></description>
			<content:encoded><![CDATA[<p>Ever found yourself struggling with a big chuck of embedded SQL failing on you? Oftentimes because of a trivial, but hard to spot, syntax (or semantic) error introduced as part of your dynamic query composition process.</p>
<p>Typically, you&#8217;d target your frustration at the debugger and insert a breakpoint around the problematic part of your code to extract the SQL and copy it into the Query Analyzer for investigation.</p>
<p>Unfortunately, pasting the SQL into Query Analyzer causes the statement to appear on one line entirely. You then find yourself inserting new line characters for readability and for making the error message more precise.</p>
<p>Transforming SQL this way is tedious, boring, and crying for automation. Fortunately, Enterprise Manager responds well to these cries. Just drill down to a table view of your database, right click on a table, and select &#8220;Open table&#8221; followed by &#8220;Query&#8221;.</p>
<p>Now paste your extracted SQL into the text portion of the Query by Example window and hit &#8220;Run&#8221;. Although the query might not actually execute, it&#8217;s transformed into a more readable one. </p>
<p>Obviously, you could start and stay in the QBE window. Personally, though, I dislike QBE as a working environtment beyond for layout beautification, so I usually copy the transformed query into Query Analyzer.</p>
<p>By the way, the transform also comes in handy if you want to make sure your query doesn&#8217;t contain any camouflaged expensive joins, e.g., for a query with inner joins done using where clauses, QBE transforms it into explicit inner joins.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/09/15/query-transformation-with-mssql-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Vista RC1 rocks</title>
		<link>http://www.bugfree.dk/blog/2006/09/12/windows-vista-rc1-rocks/</link>
		<comments>http://www.bugfree.dk/blog/2006/09/12/windows-vista-rc1-rocks/#comments</comments>
		<pubDate>Tue, 12 Sep 2006 18:52:11 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tip]]></category>
		<category><![CDATA[Tool]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/2006/09/12/windows-vista-rc1-rocks/</guid>
		<description><![CDATA[I&#8217;ve been playing around with different setups of Windows Vista RC1 the last couple of days. Just getting Vista to install was an challenge in itself as RC1 refuses to install on VMWare Workstation. It stalls at &#8220;Windows is loading files &#8230;&#8221;. Apparently the subsequent switch into graphics mode causes Vista to hang, because Vista [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with different setups of <a href="http://www.microsoft.com/Windowsvista">Windows Vista</a> RC1 the last couple of days. Just getting Vista to install was an challenge in itself as RC1 refuses to install on VMWare Workstation.</p>
<p>It stalls at &#8220;Windows is loading files &#8230;&#8221;. Apparently the subsequent switch into graphics mode causes Vista to hang, because Vista all the sudden doesn&#8217;t properly support the emulated video hardware of VMWare.</p>
<p>That&#8217;s odd, because I previously installed Beta 2 on VMWare without any sign of trouble (could it be that MS wants people to try out RC1 on their <a href="http://www.microsoft.com/Windows/virtualpc/default.mspx">free</a> Virtual PC? By the way, <a href="http://www.vmware.com/products/server/">VMWare Server</a> is free too).</p>
<p>Luckily, <a href="http://www.joelonsoftware.com/">Joel on Software</a>&nbsp;provides a <a href="http://www.joelonsoftware.com/items/2006/09/08b.html">solution</a>&nbsp;to the VMWare issue, by adding</p>
<pre class="prettyprint lang-cs">
    svga.maxWidth = "640"
    svga.maxHeight = "480"
</pre>
<p>to the configuration file for your virtual machine prior to booting the Vista DVD. It&#8217;ll force the installer to run in SVGA mode. Then when the installation is complete and you&#8217;ve installed the VMWare tools, remove the above lines and Vista shines.</p>
<p>My intention was to run Vista in VMWare on a secondary computer and connect to it via Remote Desktop. For some yet to be uncovered reason, however, I wasn&#8217;t able to connect from my WinXP machine. Perhaps the host OS&nbsp;blocked the incoming request or perhaps Vista just wasn&#8217;t properly configured. </p>
<p>Anyway, I decided to run Vista on the bare hardware instead, so I fired up PartitionMagic. Unfortunately some guy accidentally cut power while PartitionMagic was doing its shrink-existing-partition-to-create-space-for-an-additional-one magic. After that the existing OS chickened out and bluescreened on me, so out everything went and in Vista came.</p>
<p>Thus, now I utilize a two-monitor setup, running Vista on a native 2.6GHz&nbsp;processor&nbsp;with 2GB of memory on one monitor and WinXP on the other. Unfortunately, the Vista machine has a crappy video card, so no fancy, transparent UI for me (unless I find a workaround). </p>
<p>As a final note, I&#8217;m using <a href="http://synergy2.sourceforge.net/">Synergy</a>&nbsp;to seamlessly share one mouse and keyboard between the physical machines as if it was one machine with dual head video output.</p>
<p>Way cool!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/09/12/windows-vista-rc1-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to break Notepad</title>
		<link>http://www.bugfree.dk/blog/2006/09/02/how-to-break-notepad/</link>
		<comments>http://www.bugfree.dk/blog/2006/09/02/how-to-break-notepad/#comments</comments>
		<pubDate>Sat, 02 Sep 2006 20:23:03 +0000</pubDate>
		<dc:creator>Ronnie Holm</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tip]]></category>

		<guid isPermaLink="false">http://www.bugfree.dk/blog/?p=8</guid>
		<description><![CDATA[Do the following: Open Notepad Type in &#8220;this app can break&#8221; (without the quotes) Save file Close Notepad Re-open saved file in Notepad Now Notepad displays funny looking foreign characters. This is caused by a &#8220;bug&#8221; in the Win32 function IsTextUnicode, which Notepad calls to heuristically determine if a file is Unicode encoded. For more [...]]]></description>
			<content:encoded><![CDATA[<p>Do the following:</p>
<ul>
<li>Open Notepad</li>
<li>Type in &#8220;this app can break&#8221; (without the quotes)</li>
<li>Save file</li>
<li>Close Notepad</li>
<li>Re-open saved file in Notepad</li>
</ul>
<p>Now Notepad displays funny looking foreign characters.</p>
<p>This is caused by a &#8220;bug&#8221; in the Win32 function <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/unicode_81np.asp">IsTextUnicode</a>, which Notepad calls to heuristically determine if a file is Unicode encoded.</p>
<p>For more in-depth info click <a href="http://apipes.blogspot.com/2006/06/this-api-can-break.html">here</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.bugfree.dk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.bugfree.dk/blog/2006/09/02/how-to-break-notepad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
