<?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>Logaan's Site</title>
	<atom:link href="http://www.logaans-site.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.logaans-site.co.uk</link>
	<description>In my own little world, world...world</description>
	<lastBuildDate>Sun, 24 Jan 2010 15:09:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Moving profile folders to another drive</title>
		<link>http://www.logaans-site.co.uk/2010/01/24/moving-profile-folders-to-another-drive/</link>
		<comments>http://www.logaans-site.co.uk/2010/01/24/moving-profile-folders-to-another-drive/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 15:09:23 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=558</guid>
		<description><![CDATA[I use the Run app in windows an awful lot. I know the new start menu in Vista/7 offer a more advanced indexed version of the run command but I just can&#8217;t shake the habit. Also it doesn&#8217;t do the common folders a developer is looking for, such as Desktop, Temp folder etc etc.
The main [...]]]></description>
			<content:encoded><![CDATA[<p>I use the Run app in windows an awful lot. I know the new start menu in Vista/7 offer a more advanced indexed version of the run command but I just can&#8217;t shake the habit. Also it doesn&#8217;t do the common folders a developer is looking for, such as Desktop, Temp folder etc etc.</p>
<p>The main problem with it after you have moved all of the profile folders to another drive, is that you cannot get to folders like the desktop, Windows just cannot find them anymore. I know you could probably go into the registry and start hacking around and telling Windows where else to go for the user folders but that just never sat quite right with me.</p>
<p>So here is a neat little trick I found, goto the user folder (C:\Users\Logaan) and create a shortcut with the same name as the folder you wish to get to.</p>
<p>Its so simple and I cannot believe that I found this years ago.</p>
<p>Its so cool you can even create links to other folders that you cannot usually get to in this fashion.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2010/01/24/moving-profile-folders-to-another-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Composite WPF Presentation Model item template</title>
		<link>http://www.logaans-site.co.uk/2010/01/06/composite-wpf-presentation-model-item-template/</link>
		<comments>http://www.logaans-site.co.uk/2010/01/06/composite-wpf-presentation-model-item-template/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 18:16:33 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Item Template]]></category>
		<category><![CDATA[VS2008]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=555</guid>
		<description><![CDATA[Neat little template I designed for use at work which is an improvement over the ViewModel code snippet.
Download PresentationModel item template
How to use
It is a bit unusual the way I have written this. Instead of specifying the file name for the item, it is the view name that is to be used.
When prompted for the [...]]]></description>
			<content:encoded><![CDATA[<p>Neat little template I designed for use at work which is an improvement over the ViewModel code snippet.</p>
<p><a href="http://www.logaans-site.co.uk/wp-content/uploads/2010/01/PresentationModel.zip">Download PresentationModel item template</a></p>
<p><strong>How to use</strong></p>
<p>It is a bit unusual the way I have written this. Instead of specifying the file name for the item, it is the view <em>name </em>that is to be used.</p>
<p>When prompted for the ViewName, specifying &#8220;MainWindow&#8221; will create:</p>
<p>A xaml user control called MainWindowView.xaml.</p>
<p>An interface called IMainWindowView.</p>
<p>An interface called IMainWindowViewModel.</p>
<p>A class called MainWindowViewModel.</p>
<p>(Some of this is very similar to the ViewModel code snippet)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2010/01/06/composite-wpf-presentation-model-item-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interface Properties</title>
		<link>http://www.logaans-site.co.uk/2009/11/25/interface-properties/</link>
		<comments>http://www.logaans-site.co.uk/2009/11/25/interface-properties/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 17:09:27 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=540</guid>
		<description><![CDATA[Basically rip-offs of the prop and propg code snippets you get with Visual Studio but without the scope or accessor keywords.
iprop

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34; ?&#62;
&#60;CodeSnippets  xmlns=&#34;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&#34;&#62;
	&#60;CodeSnippet Format=&#34;1.0.0&#34;&#62;
		&#60;Header&#62;
			&#60;Title&#62;iprop&#60;/Title&#62;
			&#60;Shortcut&#62;iprop&#60;/Shortcut&#62;
			&#60;Description&#62;Code snippet for an automatically implemented property on an interface&#60;/Description&#62;
			&#60;Author&#62;Alex Boyne-Aitken&#60;/Author&#62;
			&#60;SnippetTypes&#62;
				&#60;SnippetType&#62;Expansion&#60;/SnippetType&#62;
			&#60;/SnippetTypes&#62;
		&#60;/Header&#62;
		&#60;Snippet&#62;
			&#60;Declarations&#62;
				&#60;Literal&#62;
					&#60;ID&#62;type&#60;/ID&#62;
					&#60;ToolTip&#62;Property type&#60;/ToolTip&#62;
					&#60;Default&#62;int&#60;/Default&#62;
				&#60;/Literal&#62;
				&#60;Literal&#62;
					&#60;ID&#62;property&#60;/ID&#62;
					&#60;ToolTip&#62;Property name&#60;/ToolTip&#62;
					&#60;Default&#62;MyProperty&#60;/Default&#62;
				&#60;/Literal&#62;
			&#60;/Declarations&#62;
			&#60;Code Language=&#34;csharp&#34;&#62;&#60;![CDATA[$type$ $property$ { get; set; }$end$]]&#62;
			&#60;/Code&#62;
		&#60;/Snippet&#62;
	&#60;/CodeSnippet&#62;
&#60;/CodeSnippets&#62;

ipropg

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34; ?&#62;
&#60;CodeSnippets  xmlns=&#34;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&#34;&#62;
	&#60;CodeSnippet Format=&#34;1.0.0&#34;&#62;
		&#60;Header&#62;
			&#60;Title&#62;ipropg&#60;/Title&#62;
			&#60;Shortcut&#62;ipropg&#60;/Shortcut&#62;
			&#60;Description&#62;Code snippet for an automatically [...]]]></description>
			<content:encoded><![CDATA[<p>Basically rip-offs of the <em>prop </em>and <em>propg </em>code snippets you get with Visual Studio but without the scope or accessor keywords.</p>
<p><strong>iprop</strong></p>
<pre class="brush: xml; auto-links: false;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;CodeSnippets  xmlns=&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;&gt;
	&lt;CodeSnippet Format=&quot;1.0.0&quot;&gt;
		&lt;Header&gt;
			&lt;Title&gt;iprop&lt;/Title&gt;
			&lt;Shortcut&gt;iprop&lt;/Shortcut&gt;
			&lt;Description&gt;Code snippet for an automatically implemented property on an interface&lt;/Description&gt;
			&lt;Author&gt;Alex Boyne-Aitken&lt;/Author&gt;
			&lt;SnippetTypes&gt;
				&lt;SnippetType&gt;Expansion&lt;/SnippetType&gt;
			&lt;/SnippetTypes&gt;
		&lt;/Header&gt;
		&lt;Snippet&gt;
			&lt;Declarations&gt;
				&lt;Literal&gt;
					&lt;ID&gt;type&lt;/ID&gt;
					&lt;ToolTip&gt;Property type&lt;/ToolTip&gt;
					&lt;Default&gt;int&lt;/Default&gt;
				&lt;/Literal&gt;
				&lt;Literal&gt;
					&lt;ID&gt;property&lt;/ID&gt;
					&lt;ToolTip&gt;Property name&lt;/ToolTip&gt;
					&lt;Default&gt;MyProperty&lt;/Default&gt;
				&lt;/Literal&gt;
			&lt;/Declarations&gt;
			&lt;Code Language=&quot;csharp&quot;&gt;&lt;![CDATA[$type$ $property$ { get; set; }$end$]]&gt;
			&lt;/Code&gt;
		&lt;/Snippet&gt;
	&lt;/CodeSnippet&gt;
&lt;/CodeSnippets&gt;
</pre>
<p><strong>ipropg</strong></p>
<pre class="brush: xml; auto-links: false;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;CodeSnippets  xmlns=&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;&gt;
	&lt;CodeSnippet Format=&quot;1.0.0&quot;&gt;
		&lt;Header&gt;
			&lt;Title&gt;ipropg&lt;/Title&gt;
			&lt;Shortcut&gt;ipropg&lt;/Shortcut&gt;
			&lt;Description&gt;Code snippet for an automatically implemented property with a 'get' accessor for interfaces&lt;/Description&gt;
			&lt;Author&gt;Alex Boyne-Aitken&lt;/Author&gt;
			&lt;SnippetTypes&gt;
				&lt;SnippetType&gt;Expansion&lt;/SnippetType&gt;
			&lt;/SnippetTypes&gt;
		&lt;/Header&gt;
		&lt;Snippet&gt;
			&lt;Declarations&gt;
				&lt;Literal&gt;
					&lt;ID&gt;type&lt;/ID&gt;
					&lt;ToolTip&gt;Property type&lt;/ToolTip&gt;
					&lt;Default&gt;int&lt;/Default&gt;
				&lt;/Literal&gt;
				&lt;Literal&gt;
					&lt;ID&gt;property&lt;/ID&gt;
					&lt;ToolTip&gt;Property name&lt;/ToolTip&gt;
					&lt;Default&gt;MyProperty&lt;/Default&gt;
				&lt;/Literal&gt;
			&lt;/Declarations&gt;
			&lt;Code Language=&quot;csharp&quot;&gt;&lt;![CDATA[$type$ $property$ { get; }$end$]]&gt;
			&lt;/Code&gt;
		&lt;/Snippet&gt;
	&lt;/CodeSnippet&gt;
&lt;/CodeSnippets&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/11/25/interface-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to learn Programming</title>
		<link>http://www.logaans-site.co.uk/2009/11/12/how-to-learn-programming/</link>
		<comments>http://www.logaans-site.co.uk/2009/11/12/how-to-learn-programming/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 17:45:22 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=532</guid>
		<description><![CDATA[Read a fantastic article on Life Hacker on how to teach yourself computer programming: http://lifehacker.com/5401954/programmer-101-teach-yourself-how-to-code
My only comment would be pick a language that is based on C-like syntax (rather than use Python or VB) because although the syntax may seem harder, the syntax is more transferrable to other languages and it would give you a [...]]]></description>
			<content:encoded><![CDATA[<p>Read a fantastic article on Life Hacker on how to teach yourself computer programming: <a href="http://lifehacker.com/5401954/programmer-101-teach-yourself-how-to-code">http://lifehacker.com/5401954/programmer-101-teach-yourself-how-to-code</a></p>
<p>My only comment would be pick a language that is based on C-like syntax (rather than use Python or VB) because although the syntax may seem harder, the syntax is more transferrable to other languages and it would give you a head start.</p>
<p>In my personal experience, a book only served as a reference. I found books that taught me how to do something soon became too basic for my needs and often there are plenty of guides on the internet that is a good replacement. Instead you will find much of my library consists of reference books, hint, tips and advanced topics.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/11/12/how-to-learn-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CyTS library stalling</title>
		<link>http://www.logaans-site.co.uk/2009/11/07/cyts-library-stalling/</link>
		<comments>http://www.logaans-site.co.uk/2009/11/07/cyts-library-stalling/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 17:48:19 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Teamspeak]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=513</guid>
		<description><![CDATA[On our guild website, we have a block in the portal that shows who is currently on teamspeak. This uses the CyTS library to connect and get such information and occasionally it would cause the portal to stop loading.
In each case I would get home, load it up and not find any problems at all. [...]]]></description>
			<content:encoded><![CDATA[<p>On our guild website, we have a block in the portal that shows who is currently on teamspeak. This uses the CyTS library to connect and get such information and occasionally it would cause the portal to stop loading.</p>
<p>In each case I would get home, load it up and not find any problems at all. Well today was a different matter, I was able to pin point the exact issue. For some reason the library connects to the server but then stalls when receiving information from the server.</p>
<p>I should tell you know, this is not a perfect fix but it does the job. I did look into other options like switch socket blocking on and off and such other approaches, but it seems that if <em>fgets</em> reads more than 1 byte, it stalls. This is a bug in PHP that has hung around for a while.</p>
<p>I have changed the <em>_readcall</em> function to read the first byte, check it for failure then continue with the rest.</p>
<pre class="brush: php;">
function _readcall()
{
	if (!is_resource($this-&gt;sCon))
		return false;

	// HACK : Workaround to fail fast
	$first = fgets($this-&gt;sCon, 1);

	if($first === false)
		return false;

	$sRead = '';
	do
	{
		$cRead = $first.fgets($this-&gt;sCon);
		$first = '';

		$sRead .= $cRead;
	} while ($cRead != CYTS_SYN &amp;&amp; $cRead != CYTS_OK &amp;&amp; strtoupper(substr($cRead, 0, 5)) != &quot;ERROR&quot;);
	return $sRead;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/11/07/cyts-library-stalling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>View model property</title>
		<link>http://www.logaans-site.co.uk/2009/11/02/view-model-property/</link>
		<comments>http://www.logaans-site.co.uk/2009/11/02/view-model-property/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:07:04 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Snippet]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=508</guid>
		<description><![CDATA[Because I am so lazy :P

&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34; ?&#62;
&#60;CodeSnippets  xmlns=&#34;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&#34;&#62;
	&#60;CodeSnippet Format=&#34;1.0.0&#34;&#62;
		&#60;Header&#62;
			&#60;Title&#62;View model property snippet&#60;/Title&#62;
			&#60;Shortcut&#62;vmprop&#60;/Shortcut&#62;
			&#60;Description&#62;&#60;/Description&#62;
			&#60;Author&#62;Alex Boyne-Aitken&#60;/Author&#62;
			&#60;SnippetTypes&#62;
				&#60;SnippetType&#62;Expansion&#60;/SnippetType&#62;
			&#60;/SnippetTypes&#62;
		&#60;/Header&#62;
		&#60;Snippet&#62;
			&#60;Declarations&#62;
        &#60;Literal&#62;
          &#60;ID&#62;name&#60;/ID&#62;
          &#60;ToolTip&#62;Property name&#60;/ToolTip&#62;
          &#60;Default&#62;Field&#60;/Default&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Because I am so lazy :P</p>
<pre class="brush: xml; auto-links: false;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;CodeSnippets  xmlns=&quot;http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet&quot;&gt;
	&lt;CodeSnippet Format=&quot;1.0.0&quot;&gt;
		&lt;Header&gt;
			&lt;Title&gt;View model property snippet&lt;/Title&gt;
			&lt;Shortcut&gt;vmprop&lt;/Shortcut&gt;
			&lt;Description&gt;&lt;/Description&gt;
			&lt;Author&gt;Alex Boyne-Aitken&lt;/Author&gt;
			&lt;SnippetTypes&gt;
				&lt;SnippetType&gt;Expansion&lt;/SnippetType&gt;
			&lt;/SnippetTypes&gt;
		&lt;/Header&gt;
		&lt;Snippet&gt;
			&lt;Declarations&gt;
        &lt;Literal&gt;
          &lt;ID&gt;name&lt;/ID&gt;
          &lt;ToolTip&gt;Property name&lt;/ToolTip&gt;
          &lt;Default&gt;Field&lt;/Default&gt;
        &lt;/Literal&gt;
        &lt;Literal&gt;
          &lt;ID&gt;field&lt;/ID&gt;
          &lt;ToolTip&gt;Field name&lt;/ToolTip&gt;
          &lt;Default&gt;field&lt;/Default&gt;
        &lt;/Literal&gt;
        &lt;Literal&gt;
          &lt;ID&gt;type&lt;/ID&gt;
          &lt;ToolTip&gt;Type&lt;/ToolTip&gt;
          &lt;Default&gt;object&lt;/Default&gt;
        &lt;/Literal&gt;
			&lt;/Declarations&gt;
			&lt;Code Language=&quot;csharp&quot;&gt;
        &lt;![CDATA[
    $type$ $field$;
    public $type$ $name$
    {
        get { return $field$; }
        set
        {
            if ($field$ == value)
                return;

            $field$ = value;
            SendPropertyChanged(&quot;$name$&quot;);
        }
    }
			$end$]]&gt;
			&lt;/Code&gt;
		&lt;/Snippet&gt;
	&lt;/CodeSnippet&gt;
&lt;/CodeSnippets&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/11/02/view-model-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSBuild creating lots of temp files</title>
		<link>http://www.logaans-site.co.uk/2009/10/23/msbuild-creating-lots-of-temp-files/</link>
		<comments>http://www.logaans-site.co.uk/2009/10/23/msbuild-creating-lots-of-temp-files/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 09:19:49 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=497</guid>
		<description><![CDATA[UPDATE: 
I found a msdn forum post with exactly the same issue: http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/42647eff-ecb8-412c-a884-a152b6fdd40d
It turns out that it is NOT msbuild but it is SN.exe leaving the temp files behind when resigning assemblies. I suppose you could easily come to this conclusion when watching the build and those files are flashing by so quickly.
On reflection a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: </strong></p>
<p>I found a msdn forum post with exactly the same issue: <a href="http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/42647eff-ecb8-412c-a884-a152b6fdd40d" target="_blank">http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/42647eff-ecb8-412c-a884-a152b6fdd40d</a></p>
<p>It turns out that it is <strong>NOT</strong> msbuild but it is SN.exe leaving the temp files behind when resigning assemblies. I suppose you could easily come to this conclusion when watching the build and those files are flashing by so quickly.</p>
<p>On reflection a custom task will not help either&#8230;</p>
<p>This post has more details on the issue with a link to a hot fix for Server 2003: <a href="http://blogs.msdn.com/pfedev/archive/2008/10/24/sn-exe-and-empty-temp-files-in-temp.aspx" target="_blank">http://blogs.msdn.com/pfedev/archive/2008/10/24/sn-exe-and-empty-temp-files-in-temp.aspx</a></p>
<p>If you are using Server 2008 I would not recommend installing it.</p>
<p><span id="more-497"></span><br />
<strong>Original:</strong></p>
<p>Recently at work we have be observing a very odd behaviour, a particular set of builds has been slowing by about 30 minutes every night.</p>
<p>We discovered that hundreds of temporary files were being created by the msbuild exec task. What happens is that the exec task will created a temp file, then use the temp file name to create a batch file with the command in it. In most cases it will delete the temp file and the batch file. If you are quick enough you can pause the build and look in the temp folder and observe these files.</p>
<p>Now the strange thing is we have observed a specific case of when msbuild will not delete that temporary file, thus adding a cumalative amount of time every night when it is trying to find a new temp file name. This occurs when we resign our assemblies using SN. If you use SN to verify the assemblies the temp file is cleaned up afterwards.</p>
<p>This is quite a baffling problem, when calling the same executable with a different command it just works, seems odd to me that it would cause such an issue. There is also little on the internet that hints at this issue, I suppose if people are careul and look after the servers with regular cleanup tasks this issue might never arise.</p>
<p>So at the moment to work around the issue we have written temp folder clean up tasks and a sceduled disk clean up task on the server. I might write a set of specific tasks wrapping the SN executable and its command line arguments to reduce the need for such measures.</p>
<p>If I can get any sort of grasp on the actual issue then I will create and link to an MSConnect issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/10/23/msbuild-creating-lots-of-temp-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simpler version of the 7-Zip backup</title>
		<link>http://www.logaans-site.co.uk/2009/10/17/simpler-version-of-the-7-zip-backup/</link>
		<comments>http://www.logaans-site.co.uk/2009/10/17/simpler-version-of-the-7-zip-backup/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 00:16:38 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[Batch]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[batch scripting]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=494</guid>
		<description><![CDATA[I have tested the 7-Zip backup I had constructured that I posted about a while back and I have come to realise that it is a tad bit too complicated. I even went through the process of creating a proxy application to try and get it to be a bit more cleverer but in the [...]]]></description>
			<content:encoded><![CDATA[<p>I have tested the 7-Zip backup I had constructured that I posted about a while back and I have come to realise that it is a tad bit too complicated. I even went through the process of creating a proxy application to try and get it to be a bit more cleverer but in the end I simplified it down to just 4 parts; the logic, settings and file lists.</p>
<p><strong>Backup.cmd</strong></p>
<pre class="brush: plain; auto-links: false;">
@ECHO OFF

ECHO 7-Zip backup script
ECHO Written by Alex Boyne-Aitken
ECHO Last update: 07/11/2009
ECHO.

ECHO TRACE: Parse arguments: '%~f1'
IF EXIST %~f1 GOTO labelBegin

ECHO.
ECHO ERROR: Settings file not found!
GOTO labelWaitEnd

:labelBegin

ECHO.
ECHO TRACE: Reading settings
FOR /F &quot;eol=# tokens=1,2 delims==&quot; %%i IN (%~f1) DO (
SET %%i=%%j
ECHO TRACE: %%i = '%%j'
)

SET varTimeStamp=%DATE:~-4%-%DATE:~3,2%-%DATE:~0,2%-%TIME:~0,2%-%TIME:~3,2%
SET varTargetBackupSet=%varBackupPath%\%varTimeStamp%-backup.zip

ECHO.
ECHO TRACE: Backup set: '%varTargetBackupSet%'
ECHO TRACE: Command line: '&quot;%varPathToSevenZip%\7z&quot; a -t%varArchiveType% &quot;%varTargetBackupSet%&quot; @&quot;%varInclusionsFile%&quot; -xr@&quot;%varExclusionsFile%&quot;'

ECHO.
ECHO TRACE: Executing backup
&quot;%varPathToSevenZip%\7z&quot; a -t%varArchiveType% &quot;%varTargetBackupSet%&quot; @&quot;%varInclusionsFile%&quot; -xr@&quot;%varExclusionsFile%&quot;

IF /I NOT &quot;%varWaitAtEnd%&quot; == &quot;true&quot; GOTO labelEnd

:labelWaitEnd
PAUSE
:labelEnd
</pre>
<p><strong>Settings.txt</strong></p>
<pre class="brush: plain; auto-links: false;">
# The path to the where the 7z.exe executable is
varPathToSevenZip=C:\Program Files\7-Zip

# The path where to store the backup sets
varBackupPath=D:\Backups

# The file path to the inclusions file
varInclusionsFile=D:\Logaan\Documents\Tools\7ZipBackup\Settings\Inclusions.txt

# The file path to the exclusions file
varExclusionsFile=D:\Logaan\Documents\Tools\7ZipBackup\Settings\Exclusions.txt

# Whether to wait at the end of the backup
varWaitAtEnd=true

# Type of backup archive to create
varArchiveType=zip
</pre>
<p><strong>Exclusions.txt</strong></p>
<pre class="brush: plain; auto-links: false;">
*.svn
</pre>
<p><strong>Inclusions.txt</strong></p>
<pre class="brush: plain; auto-links: false;">
D:\Logaan\Documents
D:\Logaan\Favorites
C:\Users\Logaan\Desktop
D:\Logaan\Saved Games
</pre>
<p><strong>How to use it</strong></p>
<p>Place the batch file and settings files in a folder somewhere.</p>
<p>Update the setttings file with the correct paths.</p>
<p>Pass the path to the settings file to the backup batch file.</p>
<pre class="brush: plain; auto-links: false;">
C:&gt; backup D:\Logaan\Documents\Backup\settings.txt
</pre>
<p>Or create a scheduled task.</p>
<p><a href="http://www.logaans-site.co.uk/wp-content/uploads/2009/10/EditAction.png"><img class="aligncenter size-full wp-image-519" title="Edit Action" src="http://www.logaans-site.co.uk/wp-content/uploads/2009/10/EditAction.png" alt="Edit Action" width="468" height="504" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/10/17/simpler-version-of-the-7-zip-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closeable TabItems using CompositeWPF</title>
		<link>http://www.logaans-site.co.uk/2009/06/25/closeable-tabitems-using-compositewpf/</link>
		<comments>http://www.logaans-site.co.uk/2009/06/25/closeable-tabitems-using-compositewpf/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 11:53:32 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=455</guid>
		<description><![CDATA[On a project I am working on at the moment, I needed to allow the user to open and close views.  As I was using the Composite Application Block injecting views into a tab control was really easy. Closing them was not.
To remove a view from a region you need two things, the RegionName [...]]]></description>
			<content:encoded><![CDATA[<p>On a project I am working on at the moment, I needed to allow the user to open and close views.  As I was using the Composite Application Block injecting views into a tab control was really easy. Closing them was not.</p>
<p>To remove a view from a region you need two things, the RegionName and the View.</p>
<p>This article helped me a lot when engineering this approach:</p>
<p>http://blogs.infosupport.com/blogs/willemm/archive/2008/07/31/Creating-closeable-tabitems-for-use-in-CompositeWPF.aspx</p>
<p>However the RegionManager.GetRegionName did not work against the TabItem. I always got null, I am assuming this is a change that was made during the time the article was posted. Using the TabControl however worked.</p>
<p>But you cannot easily bind to two things (the TabControl and the TabItem).</p>
<p>To achieve my goal I used the XAML from the article and changed it little</p>
<pre class="brush: xml; auto-links: false;">
&lt;DataTemplate x:Key=&quot;CustomTabHeader&quot;&gt;
&lt;StackPanel Orientation=&quot;Horizontal&quot;&gt;
&lt;ContentPresenter&gt;
&lt;ContentPresenter.Content&gt;
&lt;Binding Path=&quot;Content.Model.HeaderText&quot;&gt;
&lt;Binding.RelativeSource&gt;
&lt;RelativeSource Mode=&quot;FindAncestor&quot;
AncestorType=&quot;{x:Type TabItem}&quot;/&gt;
&lt;/Binding.RelativeSource&gt;
&lt;/Binding&gt;
&lt;/ContentPresenter.Content&gt;
&lt;/ContentPresenter&gt;
&lt;Button Margin=&quot;8,0,0,0&quot;
Command=&quot;{Binding Path=Model.CloseTabCommand.Command, ElementName=ThisControl}&quot;
CommandParameter=&quot;{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type TabItem}}}&quot;
HorizontalContentAlignment=&quot;Center&quot;
VerticalContentAlignment=&quot;Center&quot;&gt;
&lt;Grid&gt;
&lt;Canvas Width=&quot;8&quot; Height=&quot;8&quot;&gt;
&lt;Line X1=&quot;2&quot; X2=&quot;6&quot; Y1=&quot;2&quot; Y2=&quot;6&quot; Stroke=&quot;Black&quot; StrokeThickness=&quot;1&quot;/&gt;
&lt;Line X1=&quot;6&quot; X2=&quot;2&quot; Y1=&quot;2&quot; Y2=&quot;6&quot; Stroke=&quot;Black&quot; StrokeThickness=&quot;1&quot;/&gt;
&lt;/Canvas&gt;
&lt;/Grid&gt;
&lt;/Button&gt;
&lt;/StackPanel&gt;
&lt;/DataTemplate&gt;

&lt;Style TargetType=&quot;TabItem&quot;&gt;
&lt;Style.Setters&gt;
&lt;Setter Property=&quot;HeaderTemplate&quot;
Value=&quot;{StaticResource CustomTabHeader}&quot;/&gt;
&lt;/Style.Setters&gt;
&lt;/Style&gt;
</pre>
<p>The only difference is where I go for my commands and header text. In my project I have an interface that describes a headed content item.</p>
<p>The change really is in the code for closing the view:</p>
<pre class="brush: csharp; auto-links: false;">
class CloseTabCommand : CommandModelBase
{
private readonly IRegionManager regionManager;

public CloseTabCommand(IRegionManager regionManager)
{
this.regionManager = regionManager;
}

public override void OnExecute(object sender, ExecutedRoutedEventArgs e)
{
var tabItem = (TabItem)e.Parameter;
var tabControl = (TabControl) e.Source;

var regionName = RegionManager.GetRegionName(tabControl);

regionManager.Regions[regionName].Remove(tabItem.Content);
}
}
</pre>
<p>In the end the solution boiled down to being really simple. You still bind to the tab item but the source is the tab control.</p>
<p>There will be some drawbacks to this approach. If a key binding is setup for this command then the source could change, so care should be taken.</p>
<p>But this works and it will do for the time being until I think of a better solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/06/25/closeable-tabitems-using-compositewpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Validator</title>
		<link>http://www.logaans-site.co.uk/2009/04/27/project-validator/</link>
		<comments>http://www.logaans-site.co.uk/2009/04/27/project-validator/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 08:52:36 +0000</pubDate>
		<dc:creator>Logaan</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MSBuild]]></category>

		<guid isPermaLink="false">http://www.logaans-site.co.uk/?p=441</guid>
		<description><![CDATA[As an idea that compliments the previous validator I built, this msbuild task will search for all the projects in a given path and check that they are all building to the correct path.
Download source
To use just define two properties: SearchPath, which is the parent folder to start looking in. It will search all subfolders [...]]]></description>
			<content:encoded><![CDATA[<p>As an idea that compliments the previous validator I built, this msbuild task will search for all the projects in a given path and check that they are all building to the correct path.</p>
<p><a href="http://www.logaans-site.co.uk/wp-content/uploads/2009/04/projectvalidator.zip">Download source</a></p>
<p>To use just define two properties: SearchPath, which is the parent folder to start looking in. It will search all subfolders as well by default. And BuildFolder, which is the desired target for building to.</p>
<p>All it does is very simple substring matching to check that it is valid.</p>
<p>For example, if I build a project to <em>..\bin\Debug</em> and <em>..\bin\Release</em> and the specify my build folder is <em>..\bin</em> then both paths are valid. But if one of the build targets was set to something like <em>..\foo</em> then it would be invalid</p>
<p>Again, this validator could be extended to check other parts of the project files.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.logaans-site.co.uk/2009/04/27/project-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
