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

<channel>
	<title>graham.reeds/ &#187; Work</title>
	<atom:link href="http://www.digital-utopia.com/blogs/graham.reeds/category/life/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.digital-utopia.com/blogs/graham.reeds</link>
	<description>"The pleasure of finding things out"</description>
	<lastBuildDate>Sun, 05 Sep 2010 19:46:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>And that&#8217;s that.</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2010/08/13/and-thats-that/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2010/08/13/and-thats-that/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 14:44:49 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[contracting]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/2010/08/13/and-thats-that/</guid>
		<description><![CDATA[A six week contract comes to an end after seven months.]]></description>
			<content:encoded><![CDATA[<p>A six week contract comes to an end after seven months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2010/08/13/and-thats-that/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apologies</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2010/07/05/apologies/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2010/07/05/apologies/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 18:23:21 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/2010/07/05/apologies/</guid>
		<description><![CDATA[My apologies for lack of updates. A project I am on is currently sinking for a multitude of reasons, some of which I want to write about, but not when I am doing 10 hour days to regain the missing weeks of time.]]></description>
			<content:encoded><![CDATA[<p>My apologies for lack of updates. A project I am on is currently sinking for a multitude of reasons, some of which I want to write about, but not when I am doing 10 hour days to regain the missing weeks of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2010/07/05/apologies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C++ and Maven sitting in a tree</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2010/05/08/c-and-maven-sitting-in-a-tree/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2010/05/08/c-and-maven-sitting-in-a-tree/#comments</comments>
		<pubDate>Sat, 08 May 2010 20:05:00 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=370</guid>
		<description><![CDATA[&#8230;but they definitely were not K-I-S-S-I-N-G. In fact they weren&#8217;t even holding hands. As a test at work for a new project I was asked to look at using Maven, which is currently being used to great effect by the Java programmers, with C++. A new project has arisen that requires proof that there is [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;but they definitely were not K-I-S-S-I-N-G.  In fact they weren&#8217;t even holding hands.</p>
<p>As a test at work for a new project I was asked to look at using Maven, which is currently being used to great effect by the Java programmers, with C++. A new project has arisen that requires proof that there is 100% code coverage, has various code metrics and need to be presented at the end of it.</p>
<p>As usual the first thing I did was <a href="http://www.google.com/search?ie=UTF-8&#038;oe=UTF-8&#038;sourceid=navclient&#038;gfns=1&#038;q=Maven+C%2B%2B">canvas the &#8216;Net for other peoples experiences</a>. There is no point in reinventing the wheel if you can help it. Unfortunately peoples experiences weren&#8217;t good. On the plus side they weren&#8217;t recent.</p>
<p>So I set off looking at the <a href="http://mojo.codehaus.org/maven-native/native-maven-plugin/">Mojo Native Plugin</a>. One of the first things that concerned me was the lack of direct Unit Testing support.  I had noticed that several other language plugins had direct support for unit testing. However I can work around that. The other major concern was running the code metric tools that were being evaluated concurrently.</p>
<p>Eventually, after nearly whole frustrating week, I gave up with the Mojo tool. It was simply unworkable. Didn&#8217;t help that I am not use to paying the angle bracket tax. I then shifted my focus to the <a href="http://www.jfrog.org/sites/jade-plugins/1.3/jade-plugin-parent/jade-build-plugin-parent/jade-native-plugin/index.html">Jade Native Plugins</a>. This is actually a fork of the Maven plugin but has moved along and supports unit testing and static analysers.</p>
<p>This on the face of it seems like a good thing but was again unworkable, but this is probably me more than them &#8211; I am not used to editing the pom.xml and getting the relevant info from provided examples is not easy especially when the underlying code seemingly doesn&#8217;t work with the examples.</p>
<p>Feeling increasingly like a failure, I turned to <a href="http://hudson-ci.org/">Hudson</a> which several posts had pointed to. This was a breeze in comparison. A massive relief as I had a build up and running quickly and a couple of days later after overcoming a few niggardly problems I had a build that had unit tests and code coverage. </p>
<p>I presented my findings and guess what we picked? Option C: Maven2 execing batch files. Did I mention the PM is/was a Java programmer?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2010/05/08/c-and-maven-sitting-in-a-tree/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating directories</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2010/04/08/creating-directories/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2010/04/08/creating-directories/#comments</comments>
		<pubDate>Thu, 08 Apr 2010 20:47:45 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=357</guid>
		<description><![CDATA[I recently had a problem at work where an application failed if the user tried to use UNC paths in a application that was ran as a service. This service was written in C# that called into C DLL. Not only that, but the DLL was written in VC6. So after confirming I could recreate [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a problem at work where an application failed if the user tried to use <a href="http://en.wikipedia.org/wiki/Path_%28computing%29#Uniform_Naming_Convention">UNC paths</a> in a application that was ran as a service.</p>
<p>This service was written in C# that called into C DLL.  Not only that, but the DLL was written in VC6.</p>
<p>So after confirming I could recreate the bug I removed the service and installed the debug version. I tested again and it was still there.  I then added <code>System.Diagnostics.Debugger.Break</code> to the code and stepped in and through until I got to the calls to the DLL.  The call stepped straight over.  Hmm.</p>
<ul>
<li>Debug build of the DLL: Check.</li>
<li>PDB file: Check.</li>
<li>Step into unmanaged code: Checked.</li>
<li>Debugging option: Mixed.</li>
</ul>
<p>So what next. Maybe it wasn&#8217;t picking up the debug DLL.  So I went around and deleted every other version of the DLL. Didn&#8217;t fix it and broke most of the support apps.  Maybe it was a weird VS2K5/VC6 interaction.  So I rebuilt the library in Visual Studio but it still failed.</p>
<p>I could see the problematic code, but I couldn&#8217;t step in to see what the parameters were when it was there. So I created a small console app and transplanted in the problem code and called it. Worked as expected. Which brought up the idea that something was changing the parameters &#8211; but why, where and again why?! So the simple console app was extended to call the dll with every single call from the service in it with the same parameters, finally ending where the problem happened.</p>
<p>However it didn&#8217;t happen where I expected it to &#8211; the breakpoint I placed was never hit.  I thought that it wasn&#8217;t debugging properly still but it broke successfully if I placed a breakpoint at the start of the code. But if the code wasn&#8217;t being reached where it called <a href="http://msdn.microsoft.com/en-us/library/aa363855%28VS.85%29.aspx"><code>CreateDirectory</code></a> how comes there is a directory in the root of C:\ with the name of unc machine?</p>
<p>It turns out that it called a function earlier in the code than expected that uses <a href="http://msdn.microsoft.com/en-us/library/ms235326%28VS.80%29.aspx"><code>mkdir</code></a> &#8211; and the code that uses <code>CreateDirectory</code> never gets used due to the parameter tests that are done.</p>
<p>I looked at this code and thought about fixing it but there was over a <strong>hundred</strong> lines of <code>strcat</code>, <code>strcpy</code>, <code>strtok</code> and moving pointers around.  I decided that it was horribly broken and rewrite was in order.  So I looked on the net because this is a good case of reinventing the wheel.  Most sites, including my beloved <a href="http://stackoverflow.com/">StackOverflow</a>, suggest using <a href="http://www.boost.org/doc/libs/1_42_0/libs/filesystem/doc/index.htm">Boost.FileSystem</a> which in my case is a non-starter. So I had a think about it and this is what I came up with after one false start:</p>
<p><code>
<pre>
BOOL CreateDirectories(char* path)
{
	BOOL status = TRUE;
	char* p;
	char temp_path[256];
	strcpy(temp_path, path);
	do {
		p = strrchr(temp_path, '\\');
		*p = '\0';
	} while (!SetCurrentDirectory(temp_path));
	do {
		p = strchr(temp_path, '\0');
		*p = '\\';
		status = CreateDirectory(temp_path, 0);// do not check because this will fail on 'too\\many_slashes'
	} while (strlen(temp_path) &lt; strlen(path));
	return status;
}
</pre>
<p></code></p>
<p>Now you can get away with removing the <code>temp_path</code> but I copied the original string to be safe, and I should of used <code>MAX_PATH</code> instead of hard-coding 256 but I think the code is quite elegant (though the WordPress formatting doesn&#8217;t really do it justice).</p>
<p>There&#8217;s a warning there &#8211; not to compare against the status in the while clause as having two slashes instead of one will prematurely cause the function to exit. Ignore the error that the function returns (<code>ERROR_ALREADY_EXISTS</code>) and the following time through it will continue to create the directories.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2010/04/08/creating-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2009/09/13/update/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2009/09/13/update/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 19:52:24 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Galaxy]]></category>
		<category><![CDATA[Leisure]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=310</guid>
		<description><![CDATA[It&#8217;s been a while since I posted, so what has been keeping me busy? Work, it&#8217;s getting easier &#8211; I think I am getting into the VB6 mindset, but I still hate VBA with a passion. When is the nice .NET extension becoming available? Is it already, and could Reporting Services save our souls (not [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since I posted, so what has been keeping me busy?</p>
<p>Work, it&#8217;s getting easier &#8211; I think I am getting into the VB6 mindset, but I still hate VBA with a passion. When is the nice .NET extension becoming available? Is it already, and could Reporting Services save our souls (not to mention our sanity)?</p>
<p>Space is coming along very slowly. Any time I sit down to work on it I have to spend about an hour refreshing my mind on what I have done &#8211; and I only have about 40 mins to do it in.</p>
<p>Had my birthday: One of my presents was an iPod from Mrs Bear &#8211; which gave me a lovely opportunity to hate iTunes all over again. This time I accidently deleted my play list, there is no undelete and then it synced it &#8211; wiping it. I&#8217;ve installed iTunes 9 but I don&#8217;t hold out any hope for them fixing all the problems with it. Another present is an ant farm &#8211; so along with my Sea Monkeys you could say I have Surf&#8217;n'Turf.</p>
<p>Another side effect of my birthday was my the choice of venues for a meal.  Since I&#8217;ve always wanted to eat there I picked <a title="Kaminaki" href="http://www.kaminaki.co.uk/">Kaminaki </a>and had some of the nicest fish I have ever eaten, and definately the nicest pitta bread ever. All this and despite the grumblings of some of my friends.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2009/09/13/update/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VB6 and VBA</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2009/06/25/vb6-and-vba/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2009/06/25/vb6-and-vba/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 23:17:54 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=291</guid>
		<description><![CDATA[My employer of nearly 3 months is slowly moving to VB.NET. However a lot of their &#8216;legacy&#8217; apps still need to be maintained and extended to support new methods, etc. This involves VB6 and VBA.  I was always in the position that VB6 was a mickey-mouse program for throwaway apps but not really suitable for [...]]]></description>
			<content:encoded><![CDATA[<p>My employer of nearly 3 months is slowly moving to VB.NET. However a lot of their &#8216;legacy&#8217; apps still need to be maintained and extended to support new methods, etc.</p>
<p>This involves VB6 and VBA.  I was always in the position that VB6 was a mickey-mouse program for throwaway apps but not really suitable for real dev work &#8211; I was an elitist C++ programmer basically.</p>
<p>My view has shifted &#8211; you can really write large enterprise class apps in VB6. But one thing I can&#8217;t seem to shake off is the contempt the people who wrote VB6 IDE had for their users. Having used VC6 for a number of years you get used to certain things: Like if you start editing a file that isn&#8217;t checked out it will ask you if you want to start editing and then when checked out your caret is where you want it to be.</p>
<p>Not in VB6.  You are informed that the file is locked.  So you then have to right click on the file and manually check it out.  But now the file closes itself and reopens with you looking at the top of the file.</p>
<p>Should I mention the 255 control limit? Who picked that as a number? (As an aside why is Excel 2003 limited to 1026 rows? Why 1026 and not 1024? Is that a typo?)</p>
<p>&#8220;Out of memory error&#8221;. I have 4gb in my machine.  Why am I out of memory and why does that stop you from saving my last 15 minutes of careful debugging work?  Why must you lose my break points?</p>
<p>And the mouse wheel doesn&#8217;t work.</p>
<p>This isn&#8217;t to say VC6 was all roses &#8211; far from it &#8211; but it makes you wonder if the VB6 team actually a) used it for anything b) gave a damn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2009/06/25/vb6-and-vba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Onwards and upwards</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2009/04/25/onwards-and-upwards/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2009/04/25/onwards-and-upwards/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 23:46:24 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=273</guid>
		<description><![CDATA[Life continues. Slowly getting used to the way my new employer does things. It&#8217;s a little more strict than previous places but this is the largest organisation that I&#8217;ve worked for under one roof. Using VB after a break of 5 years is a real pain but apparently it is only going to be for [...]]]></description>
			<content:encoded><![CDATA[<p>Life continues.</p>
<p>Slowly getting used to the way my new employer does things. It&#8217;s a little more strict than previous places but this is the largest organisation that I&#8217;ve worked for <em>under one roof</em>. Using VB after a break of 5 years is a real pain but apparently it is only going to be for a short time. There are plans to rewrite (why do I cringe when I hear that word?) the apps in VB.NET. Oh joy of joys. Between now and then I can try and wheedle my way into getting C# used. Meanwhile I am learning to swim again by being thrown in at the deep end. As a plus I don&#8217;t have to get up/leave so early and I get home an hour earlier too.</p>
<p>While this is going on I am still working on <a title="Space - Glory Through Conquest" href="http://space.zerosumgames.net/">Space</a>. Or rather trying to get Space to work on a local VM. There is little point in pushing forward with changes when the changes are so hard to implement, and the only way to test is on a live system. That&#8217;s just folly: If something breaks then we start to lose real money. Better to make a VM and play safely in there.</p>
<p>That means learning Linux. Which I have now installed a dozen times. Even the book on the subject doesn&#8217;t work the way it is supposed to. Fortunately I am savvy enough to figure out my way around where the book misses out one of the hyphens in &#8211;dport.</p>
<p>With learning comes confidence so I went and reinstalled selecting server as the install option and doing everything manually. However with <a title="Download details: Virtual PC 2007" href="http://www.microsoft.com/downloads/details.aspx?FamilyId=04D26402-3199-48A3-AFA2-2DC0B40A73B6&amp;displaylang=en">Virtual PC </a>as my VM I kept getting the &#8216;i8253 too high &#8211; resetting&#8217; all the time which made working in Vim a nightmare. So I decided to give <a title="VirtualBox" href="http://www.virtualbox.org/">VirtualBox </a>a try.</p>
<p>Oh my God! How fast is it compared to Virtual PC!?. It just rips along. The boot is a blur, the install of the OS is twice as quick and UI is feels more responsive. As a plus I haven&#8217;t seen the i8253 bug yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2009/04/25/onwards-and-upwards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean again</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2009/04/10/clean-again/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2009/04/10/clean-again/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 19:10:44 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=270</guid>
		<description><![CDATA[Just finished my first week back in work and though it wasn&#8217;t a full week, does give one some confidence once again. However, the job isn&#8217;t my ideal one &#8211; working with mess that is classic VB (could be worse might be PHP) &#8211; but it is a job all the same.]]></description>
			<content:encoded><![CDATA[<p>Just finished my first week back in work and though it wasn&#8217;t a full week, does give one some confidence once again.</p>
<p>However, the job isn&#8217;t my ideal one &#8211; working with mess that is classic VB (could be worse might be PHP) &#8211; but it is a job all the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2009/04/10/clean-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Final day at work</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2009/03/26/final-day-at-work/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2009/03/26/final-day-at-work/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 06:07:47 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[p45]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=264</guid>
		<description><![CDATA[Today is my final day at work.]]></description>
			<content:encoded><![CDATA[<p>Today is my final day at work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2009/03/26/final-day-at-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I am now a member of the great unwashed</title>
		<link>http://www.digital-utopia.com/blogs/graham.reeds/2009/02/26/i-am-now-a-member-of-the-great-unwashed/</link>
		<comments>http://www.digital-utopia.com/blogs/graham.reeds/2009/02/26/i-am-now-a-member-of-the-great-unwashed/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 16:50:53 +0000</pubDate>
		<dc:creator>graham.reeds</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.digital-utopia.com/blogs/graham.reeds/?p=249</guid>
		<description><![CDATA[With effect of Friday the 27th of March I will be unemployed by reason of redundancy.]]></description>
			<content:encoded><![CDATA[<p>With effect of Friday the 27th of March I will be unemployed by reason of redundancy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.digital-utopia.com/blogs/graham.reeds/2009/02/26/i-am-now-a-member-of-the-great-unwashed/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
