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

<channel>
	<title>Completely Nuts &#187; Development</title>
	<atom:link href="http://completenutter2.co.uk/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://completenutter2.co.uk</link>
	<description>Ramblings of a complete nutter</description>
	<lastBuildDate>Mon, 12 Jul 2010 17:45:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='completenutter2.co.uk' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/ace54854ef6c8f94e5ada688c244cabf?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Completely Nuts &#187; Development</title>
		<link>http://completenutter2.co.uk</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://completenutter2.co.uk/osd.xml" title="Completely Nuts" />
	<atom:link rel='hub' href='http://completenutter2.co.uk/?pushpress=hub'/>
		<item>
		<title>Adding a column to a replicated table in SQL Server 2005</title>
		<link>http://completenutter2.co.uk/2010/02/04/adding-a-column-to-a-replicated-table-in-sql-server-2005/</link>
		<comments>http://completenutter2.co.uk/2010/02/04/adding-a-column-to-a-replicated-table-in-sql-server-2005/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 12:09:46 +0000</pubDate>
		<dc:creator>completenutter2</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Replication]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://completenutter2.co.uk/?p=126</guid>
		<description><![CDATA[A problem that I have come across a number of times, yet seem to forget how to solve, is when you want to add a column to a table that you have set up for replication in SQL Server 2005. SSMS (SQL Server Management Studio) modifies a table by simply dropping it, then re-creating it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=completenutter2.co.uk&amp;blog=1989114&amp;post=126&amp;subd=completenutter2&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A problem that I have come across a number of times, yet seem to forget how to solve, is when you want to add a column to a table that you have set up for replication in SQL Server 2005.</p>
<p>SSMS (SQL Server Management Studio) modifies a table by simply dropping it, then re-creating it again with the new definition. However, when a table is replicated you&#8217;re not allowed to drop it (all kinds of nasty things could happen). Of course SSMS doesn&#8217;t tell you this is the problem, it just complains of something similar to this:</p>
<p><code>"Error validating the default for column 'rowguid'."</code></p>
<p>The only way (that I&#8217;ve found) round this, is to manually alter the table. Something I got taught at University, however I don&#8217;t use it much in practice so had to look it up. Luckily the syntax is nice and simple:</p>
<p><code>ALTER TABLE [table]<br />
ADD [column] nvarchar(50) NOT NULL DEFAULT ('')<br />
GO</code></p>
<p>This will add a column with the name &#8216;column&#8217; to the table &#8216;table&#8217; that is an nvarchar, with a max size of 50, that isn&#8217;t allowed to be NULL, and has a default value of an empty string.</p>
<p>Hopefully this will help someone, at the very least, it should give me somewhere to come back to if/when I run into this issue again.</p>
<p>Replication is great in theory, unfortunately, it is one of the most troublesome areas I&#8217;ve had to deal with.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/completenutter2.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/completenutter2.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/completenutter2.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/completenutter2.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/completenutter2.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/completenutter2.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/completenutter2.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/completenutter2.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=completenutter2.co.uk&amp;blog=1989114&amp;post=126&amp;subd=completenutter2&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://completenutter2.co.uk/2010/02/04/adding-a-column-to-a-replicated-table-in-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51a4d279035e8cea3222feef46b7d582?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">completenutter2</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating new projects in SVN and Trac</title>
		<link>http://completenutter2.co.uk/2010/01/10/creating-new-projects-in-svn-and-trac/</link>
		<comments>http://completenutter2.co.uk/2010/01/10/creating-new-projects-in-svn-and-trac/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 16:41:13 +0000</pubDate>
		<dc:creator>completenutter2</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Batch script]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[Trac]]></category>

		<guid isPermaLink="false">http://completenutter2.co.uk/?p=113</guid>
		<description><![CDATA[I have finally managed to introduce Trac and Subversion (SVN) at work. For the first few months, only some projects were put into SVN and fewer were put into Trac. This was partly due to people not feeling the need, but more to do with people not knowing/understanding how to create these projects. Since I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=completenutter2.co.uk&amp;blog=1989114&amp;post=113&amp;subd=completenutter2&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have finally managed to introduce <a href="http://trac.edgewall.org/">Trac</a> and <a href="http://subversion.tigris.org/">Subversion</a> (SVN) at work. For the first few months, only some projects were put into SVN and fewer were put into Trac. This was partly due to people not feeling the need, but more to do with people not knowing/understanding how to create these projects.</p>
<p>Since I was the one who setup and researched SVN and Trac, I was fairly comfortable setting up a new repository or new Trac project, however it was quite daunting for any body else to step in and do, and even more daunting for me to try and explain the process to people.</p>
<p>Now that 2010 (twenty ten?) is upon us, it was decided we would move all active projects (those that we are still supporting) into SVN and create Trac projects.</p>
<p>We have about 50 applications that are still being supported, so even split among 4, I didn&#8217;t really want to have to go through the process of creating repositories and Trac projects for all of this, so I started looking into a way of scripting this. Since I&#8217;ve really not done much scripting before, it took me slightly longer than planned, but 2 work days (work was snowed off for 3 days this week) later and the script is &#8216;done&#8217;, so I thought I&#8217;d share it here, and share the difficulties I had. Maybe someone will find this useful.<br />
<span id="more-113"></span><br />
If you just want the script, it&#8217;s available here.</p>
<p>The first thing the script does is ask for input from the user, for the project name (we decided to insist that Trac project folder names and SVN repository names were kept the same). It was also decided that we&#8217;d use underscores to seperate words in a project name.</p>
<p>I&#8217;ll go through the script, picking out the &#8216;interesting&#8217; or parts that I struggled with.<br />
<code><br />
set /P project_name=[Enter Project Name]:<br />
set nice_project_name=%project_name:_= %<br />
set project_name=%project_name: =_%<br />
</code></p>
<p>The /P on the set command allows you to set a variable to a line of input from the user.<br />
For Trac, I wanted the project name to have spaces in, as it was nicer, so <code>nice_project_name</code> goes through the <code>project_name</code> variable, and removes the underscores (_) and replace them with a single space.<br />
Then it does almost the opposite, to allow the user to enter the &#8216;nice&#8217; project name instead of with underscores, I make sure all spaces are replaced with underscores.</p>
<p><code>mkdir %svn%%project_name%<br />
svnadmin create %svn%%project_name%</code></p>
<p>Setting up the SVN repository couldn&#8217;t really be any easier. (If you&#8217;re having trouble with this bit, make sure that the svn bin directory is setup in your windows PATH variable).<br />
Simply calling <code>svnadmin create</code> with the directory of the repository you want to create as the first argument and hey presto! a new repository.</p>
<p>Setting up Trac is almost as simple as setting up SVN was, the command you have to run is longer, and I had a bit of trouble with the project description as you&#8217;ll see in a minute.<br />
<code><br />
mkdir %trac%%project_name%<br />
call %trac-admin% %trac%%project_name% initenv "%nice_project_name%" sqlite:db/trac.db svn %svn%%project_name% --inherit=c:\trac_conf\trac.ini</code></p>
<p>If you&#8217;re using the <code>nice_project_name</code> variable, you need to make sure it&#8217;s surrounded with speech marks, since you&#8217;ll get complaints if you have spaces in the project name.</p>
<p>By passing the repository location to Trac, it&#8217;ll nicely link the 2 together for you, so you can see your source code from within trac, and (as you&#8217;ll see later) be able to close tickets from commits.</p>
<p>The only added thing there of any interest, is the <code>--inherit=c:\trac_conf\trac.ini</code> part, which allows us to use a single config file for trac. When given a file to inherit, Trac is smart enough to only include the parts that have changed in the project specific <code>trac.ini</code> file.</p>
<p>I then needed (well, I didn&#8217;t need, but really wanted) to include the description of the project. I could find no way to do this nicely, so I had to &#8216;hack&#8217; a solution together.</p>
<p><code>set project_conf=%trac%%project_name%\conf\trac.ini<br />
echo Project configuration file: %project_conf%<br />
echo [project] &gt;&gt; %project_conf%<br />
echo descr = %description% &gt;&gt; %project_conf%</code></p>
<p>This basically finds the project specific <code>trac.ini</code> file and bolts the description part of it on to the end. It doesn&#8217;t check to see if the description is already there (it shouldn&#8217;t be) and it&#8217;s a complete hack that I am not at all proud of. However, after spending several hours searching for a &#8216;nice&#8217; solution, I gave in and this works.</p>
<p>Another thing that developers where I work didn&#8217;t seem to quite grasp, was the base folder structure to use in SVN. At the top-level, we wanted 3 folders: trunk, branches and doc. A fairly standard layout, but we ended up with all kinds of things, so I put this into the script as well.</p>
<p><code>set repoURL=file://localhost/Repositories/%project_name%<br />
svn import c:\Repositories\.global\base %repoURL% -m "Create base folder structure."</code></p>
<p>This was another thing that took me longer than it should have done to figure out. I was trying to find a way to create a folder in the repository, without checking out first, I couldn&#8217;t. So the solution I settled on, was to create the folder structure somewhere on the server that was hosting svn, then just <code>import</code> that folder into the repository, thus creating our top-level folder structure.</p>
<p>The next thing I wanted to do, was be able to close Trac tickets from an SVN commit comment, so it was time to set up a post-commit hook in SVN. These go in the hooks folder of your repositiory.</p>
<p>Since this was again a step I didn&#8217;t want other developers to be concerned with, I scripted the creation of these hooks too.</p>
<p><code>set svn_post_commit_hook=%svn%%project_name%\hooks\post-commit.bat<br />
echo call "%%~dp0post-commit-run.bat" %%* ^&gt; %%1/hooks/post-commit.log 2^&gt;^&amp;1 &gt;&gt; %svn_post_commit_hook%</code></p>
<p>Because I wanted to be able to log the output, the first file <code>post-commit.bat</code> just calls the <code>post-commit-run.bat</code> file and outputs it to the log file in the same directory.</p>
<p><code>set svn_commit_hook=%svn%%project_name%\hooks\post-commit-run.bat<br />
echo Project configuration file: %svn_commit_hook%<br />
echo @echo off &gt;&gt; %svn_commit_hook%<br />
echo "rem |%1 and %2 come from the post-commit.bat that runs this. They are the repository and the revision number." &gt;&gt; %svn_commit_hook%<br />
echo set APPFOLDER=%project_name% &gt;&gt; %svn_commit_hook%<br />
echo call C:\Repositories\.hooks\post-commit-run.bat %%1 %%2 %%APPFOLDER%% &gt;&gt; %svn_commit_hook%</code></p>
<p>Since all of the repositories will do the same thing, <code>post-commit-run.bat</code> just calls the global file, which looks something like this:</p>
<p><code>set REPOS="%1"<br />
set REV="%2"<br />
set TRAC_ENV="C:\trac\%3"<br />
call C:\python25\python "c:\trac_conf\trac-post-commit-hook.py" -p "%TRAC_ENV%" -r "%REV%"</code></p>
<p><code>trac-post-commit-hook.py</code> is the original found <a href="http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook">here</a> on the Trac website.</p>
<p>If there&#8217;s an easier way to do any of this (especially the description bit of Trac) then please let me know. </p>
<p>I hope this post at least helps someone out, I had quite a lot of fun automating this, I might have to look into what else I can script to make my life easier.</p>
<p>I&#8217;ve put all the files (I think) needed for this to work (you will have to edit paths and such) into a zip file that you can download <a href="http://www.box.net/shared/o994l3r23e">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/completenutter2.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/completenutter2.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/completenutter2.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/completenutter2.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/completenutter2.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/completenutter2.wordpress.com/113/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/completenutter2.wordpress.com/113/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/completenutter2.wordpress.com/113/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=completenutter2.co.uk&amp;blog=1989114&amp;post=113&amp;subd=completenutter2&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://completenutter2.co.uk/2010/01/10/creating-new-projects-in-svn-and-trac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51a4d279035e8cea3222feef46b7d582?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">completenutter2</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Wave</title>
		<link>http://completenutter2.co.uk/2009/05/30/google-wave/</link>
		<comments>http://completenutter2.co.uk/2009/05/30/google-wave/#comments</comments>
		<pubDate>Sat, 30 May 2009 17:09:00 +0000</pubDate>
		<dc:creator>completenutter2</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Google Wave]]></category>
		<category><![CDATA[Wave]]></category>

		<guid isPermaLink="false">http://completenutter2.co.uk/?p=74</guid>
		<description><![CDATA[I just finished watching the Google Wave video on YouTube, here. Google have come along with a new technology called Wave. Watch the video to find out more about it (be warned, its a video from the Google I/O developer conference, so its a little techy). Basically they have stepped back from the way we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=completenutter2.co.uk&amp;blog=1989114&amp;post=74&amp;subd=completenutter2&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-77" src="http://www.google.com/intl/en_ALL/images/logo.gif" title="Google Logo" /></p>
<p>I just finished watching the <a href="http://wave.google.com/">Google Wave</a> video on <a href="http://www.youtube.com">YouTube</a>, <a href="http://www.youtube.com/watch?v=v_UyVmITiYQ">here</a>.</p>
<p>Google have come along with a new technology called Wave. Watch the video to find out more about it (be warned, its a video from the <a href="http://code.google.com/events/io/">Google I/O</a> developer conference, so its a little techy). Basically they have stepped back from the way we currently communicate with each other (e-mail, IM, SMS) etc and, reinvented it. Its hard to explain, just watch the <a href="http://www.youtube.com/watch?v=v_UyVmITiYQ">video</a> (its long though).</p>
<p>There are times when I think <a href="http://www.google.com">Google</a> are becoming the new <a href="http://www.microsoft.com">Microsoft</a>, the way they&#8217;re taking over everything and the way they buy new companies, however&#8230; Google keep proving me wrong, time and time again they surprise me.</p>
<p>I&#8217;ll try and summarise the features that I can remember (guess they&#8217;re the good ones):</p>
<ul>
<li><strong>Live</strong> &#8211; <em>All communication when using Wave is live, even the typing, so no more &#8220;Buddy is typing&#8230;&#8221;. Waves come and go in your inbox, even the search is live.</em></li>
<li><strong>Open Source</strong> &#8211; <em>Woo! This means that other people can create their own Wave servers. Different wave servers can communicate with each other, using something called <strong>Foundation</strong></em></li>
<li><strong>Collaboration</strong> &#8211; <em>A wave is basically a smart document, or conversation. A smart docusation if you would. All the people involved with the Wave can edit the Wave at the same time and all the changes are displayed live on all the clients. Impressive <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></li>
<li><strong>Playback</strong> &#8211; <em>When you are added to a Wave after it has already started, you will see all the edits/comments/conversations in the Wave already. Google have come up with a playback feature, which lets you see how the Wave was constructed. Another impressive feature.</em></li>
<li><strong>Extensions</strong> &#8211; <em>Google demonstrated some pretty cool extensions, check them out in the video.</em></li>
<li><strong>Rosy</strong> &#8211; <em>Live Translation! This was probably the most impressive feature of Wave, Google demonstrated two people conversing, one in French and another in English, Wave was translating what was written, <strong>in real time!</strong></em></li>
</ul>
<p><span style="color:#7f817e;"> </span></p>
<p>Overall I was very impressed with Google Wave, obviously as a developer I find this thing interesting anyway, but hopefully this will change the way people communicate world wide. For the better. Open protocols, Open source.</p>
<p>Google have impressed me today.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/completenutter2.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/completenutter2.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/completenutter2.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/completenutter2.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/completenutter2.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/completenutter2.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/completenutter2.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/completenutter2.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=completenutter2.co.uk&amp;blog=1989114&amp;post=74&amp;subd=completenutter2&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://completenutter2.co.uk/2009/05/30/google-wave/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/51a4d279035e8cea3222feef46b7d582?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">completenutter2</media:title>
		</media:content>

		<media:content url="http://www.google.com/intl/en_ALL/images/logo.gif" medium="image">
			<media:title type="html">Google Logo</media:title>
		</media:content>
	</item>
	</channel>
</rss>