<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-31420744</id><updated>2009-09-09T11:30:02.798+01:00</updated><title type='text'>The Mouse Organ</title><subtitle type='html'>My accumulated programming knowledge.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://themouseorgan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default'/><link rel='alternate' type='text/html' href='http://themouseorgan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Charliemouse</name><uri>http://www.blogger.com/profile/06351311493573299781</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-31420744.post-115883213693476724</id><published>2006-09-21T10:12:00.000+01:00</published><updated>2006-09-21T12:23:53.113+01:00</updated><title type='text'>Hair pulling</title><content type='html'>I've been setting up a &lt;a href="http://subversion.tigris.org"&gt;Subversion&lt;/a&gt; server. My company has traditionally used VSS without much issue for years, which is amazing considering how flakey and &lt;em&gt;half-arsed&lt;/em&gt; it is. So, as I needed a source control management system that could be accessed from other physical locations, and that had a reasonable level of functionality, I decided to leave VSS behind and go to Subversion.&lt;br /&gt;&lt;br /&gt;So, installing Subversion took about 2 hours.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Get the the Win32 binaries&lt;/li&gt;&lt;li&gt;Install them on the server (just a test box for now)&lt;/li&gt;&lt;li&gt;Get TortoiseSVN binaries&lt;/li&gt;&lt;li&gt;Install them on the client&lt;/li&gt;&lt;li&gt;Run the Subversion dedicated server (can't be bothered to install Apache)&lt;/li&gt;&lt;li&gt;Point the client at the server&lt;/li&gt;&lt;li&gt;Spend the rest of the morning importing some repositories and getting used to it&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;So then I think to myself &lt;em&gt;"This really needs to be secure before it goes onto a public server with real source code."&lt;/em&gt; Looking at the documentation, I needed to setup SSH on the server. No hope! I spend about 10 hours going around in circles - none of the &lt;em&gt;how-to's&lt;/em&gt; I could find were consistent with what actually happens.&lt;/p&gt;&lt;p&gt;Plan B. Install Apache. Configure it to work with Subversion. Job done. Took about an hour.&lt;/p&gt;&lt;p&gt;Right, now to secure it with SSL. Should be easy as the user community for Apache is even bigger than that for Subversion. Download a &lt;span style="font-family:courier new;font-size:85%;"&gt;mod_ssl&lt;/span&gt; binary (Apache refuse to distribute the binary because of America's export laws). Was it easy? No! 3 days of &lt;em&gt;hair pulling&lt;/em&gt;. Everything looks like it should work (I even recruited an Apache guru friend to check my configuration), but it falls over silently on boot. I was convinced it was some sort of problem with the keys or my configuration files.&lt;/p&gt;&lt;p&gt;You know how you get into a state of mind with a problem where you only look at a subset of possible solutions, and you try those repeatedly, even though you know that there are other options? I finally decided to remove everything and start again with a single binary distribution of Apache that included SSL. Suddenly, everything sprung into life.&lt;/p&gt;&lt;p&gt;Oh well. Works a treat now. I'm just waiting for the red-tape to part and allow me to buy a server for this. Kind of tricky to work together with a team 2,000 miles away without common source.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31420744-115883213693476724?l=themouseorgan.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://themouseorgan.blogspot.com/feeds/115883213693476724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=31420744&amp;postID=115883213693476724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115883213693476724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115883213693476724'/><link rel='alternate' type='text/html' href='http://themouseorgan.blogspot.com/2006/09/hair-pulling.html' title='Hair pulling'/><author><name>Charliemouse</name><uri>http://www.blogger.com/profile/06351311493573299781</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07464659870733813820'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31420744.post-115348059802500212</id><published>2006-07-21T11:52:00.000+01:00</published><updated>2006-07-22T00:06:04.100+01:00</updated><title type='text'>.NET XML Gotcha</title><content type='html'>Ran into another little wrinkle earlier in the week.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;XMLNode.SelectNodes()&lt;/code&gt; and &lt;code&gt;XMLNode.SelectSingleNode()&lt;/code&gt; are very handy methods inside the DOM for jumping around inside XML documents. However, don't try to alter the nodes that are returned because &lt;strong&gt;they may not be live.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It took me several hours to track down a bug in my code caused by this. I noticed that, although the OwnerDocument of the nodes returned was correct, when I walked back up the tree by following the parents, I bump into a null before reaching the document node.&lt;br /&gt;&lt;br /&gt;Firstly, it amazes me to think that it must have taken effort to program it to be less useful. Secondly, I dislike the uncertainty of it all...&lt;br /&gt;&lt;br /&gt;Quote from the Help: &lt;blockquote&gt;The XmlNode &lt;em&gt;should not be expected&lt;/em&gt; to be connected "live" to the XML document.&lt;br /&gt;That is, changes that appear in the XML document &lt;em&gt;may&lt;/em&gt; not appear in the XmlNode,&lt;br /&gt;and vice versa. &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31420744-115348059802500212?l=themouseorgan.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://themouseorgan.blogspot.com/feeds/115348059802500212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=31420744&amp;postID=115348059802500212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115348059802500212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115348059802500212'/><link rel='alternate' type='text/html' href='http://themouseorgan.blogspot.com/2006/07/net-xml-gotcha.html' title='.NET XML Gotcha'/><author><name>Charliemouse</name><uri>http://www.blogger.com/profile/06351311493573299781</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07464659870733813820'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31420744.post-115342898604286905</id><published>2006-07-20T21:27:00.000+01:00</published><updated>2006-07-20T22:30:43.940+01:00</updated><title type='text'>Foible #1</title><content type='html'>I've come across an irritating little foible in C#, and I keep wondering whether it's me not thinking of the right solution, or it's a weakness of C# or .NET. Unfortunately, it's going to take a while to explain.&lt;br /&gt;&lt;br /&gt;The short version is: &lt;em&gt;You can't have a static abstract member&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;The long version is...&lt;br /&gt;&lt;br /&gt;I have written an extensible component. You add functionality (plug-ins) to it by writing additional assemblies and 'registering' them with the component.&lt;br /&gt;&lt;br /&gt;The plug-ins must inherit from a public abstract class and I need them to implement their own version of a static property - we'll call it DataFormat.&lt;br /&gt;&lt;br /&gt;I would like to implement it like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;public abstract class MyBaseClass&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static abstract string DataFormat { get; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// other stuff&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;But I can't!&lt;/strong&gt; C# doesn't allow a member to be both abstract and static. So, I must remove one of those modifiers and keep the other, in order to compile.&lt;br /&gt;&lt;br /&gt;If I keep the static modifier, i.e.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;public abstract class MyBaseClass&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static string DataFormat&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return "";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;... then I cannot ensure that the inheriting object implements its own version.&lt;br /&gt;&lt;br /&gt;If I keep the abstract modifier, i.e.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;public abstract class MyBaseClass&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public abstract string DataFormat { get; }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;br /&gt;... then I need to create an instance of the object just to read a static value.&lt;br /&gt;&lt;br /&gt;I originally took the first option, but it was painful. The reflection code was more complex and there was no early binding - you had to check at run-time that the object was written with a correct implementation of DataFormat.&lt;br /&gt;&lt;br /&gt;So today I relented, and refactored to the second way. There's a lot less code, and it's strongly typed. I just have to instantiate the plug-in class when I need to read the DataFormat value.&lt;br /&gt;&lt;br /&gt;This feels wrong, and yet I can't think of a better approach. Oh, and don't think Interfaces help, because they can't have static members.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31420744-115342898604286905?l=themouseorgan.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://themouseorgan.blogspot.com/feeds/115342898604286905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=31420744&amp;postID=115342898604286905' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115342898604286905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115342898604286905'/><link rel='alternate' type='text/html' href='http://themouseorgan.blogspot.com/2006/07/foible-1.html' title='Foible #1'/><author><name>Charliemouse</name><uri>http://www.blogger.com/profile/06351311493573299781</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07464659870733813820'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-31420744.post-115342663899401541</id><published>2006-07-20T21:12:00.000+01:00</published><updated>2006-07-20T21:17:18.996+01:00</updated><title type='text'>Introduction</title><content type='html'>This is a documentation of my programming voyage of discovery.&lt;br /&gt;&lt;br /&gt;I am primarily a &lt;em&gt;Delphi&lt;/em&gt; programmer by trade, having been programming that language since Delphi 1 back in the mid 90's.  Previously I'd been a Pascal programmer, only dabbling in C a little as my University didn't teach it (shocking!).&lt;br /&gt;&lt;br /&gt;At the time of creating this blog, I am concentrating on &lt;em&gt;C#&lt;/em&gt; and learning my way around .NET, although I juggle both Delphi and C# in my day job.  Actually, programming is only about half of my job these days, as I have to perform recruitment, mentoring and technical liaison duties - the price of career progression.  But I never intend to stop programming (I'm sure a lot of people say that).&lt;br /&gt;&lt;br /&gt;I plan to use this blog to document some of the technical foibles I come across, as both a memory aid and a possible resource for others.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/31420744-115342663899401541?l=themouseorgan.blogspot.com'/&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://themouseorgan.blogspot.com/feeds/115342663899401541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=31420744&amp;postID=115342663899401541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115342663899401541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/31420744/posts/default/115342663899401541'/><link rel='alternate' type='text/html' href='http://themouseorgan.blogspot.com/2006/07/introduction.html' title='Introduction'/><author><name>Charliemouse</name><uri>http://www.blogger.com/profile/06351311493573299781</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='07464659870733813820'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>