<?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>Ramblings</title>
	<atom:link href="http://jat45.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jat45.wordpress.com</link>
	<description>surely that says it all</description>
	<lastBuildDate>Tue, 06 Dec 2011 11:39:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jat45.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ramblings</title>
		<link>http://jat45.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jat45.wordpress.com/osd.xml" title="Ramblings" />
	<atom:link rel='hub' href='http://jat45.wordpress.com/?pushpress=hub'/>
		<item>
		<title>The launch of Chem4Word</title>
		<link>http://jat45.wordpress.com/2010/04/02/the-launch-of-chem4word/</link>
		<comments>http://jat45.wordpress.com/2010/04/02/the-launch-of-chem4word/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 22:08:08 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[chem4word]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=104</guid>
		<description><![CDATA[I spoke last week at the spring meeting of the ACS in San Francisco about Chem4Word (well, at least we can still call the project that even though the product actually goes by the much catchier &#8220;Chemistry Add-in for Word&#8221;). The talk was the day after Alex Wade, Peter and I had officially announced the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=104&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I spoke last week at the spring meeting of the ACS in San Francisco about <a href="http://research.microsoft.com/chem4word/">Chem4Word</a> (well, at least we can still call the project that even though the product actually goes by the much catchier &#8220;Chemistry Add-in for Word&#8221;). The talk was the day after <a href="http://research.microsoft.com/en-us/people/awade/">Alex Wade</a>, <a href="http://wwmm.ch.cam.ac.uk/blogs/murrayrust/">Peter</a> and I had officially announced the launch. The talk went down well and was captured on video which will be available soon. I&#8217;ll also get my slide deck online.</p>
<p>Since then I have been on holiday &#8211; driving up the coast (via Sonoma) to Seattle for the external research symposium at Microsoft &#8211; so have been out of contact. On reconnecting to WiFi (bless it) I am delighted to find that the add-in has been downloaded 27,000 times in the first week. Oh my!</p>
<p>I am going to be heading up the project when it goes open source (we are expecting this to happen in a couple of weeks and it will be available <a href="http://chem4word.codeplex.com/">here</a>) so I&#8217;m delighted to find so much interest out there and, of course, so many potential developers.</p>
<p>However, mostly the reason for this entry is to make sure that I commit myself publicly to writing up a list of TODOs for the project and where we see it going in the short to medium term. I would try to look far into the future but we all know that whatever I come back with will certainly come back to haunt me.</p>
<p>So there you have it. My commitment in print. It is for my own good; when I get back to Cambridge I am definitely going to have to hit the ground running. How exciting&#8221;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=104&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2010/04/02/the-launch-of-chem4word/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>
	</item>
		<item>
		<title>Extracting CML from a Chem4Word authored document (C#)</title>
		<link>http://jat45.wordpress.com/2010/01/21/extracting-cml-from-a-chem4word-authored-document-c/</link>
		<comments>http://jat45.wordpress.com/2010/01/21/extracting-cml-from-a-chem4word-authored-document-c/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 00:15:01 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[chem4word]]></category>
		<category><![CDATA[CML]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[OOXML]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[walkthrough]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=87</guid>
		<description><![CDATA[My previous post was the first in a series demonstrating how CML embedded in DOCX files could be extracted (in that case using Java). For completeness I thought I ought to post some code to accomplish the same thing in C#. This should also allow people to get used to the packaging tools before we [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=87&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://jat45.wordpress.com/2010/01/20/extracting-cml-from-a-chem4word-authored-document-java/">previous post</a> was the first in a series demonstrating how CML embedded in DOCX files could be extracted (in that case using Java). For completeness I thought I ought to post some code to accomplish the same thing in C#. This should also allow people to get used to the packaging tools before we build up functionality in later posts.</p>
<p>If you would like a file containing CML to test this out with, one is available <a href="http://jat45.files.wordpress.com/2010/01/example.docx">here</a>. </p>
<p>Now for the code:</p>
<pre><code>
using System.Collections.Generic;
using System.IO;
using System.IO.Packaging;
using System.Linq;
using System.Xml.Linq;
using System.Xml.XPath;

namespace Chem4Word.Tools
{
  public class OOXMLTools
  {
    public ICollection GetCML(string path)
    {
      ICollection list = new List();
      using (Package package = Package.Open(path, FileMode.Open))
      {
        foreach (PackagePart packagePart in package.GetParts())
        {
          if (packagePart.ContentType == "application/xml")
          {
            using (StreamReader streamReader =
               new StreamReader(packagePart.GetStream()))
            {
              try
              {
                XDocument xDocument =
                  XDocument.Parse(streamReader.ReadToEnd());
                if (xDocument.XPathSelectElements(
              "//*[local-name()='cml' and namespace-uri()=
              'http://www.xml-cml.org/schema']").Count() &gt; 0)
                {
                  list.Add(xDocument);
                }
              }
              catch
              {
                  // not valid XML so therefore can't be CML
              }
            }
          }
        }
      }
      return list;
    }
  }
}
</code>
</pre>
<p>So there we go. Pretty similar to the Java version really. Just in case you were wondering, I know I haven&#8217;t done a load of exception checking.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=87&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2010/01/21/extracting-cml-from-a-chem4word-authored-document-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>
	</item>
		<item>
		<title>Extracting CML from a Chem4Word authored document (Java)</title>
		<link>http://jat45.wordpress.com/2010/01/20/extracting-cml-from-a-chem4word-authored-document-java/</link>
		<comments>http://jat45.wordpress.com/2010/01/20/extracting-cml-from-a-chem4word-authored-document-java/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 18:34:59 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[chem4word]]></category>
		<category><![CDATA[CML]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[OOXML]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=68</guid>
		<description><![CDATA[I have been meaning to write this post for ages and thanks to a recent tweet from Egon I&#8217;ve finally got round to it. Basically what I am going to do over a series of posts is explain how CML can be extracted from a DOCX (OOXML) file authored using Chem4Word. I&#8217;ll post methods in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=68&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have been meaning to write this post for ages and thanks to a recent tweet from <a href="http://chem-bla-ics.blogspot.com/">Egon</a> I&#8217;ve finally got round to it. Basically what I am going to do over a series of posts is explain how CML can be extracted from a <a href="http://en.wikipedia.org/wiki/Office_Open_XML">DOCX (OOXML)</a> file authored using <a href="http://research.microsoft.com/en-us/projects/chem4word/">Chem4Word</a>. I&#8217;ll post methods in both Java and C# but I am starting off in Java.</p>
<h3>A very quick into to DOCX and OOXML</h3>
<p>There are plenty of <a href="http://blogs.msdn.com/ericwhite/pages/packages-and-parts.aspx">blogs</a>, papers, videos and the like out there which explain OOXML in various levels of detail. I don&#8217;t want to replicate that here but I think it will be useful to have a quick overview for reference. Microsoft developed the Open Packaging Convention (OPC) specification as a successor to its binary Microsoft Office file formats. The file-extension DOCX indicates an OPC document which should be edited using Microsoft Office Word 2007 (as opposed to the XSLX file extension for example which are OPC documents editable using Excel). A DOCX document is effectively a zip-file (the package) which contains the original text as a marked-up XML component (document.xml), with images and other embedded objects stored as separate files.</p>
<p><a href="http://jat45.files.wordpress.com/2010/01/ooxml-structure.png"><img class="size-full wp-image-77" title="ooxml-structure" src="http://jat45.files.wordpress.com/2010/01/ooxml-structure.png?w=450&#038;h=240" alt="the simplified structure of an OPC document" width="450" height="240" /></a></p>
<p>The package-part <strong>word\document.xml</strong> contains the main text and body of the document. Chem4Word stores CML files in the customXml folder within the package. This directory contains pairs of files with names <strong>item[\d].xml</strong> and<strong> itemProps[\d].xml</strong> &#8211; itemProps[n] contains a list of all the namespaces and schemas used in item[n].</p>
<h3>Getting the CML out &#8211; the brute force extraction method</h3>
<p>The first method of extracting the CML files is the simplest. This method does not allow us to know anything more about the data other than it has been included somewhere in the document by the user. For example, we don&#8217;t know where and how it is being used in the document (or how many times). So, for the algorithm: iterate through all those files where the CML may be found, attempt to build each file as a XOM document, if it builds then search within it for a cml element from the cml namespace (see code below).</p>
<pre><code>import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;

import nu.xom.Builder;
import nu.xom.Document;

public class OOXMLTools {

  public static List&lt;Document&gt; GetCML(File file)
    throws ZipException, IOException  {

    ZipFile zipFile = new ZipFile(file);
    List&lt;Document&gt; list = new ArrayList&lt;Document&gt;();</code><code>
    Builder builder = new Builder();
</code><code>    Matcher m =
      Pattern.compile("customXml/item([1-9][0-9]*)\\.xml")
        .matcher("");

    for (Enumeration &lt;? extends ZipEntry&gt;
      entries = zipFile.entries(); entries.hasMoreElements();) {

      ZipEntry entry = entries.nextElement();
      if (m.reset(entry.getName()).matches()) {
        try {
          Document doc =
            builder.build(zipFile.getInputStream(entry));

          if (doc.query("//*[local-name()='cml' and
            namespace-uri()='http://www.xml-cml.org/schema']")
              .size() &gt; 0) {

            list.add(doc);
          }

        } catch (Exception e) {
          // not an XML file so can't be CML
        }
      }
    }
    return list;
  }
}
</code></pre>
<p>If you would like to try it out <a href='http://jat45.files.wordpress.com/2010/01/example.docx'>here</a> is a DOCX file with some chemistry in it. There are three chemistry zones in the document (containing testosterone [item1] and acetic acid [item3]) but only two CML files in the customXml directory because both testosterone instances point to the same backing CML file.</p>
<p>In following posts I will go further into how you can discover which representation is being used in the document, how many times a particular CML file is referenced and how the data is converted into the on screen representation.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=68&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2010/01/20/extracting-cml-from-a-chem4word-authored-document-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2010/01/ooxml-structure.png" medium="image">
			<media:title type="html">ooxml-structure</media:title>
		</media:content>
	</item>
		<item>
		<title>Post christmas lunch doodlings</title>
		<link>http://jat45.wordpress.com/2009/12/17/post-christmas-lunch-doodlings/</link>
		<comments>http://jat45.wordpress.com/2009/12/17/post-christmas-lunch-doodlings/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 11:49:02 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[pictures]]></category>
		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=56</guid>
		<description><![CDATA[The UCC had Christmas lunch on Monday and then members of the PMR group retired to the Pickerel for further enjoyment. Nick Day and I spent a little while doodling later in the evening and I have captured these for posterity. I should say that the major muse is someone who would be extremely gratified [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=56&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The UCC had Christmas lunch on Monday and then members of the PMR group retired to the Pickerel for further enjoyment. Nick Day and I spent a little while doodling later in the evening and I have captured these for posterity. I should say that the major muse is someone who would be extremely gratified to be sketched on beer mats as their favourite medium is currently the backs of paper plates.<br />
<div id="attachment_57" class="wp-caption aligncenter" style="width: 460px"><a href="http://jat45.files.wordpress.com/2009/12/img001.jpg"><img src="http://jat45.files.wordpress.com/2009/12/img001.jpg?w=450&#038;h=716" alt="face on woodforde&#39;s beer mat " title="unknown collaborative effort" width="450" height="716" class="size-full wp-image-57" /></a><p class="wp-caption-text">A collaborative effort started by Nick ... in fact I only added the beard.</p></div><br />
<div id="attachment_62" class="wp-caption aligncenter" style="width: 460px"><a href="http://jat45.files.wordpress.com/2009/12/img0021.jpg"><img src="http://jat45.files.wordpress.com/2009/12/img0021.jpg?w=450&#038;h=296" alt="The muse - on beer mat." title="The muse" width="450" height="296" class="size-full wp-image-62" /></a><p class="wp-caption-text">The muse - on beer mat.</p></div></p>
<div id="attachment_63" class="wp-caption aligncenter" style="width: 460px"><a href="http://jat45.files.wordpress.com/2009/12/img0031.jpg"><img src="http://jat45.files.wordpress.com/2009/12/img0031.jpg?w=450&#038;h=619" alt="The muse from the side - on beer mat." title="The muse from the side." width="450" height="619" class="size-full wp-image-63" /></a><p class="wp-caption-text">The muse from the side - on beer mat.</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=56&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/12/17/post-christmas-lunch-doodlings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2009/12/img001.jpg" medium="image">
			<media:title type="html">unknown collaborative effort</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2009/12/img0021.jpg" medium="image">
			<media:title type="html">The muse</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2009/12/img0031.jpg" medium="image">
			<media:title type="html">The muse from the side.</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Mercurial, VisualHG and Visual Studio 2008 together</title>
		<link>http://jat45.wordpress.com/2009/12/16/using-mercurial-visualhg-and-visual-studio-2008-together/</link>
		<comments>http://jat45.wordpress.com/2009/12/16/using-mercurial-visualhg-and-visual-studio-2008-together/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 21:48:48 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[tutorial]]></category>
		<category><![CDATA[walkthrough]]></category>
		<category><![CDATA[DCVS]]></category>
		<category><![CDATA[mercurial]]></category>
		<category><![CDATA[VisualHG]]></category>
		<category><![CDATA[VS2008]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=39</guid>
		<description><![CDATA[There is a strong desire in our group to move towards distributed version control systems specifically mercurial. As I spend most of my time working on the Chemistry Add-in for Word 2007 (Chem4Word) I have been using Visual Studio 2008. This doesn&#8217;t come with source control support out of the box &#8211; but you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=39&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There is a strong desire in our <a href="http://wwmm.ch.cam.ac.uk/wikis/wwmm/index.php/Main_Page">group</a> to move towards <a href="http://en.wikipedia.org/wiki/Distributed_revision_control">distributed version control systems</a> specifically <a href="http://mercurial.selenic.com/">mercurial</a>. As I spend most of my time working on the <a href="http://research.microsoft.com/en-us/projects/chem4word/">Chemistry Add-in for Word 2007</a> (Chem4Word) I have been using Visual Studio 2008. This doesn&#8217;t come with source control support out of the box &#8211; but you can (and we have) added on team foundation server support but this isn&#8217;t distributed and quite frankly sucked.</p>
<p>I have spent the last couple of days investigating other options and having got a good solution up and running thought I should share this with the world. This definitely isn&#8217;t meant to be an introduction to mercurial in general and I won&#8217;t be explaining all the terms (good intros are available from the <a href="http://mercurial.selenic.com/">mercurial website</a> and elsewhere). I will be giving both command line and GUI instructions.</p>
<h2>Installing VisualHG</h2>
<p>The instructions on the <a href="http://sharesource.org/project/visualhg/wiki/">VisualHG</a> site are pretty good &#8211; but you only need to go through the first three. Basically you need to download and install <a href="http://tortoisehg.bitbucket.org/">TortoiseHg</a> and then VisualHG.</p>
<p>Next make VisualHG the current active Source Control Plugin in Visual Studio 2008. <em><strong>&lt;Tools&gt; -&gt; &lt;Options&gt;</strong></em> -&gt; <em><strong>&lt;Source Control&gt;</strong></em>. Set the value of the drop-down list (Current Source Control plug-in) to <em><strong>&lt;VisualHG&gt;</strong></em>.</p>
<h2>How to create a new repository and add it to source control</h2>
<p>Open Visual Studio 2008 and create a new solution (in my case I went for a Console Application called <code>cs-walkthrough</code> under <code>C:\projects\c#</code> and I didn&#8217;t want a new directory for the solution)</p>
<p>In a command window change directory so you are in <code>cs-walkthrough</code>.</p>
<p><code>&gt;hg init</code></p>
<p>this will create the <code>.hg</code> directory</p>
<p>create a file called <code>.hgignore</code> as a sibling of the <code>.hg</code> directory the contents of the file should be:<br />
<code><br />
</code></p>
<blockquote><p>syntax: glob</p>
<p>*.csproj.user<br />
obj/<br />
bin/<br />
*.ncb<br />
*.suo<br />
_ReSharper.*<br />
*.resharper.user</p></blockquote>
<p>Create a project on <a href="http://bitbucket.org">bitbucket</a> with the same name as the solution (doesn&#8217;t have to be but will make things easier). So in this case I now have a publicly viewable repository on bitbucket <code>http://bitbucket.org/jat45/cs-walkthrough</code>.</p>
<p>Now create a file called <code>hgrc</code> under the <code>.hg</code> directory. This file should contain the following text:</p>
<blockquote><p>[paths]<br />
default = http://bitbucket.org/jat45/cs-walkthrough</p>
<p>[ui]<br />
username = Joe Townsend</p></blockquote>
<p>where <code>jat45</code> should be replaced with your bitbucket id and <code>cs-walkthrough</code> should be replaced by the name of the bitbucket repository you just created.</p>
<p>From here on in you can do everything either from the command line or from within Visual Studio. I will give both commands (to access the VisualHG commands right-click on any of the files in the solution). All the command line commands should be run from the <code>[cs-walkthrough]</code> directory.<br />
<code><br />
&gt;hg status</code></p>
<p style="text-align:center;"><img class="size-full wp-image-41 aligncenter" title="hg-status-1" src="http://jat45.files.wordpress.com/2009/12/hg-status-1.jpg?w=450" alt="hg status from the command line"   /></p>
<p>or <code>&lt;HG status&gt;</code> from VisualHG</p>
<p style="text-align:center;"><img class="size-full wp-image-42 aligncenter" title="hg-status-visual-1" src="http://jat45.files.wordpress.com/2009/12/hg-status-visual-1.jpg?w=450&#038;h=197" alt="hg status from VisualHG" width="450" height="197" /></p>
<p>We want all these files under source control so either use</p>
<p><code>&gt;hg add</code><br />
or select all the files from the GUI and click <code>Add</code> then close the window</p>
<p>To commit these additions either use<br />
<code>&gt;hg commit -m "initial commit"</code><br />
or commit using <code>&lt;HG Commit&gt;</code></p>
<p>Now push these changes to bitbucket</p>
<p><code>&gt;hg push</code><br />
or <code>&lt;HG Synchronize&gt;</code>(this will allow you to push, pull and see the incoming and outgoing changes).</p>
<h3>Warning</h3>
<p>Before committing or pushing changes you <strong><em>must</em></strong> make sure you build the solution first. This ensures that the <code>[project].csproj</code> file is correctly updated.</p>
<h2>Getting an existing project</h2>
<p>This is much easier than creating a new repository from scratch. Once again though we are back to the command line.</p>
<p>Change directory to the parent of where you would like the new project repository to be checked out to. In my case this is <code>c:\projects\c#</code>.</p>
<p>I am now going to get a clone of the cs-walkthough code from bitbucket but put it in a new location.</p>
<p><code>c:\projects\c#&gt;hg clone http://bitbucket.org/jat45/cs-walkthrough my-new-source-dir</code></p>
<p>You can use the same command because the project is public so you can access the source code but not commit.</p>
<p>So I think that is it. You can do all the usual, push, pull, diff and so on either from the command line or from the VisualHG add-in. The one only thing that must be done from the command line is the initial <code>clone</code> or <code>init</code>. I am also investigating if everything works in VS2010 &#8211; so far no problems but if I run into any I will update you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=39&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/12/16/using-mercurial-visualhg-and-visual-studio-2008-together/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2009/12/hg-status-1.jpg" medium="image">
			<media:title type="html">hg-status-1</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2009/12/hg-status-visual-1.jpg" medium="image">
			<media:title type="html">hg-status-visual-1</media:title>
		</media:content>
	</item>
		<item>
		<title>Using &#8220;using&#8221;</title>
		<link>http://jat45.wordpress.com/2009/11/05/using-using/</link>
		<comments>http://jat45.wordpress.com/2009/11/05/using-using/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:45:43 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=29</guid>
		<description><![CDATA[I presented my own code for review in the last PMR group meeting and thankfully came off very lightly. However Nick Day who is currently doing a lot of Clojure work picked me up on something. I had many lines of code similar to: XPathDocument xPathDocument = new XPathDocument(new StringReader(source)); and he was worried that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=29&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I presented my own code for review in the last PMR group meeting and thankfully came off very lightly. However Nick Day who is currently doing a lot of <a href="http://clojure.org">Clojure</a> work picked me up on something. I had many lines of code similar to:<br />
<code><br />
XPathDocument xPathDocument = new XPathDocument(new StringReader(source));<br />
</code><br />
and he was worried that I was not closing my string reader after use. After a bit of looking around I see that the code should be refactored into:<br />
<code>
<pre>
XPathDocument xPathDocument = null;
using (StringReader sr = new StringReader(source)) {
  xPathDocument = new XPathDocument(sr);
}
</pre>
<p></code><br />
This ensures that the StringReader can be disposed of as soon as it has been used to create the XPathDocument. I am not at all surprised that Nick would spot this as it reminds me of the first Clojure macro that I finally got &#8211; though that was for a HTTP request.</p>
<p>Of course I could always have done the more conventional (and Java like):<br />
<code><br />
StringReader sr = new StringReader(source);<br />
XPathDocument xPathDocument = new XPathDocument(sr);<br />
sr.Close();<br />
sr.Dispose();<br />
</code><br />
but I find the first way far more elegant and clear and it ensures that the resources are cleaned up no matter what &#8211; even if the creation of the XPathDocument throws exceptions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=29&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/11/05/using-using/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>
	</item>
		<item>
		<title>My Brain</title>
		<link>http://jat45.wordpress.com/2009/11/02/my-brain/</link>
		<comments>http://jat45.wordpress.com/2009/11/02/my-brain/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:45:10 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[pictures]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=22</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=22&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[
<a href='http://jat45.wordpress.com/2009/11/02/my-brain/its-your-head-2/' title='it&#039;s your head'><img data-attachment-id='25' data-orig-size='5081,6981' data-liked='0'width="109" height="150" src="http://jat45.files.wordpress.com/2009/11/its-your-head1.jpg?w=109&#038;h=150" class="attachment-thumbnail" alt="scan of my brain" title="it&#039;s your head" /></a>

<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=22&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/11/02/my-brain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>

		<media:content url="http://jat45.files.wordpress.com/2009/11/its-your-head1.jpg?w=109" medium="image">
			<media:title type="html">it&#039;s your head</media:title>
		</media:content>
	</item>
		<item>
		<title>Unchecked Conversion Warnings</title>
		<link>http://jat45.wordpress.com/2009/11/02/unchecked-conversion-warnings/</link>
		<comments>http://jat45.wordpress.com/2009/11/02/unchecked-conversion-warnings/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 14:30:07 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=17</guid>
		<description><![CDATA[This post is taken from an email sent round by Jim Downing following a PMR group code review meeting. The topic which caused the most problem was how to remove unchecked conversion warnings from eclipse which were greatly upsetting a few members of the group (not me). Primarily I just wanted to capture this for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=17&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This post is taken from an email sent round by <a href="http://jimdowning.wordpress.com/">Jim Downing</a> following a PMR group code review meeting. The topic which caused the most problem was how to remove unchecked conversion warnings from eclipse which were greatly upsetting a few members of the group (not me).</p>
<p>Primarily I just wanted to capture this for reference rather than keeping it in my inbox.</p>
<blockquote><p>Had a bit of a dig around the unchecked conversion issue.<br />
The solutions to the problem, in my opinion and in Miss World order: -</p>
<ol>
<li>
 I think the _worst_ thing to do is the default eclipse behaviour; adding @SuppressWarnings(&#8220;unchecked&#8221;) to the method declaration, since this will mask other warnings too, some of which can be much more severe than this one.
</li>
<li>The next worst thing to do is to suppress warnings by annotating the individual line. I dislike this one because the annotation is just distracting noisy cruft.
</li>
<li>Live with it. Stop your IDE whinging about it so much &#8211; the code will still compile.</li>
<li>The best solution is given in the answer at</li>
</ol>
<p><a href="http://stackoverflow.com/questions/367626/how-do-i-fix-the-expression-of-type-list-needs-unchecked-conversion/367673#367673">http://stackoverflow.com/questions/367626/how-do-i-fix-the-expression-of-type-list-needs-unchecked-conversion/367673#367673</a></p>
<p>The main point in the answer given above is that doing an unchecked conversion results in the <code>ClassCastException</code> coming from the guts of the compiled code somewhere, rather than from your code, which is a Bad Thing. So the best thing to do is: -</p>
<p>Rather than : -<br />
<code>List&lt;String&gt; whatYoudLike = foo.getUntypedList(); // Exception gets thrown from the guts of whatever the compile generates to do this.</p>
<p>for(String s: whatYoudLike) {<br />
//<br />
}</code></p>
<p>the best way to do it would be: -</p>
<p><code>for(Object o : foo.getUntypedList()) {<br />
String s = (String) o; // Exception gets thrown here if at all.<br />
//<br />
}</code></p>
<p>This approach can get a bit more verbose, but that is, I&#8217;m afraid, tough luck.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=17&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/11/02/unchecked-conversion-warnings/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>
	</item>
		<item>
		<title>First tentative steps in ClojureCLR</title>
		<link>http://jat45.wordpress.com/2009/08/27/first-tentative-steps-in-clojureclr/</link>
		<comments>http://jat45.wordpress.com/2009/08/27/first-tentative-steps-in-clojureclr/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 21:59:51 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[CML]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[clojure]]></category>

		<guid isPermaLink="false">http://jat45.wordpress.com/?p=13</guid>
		<description><![CDATA[Jim and Nick (Day) have been using Clojure for a while on various projects and all too frequently I have heard exclamations of delight when they find what would have been 100s of lines of Java can be done in two or three of Clojure. I have spent most of the past year writing in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=13&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimdowning.wordpress.com/">Jim </a>and Nick (Day) have been using <a href="http://clojure.org/">Clojure</a> for a while on various projects and all too frequently I have heard exclamations of delight when they find what would have been 100s of lines of Java can be done in two or three of Clojure. I have spent most of the past year writing in C# and just haven&#8217;t been able to join in, although it has been good to have break from Java.</p>
<p>One of the things to come out of the <a href="http://www.chem4word.com/">Chem4Word</a> project has been the idea of performing chemical changes via a stateless interface (CID &#8211; the Chemistry Interface Definition). This approach was strongly pushed by <a href="http://savas.me">Savas</a> and Jim (possibly as an excuse to learn yet another language). A stateless system lends itself beautifully to a functional language and as a bonus Clojure has both a CLR and JVM implementation so we can have a single definition which we can use on both platforms.</p>
<p>As a CompSci at Cambridge the first programming language you see is <a href="http://en.wikipedia.org/wiki/ML_%28programming_language%29">ML</a> &#8211; probably because it makes it fairly easy to work out the big O. So I have some fond memories of functional programming (though quite what aroma it would require to really take me back does not bear thinking about) and (conveniently) a need for it.</p>
<p>The <a href="http://wiki.github.com/richhickey/clojure-clr/installing-clojureclr">CLR implementation</a> is still fairly bleeding edge and the installation process reminded me of the bad old days of Open Source software. Still 3 hours into the process and I had my <a href="http://en.wikipedia.org/wiki/REPL">REPL</a> up and running and a function which would say Hello! not just to the world, but whoever happened to be passed to it. Tomorrow I shall be dusting off the ML part 1a handout by Larry Paulson (who broke off in lectures to teach us how to make bread the traditional way) and attempting any of the exercises I can find.</p>
<p>I&#8217;m looking forward to the<a href="http://jimdowning.wordpress.com/2009/08/27/cambridge-clojure-user-group-meeting/"> Cambridge Clojure user group meeting</a> and all this ML and functional talk means that a sneaky peak at F# over the long weekend is probably coming up too.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=13&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/08/27/first-tentative-steps-in-clojureclr/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>
	</item>
		<item>
		<title>Chem4Word logo and my own unit</title>
		<link>http://jat45.wordpress.com/2009/07/30/chem4word-logo-and-my-own-unit/</link>
		<comments>http://jat45.wordpress.com/2009/07/30/chem4word-logo-and-my-own-unit/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 22:55:55 +0000</pubDate>
		<dc:creator>jat45</dc:creator>
				<category><![CDATA[Semantic Enrichment]]></category>
		<category><![CDATA[chem4word]]></category>
		<category><![CDATA[fun]]></category>

		<guid isPermaLink="false">http://wwmm.ch.cam.ac.uk/blogs/townsend/?p=12</guid>
		<description><![CDATA[I realise that I have been quiet for a long time on here which is annoying because I have so much that I should be telling people &#8211; especially about Chem4Word . Luckily, PMR has been keeping the interest ticking over on his blog and there is always twitter for those quick messages. Speaking of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=12&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I realise that I have been quiet for a long time on here which is annoying because I have so much that I should be telling people &#8211; especially about <a title="Chem4Word" href="http://www.chem4word.com/" target="_blank">Chem4Word</a> . Luckily, PMR has been keeping the interest ticking over on his <a href="http://wwmm.ch.cam.ac.uk/blogs/murrayrust/">blog</a> and there is always twitter for those quick messages. Speaking of PMR &#8211; he and I have had many &#8220;robust discussion&#8221; sessions over the last few weeks (months) as we have been trying to define what semantic chemistry really is, how much is possible before release and what is absolutely necessary. It has sometimes felt like smacking a puppy.</p>
<p>As we near a release date (we have function freeze and are now bug fixing) I was thinking about the branding etc and realised that we don&#8217;t have a logo, favicon or anything so was wondering if anyone has any suggestions.</p>
<p>I have to get back to writing a paper but first of all I was pleased to discover (thanks to Helen) that there is a <a href="http://en.wikipedia.org/wiki/Townsend_%28unit%29">Townsend unit</a> (Td) but slightly less pleased that it is most important in gas discharge physics.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jat45.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jat45.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jat45.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jat45.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jat45.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jat45.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jat45.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jat45.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jat45.wordpress.com&amp;blog=9197105&amp;post=12&amp;subd=jat45&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jat45.wordpress.com/2009/07/30/chem4word-logo-and-my-own-unit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/77b486d8bad5602a4065ae98dcbc8c21?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jat45</media:title>
		</media:content>
	</item>
	</channel>
</rss>
