<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Alex Duggleby's Palace of Words</title>
	<atom:link href="http://alexduggleby.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexduggleby.com</link>
	<description>Just me, you and a cup of tee...</description>
	<pubDate>Fri, 18 Jul 2008 09:41:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>SQL Server Reporting Services 2008 Tutorial in 5 Minutes or &#34;How to send my boss a report from a view quickly&#34;</title>
		<link>http://alexduggleby.com/2008/07/18/sql-server-reporting-services-2008-tutorial-in-5-minutes-or-how-to-send-my-boss-a-report-from-a-view-quickly/</link>
		<comments>http://alexduggleby.com/2008/07/18/sql-server-reporting-services-2008-tutorial-in-5-minutes-or-how-to-send-my-boss-a-report-from-a-view-quickly/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 09:41:27 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[MSP]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://alexduggleby.com/2008/07/18/sql-server-reporting-services-2008-tutorial-in-5-minutes-or-how-to-send-my-boss-a-report-from-a-view-quickly/</guid>
		<description><![CDATA[Some facts:

SQL Server Reporting Services were great in the past. SSRS 2008 are better.
MSDN is great. MSDN has lots of details. Sometimes it&#8217;s too much if you are under pressure.
Google usually gets me the information I want faster. Especially when I need to get something done quickly. 

All in all this post is for those [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Some facts:</p>
<ul>
<li>SQL Server Reporting Services were great in the past. SSRS 2008 are better.
<li>MSDN is great. MSDN has lots of details. Sometimes it&#8217;s too much if you are under pressure.
<li>Google usually gets me the information I want faster. Especially when I need to get something done quickly. </li>
</ul>
<p>All in all this post is for those of you that need to learn how to use SQL Server Reporting Services fast or need to solve the above mentioned problem fast, without knowing too much about the details. I read a lot of and like these introductory posts and so now I&#8217;m writing another one, here goes.</p>
<p>I assume you have SQL Server Reporting Services already setup (by your grand one-and-only unmissable sys-admins or by yourself, but in the latter case you probably are not the target audience for this) and you have access to the all required tools. Talking about tools, there are three you should know of:</p>
<p>- <strong>RSConfigTool</strong> - (Start menu &gt; SQL Server 2008 &gt; Configuration &gt; Reporting Services Configuration): What do I need it for: Troubleshooting, Finding Urls, Configuration Report Server. Having problems trying to connect. See Additional Tip #1.</p>
<p>- <strong>Report Manager</strong> - (<a href="http://&lt;yourserver&gt;/reports">http://&lt;yourserver&gt;/reports</a>): What do I need it for: Managing your reports (you won&#8217;t actually see anything on a clean install yet)</p>
<p>- <strong>Business Intelligence Studio</strong> - (Start menu &gt; SQL Server 2008 &gt; SQL Server Business Intelligence Development Studio): What do I need it for: Creating and editing your reports</p>
<p>and of course you will need SQL Server Management Studio for managing the data the report is based upon.</p>
<p>(side note: This tutorial is based on the 2008 version, can&#8217;t say how many differences there are between this and the older versions.)</p>
<p>1. Create your views</p>
<p>There are ways to aggregate your data in the report itself, but it&#8217;s easier and cleaner to use SQL views to provide the data for the report and use Reporting Services only for the report. So go to SSMS and create your view.</p>
<p>2. Create a new BIDS (Business Intelligence Development Studio) solution based on the &#8220;Report Server Project&#8221; Template. Add a new report by clicking on the Report node in the Solution Explorer. Next we need to connect to a data source. Give it a name, click edit and connect to your database.</p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/07/datasource.png"><img style="border-width:0;" height="295" alt="datasource" src="http://alexduggleby.files.wordpress.com/2008/07/datasource-thumb.png?w=404&h=295" width="404" border="0"></a> </p>
<p>3. Click next and the Query Designer appears. Here you enter the T-SQL statement for your data. Ideally it&#8217;s just a &#8220;SELECT * FROM yourView&#8221; (or select each column distinctly). You can test it using &#8216;Run Query&#8217;. You can also choose to use data from a stored procedure if you like, just select the appropriate option.</p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/07/reportdesigner1.png"><img style="border-width:0;" height="226" alt="reportdesigner1" src="http://alexduggleby.files.wordpress.com/2008/07/reportdesigner1-thumb.png?w=404&h=226" width="404" border="0"></a></p>
<p>4. Design your report. You can add elements to the report surface, by right clicking on the center surface and select them from the insert menu. The most important are Header, Footer and Table. In the Header and Footer you can add Textboxes with text or by right-clicking on them and choosing expressoin you can choose some variable input. For example page number, report name etc. In the table you can drag columns from the &#8220;Report Data&#8221; (on the left showing the data source you just added). When you are finished, you might have something like this. Click preview to get a glimpse at what your boss might get.</p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/07/reportdesigner2.png"><img style="border-width:0;" height="304" alt="reportdesigner2" src="http://alexduggleby.files.wordpress.com/2008/07/reportdesigner2-thumb.png?w=399&h=304" width="399" border="0"></a> </p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/07/reportpreview.png"><img style="border-width:0;" height="304" alt="reportpreview" src="http://alexduggleby.files.wordpress.com/2008/07/reportpreview-thumb.png?w=399&h=304" width="399" border="0"></a></p>
<p>5. Now let&#8217;s deploy it to the report server. First we must set the report server url. Right-click on the solution in the Solution Explorer and click on Properties. You will see the following dialog. Change the TargetReportFolder value to something you wish and provide the TargetServerURL as <a href="http://yourserver/reportserver">http://yourserver/reportserver</a> (not just /report!). Press save. Now right-click on the solution again and select Deploy.</p>
<p>&nbsp;<a href="http://alexduggleby.files.wordpress.com/2008/07/reportproperties.png"><img style="border-width:0;" height="267" alt="reportproperties" src="http://alexduggleby.files.wordpress.com/2008/07/reportproperties-thumb.png?w=404&h=267" width="404" border="0"></a> </p>
<p>6. When it finishes open the url <a href="http://yourserver/report">http://yourserver/report</a> (not /reportserver!). You will see something like this. Go ahead and click on Test.Reports (or whatever you specified as TargetReportFolder) and then click on your test report. You will be greeted with the web version of your report. </p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/07/webreport.png"><img style="border-width:0;" height="304" alt="webreport" src="http://alexduggleby.files.wordpress.com/2008/07/webreport-thumb.png?w=403&h=304" width="403" border="0"></a> </p>
<p>7. Now your Boss will not want to go the web page to get that report, so let&#8217;s look at sending it to him per email automatically. First we need to change the security settings for connecting to the data source. In the report page, click on Properties &gt; Data Sources. Change the &#8220;Connect using&#8221; to &#8220;Credentials stored securely in the report server&#8221; and specify an account that has access to the data. Also check &#8220;Use as Windows credentials&#8230;&#8221;.</p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/07/security.png"><img style="border-width:0;" height="408" alt="security" src="http://alexduggleby.files.wordpress.com/2008/07/security-thumb.png?w=404&h=408" width="404" border="0"></a> </p>
<p>8. Now you can go to Subscriptions. Click on email. Don&#8217;t have email as an option? See Additional Tip #2. Enter the recipient information as you wish and select a schedule for the sending. If you press save and encounter an error that &#8216;SQL Server Agent is not running&#8217; either figure it out yourself what the problem could be or read Additional Tip #3 :). Once you have finished, lean back and let SSRS make your boss happy and in turn make you happy. </p>
<p><strong>So we have seen the absolute basics of report creation. A quick and dirty introduction. This should cover your first encounters with SSRS. Hope it helps someone!</strong></p>
<p><em>Stop reading here unless you are Troubleshooting&#8230;</em></p>
<p>Additional Tip #1:</p>
<p>I try connecting with SSMS (Management Studio) and it won&#8217;t connect. Maybe you renamed the server? Open RSConfigTool, go to Database &gt; Change Database &gt; Choose an existing report server database. Just choose the existing one, and let it run through it&#8217;s config. That should repair everything and you should be able to connect using SSMS again.</p>
<p>Additional Tip #2:</p>
<p>You don&#8217;t have email in the options for delivery in the subscriptions dialog? Probably it&#8217;s not configured. Thankfully that is very easy. You start the RSConfigTool. Connect and go to the Email tab. There you just specify a sender address and the SMTP server you would like to use. Click apply and voila. The server will automatically restart and the now the email option appears.</p>
<p>Additional Tip #3:</p>
<p>Saving the subscription results in an error message saying SQL Server Agent is not running. This is a DB or sysadmin issue, but just fire up SQL Server Configuration Manager (in the Start Menu under SQL Server 2008 &gt; Configuration) then click on SQL Server Services, right-click on the SQL Server Agent &gt; Properties. Go to the service tab, change Start Mode to Automatic and press OK. On the next reboot it will start automatically, but you still need to start it once for now. Right-click on the &#8216;SQL Server Agent&#8217; and press Start. </p>
<div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:faeb7d4a-4d86-49bd-a502-8ac985346daf" style="display:inline;margin:0;padding:0;">Technorati Tags: <a href="http://technorati.com/tags/Microsoft%20SQL%20Server%20Reporting%20Services" rel="tag">Microsoft SQL Server Reporting Services</a></div>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/144/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/144/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/144/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/144/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/144/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=144&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/07/18/sql-server-reporting-services-2008-tutorial-in-5-minutes-or-how-to-send-my-boss-a-report-from-a-view-quickly/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/datasource-thumb.png" medium="image">
			<media:title type="html">datasource</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/reportdesigner1-thumb.png" medium="image">
			<media:title type="html">reportdesigner1</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/reportdesigner2-thumb.png" medium="image">
			<media:title type="html">reportdesigner2</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/reportpreview-thumb.png" medium="image">
			<media:title type="html">reportpreview</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/reportproperties-thumb.png" medium="image">
			<media:title type="html">reportproperties</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/webreport-thumb.png" medium="image">
			<media:title type="html">webreport</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/security-thumb.png" medium="image">
			<media:title type="html">security</media:title>
		</media:content>
	</item>
		<item>
		<title>Installing MiniSAP 4.6D on SQL Server 2005</title>
		<link>http://alexduggleby.com/2008/07/16/installing-minisap-46d-on-sql-server-2005/</link>
		<comments>http://alexduggleby.com/2008/07/16/installing-minisap-46d-on-sql-server-2005/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 18:45:45 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[Troubleshooting]]></category>

		<category><![CDATA[SAP]]></category>

		<category><![CDATA[SQL Server 2005]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=128</guid>
		<description><![CDATA[So after Paris it&#8217;s back to work again and this week I need to prep a VM for a customer project. I already received a clean Windows 2003 Machine and on Monday I installed SQL Server 2005 before I went. I should have seen this coming, but anyhow today I wanted to install a Mini-SAP [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So after Paris it&#8217;s back to work again and this week I need to prep a VM for a customer project. I already received a clean Windows 2003 Machine and on Monday I installed SQL Server 2005 before I went. I should have seen this coming, but anyhow today I wanted to install a Mini-SAP 4.6D.</p>
<p>MiniSAP (now called MiniWAS) is available for Linux as a download but the Windows version is only distributed in the shop or as part of the ABAP Objects book (I hope the program manager who made that decision never crosses my way). Anyhow, I got the CDs somehow (don&#8217;t ask) and looked at the Documentation.doc file. (Actually I of course immediatelly clicked on setup.bat and bang it crashed, but doesn&#8217;t it sound calmer when I say I looked at the documentation first?).</p>
<p>Seems that I have versions of the CD that contain a production bug, so after doing some manually editing in the install files (as described in the documentation) I was ready to go. It tries to install MSDE on the machine, but that fails with an (&#8217;Instance name not valid&#8217;) but I have a big SQL Server 2005 running on the machine, so I just commented out the MSDE install line in the setup.bat and it continued.</p>
<p>The first error I got was a collation problem. Having installed SQL Server 2005 with the default collation SAP expected it to be <em>SQL_Latin1_General_Cp850_BIN</em>.</p>
<p>Thankfully it was a clean sql server so I only needed to mount my SQL Server DVD again and run:</p>
<p><code>setup.exe /qb INSTANCENAME=MSSQLSERVER REINSTALL=SQL_Engine REBUILDDATABASE=1 SQLCOLLATION=SQL_Latin1_General_Cp850_BIN</code></p>
<p>(you can specify SAPWD if you are using mixed and not Windows Authentication). You will be prompted:<br />
<em>You have chosen to re-install, and therefore overwrite the system databases. Are you sure you want to proceed?</em> Yes! (Don&#8217;t do this on a live production server. Ever.)</p>
<p>Started setup again, and next I was presented with an error for a registry key it couldn&#8217;t find in &#8216;Software\Microsoft\MSSQLServer\MSSQLServer\Parameters&#8217;. I found the MSSQLServer node but had to manually create the Parameters node. And restarted setup.bat and this time it finished without problem! Hurray.</p>
<p>Next up was the GUI which the original setup tried installing but couldn&#8217;t locate the setup file. It&#8217;s in the MINIGUI folder. Once that is installed, just double click the &#8216;Start R3 MBS&#8217; on the desktop, then fire up the GUI and follow the rest of the instructions in the documentation. Don&#8217;t forget to install the latest Kernel Patches from the SAP Site. Voila. Hope it helps.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/128/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/128/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=128&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/07/16/installing-minisap-46d-on-sql-server-2005/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
		<item>
		<title>TOP12 announced and what are *we* doing for the rest of the week</title>
		<link>http://alexduggleby.com/2008/07/05/top12-announced-and-what-are-we-doing-for-the-rest-of-the-week/</link>
		<comments>http://alexduggleby.com/2008/07/05/top12-announced-and-what-are-we-doing-for-the-rest-of-the-week/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 17:21:21 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Imagine Cup]]></category>

		<guid isPermaLink="false">http://alexduggleby.com/?p=127</guid>
		<description><![CDATA[So a couple of hours ago the top 12 finalists were announced that rise to round 2 of the world finals. Since you are reading this - you might guess - we are not really under much pressure because we didn&#8217;t rise up to the next round. Interestingly enough though I honestly thought we were [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>So a couple of hours ago the top 12 finalists were announced that rise to round 2 of the world finals. Since you are reading this - you might guess - we are not really under much pressure because we didn&#8217;t rise up to the next round. Interestingly enough though I honestly thought we were quite good this year (remember I do have quite a bit of grounds for comparison) but it seems the judges really liked us, but they liked others even more. Anyway you win a few, you lose a few and you can&#8217;t really talk about losing if you are sitting in a <a href="http://www.novotel.com/novotel/fichehotel/gb/nov/3546/fiche_hotel.shtml" target="_blank">four star hotel</a> near the Eiffel tour relaxing and having fun. There are 49 other teams experiencing the same and the excitement is at a bit of a low, but there is one thing I know from the last years: Cry for about half an hour and then forget it and move on. Otherwise you lose the beauty of the remaining finals.</p>
<p>Anyhow, I promised some pictures but I though I&#8217;d just pop them up on <a href="http://flickr.com/photos/gidion/sets/72157605972832544/" target="_blank">Flickr for everybody to see</a>. If you are interested which interesting projects did advance try the <a href="http://imaginecupfinalsinparis.spaces.live.com/default.aspx" target="_blank">official blog</a>. Will I participate again next year? Who knows. It depends. I could finally get the record for most imagine cup world finals, I could finally advance to a TOP12, but on the other hand I&#8217;m getting old, it&#8217;s a lot of work (but always worth it). But I have to start balancing work life, student life and all other activities.</p>
<p>So you&#8217;ll probably hear more about Paris now, I&#8217;ll blog some more in the next few days. I&#8217;ll leave you with some screenshots of BioMatch.</p>
<table border="0">
<tbody>
<tr>
<td><a href="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen5.png"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" src="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen5-thumb.png?w=244&h=149" border="0" alt="BioMatch_Screen5" width="244" height="149" /></a></td>
<td>This is the newest module we developed for the world finals. An environmental simulation that can forecast which species will become endangered and why.</td>
</tr>
<tr>
<td><a href="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen4.png"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" src="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen4-thumb.png" border="0" alt="BioMatch_Screen4" /></a></td>
<td>The two standard modules we developed for the first round, which were the Bayes prediction of where the species could most likely survive and the self organizing net showing clusters of species.</td>
</tr>
<tr>
<td width="150" valign="top"><a href="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen3.png"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" src="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen3-thumb.png" border="0" alt="BioMatch_Screen3" width="244" height="148" /></a></td>
</tr>
<tr>
<td width="150" valign="top"><a href="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen1.png"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" src="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen1-thumb.png" border="0" alt="BioMatch_Screen1" width="244" height="148" /></a></td>
</tr>
</tbody>
</table>
<p>Just for completeness in case you are interested. The application is built using WPF (my first WPF application actually) and uses a couple of data mining algorithms to analyse data aggregated from different sources (such as the US PLANTS database) to simplify it, group it and show similarities. The visualisation helps the scientists to use and understand the simplified data.</p>
<p>As far as press is concerned we had interviews with a french magazine, with some netherland media of course with the Austrian press OE3 and derStandard (I&#8217;ll post them when they come out). The judges generally were impressed and expressed it at the end of the sessions. In the second presentation they even thanked us personally (something I hadn&#8217;t experience before) but I&#8217;m looking forward to seeing the presentations of the others on Monday to gain some insight into why they were better. To finish off with a Soma&#8217;esque reference to a past Imagine Cup world finals.</p>
<p>Namaste!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/127/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/127/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/127/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/127/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/127/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=127&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/07/05/top12-announced-and-what-are-we-doing-for-the-rest-of-the-week/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen5-thumb.png" medium="image">
			<media:title type="html">BioMatch_Screen5</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen4-thumb.png" medium="image">
			<media:title type="html">BioMatch_Screen4</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen3-thumb.png" medium="image">
			<media:title type="html">BioMatch_Screen3</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/07/biomatch-screen1-thumb.png" medium="image">
			<media:title type="html">BioMatch_Screen1</media:title>
		</media:content>
	</item>
		<item>
		<title>The Hattrick begins or The Imagine Cup 2008 Worldwide Finals</title>
		<link>http://alexduggleby.com/2008/07/04/the-hattrick-begins-or-the-imagine-cup-2008-worldwide-finals/</link>
		<comments>http://alexduggleby.com/2008/07/04/the-hattrick-begins-or-the-imagine-cup-2008-worldwide-finals/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 10:00:04 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Imagine Cup]]></category>

		<category><![CDATA[MSP]]></category>

		<category><![CDATA[BioMatch]]></category>

		<category><![CDATA[Imagine Cup 2008]]></category>

		<category><![CDATA[Imagine Cup 2008 - Paris]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=116</guid>
		<description><![CDATA[It&#8217;s been quiet for a while due to my participation in the Imagine Cup (again). Not only have I participated in each Imagine Cup since the start:
- 2008: BioMatch - www.biomatch.at (I&#8217;ll report some more on that of course later&#8230;)
- 2007: Kalie - Decision making system to support students during studying.
- 2006: MyCaps - e-Sports Framework [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It&#8217;s been quiet for a while due to my participation in the Imagine Cup (again). Not only have I participated in each Imagine Cup since the start:</p>
<ul>- 2008: BioMatch - <a href="http://www.biomatch.at">www.biomatch.at</a> (I&#8217;ll report some more on that of course later&#8230;)<br />
- 2007: Kalie - Decision making system to support students during studying.<br />
- 2006: MyCaps - e-Sports Framework with real-life movement integration for a healthier life<br />
- 2005: Gecco - Global Emergency Clinic Coordination - Fast automatic help for people requiring constant medical monitoring to break their boundaries.<br />
- 2004: NoName - This was the worst year by far because we had not realized there was a theme, but we still took part but did not get very far.<br />
- 2003: SAMANTA - System for Astute Management of Time-aware Archictectures - The beginning of it all and we had an intelligent organisation system for trade fares. (2nd place locals)</ul>
<p>but it is also my third time at the WORLD FINALS (2005: Yokohama, Japan; 2006: Delhi/Agra, India; 2008: Paris, France). I have heard that there is a polish short film team, that I met the years before (but not this time) that have also been here three times. So I wonder if I have to participate again next year to make the record official (on the otherhand I think there may actually be some guys in the IT challenge that been here more often&#8230;).</p>
<p>Anyway if you are interested in why I take on this challenge every year take a look at an interview I gave to the Danish Academic Relations Manager Martin Esmann over on his blog: <a href="http://blogs.msdn.com/mesmann/archive/2008/07/04/imagine-cup-2008-torsdag-dag-1.aspx">http://blogs.msdn.com/mesmann/archive/2008/07/04/imagine-cup-2008-torsdag-dag-1.aspx</a></p>
<p>That&#8217;s all for now, pictures will follow this evening. We have to rehearse the presentation once more. Just under 3 hours to go until round 1. Wish us luck!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/116/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/116/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=116&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/07/04/the-hattrick-begins-or-the-imagine-cup-2008-worldwide-finals/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
		<item>
		<title>Availability: March 2020?</title>
		<link>http://alexduggleby.com/2008/06/15/availability-march-2020/</link>
		<comments>http://alexduggleby.com/2008/06/15/availability-march-2020/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 17:35:37 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Humor]]></category>

		<category><![CDATA[Amazon]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=111</guid>
		<description><![CDATA[Well we all know companies usually set their release dates way too early and they get corrected on the way to that date (not picking on any particular big software company). But the other extreme seems to be brutal honesty. Not quite sure which one I prefer? Will we be using agile software methodologies in [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well we all know companies usually set their release dates way too early and they get corrected on the way to that date (not picking on any particular big software company). But the other extreme seems to be brutal honesty. Not quite sure which one I prefer? Will we be using agile software methodologies in 2020 at all? Will there be software at all? Just too much for me to cope.</p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/06/amazon_agilebook1.png"><img class="aligncenter size-thumbnail wp-image-112" src="http://alexduggleby.files.wordpress.com/2008/06/amazon_agilebook1.png?w=128&h=47" alt="Amazon Availability" width="128" height="47" /></a></p>
<p><a href="http://alexduggleby.files.wordpress.com/2008/06/amazon_agilebook.png"><br />
</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/111/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/111/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=111&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/06/15/availability-march-2020/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>

		<media:content url="http://alexduggleby.files.wordpress.com/2008/06/amazon_agilebook1.png?w=128" medium="image">
			<media:title type="html">Amazon Availability</media:title>
		</media:content>
	</item>
		<item>
		<title>Restoring a backup. Wait, where are my permissions? or &#8220;How to replace all permissions in one directory tree with the permissions from another identical tree&#8221;</title>
		<link>http://alexduggleby.com/2008/05/27/restoring-a-backup-wait-where-are-my-permissions-or-how-to-replace-all-permissions-in-one-directory-tree-with-the-permissions-from-another-identical-tree/</link>
		<comments>http://alexduggleby.com/2008/05/27/restoring-a-backup-wait-where-are-my-permissions-or-how-to-replace-all-permissions-in-one-directory-tree-with-the-permissions-from-another-identical-tree/#comments</comments>
		<pubDate>Tue, 27 May 2008 18:03:45 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=109</guid>
		<description><![CDATA[Ok, I&#8217;m starting to get fond of these &#8220;a slice of reality&#8221; or &#8220;what am I going to show you&#8221; title blog posts&#8230;
So once again this piece of code is a bit drastic. It&#8217;s neatly written if you ask me and should show you how you can replace the file security settings (ACLs) with some [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Ok, I&#8217;m starting to get fond of these &#8220;a slice of reality&#8221; or &#8220;what am I going to show you&#8221; title blog posts&#8230;</p>
<p>So once again this piece of code is a bit drastic. It&#8217;s neatly written if you ask me and should show you how you can replace the file security settings (ACLs) with some other files security settings (same for directories). The only meaningfull place to do this (off the top of my head) is when you have two identical files and for some reason the one file has the correct permissions and the other doesn&#8217;t. But daily developer business is always full of these little request, and it&#8217;s like a personal search for the holy grail - you just have to give it a try.</p>
<p>So if you ever want to copy the exact permission structure from one directory tree to another (for example you used some copy tool that doesn&#8217;t copy the permissions) then you can use this little tool to do just that.</p>
<p>A word of warning (as always). Have a backup of your permissions (most probably you will, because you need to copy them from somewhere) and of course run this tool at your own risk. The binary is available <a title="The link to binary exe for MirrorNTFSPermissions Tool" href="http://in.solit.us/archives/download/143447" target="_blank">here</a> and is compiled from the source you see below. Have fun and tell me if you find bugs or if it&#8217;s useful.</p>
<pre name="code" class="c#">

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.AccessControl;
using System.Diagnostics;
using System.Security.Principal;

namespace AlexDuggleby.Tools.MirrorNTFSPermissions
{
    class Program
    {
        #region Properties

        /// &lt;summary&gt;
        /// The root we are copying from
        /// &lt;/summary&gt;
        private static DirectoryInfo m_diFromRoot;

        /// &lt;summary&gt;
        /// The root we are copying to
        /// &lt;/summary&gt;
        private static DirectoryInfo m_diToRoot;

        /// &lt;summary&gt;
        /// The log file to write to
        /// &lt;/summary&gt;
        private static FileInfo m_fiLog;

        #endregion

        #region Main Operation

        static void Main(string[] args)
        {
            // Check args and output usage if required
            if (args.Length != 3)
            {
                OutputUsage();
                System.Environment.Exit(-1);
                return;
            }

            if (PopulateAndCheckDirectoriesExist(args) &amp;&amp; ConfirmUserAction())
            {
                try
                {
                    Trace.Listeners.Add(new ConsoleTraceListener());
                    Trace.Listeners.Add(new TextWriterTraceListener(m_fiLog.FullName));

                    WriteTraceHeader();

                    Console.Clear();
                    CopyPermissions(m_diFromRoot, m_diToRoot, true);
                    WriteTraceFooter();
                }
                catch (ApplicationException aex)
                {
                    OutputError(&quot;Application&quot;, aex);
                }
                catch (Exception ex)
                {
                    OutputError(&quot;Critical&quot;, ex);
                }
            }

        }

        private static void CopyDirectorySecurity(DirectoryInfo diFrom, DirectoryInfo diTo, bool skipRootNameCheck, out bool continueInThisDirectory)
        {
            continueInThisDirectory = true;

            try
            {
                // Name comparison
                if (diFrom.Name != diTo.Name &amp;&amp; !skipRootNameCheck)
                    throw new ApplicationException(string.Format(&quot;During processing the directory names changed! &#039;{0}&#039;-&#039;{1}&#039;&quot;,
                        diFrom.Name, diTo.Name));

                // Set my own permissions
                DirectorySecurity _dsFrom = Directory.GetAccessControl(diFrom.FullName, AccessControlSections.All);
                DirectorySecurity _dsTo = new DirectorySecurity();
                _dsTo.SetSecurityDescriptorSddlForm(_dsFrom.GetSecurityDescriptorSddlForm(AccessControlSections.All));
                Directory.SetAccessControl(diTo.FullName, _dsTo);

                // Tell the user what we are doing
                Trace.WriteLine(string.Format(&quot;Copying directory security from {0} to {1}&quot;,
                        diFrom.FullName, diTo.FullName));
            }
            catch (PathTooLongException _plex)
            {
                Trace.WriteLine(string.Format(&quot;[WARN] Path too long do continue with this directory &#039;{0}&#039;&quot;,
                        diFrom.FullName));
                continueInThisDirectory = false; // Abort because all files and subdirs will be affected
            }
            catch (Exception _ex) // General catch here, because we would like the batch to continue
            {
                Trace.WriteLine(string.Format(&quot;[ERROR] Error while doing current directory &#039;{0}&#039;: {1}&quot;,
                        diFrom.FullName, _ex.ToString()));
                // We will continue here, since error type is undefined.
                continueInThisDirectory = true;
            }
        }

        #endregion

        #region File/Directory I/O and Security

        private static void CopyPermissions(DirectoryInfo diFrom, DirectoryInfo diTo, bool skipRootNameCheck)
        {
            bool _continueInThisDirectory;

            CopyDirectorySecurity(diFrom, diTo, skipRootNameCheck, out _continueInThisDirectory);

            if (_continueInThisDirectory)
            {
                // Now set files
                foreach (FileInfo _fiTo in diTo.GetFiles())
                {
                    CopyFileSecurity(diFrom, _fiTo);
                }

                // Get all the -to- subdirs ...
                foreach (DirectoryInfo _toSubDir in diTo.GetDirectories())
                {
                    // ... and check if they also exist in the from directory
                    DirectoryInfo _fromSubDir = diFrom.GetDirectories(_toSubDir.Name, SearchOption.TopDirectoryOnly).FirstOrDefault(d =&gt; d.Name == _toSubDir.Name);
                    if (_fromSubDir != null)
                    {
                        // Recursive
                        CopyPermissions(_fromSubDir, _toSubDir, false);
                    }
                }
            }
        }

        private static void CopyFileSecurity(DirectoryInfo diFrom, FileInfo fiTo)
        {
            // Turn the paths into relative paths based on the root dirs we started from
            string _relativeFromPath = fiTo.Directory.FullName.ToLower()
                .Replace(m_diToRoot.FullName.ToLower(), &quot;&quot;);
            string _relativeToPath = diFrom.FullName.ToLower()
                .Replace(m_diFromRoot.FullName.ToLower(), &quot;&quot;);

            // now compare those relative paths, just to be sure
            if (_relativeFromPath != _relativeToPath)
                throw new ApplicationException(string.Format(
                    &quot;Subdirectories went out of sync during processing! &#039;{0}&#039;-&#039;{1}&#039;&quot;, _relativeFromPath, _relativeToPath));

            FileInfo _fiFrom = new FileInfo(Path.Combine(diFrom.FullName, fiTo.Name));

            if (_fiFrom.Exists) // if it doesn&#039;t exist in the from we will ignore...
            {
                // Copy the file permissions
                FileSecurity _fsFrom = File.GetAccessControl(_fiFrom.FullName);

                // Sometimes there are now access rules on the item, so only the owner can access it
                if (File.GetAccessControl(fiTo.FullName).GetAccessRules(true, true, typeof(NTAccount)).Count == 0)
                {
                    // Tell the user what we are doing
                    Trace.WriteLine(string.Format(&quot;File can only be accessed by owner: {0}&quot;, fiTo.FullName));
                }
                else
                {
                    try
                    {
                        // Copy the file permissions
                        FileSecurity _fsTo = new FileSecurity();
                        _fsTo.SetSecurityDescriptorSddlForm(_fsFrom.GetSecurityDescriptorSddlForm(AccessControlSections.All));
                        File.SetAccessControl(fiTo.FullName, _fsTo);

                        // Tell the user what we are doing
                        Trace.WriteLine(string.Format(&quot;Copying file security from {0} to {1}&quot;,
                            _fiFrom.FullName, fiTo.FullName));
                    }
                    catch (Exception _ex)
                    {
                        // Tell the user what went wrong
                        Trace.WriteLine(string.Format(&quot;[ERROR] Error while copying file security from {0} to {1}: {2}&quot;,
                            _fiFrom.FullName, fiTo.FullName, _ex.ToString()));
                    }
                }
            }
            else
            {
                Trace.WriteLine(string.Format(&quot;File did not exist in original tree: {0}&quot;,
                 fiTo.FullName));
            }
        }

        #endregion

        #region User I/O and Tracing

        private static void WriteTraceHeader()
        {
            Trace.WriteLine(&quot;*****************************************&quot;);
            Trace.WriteLine(&quot;Mirror NTFS Permissions&quot;);
            Trace.WriteLine(&quot;Version 1.0 - 27.05.2008&quot;);
            Trace.WriteLine(&quot;Alex Duggleby - http://alexduggleby.com&quot;);
            Trace.WriteLine(&quot;*****************************************&quot;);
            Trace.WriteLine(&quot;== New run @ &quot; + DateTime.Now.ToString() + &quot;&quot;);
            Trace.WriteLine(&quot;== From : &quot; + m_diFromRoot.FullName + &quot;&quot;);
            Trace.WriteLine(&quot;== To   : &quot; + m_diToRoot.FullName + &quot;&quot;);
            Trace.WriteLine(&quot;=========================================&quot;);
        }

        private static void WriteTraceFooter()
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Trace.WriteLine(&quot;=========================================&quot;);
            Trace.WriteLine(&quot;Finished!&quot;);
            Trace.WriteLine(&quot;=========================================&quot;);
            Console.ForegroundColor = ConsoleColor.White;
            Trace.Flush();
        }

        private static void OutputError(string errType, Exception ex)
        {
            Console.ForegroundColor = ConsoleColor.Red;
            string _s = string.Format(&quot;***********************{1}{2} error: {0}&quot;, ex.ToString(), Environment.NewLine, errType);
            Trace.WriteLine(_s);
            Console.ForegroundColor = ConsoleColor.White;
            OutputPressKeyToExit();
            Trace.Flush();
        }

        private static void OutputPressKeyToExit()
        {
            Console.WriteLine();
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine(&quot;{0}Press any key to exit&quot;, Environment.NewLine);
            Console.ReadKey();
        }

        private static void OutputUsage()
        {
            Console.WriteLine(&quot;Mirror NTFS Permissions&quot;);
            Console.WriteLine(&quot;by Alex Duggleby - http://alexduggleby.com&quot;);
            Console.WriteLine();
            Console.WriteLine(&quot;Usage: application.exe &lt;path1&gt; &lt;path2&gt; &lt;log-file&gt;&quot;);
            Console.WriteLine(&quot;Replaces all permissions on all subdirectory and files in path2 with those from path1 if they exist there.&quot;);
            Console.WriteLine(&quot;The &lt;log-file&gt; is used to write the appplications trace output.&quot;);
            Console.WriteLine();
        }

        private static bool ConfirmUserAction()
        {
            Console.WriteLine(&quot;Do you wish to copy all permissions form &#039;{0}&#039; to &#039;{1}&#039;? [y/n]&quot;,
                m_diFromRoot.FullName,
                m_diToRoot.FullName);

            if (Console.ReadKey().KeyChar.ToString().ToLower() != &quot;y&quot;)
            {
                Console.WriteLine(&quot;User aborted!&quot;);
                OutputPressKeyToExit();
                System.Environment.Exit(-1);
                return false;
            }

            return true;
        }

        #endregion

        #region Prechecks

        private static bool PopulateAndCheckDirectoriesExist(string[] args)
        {
            string _dirFrom = args[0];
            string _dirTo = args[1];
            string _logFile = args[2];

            if (_dirFrom.EndsWith(&quot;\\&quot;)) _dirFrom = _dirFrom.Substring(0, _dirFrom.Length - 1);
            if (_dirTo.EndsWith(&quot;\\&quot;)) _dirTo = _dirTo.Substring(0, _dirTo.Length - 1);

            m_diFromRoot = new DirectoryInfo(_dirFrom);
            m_diToRoot = new DirectoryInfo(_dirTo);
            m_fiLog = new FileInfo(_logFile);

            if (!m_fiLog.Exists)
            {
                try
                {
                    m_fiLog.Create().Close();
                }
                catch (Exception _ex)
                {
                    Console.WriteLine(&quot;Could not create log file: &quot; + _ex.ToString());
                }

                m_fiLog.Refresh();
            }

            if (!m_diFromRoot.Exists)
                Console.WriteLine(&quot;Directory &#039;{0}&#039; does not exist&quot;, m_diFromRoot.FullName);

            if (!m_diToRoot.Exists)
                Console.WriteLine(&quot;Directory &#039;{0}&#039; does not exist&quot;, m_diToRoot.FullName);

            if (!m_fiLog.Exists)
                Console.WriteLine(&quot;File &#039;{0}&#039; does not exist&quot;, m_fiLog.FullName);

            return m_diFromRoot.Exists &amp;&amp; m_diToRoot.Exists &amp;&amp; m_fiLog.Exists;
        }

        #endregion
    }
}
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/109/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/109/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=109&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/05/27/restoring-a-backup-wait-where-are-my-permissions-or-how-to-replace-all-permissions-in-one-directory-tree-with-the-permissions-from-another-identical-tree/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
		<item>
		<title>SkyDrive: Why aren&#8217;t thou nicer to me? or &#8220;How to crawl pages and download all images using C#&#8221;</title>
		<link>http://alexduggleby.com/2008/05/24/skydrive-why-arent-thou-nicer-to-me-or-how-to-crawl-pages-and-download-all-images-using-c/</link>
		<comments>http://alexduggleby.com/2008/05/24/skydrive-why-arent-thou-nicer-to-me-or-how-to-crawl-pages-and-download-all-images-using-c/#comments</comments>
		<pubDate>Sat, 24 May 2008 19:11:55 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Utilities]]></category>

		<category><![CDATA[Crawler]]></category>

		<category><![CDATA[Crawling]]></category>

		<category><![CDATA[SkyDrive]]></category>

		<category><![CDATA[WebClient]]></category>

		<category><![CDATA[RegEx]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=108</guid>
		<description><![CDATA[Ok, SkyDrive is still a baby, and personally I&#8217;ve used other services providing file space in the cloud and enjoyed them a little better. But this post isn&#8217;t about if SkyDrive is good or bad, it&#8217;s just about a missing feature that is very painful. Someone wanted to share some fotos, uploaded them to SkyDrive [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Ok, SkyDrive is still a baby, and personally I&#8217;ve used other services providing file space in the cloud and enjoyed them a little better. But this post isn&#8217;t about if SkyDrive is good or bad, it&#8217;s just about a missing feature that is very painful. Someone wanted to share some fotos, uploaded them to SkyDrive and all I wanted was to download them all to my PC. Tough look, you can click on each and every image to get to the preview page, where you click on the preview picture to then finally get at the actual picture. Multiply that by about 100. I have better things to do than waste my time on that.</p>
<p>So a Dev does what he does best, fires up Visual Studio 2008 and hacks away (did I just say I had something better to do - well I lied partially, but before I go off to do that, there is always time for some good ol&#8217; C#).</p>
<p>I&#8217;ve posted it here not as a finished utility (there are no binaries) but as a small sample. Using WebClients, RegEx and some other stuff it downloads the list page of the SkyDrive folder, fetches the preview page and then downloads the actual image to a folder on the hard disk. Not really rocket science and of course there are a few quirks (no real error handling for example), but it&#8217;s just a sample. Feel free to extend as you wish, don&#8217;t blame me if it starts downloading Gigabytes of files overnight, because you accidentally crawled a <a title="What's a Honeypot?" href="http://en.wikipedia.org/wiki/Honeypot_(computing)">HoneyPot</a>. (And yes, it only downloads jpgs at the moment. I didn&#8217;t need any other types.)</p>
<p>May those SkyDrive bytes be with you&#8230;</p>
<pre name="code" class="c#">

/**********************************************************************************
 *
 * Example Application for crawling web pages and downloading images.
 *
 * This code works if you pass in a SkyDrive Folder Url (http://.... /browse.aspx/...)
 * and will download any jpg images it finds in there.
 *
 * Permission to use, copy, modify, distribute and sell this software and its
 * documentation for any purpose is hereby granted without fee.
 * I make no representations about the suitability of this software for any purpose.
 * It is provided &quot;as is&quot; without express or implied warranty.
 *
 * Alex Duggleby - 24.05.08 - V0.9 - http://alexduggleby.com
 *
 **********************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Text.RegularExpressions;
using System.IO;
using System.Web;
using System.ComponentModel;

namespace Tools.SkyDrive.DownloadAll
{
    class Program
    {
        // Used for tracking how many items we have left
        private static int _wcInnerCount = 0;
        private static int _wcInnerCompleted = 0;

        // We have to start somewhere
        private static Uri _uriStart;

        // Work we have already done
        private readonly static List&lt;string&gt; _urisCrawled = new List&lt;string&gt;();
        private readonly static List&lt;string&gt; _imagesDownloaded = new List&lt;string&gt;();

        // Download images to?
        private readonly static DirectoryInfo _diDownloadTo = new DirectoryInfo(Path.Combine(Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.Personal), &quot;Downloads&quot;),&quot;Images&quot;));

        // This finds urls in the page
        private readonly static Regex _regexUrl = new Regex(&quot;href\\s*=\\s*(?:(?:\\\&quot;(?&lt;url&gt;[^\\\&quot;]*)\\\&quot;)|(?&lt;url&gt;[^\\s]* ))&quot;);

        // This finds the open url in the image page
        private readonly static Regex _regexUrlOpen = new Regex(&quot;href\\s*=\\s*(?:(?:\\\&quot;(?&lt;url&gt;[^\\\&quot;]*)\\\&quot;)|(?&lt;url&gt;[^\\s]*)) title=\\\&quot;Open\\\&quot;&quot;); 

        /// &lt;summary&gt;
        /// Takes the url to a skydrive folder page and downloads all jpg images.
        /// &lt;/summary&gt;
        static void Main(string[] args)
        {
            // Usage check
            if (args.Length != 1)
            {
                Console.WriteLine(&quot;Usage: App.exe http://theUrlToThe/SkyDrive/FolderPage&quot;);
                return;
            }

            try
            {
                // First parameter is url
                _uriStart = new Uri(args[0]);
            }
            catch (Exception _ex)
            {
                Console.WriteLine(&quot;Invalid Url. &quot; + _ex.Message);
                return;
            }

            // Make sure download directory exists
            if (!_diDownloadTo.Exists) _diDownloadTo.Create();

            using (WebClient _wc = new WebClient())
            {
                // This is the index with all the images
                string _pageContents = _wc.DownloadString(_uriStart);

                // Each image has a preview page, so we get the url to that, before we get the url to the actual image
                foreach (Match _matchUrlToImagePage
                    in _regexUrl.Matches(_pageContents))
                {
                    Uri _uriToImagePage =
                        new Uri(_uriStart, HttpUtility.HtmlDecode(_matchUrlToImagePage.Groups[&quot;url&quot;].Value));

                    CrawlPreviewPage(_uriToImagePage);
                }
            }

            // Wait for the async web clients to complete...
            while (_wcInnerCompleted &lt; _wcInnerCount)
            {
                Console.WriteLine(&quot;Wait for images to complete...&quot;);
                Console.ReadLine();
            }

            Console.WriteLine(&quot;Should be finished!&quot;);
            Console.ReadLine();
        }

        /// &lt;summary&gt;
        /// Parses the preview page and finds the actual image link
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;uriToImagePage&quot;&gt;The url to the preview page&lt;/param&gt;
        /// &lt;returns&gt;&lt;/returns&gt;
        private static void CrawlPreviewPage(Uri uriToImagePage)
        {
            using (WebClient _wc = new WebClient())
            {
                if (!_urisCrawled.Contains(uriToImagePage.ToString()))
                {
                    _urisCrawled.Add(uriToImagePage.ToString());

                    if (uriToImagePage.ToString().ToLower().EndsWith(&quot;.jpg&quot;))
                    {
                        string _pageContents = _wc.DownloadString(uriToImagePage);

                        // Find the image we want to download... There should be
                        // only one link with title=&quot;Open&quot; in it.
                        foreach (Match _matchImage in _regexUrlOpen.Matches(_pageContents))
                        {
                            Uri _uriToImage = new Uri(_matchImage.Groups[&quot;url&quot;].Value);

                            DownloadImage(_uriToImage);
                        }
                    }
                }
            }
        }

        /// &lt;summary&gt;
        /// Downloads async&#039;ly an image from a Uri
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;uriToImage&quot;&gt;The uri to download&lt;/param&gt;
        private static void DownloadImage(Uri uriToImage)
        {
            // Output the url
            Console.WriteLine(&quot;{0}{1}&quot;, uriToImage.ToString(), Environment.NewLine);

            if (!_imagesDownloaded.Contains(uriToImage.ToString()))
            {
                _imagesDownloaded.Add(uriToImage.ToString());
                string _lowerUrl = uriToImage.ToString().ToLower();

                // Simple checking
                if (_lowerUrl.EndsWith(&quot;.jpg&quot;) &amp;&amp;
                   (!_lowerUrl.Contains(&quot;browse&quot;)) &amp;&amp;
                   (!_lowerUrl.Contains(&quot;self&quot;)))
                {
                    // HtmlDecode here because some urls have encoded characters
                    string _localFilename = HttpUtility.HtmlDecode(
                        uriToImage.Segments[uriToImage.Segments.Length - 1]);

                    // Create a valid local filename
                    Path.GetInvalidPathChars().ToList().ForEach(
                        c =&gt; _localFilename = _localFilename.Replace(c, &#039;_&#039;));

                    Console.Write(&quot;Downloading {0}...{1}&quot;, _localFilename, Environment.NewLine);

                    // Create a seperate web client for each image (uses async, and you can&#039;t
                    // issue two downloads at the same time for the same client). Of course
                    // here we should be using some kind of pooling but this is the quickest
                    // way to do it.
                    using (WebClient _wcInner = new WebClient())
                    {
                        _wcInnerCount++;
                        _wcInner.DownloadFileAsync(uriToImage, Path.Combine(_diDownloadTo.ToString(), _localFilename));
                        _wcInner.DownloadFileCompleted += new AsyncCompletedEventHandler(_wcInner_DownloadFileCompleted);
                    }
                }
            }
        }

        // Is fired when a download complete. We output status and check if we are finished!
        private static void _wcInner_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
        {
            // Increase the completed counter
            _wcInnerCompleted++;

            // Ok, we could do some more extensive checking, this could trigger
            // even if there are still items to download... but hey, it&#039;s just a
            // quick utility!
            if (_wcInnerCompleted == _wcInnerCount)
            {
                Console.WriteLine(&quot;{0}{1}{2}&quot;, Environment.NewLine, &quot;Finished all files!&quot;, Environment.NewLine);
                Console.ReadLine();
            }
            else
            {
                Console.WriteLine(&quot;File {0} of {1} completed!&quot;, _wcInnerCompleted, _wcInnerCount);
            }
        }
    }
}
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/108/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/108/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/108/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/108/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/108/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=108&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/05/24/skydrive-why-arent-thou-nicer-to-me-or-how-to-crawl-pages-and-download-all-images-using-c/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
		<item>
		<title>Off-Topic: T-SQL: Replace all occurrences in all columns in all tables?</title>
		<link>http://alexduggleby.com/2008/05/09/off-topic-t-sql-replace-all-occurrences-in-all-columns-in-all-tables/</link>
		<comments>http://alexduggleby.com/2008/05/09/off-topic-t-sql-replace-all-occurrences-in-all-columns-in-all-tables/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:09:28 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[SQL]]></category>

		<category><![CDATA[System Tables]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=107</guid>
		<description><![CDATA[Update: You can download the sql file here: http://in.solit.us/archives/download/149837 (saves you cleaning up the copy-pasted code from below&#8230; oh and hello experts-exchange-users)
Have you ever been asked to write something where you knew from the start that it could possibly wreak havok? Well I did today and since I haven&#8217;t posted in a while I thought [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em><strong>Update:</strong></em> You can download the sql file here: <a href="http://in.solit.us/archives/download/149837">http://in.solit.us/archives/download/149837</a> (saves you cleaning up the copy-pasted code from below&#8230; oh and hello experts-exchange-users)</p>
<p>Have you ever been asked to write something where you knew from the start that it could possibly wreak havok? Well I did today and since I haven&#8217;t posted in a while I thought I&#8217;d quickly share. Don&#8217;t worry I&#8217;ll be back blogging Sync, MVC and more soon (and hopefully tell you why I was gone).</p>
<p>Without talking too much about the real scenario that this was needed for, let me just say there is a large database that stores configuration data including a set of connection strings in multiple places spread across numerous tables. And our admins moved the database but didn&#8217;t know where exactly to change these config strings. I was the only dev left in the office at the time and they turned to me asking me if I could write a script that &#8220;replaced all occurrences of stringA with stringB throughout the whole database&#8221;.</p>
<p>Yikes. It sounds like trouble, you know it&#8217;s gonna hurt and I don&#8217;t want to be anywhere nearby when they press F5 to run the script. Ok, nevertheless I put together a little script that did just that, sent it to them and let&#8217;s see what happens next week. They have backups so even if everything goes wrong we can quickly restore things.</p>
<p>Here&#8217;s what I came up with. It&#8217;s not rocket science, but does the job. Use the script at your own risk (I didn&#8217;t find anything comparable on the web so maybe it will come in handy to someone). It shows some interesting usage of the system tables that I use now and again for things like this (when I don&#8217;t have my beloved <a href="http://msdn.microsoft.com/en-us/library/ms162169.aspx">SQLSMO</a>). Have fun and use with caution (I can&#8217;t say that enough!)</p>
<pre name="code" class="sql">

------------------------------------------------------------
-- Name: STRING REPLACER
-- Author: ADUGGLEBY
-- Version: 20.05.2008 (1.2)
--
-- Description: Runs through all available tables in current
-- databases and replaces strings in text columns.
------------------------------------------------------------

-- PREPARE
SET NOCOUNT ON

-- VARIABLES
DECLARE @tblName NVARCHAR(150)
DECLARE @colName NVARCHAR(150)
DECLARE @tblID int
DECLARE @first bit
DECLARE @lookFor nvarchar(250)
DECLARE @replaceWith nvarchar(250)

-- CHANGE PARAMETERS
SET @lookFor = &#039;virtual2&#039;
SET @replaceWith = &#039;virtual3&#039;

-- TEXT VALUE DATA TYPES
DECLARE @supportedTypes TABLE ( xtype NVARCHAR(20) )
INSERT INTO @supportedTypes SELECT XTYPE FROM SYSTYPES WHERE NAME IN (&#039;varchar&#039;,&#039;char&#039;,&#039;nvarchar&#039;,&#039;nchar&#039;,&#039;xml&#039;)

-- ALL USER TABLES
DECLARE cur_tables CURSOR FOR
SELECT SO.name, SO.id FROM SYSOBJECTS SO WHERE XTYPE=&#039;U&#039;
OPEN cur_tables
FETCH NEXT FROM cur_tables INTO @tblName, @tblID

WHILE @@FETCH_STATUS = 0
BEGIN
	-------------------------------------------------------------------------------------------
	-- START INNER LOOP - All text columns, generate statement
	-------------------------------------------------------------------------------------------
	DECLARE @temp NVARCHAR(4000)
	DECLARE @count INT
	SELECT @count = COUNT(name) FROM SYSCOLUMNS WHERE ID = @tblID AND
		XTYPE IN (SELECT xtype FROM @supportedTypes)

	IF @count &gt; 0
	BEGIN
		-- fetch supported columns for table
		DECLARE cur_columns CURSOR FOR
			SELECT name FROM SYSCOLUMNS WHERE ID = @tblID AND
				XTYPE IN (SELECT xtype FROM @supportedTypes)
		OPEN cur_columns
		FETCH NEXT FROM cur_columns INTO @colName

		-- generate opening UPDATE cmd
		SET @temp = &#039;
	PRINT &#039;&#039;Replacing &#039; + @tblName + &#039;&#039;&#039;

	UPDATE &#039; + @tblName + &#039; SET
		&#039;
		SET @first = 1

		-- loop through columns and create replaces
		WHILE @@FETCH_STATUS = 0
		BEGIN
			IF (@first=0) SET @temp = @temp  + &#039;,
		&#039;
			SET @temp = @temp  + @colName
			SET @temp  = @temp  + &#039; = REPLACE(&#039; +  @colName + &#039;,&#039;&#039;&#039;
			SET @temp  = @temp  + @lookFor
			SET @temp  = @temp  + &#039;&#039;&#039;,&#039;&#039;&#039;
			SET @temp  = @temp  + @replaceWith
			SET @temp  = @temp  +  &#039;&#039;&#039;)&#039;

			SET @first = 0
			FETCH NEXT FROM cur_columns INTO @colName
		END

		PRINT @temp

		CLOSE cur_columns
		DEALLOCATE cur_columns
	END
	-------------------------------------------------------------------------------------------
	-- END INNER
	-------------------------------------------------------------------------------------------

	FETCH NEXT FROM cur_tables INTO @tblName, @tblID
END

CLOSE cur_tables
DEALLOCATE cur_tables
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/107/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/107/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=107&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/05/09/off-topic-t-sql-replace-all-occurrences-in-all-columns-in-all-tables/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
		<item>
		<title>Academic on Tour: Community Launch 2008</title>
		<link>http://alexduggleby.com/2008/04/15/academic-on-tour-community-launch-2008/</link>
		<comments>http://alexduggleby.com/2008/04/15/academic-on-tour-community-launch-2008/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 12:15:31 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Community]]></category>

		<category><![CDATA[MSP]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=105</guid>
		<description><![CDATA[I&#8217;m quite busy at the moment with the Academic Community Launch, so I&#8217;ll leave the talking to Christian, who has posted some information about why I&#8217;ve seen most of Austria&#8217;s big cities within the last week.
Info and Pictures of the ACL 2008
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m quite busy at the moment with the Academic Community Launch, so I&#8217;ll leave the talking to Christian, who has posted some information about why I&#8217;ve seen most of Austria&#8217;s big cities within the last week.</p>
<p><a href="http://www.liensberger.it/web/blog/?p=303">Info and Pictures of the ACL 2008</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/105/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/105/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/105/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/105/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/105/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=105&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/04/15/academic-on-tour-community-launch-2008/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
		<item>
		<title>dot.net Magazin 5.08 Sync Framework Article and File Sync with VB.net</title>
		<link>http://alexduggleby.com/2008/04/01/dotnet-magazin-508-sync-framework-article-and-file-sync-with-vbnet/</link>
		<comments>http://alexduggleby.com/2008/04/01/dotnet-magazin-508-sync-framework-article-and-file-sync-with-vbnet/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 12:25:36 +0000</pubDate>
		<dc:creator>Alex Duggleby</dc:creator>
		
		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Sync Framework]]></category>

		<guid isPermaLink="false">http://alexduggleby.wordpress.com/?p=104</guid>
		<description><![CDATA[This morning I finally got my authors copy of the dot.net Magazin that I wrote an article on Microsoft Sync Framework. It&#8217;s in german, 7 pages long and you can buy it tomorrow.
Anyhow, I got an email this morning asking about one of the code listings and asking if there was anything different to do [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This morning I finally got my authors copy of the dot.net Magazin that I wrote an article on Microsoft Sync Framework. It&#8217;s in german, 7 pages long and you can buy it tomorrow.</p>
<p>Anyhow, I got an email this morning asking about one of the code listings and asking if there was anything different to do in VB.net. It&#8217;s been a while since I last did VB.net (I actually did more VB6 than VB.net) but I converted the sample from the magazine to VB.net. Just remember to reference Microsoft.Synchronization  and Microsoft.Synchronization.Files.</p>
<p>(By the way I still haven&#8217;t got round to looking at CTP2 of the Sync Framework. All this stuff (and the article) applies to CTP1. Maybe there was a breaking change in CTP2 with regard to the FileSyncProvider. I must get round to looking at CTP2 a.s.a.p.)</p>
<p>Here is the code:</p>
<pre name="code" class="vb">

Imports Microsoft.Synchronization
Imports Microsoft.Synchronization.Files
Imports System.IO

Module Module1

    Sub Main()

        &#039;Define directories
        Dim _sourceDir As String = &quot;c:\temp\1&quot;
        Dim _destDir As String = &quot;c:\temp\2&quot;

        &#039;Define system ids
        Dim _sourceId As SyncId = New SyncId(New Guid(&quot;A4715EAF-341E-4ebf-90C3-71E8644CA6E8&quot;))
        Dim _destId As SyncId = New SyncId(New Guid(&quot;FF766014-0DA4-401d-BDA1-0679326ECF96&quot;))

        &#039;Exclude some patterns
        Dim _syncFilter As FileSyncScopeFilter = New FileSyncScopeFilter()
        _syncFilter.AttributeExcludeMask = FileAttributes.Hidden Or FileAttributes.System
        _syncFilter.FileNameExcludes.Add(&quot;DoNotCopy.txt&quot;)
        _syncFilter.SubdirectoryExcludes.Add(&quot;DoNotCopy&quot;)

        &#039;Setup options (makes sure files aren&#039;t deleted for ever)
        Dim _syncOptions As FileSyncOptions = FileSyncOptions.RecycleDeletes Or FileSyncOptions.RecycleOverwrites

        &#039;Do the sync
        Using _sourceProvider As FileSyncProvider = New FileSyncProvider(_sourceId, _sourceDir, _syncFilter, _syncOptions)
            Using _destinationProvider As FileSyncProvider = New FileSyncProvider(_destId, _destDir, _syncFilter, _syncOptions)

                Dim _syncAgent As SyncAgent = New SyncAgent()
                _syncAgent.LocalProvider = _sourceProvider
                _syncAgent.RemoteProvider = _destinationProvider
                _syncAgent.Direction = SyncDirection.UploadAndDownload
                _syncAgent.Synchronize()

            End Using
        End Using

    End Sub

End Module
</pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/alexduggleby.wordpress.com/104/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/alexduggleby.wordpress.com/104/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/alexduggleby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/alexduggleby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/alexduggleby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/alexduggleby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/alexduggleby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/alexduggleby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/alexduggleby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/alexduggleby.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/alexduggleby.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/alexduggleby.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=alexduggleby.com&blog=1972306&post=104&subd=alexduggleby&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://alexduggleby.com/2008/04/01/dotnet-magazin-508-sync-framework-article-and-file-sync-with-vbnet/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/alexduggleby-128.jpg" medium="image">
			<media:title type="html">Gidion</media:title>
		</media:content>
	</item>
	</channel>
</rss>