<?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>Feeding the Bit Bucket &#187; Uncategorized</title>
	<atom:link href="http://www.adrianmouat.com/bit-bucket/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adrianmouat.com/bit-bucket</link>
	<description>Software development thoughts and rants</description>
	<lastBuildDate>Mon, 09 Jan 2012 13:49:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Minimal TODOs for Linux</title>
		<link>http://www.adrianmouat.com/bit-bucket/2012/01/minimal-todos-for-linux/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2012/01/minimal-todos-for-linux/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 14:25:49 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=292</guid>
		<description><![CDATA[Up until now I&#8217;ve just used bits of paper for my TODO system. This has served me quite well, but the problem is that bits of paper are too easily lost or mislaid. So, after reading Minimally Awesome TODOs I wanted to set something similar up for my Ubuntu box. Minimally Awesome TODOs describes a [...]]]></description>
			<content:encoded><![CDATA[<p>Up until now I&#8217;ve just used bits of paper for my TODO system. This has served me quite well, but the problem is that bits of paper are too easily lost or mislaid. So, after reading <a href="http://blog.jerodsanto.net/2010/12/minimally-awesome-todos/">Minimally Awesome TODOs</a> I wanted to set something similar up for my Ubuntu box. Minimally Awesome TODOs describes a very simple TODO system for the Mac that displays your TODOs on the desktop. With a few tweaks, I got a very similar system working on Linux, which looks like this:</p>
<p style="text-align: center;"><a href="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2012/01/todo1.png"><img class="size-full wp-image-293 aligncenter" title="Snapshot of TODOs on Desktop" src="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2012/01/todo1.png" alt="" width="502" height="228" /></a></p>
<p>To add a todo you just use a simple terminal command:</p>
<p><code>$ todo example blog todo</code></p>
<p><a href="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2012/01/todo2.png"><img src="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2012/01/todo2.png" alt="" title="Desktop TODO with extra item" width="502" height="228" class="aligncenter size-full wp-image-299" /></a><br />
To complete a todo:</p>
<p><code>$ todone 3</code></p>
<p style="text-align: center;"><a href="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2012/01/todo1.png"><img class="size-full wp-image-293 aligncenter" title="Snapshot after TODO completion" src="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2012/01/todo1.png" alt="" width="502" height="228" /></a></p>
<p>It was pretty easy to port the system from Mac to Linux (I did it on Ubuntu Unity, but it should work for pretty much any Linux distro with a few minor changes) by following the instructions in the post and follow-up comments, but I&#8217;ll repeat them here to save others effort. Firstly, create the following shell scripts:</p>
<p><code><br />
$ cat /usr/local/bin/todo<br />
#!/bin/bash<br />
if [ $# == "0" ]; then cat $TODO; else n=$(($(tail -1 $TODO | cut -d ' ' -f 1) +1)); echo "$n ⇾ $@" >> $TODO; fi</p>
<p>$ cat /usr/local/bin/todone<br />
#!/bin/bash<br />
sed -i -e "/^$*/d" $TODO;<br />
</code></p>
<p><em>UPDATE: Improvements to these scripts can be found in the comments. Or, even better, try <a href="http://www.todotxt.com/">Todo .txt</a>, which has a similarly minimalist interface but some more advanced features. There is also a page on <a href="https://github.com/ginatrapani/todo.txt-cli/wiki/linux-with-conky">setting it up with conky</a>, similar to what is done below. (I found that I had to rename <code>todo.cfg</code> to <code>config</code> to get Todo .txt to work correctly though). Thanks to Fred for suggesting Todo .txt.<br />
</em></p>
<p>Remember to set them to be executable (<code>chmod +x /usr/local/bin/todo</code>). You then need to set a <code>TODO</code> environment variable to wherever you want to keep your TODO file (i.e. add something like <code>export TODO=~/todo.txt</code> to your <code>.profile</code>). If you want to sync your TODOs over several machines, you could point it to a dropbox folder or similar.</p>
<p>For the next step, you need to install <a href="http://conky.sourceforge.net/">conky</a>, a utility for displaying info (more normally system monitor stuff) on the desktop (you should be able to grab this from your package manager). To get the same set-up as me, use the <code>.conkyrc</code> in this <a href="https://gist.github.com/1572195">gist</a> &#8211; I had to play around with the basic config to get it to display properly in Unity, you may face different problems in other window managers.</p>
<p>Finally, you should set conky to run on startup &#8211; in Ubuntu just open Startup Applications and add it to the list.</p>
<p>I can&#8217;t take credit for any of this stuff, all I did was put together a bunch of hints from the internet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2012/01/minimal-todos-for-linux/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>XPathGen Released</title>
		<link>http://www.adrianmouat.com/bit-bucket/2012/01/xpathgen-released/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2012/01/xpathgen-released/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 21:24:44 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=280</guid>
		<description><![CDATA[I&#8217;ve just released XPathGen, a simple utility class for generating XPath paths that uniquely identify DOM Nodes in Java. For example: Document testDoc = createDocument( "&#60;a&#62;aa&#60;b attr='test'&#62;b&#60;!-- comment --&#62;c&#60;c/&#62;&#60;/b&#62;d&#60;/a&#62;"); //Grab text node "aa" Node aa = testDoc.getDocumentElement().getFirstChild(); System.out.println(XPathGen.getXPath(aa)); //Should print "/node()[1]/node()[1]" I pulled this code out of diffxml and re-licensed it under the Apache licence, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released <a href="https://github.com/amouat/XPathGen">XPathGen</a>, a simple utility class for generating XPath paths that uniquely identify DOM Nodes in Java.</p>
<p>For example:</p>
<p><code>Document testDoc = createDocument(<br />
                "&lt;a&gt;aa&lt;b attr='test'&gt;b&lt;!-- comment --&gt;c&lt;c/&gt;&lt;/b&gt;d&lt;/a&gt;");</p>
<p>//Grab text node "aa"<br />
Node aa = testDoc.getDocumentElement().getFirstChild(); </p>
<p>System.out.println(<b>XPathGen.getXPath(aa)</b>);<br />
//Should print "/node()[1]/node()[1]"<br />
</code></p>
<p>I pulled this code out of <a href="http://diffxml.sourceforge.net">diffxml</a> and re-licensed it under the Apache licence, so that it can be used more freely.</p>
<p>(This was mainly prompted by <a href="http://stackoverflow.com/questions/8417328/java-how-do-i-get-an-xpath-for-a-org-w3c-dom-node">this StackOverflow question</a>).</p>
<p>Grab it from <a href="https://github.com/amouat/XPathGen">github</a> if you&#8217;re interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2012/01/xpathgen-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An Intro to Lisp Editors and IDEs</title>
		<link>http://www.adrianmouat.com/bit-bucket/2011/12/an-intro-to-lisp-editors-and-ides/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2011/12/an-intro-to-lisp-editors-and-ides/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 15:58:10 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=254</guid>
		<description><![CDATA[(or Lisp IDEs where for art thou revisited) A while ago I wrote a post berating the lack of full-blown IDEs available for the various Lisp languages (cue the sound of Emacs fanboys sharpening their knives in the background ;) ). To some degree I regret that post, as although its popularity proved it hit [...]]]></description>
			<content:encoded><![CDATA[<h3><em>(or Lisp IDEs where for art thou revisited)</em></h3>
<p>A while ago I wrote <a href="http://www.adrianmouat.com/bit-bucket/2011/01/lisp-ides-where-for-art-thou/">a post berating the lack of full-blown IDEs</a> available for the various Lisp languages (cue the sound of Emacs fanboys sharpening their knives in the background ;) ). To some degree I regret that post, as although its popularity proved it hit something of nerve, it was basically a whine that lacked helpful or insightful comment. </p>
<p>Whilst my views haven&#8217;t substantially changed, in this post I thought I&#8217;d try to put things right by compiling some advice to people who want to edit Lisp for the first time.</p>
<h3>In the beginning was the REPL</h3>
<p>To begin with <em>forget</em> about the editor or IDE. Just use whatever simple text editor you are used to in conjunction with the REPL, whether this is Notepad, gedit, nano or Vim (or, yes, Emacs). Don&#8217;t even worry about syntax highlighting etc if you are just trying out a few simple examples. Most Lisps come with a pretty decent REPL, especially CLISP and to a lesser degree SBCL and Clojure<sup><a href="http://www.adrianmouat.com/bit-bucket/2011/12/an-intro-to-lisp-editors-and-ides/#footnote_0_254" id="identifier_0_254" class="footnote-link footnote-identifier-link" title="If you&amp;#8217;re getting started with Clojure, I recommend using leiningen to install Clojure and launch the REPL, but at least make sure you install JLine or rlwrap to improve the basic REPL. There also seems to be some work on a more advanced Clojure REPL called nREPL.">1</a></sup>.</p>
<p>Get used to typing in simple functions and testing things out directly in the REPL. Once you start wanting to save your work, just learn your Lisp&#8217;s command to load files (e.g. <code>(load 'filename.lsp')</code> in SBCL or <code>(load-file 'filename.clj')</code> in Clojure) and use this to in-directly interface with your text editor. This should actually provide you with quite a friendly environment, where it is quick and easy to build your code up and try out changes in the REPL.</p>
<h3>Next Steps</h3>
<p>The advantages a more integrated Lisp editor will bring you are things like syntax highlighting, code formatting and an integrated REPL with the ability to evaluate single expressions at a time rather than whole files. More advanced environments (notably Emacs) will include debuggers and other tools.</p>
<p>Unfortunately, there a few options to pick from here and they are not all equal. If you already know (and like?) Emacs, your decision is easy and you just need to look at some documentation on getting slime and paredit set-up. Emacs is probably the most common and perhaps the most powerful setup. The disadvantage is needing to learn Emacs, although there are some packages designed to make this a little easier, such as <a href="http://common-lisp.net/project/lispbox/">lispbox</a> and <a href="http://aquamacs.org/">aquamacs</a> (Mac only). </p>
<p>If you know Vi or Vim, the <a href="http://kovisoft.bitbucket.org/tutorial.html">slimv</a> plug-in has progressed very nicely and provides most of the  functionality of its Emacs cousin, although I find the modal editing of Vi can make using the REPL a little awkward.</p>
<p>If you&#8217;re used to IDEs such as Visual Studio or Eclipse and would rather not leave their cosy warmth, you are in for a rougher ride. The best I have found so far is <a href="http://code.google.com/p/counterclockwise/">counterclockwise</a>, a Clojure plug-in for Eclipse. There are Eclipse plug-ins for other Lisps, but all the ones I found were abandoned and/or buggy (this has possibly since changed but my experience was bad enough that I don&#8217;t want to revisit it). There is also <a href="http://www.lispworks.com/downloads/index.html">LispWorks</a>, which looks good, but note that there are significant restrictions on the free (as in beer) version (mainly that you can only use for up to 5 hours <del datetime="2011-12-23T11:09:47+00:00">a day</del> per session). In most cases it seems you are best advised to bite the bullet and learn Emacs.</p>
<h3>Racket</h3>
<p>A final honourable mention needs to go to <a href="http://racket-lang.org/">Racket</a>, which includes its own IDE, DrRacket. This seems to be a really nice environment for learning in. If you just want to play around with functional programming, this might be exactly what you are looking for &#8212; it comes with a great tutorial which gets the user playing with graphics primitives directly in the REPL (circle, rectangle etc). However, if you want to use a different type of Lisp, you will need to consider the above choices.</p>
<p>I believe that this covers the main choices, although there were some other suggestions in the comments to the previous blog. Again, the main take-away should be not to worry about IDEs at first. Just get started with the REPL and a text editor and put off the IDE question till later.</p>
<ol class="footnotes"><li id="footnote_0_254" class="footnote">If you&#8217;re getting started with Clojure, I recommend using <a href="https://github.com/technomancy/leiningen#readme">leiningen</a> to install Clojure and launch the REPL, but at least make sure you install JLine or rlwrap to improve the basic REPL. There also seems to be some work on a more advanced Clojure REPL called <a href="https://github.com/clojure/tools.nrepl">nREPL</a>.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2011/12/an-intro-to-lisp-editors-and-ides/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>On Code Quality</title>
		<link>http://www.adrianmouat.com/bit-bucket/2011/08/on-code-quality/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2011/08/on-code-quality/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 17:33:01 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=249</guid>
		<description><![CDATA[As part of the Enhanced Visual OGSA-DAI Workbench project, I&#8217;ve been asked to keep a developer&#8217;s blog. My latest article in this series is titled On Code Quality, where I investigate what it means to write good code.]]></description>
			<content:encoded><![CDATA[<p>As part of the <a href="http://sourceforge.net/apps/wordpress/ogsa-dai/2011/07/27/an-enhanced-visual-workbench-for-ogsa-dai/">Enhanced Visual OGSA-DAI Workbench</a> project, I&#8217;ve been asked to keep a developer&#8217;s blog. My latest article in this series is titled <a href="http://sourceforge.net/apps/wordpress/ogsa-dai/2011/08/22/on-code-quality/">On Code Quality</a>, where I investigate what it means to write good code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2011/08/on-code-quality/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Common Lisp, Clojure and Evolution</title>
		<link>http://www.adrianmouat.com/bit-bucket/2011/02/common-lisp-clojure-and-evolution/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2011/02/common-lisp-clojure-and-evolution/#comments</comments>
		<pubDate>Sun, 27 Feb 2011 11:08:31 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=175</guid>
		<description><![CDATA[After my last post about Lisp IDEs, I decided to use Clojure and the Counter-Clockwise Eclipse plug-in as I continued working my way through Land of Lisp. This turned out to be a good move, as the effort of porting to Clojure forced me to really understand how the games worked and highlighted a lot [...]]]></description>
			<content:encoded><![CDATA[<p>After my last post about <a href="http://www.adrianmouat.com/bit-bucket/2011/01/lisp-ides-where-for-art-thou/">Lisp IDEs</a>, I decided to use <a href="http://clojure.org/">Clojure</a> and the <a href="http://code.google.com/p/counterclockwise/">Counter-Clockwise Eclipse plug-in</a> as I continued working my way through <a href="http://landoflisp.com/">Land of Lisp</a>. This turned out to be a good move, as the effort of porting to Clojure forced me to really understand how the games worked and highlighted a lot of the differences between Common Lisp and Clojure. Before this, I hasn&#8217;t appreciated how close Clojure is to a traditional Lisp. This post shares my findings from translating the &#8220;Evolution&#8221; example in Land of Lisp into Clojure. This post assumes a basic familiarity with Lisp style code. As I&#8217;m still very much a beginner at this stuff, please feel free to post any suggested improvements or point out mistakes.</p>
<p><em>TL;DR: Clojure is very close to Common Lisp but has several minor syntactical differences, some bigger differences in macros, support for more intrinsic types, Java integration and, perhaps most significantly, a programming model that encourages a more functional style of development and is designed to support concurrency.<br />
</em></p>
<p>&#8220;Evolution&#8221; attempts to simulate a very simple world where animals roam in directions dictated by their genes, eating food and reproducing asexually. Reproductions cause random changes to genes and hence the movement of animals. The center of the game world has more food resources than the rest, which means we can expect different types of animal to evolve in the middle than the rest of the world. It&#8217;s apparently based on article by A.K. Dewdney: &#8220;Simulated evolution: wherein bugs learn to hunt bacteria&#8221; (searching for this will find you some interesting resources). Full source code for the Common Lisp version is in the book as well as on the <a href="http://landoflisp.com/evolution.lisp">Land of Lisp website</a>, the Clojure version is available on <a href="https://github.com/amouat/Evolution-in-Clojure/blob/master/evolve.clj">github</a>.</p>
<p><em>UPDATE: the above github link is to the latest version of the code, the first version is <a href="https://github.com/amouat/Evolution-in-Clojure/blob/1c37c88e2a642babbf1e48988c63afdf8c0250d0/evolve.clj">available here</a>. Both the post and code have been updated to reflect changes suggested in comments.</em></p>
<p>We start off by defining some parameters for the game world, which is almost identical in both versions. For example, defining the <code>*width*</code> parameter in Common Lisp:</p>
<pre class="brush: clisp; title: ; notranslate">
(defparameter *width* 100)
</pre>
<p>And in Clojure:</p>
<pre class="brush: clojure; title: ; notranslate">
(def *width* 100)
</pre>
<p>However, we almost immediately stumble upon a more important difference when we try to create a hash-set to store the location of plants in the game-world. In Common Lisp, hash-sets are faked using hash-tables where the value stored is unimportant (we are only interested if the key exists in the table, not what its value is). The Evolution example uses the following code to add plants to the game world at a random location:</p>
<pre class="brush: clisp; title: ; notranslate">
(defparameter *plants* (make-hash-table :test #'equal))

(defun random-plant (left top width height)
   (let ( (pos (cons (+ left (random width))
                     (+ top (random height)))))
        (setf (gethash pos *plants*) t)))
</pre>
<p>The position of the plant in the game world is the key and true (<code>t</code> in Common Lisp) is used as the value. Note the use of the <code>equal</code> method for testing equality rather than <code>eq</code> (so that the contents of the con cells are compared rather than testing if they are the same cons cell). In Clojure we can achieve something similar like this:</p>
<pre class="brush: clojure; title: ; notranslate">
(def *plants* (ref #{}))

(defn random-plant [left top width height]
  (let [pos (list (+ left (rand-int width))
                  (+ top (rand-int height)))]
    (dosync (alter *plants* conj pos)))))
</pre>
<p>In Clojure, if you want to modify something, you instead point to it using a <code>ref</code> which can be changed to point at a different &#8220;thing&#8221; (refs are the one of the few things in Clojure that are allowed to mutate). All modification of refs must be synchronised in &#8220;transactions&#8221; such as the <code>dosync</code> method. This marks a fundamental difference between the languages; Clojure programmers are forced to think up-front about parallelism and are almost ushered down a more functional path. The <code>#{}</code> is just shorthand for an empty hash-set (Clojure has a intrinsic support for more data structures than just lists). Also, in this case, we don&#8217;t need to worry about the <code>equals</code> method in Clojure — the default does what we need. Other minor differences are the use of square brackets for function arguments (which helps make things more readable), <code>random</code> becoming <code>rand-int</code> and using <code>list</code> to create a new list rather <code>cons</code> (which appears trivial, but points towards a slightly bigger difference in how lists are constructed in Common Lisp and Clojure).</p>
<p>Creating the list of animals and populating with the first animal also has a few differences. In Common Lisp:</p>
<pre class="brush: clisp; title: ; notranslate">
(defstruct animal x y energy dir genes)

(defparameter *animals*
    (list (make-animal :x      (ash *width*  -1)
                       :y      (ash *height* -1)
                       :energy 1000
                       :dir    0
                       :genes  (loop repeat 8
                                     collecting (1+ (random 10))))))
</pre>
<p>And in my Clojure version:</p>
<pre class="brush: clojure; title: ; notranslate">
(defstruct animal :x :y :energy :dir :genes)

(def *animals*
  (list (struct animal
          (round (/ *width* 2)) ; x
          (round (/ *height* 2)) ; y
          1000 ; energy
          0 ; dir
          (loop [genes [] i 8]
            (if (zero? i)
              genes
              (recur (conj genes (+ 1 (rand-int 10))) (dec i)))))))
</pre>
<p>Note that Conrad uses the <code>ash</code> function to do division. Personally, I would only use <code>ash</code> when I was doing bitwise operations or if it provided a large performance increase on a time-sensitive section of code, as I feel it obscures the meaning of the code slightly. Clojure does have the <code>bit-shift-left</code> and <code>bit-shift-right</code> operations to provide similar functionality but I decided to use the standard division operator instead. (Conrad later told me that he used <code>ash</code> to avoid using <code>round</code> which would have required him to explain about returning multiple values from a single Lisp function).</p>
<p>More interestingly, the <code>loop</code> construct is considerably different. The <code>loop</code> macro is a lot simpler in Clojure (it&#8217;s little more than a <code>recur</code> binding), so we need a little more coding to achieve the same effect as Common Lisp (in particular, Clojure has no <code>collecting</code> keyword). However, comments on this post showed me that this could be better written as:</p>
<pre class="brush: clojure; title: ; notranslate">
(def *animals*
  (list {:x (round (/ *width* 2))
         :y (round (/ *height* 2))
         :energy 1000
         :dir 0
         :genes (vec (repeatedly 8 #(inc (rand-int 10))))}))
</pre>
<p>Which gets rid of the unnecessary use of structs (plain maps are easier here) and generates the random genes in a cleaner, more concise way.</p>
<p>At the next point, my Clojure code takes a significant departure from the Common Lisp. The Common Lisp function for moving animals in the game world looks like:</p>
<pre class="brush: clisp; title: ; notranslate">
(defun move (animal)
  (let ( (dir (animal-dir animal))
        (x (animal-x animal))
        (y (animal-y animal)))
    (setf (animal-x animal)
        (mod (+ x
                    (cond ( (and (&gt;= dir 2) (&lt; dir 5)) 1)
                           ( (or (= dir 1) (= dir 5)) 0)
                          (t -1))
                     *width*)
                     *width*))
    (setf (animal-y animal)
        (mod (+ y
                    (cond ( (and (&gt;= dir 0) (&lt; dir 3)) -1)
                           ( (and (&gt;= dir 4) (&lt; dir 7)) 1)
                           (t 0))
                    *height*)
                    *height*))
    (decf (animal-energy animal))))
</pre>
<p>And my Clojure looks like:</p>
<pre class="brush: clojure; title: ; notranslate">
(defn move [{:keys [x y dir] :as animal}]
    {:x (mod (+ x
             (cond
               (and (&gt;= dir 2) (&lt; dir 5)) 1
               (or (= dir 1) (= dir 5)) 0
               :else -1)) ; note clojure has else form and less ()s
        *width*)
      :y (mod (+ y
             (cond (and (&gt;= dir 0) (&lt; dir 3)) -1
               (and (&gt;= dir 4) (&lt; dir 7)) 1
               :else 0))
        *height*)
      :energy (dec (:energy animal))
      :dir (:dir animal)
      :genes (:genes animal)}) ; return new animal rather than change given
</pre>
<p>Movement is calculated by using an animals &#8220;dir&#8221; which is integer representing a direction (0 is up-left, 1 is up, 2 is up-right etc).</p>
<p>The fundamental difference between the versions is that I decided not to directly change the animal in the function argument, but instead to return a new animal representing the animals location. This meant I could avoid worrying about refs and also let me play with programming in a more pure functional manner. Some other minor points:</p>
<ul>
<li>Clojure can use <i>destructuring</i> to bind symbols to parts of parameter lists in functions or let bindings. This allows us to use <code>x</code>, <code>y</code> and <code>dir</code> directly rather than have to extract it from the map each time.</li>
<li>When we do want to pull bits out of structs/maps, it works a little differently; in Clojure you can use the key directly as a method (e.g. (<code>:energy orig</code>) whereas Common Lisp generates methods like <code>animal-energy</code></li>
<li>The Clojure version of the cond macro has less brackets than the Common Lisp and an <code>else</code> keyword.</li>
<li>I removed the unneeded addition of <code>*width*</code> and <code>*height*</code> before calling <code>mod</code> (I think this intended to avoided negative results from <code>mod</code>, but both the Clojure and Common Lisp version of <code>mod</code> return the sign of the <i>divisor</i> not the <i>dividend</i> i.e. <code>(mod -1 4)</code> is 3. (This was pointed out to me by a <a href="http://www.reddit.com/r/lisp/comments/ftng6/common_lisp_clojure_and_evolution/c1iq934">commenter on reddit</a>).</li>
</ul>
<p>The <code>eat</code> method, which simulates an animal eating any plants in its current location, also contains a few interesting differences. In Common Lisp we have:</p>
<pre class="brush: clisp; title: ; notranslate">
(defun eat (animal)
  (let ( (pos (cons (animal-x animal) (animal-y animal))))
    (when (gethash pos *plants*)
      (incf (animal-energy animal) *plant-energy*)
      (remhash pos *plants*))))
</pre>
<p>Whereas my Clojure version looks like:</p>
<pre class="brush: clojure; title: ; notranslate">
(defn eat [{:keys [x y energy] :as animal}]
  (let [pos (list x y)]
    (dosync
      (if (contains? @*plants* pos)
        (do
          ; get rid of the plant first
          (alter *plants* disj pos)
          ; so we can return the updated animal
          (assoc animal :energy (+ energy *plant-energy*)))
        animal))))
</pre>
<p>(Or at least it does after I fixed the concurrency error pointed out by cgrand).</p>
<p>The code for checking for existence of a plant at the animal&#8217;s location is fairly similar, but note that Clojure needs to dereference the hash-map using <code>@</code> and uses the <code>contains?</code> predicate rather than getting the value in the hash-table. In Clojure I needed to remove the plant first (which is a side-effect) before returning the updated animal. Removing the plant in Clojure is a little more complicated — rather than just calling <code>remhash</code>, I need to set the <code>*plants*</code> reference to a new hash-map which is the &#8220;disjoint&#8221; of the old hash-map and the position of the eaten plant. Whilst the Common Lisp version can just increment the energy of the animal (another side-effect), the Clojure version creates a new animal which is the same as the old animal, except with its energy increased, thorugh use of the <code>assoc</code> function. </p>
<p>The <code>reproduce</code> function (which I haven&#8217;t reproduced for brevity) was modified in a similar way, most notably to return a list of all animals including the new animal rather than inserting directly into animal list (which isn&#8217;t mutable in my version). The <code>update-world</code> function was also modified to be more functional, taking an animal list as input and returning an updated list. The Clojure version uses <code>#</code> as shorthand for an anonymous function rather than <code>lambda</code>. <code>flatten</code> is needed so that we keep all the animals in a single list rather have lists of lists.</p>
<p>The <code>draw-world</code> method (also not reproduced) doesn&#8217;t contain any interesting new differences, but was the source of a bug for a long time — turns out if you do <code>print "\n"</code> instead of <code>println</code> in Clojure, the output buffer won&#8217;t be flushed properly. Also worth noting is that Clojure uses <code>first</code> and <code>rest</code> instead of <code>car</code> and <code>cdr</code>, as you can see if you look at the code for the <code>turn</code> function.</p>
<p>The final function we&#8217;ll look at is the one that holds it all together and runs the simulation in response to user input. The idea is that the user can enter a number of time-steps to process or just hit enter to process a single step. The original Common Lisp code looks like this:</p>
<pre class="brush: clisp; title: ; notranslate">
(defun evolution ()
  (draw-world)
  (fresh-line)
  (let ( (str (read-line)))
    (cond ( (equal str &quot;quit&quot;) ())
          (t (let ( (x (parse-integer str :junk-allowed t)))
               (if x
                   (loop for i
                      below x
                      do (update-world)
                      if (zerop (mod i 1000))
                      do (princ #\.))
                   (update-world))
               (evolution))))))
</pre>
<p>And my, not quite equivalent, Clojure code looks like this:</p>
<pre class="brush: clojure; title: ; notranslate">
(defn parseInput [x]
  (try (Integer/parseInt x) (catch Exception e 0)))

(defn evolution [animals]
  (do
    (draw-world animals @*plants*)
    (println) ; don't do 'print &quot;\n&quot;' or 'newline' as won't flush
    (let [line (read-line)] ;str is a function in clojure
      (cond (= line &quot;quit&quot;) ()
        (= line &quot;p&quot;) (do (println animals) (evolution animals))
        :else (evolution
                (let [x (parseInput line)]
                  (nth (iterate update-world animals) (inc x))))))))
</pre>
<p>Again, there are variations caused by differences in the <code>loop</code> macro (here we use <code>iterate</code> instead) and my decision to keep the animals list immutable. Also, I didn&#8217;t implement outputting a &#8220;<code>.</code>&#8221; every 1000 steps. However, the most interesting change is in the way input is parsed. Clojure doesn&#8217;t have the <code>parse-integer</code> function, but I was quickly able to implement something that did the job by calling out to the Java <code>parseInt</code> method. If the <code>parseInt</code> method throws an exception, we just return 0 instead which will run the simulation for 1 time step. It&#8217;s worth noting how concise this bit of code is (how many lines would the equivalent Java be?).</p>
<p>Out of all of these differences, the most important ones are the Java integration and the support for concurrency, with intrinsic support for more types of collections somewhere slightly behind. The Java integration wasn&#8217;t forefront in this article, but I was able to use it to quickly create a parse method that did what I needed. Having a large, tested and useful library is one of the most important requirements for a general purpose language if it is to gain uptake with the average developer. The concurrency support also didn&#8217;t really come out in this article (although you were introduced to <code>dosync</code> and <code>ref</code>s), but it seems to offer a relatively simple path to scalability; I hope to play more with Clojure&#8217;s concurrency model and see if this really is the case and see what sort of speed-up is possible at what cost to simplicity (possibly I&#8217;ll try to write an agent based version of the simulation à la <a href="http://blip.tv/file/812787">Rich Hickey&#8217;s ants demo</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2011/02/common-lisp-clojure-and-evolution/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Lisp IDEs (where for art thou?)</title>
		<link>http://www.adrianmouat.com/bit-bucket/2011/01/lisp-ides-where-for-art-thou/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2011/01/lisp-ides-where-for-art-thou/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 12:13:20 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=162</guid>
		<description><![CDATA[﻿Lately, I&#8217;ve been trying to learn Lisp, working my way through the great &#8220;Land of Lisp&#8221; book by Conrad Barski. One of the first things Conrad tells you to do is to install CLISP, and explains a bit about the REPL. This is all well and good, but not a word is said about using a text-editor or [...]]]></description>
			<content:encoded><![CDATA[<p>﻿Lately, I&#8217;ve been trying to learn Lisp, working my way through the great <a href="http://landoflisp.com/">&#8220;Land of Lisp&#8221; book by Conrad Barski</a>. One of the first things Conrad tells you to do is to install <a href="http://clisp.cons.org/">CLISP</a>, and explains a bit about the REPL. This is all well and good, but not a word is said about using a text-editor or IDE, leaving the user to figure out for themselves how to save their programs. I think the reason for this is simple: Conrad&#8217;s book is about Lisp and he doesn&#8217;t want to spend time explaining how to use Emacs &#8211; which seems to be the only serious free choice for Lisp programming.</p>
<p>Not being an Emacs user, I tried a few different possibilities. I tried to get the impressive sounding <a href="http://www.vim.org/scripts/script.php?script_id=2531">slimv Vim plug-in</a> working, but had no joy. I <em>think</em> the issue was that I was using Windows and needed to install some more python (yes, <em>python</em>) libs, but the lack of error messages made me wonder if I was wasting my time. This plug-in also won&#8217;t appeal to anyone who doesn&#8217;t want to invest in learning vi.</p>
<p>After giving up on slimv, I tried the CUSP plug-in for Eclipse. This plug-in pleasantly surprised me, given that the web pages for it don&#8217;t inspire confidence. It worked straight away on my Windows box, providing a decent REPL/editor integration. However, it does have a few issues:</p>
<div>
<ul>
<li>It&#8217;s tied to <a href="http://sbcl.sourceforge.net/">SBCL</a> rather than allowing you to choose a Lisp implementation (and it currently uses an old version of SBCL)</li>
<li>There seems to be two &#8220;official&#8221; webpages; one at <a href="http://sergeykolos.com/cusp/intro/">sergeykolos.com</a> and one at <a href="http://www.bitfauna.com/projects/cusp/cusp.htm">www.bitfauna.com</a>, neither of which really inspire confidence. Sergey Kolos&#8217;s site includes an Eclipse update site for installing straight from Eclipse, but it seems to be older than the download from bitfauna, despite suggestions on the bitfauna page to the contrary.</li>
<li>I&#8217;m having problems getting it to work under Linux currently.</li>
</ul>
</div>
<p>There is another Eclipse plug-in called <a href="http://sourceforge.net/projects/dandelion-ecl/">Dandelion</a> which claims to work with both CLISP and SBCL, but I never managed to get it to connect to the REPL and had problems with the text-editor hanging.</p>
<p>A few more options are hinted at by this <a href="http://stackoverflow.com/questions/232486/best-common-lisp-ide">stackoverflow question</a>, but none of them look very promising, with the exception of Emacs.</p>
<p>This leaves newcomers to Lisp with the following choices:</p>
<div>
<ul>
<li>learn Emacs (boo!)</li>
<li>pound an Eclipse plug-in into submission and ignore/work-around any shortcomings</li>
<li>use a standard text editor and figure out the best way to communicate with a REPL</li>
<li>pay for <a href="http://www.lispworks.com/products/lispworks.html">LispWorks</a> or use the crippled &#8220;Personal&#8221; edition.</li>
</ul>
</div>
<p>Which isn&#8217;t the greatest set of choices. Why is this the case for a programming language with such a long and illustrious history?</p>
<p>If you&#8217;re considering learning Lisp, this may well present a considerable dilemma to you. If you don&#8217;t want to learn Emacs (and why should you have to?), I suggest trying CUSP. I also just found the <a href="https://bitbucket.org/skolos/lispdev/wiki/Home">Lispdev</a> fork of CUSP, which I&#8217;m hoping may solve some of the issues with CUSP.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2011/01/lisp-ides-where-for-art-thou/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>The programming equivalent of &#8220;a long stand&#8221;</title>
		<link>http://www.adrianmouat.com/bit-bucket/2010/05/the-programming-equivalent-of-a-long-stand/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2010/05/the-programming-equivalent-of-a-long-stand/#comments</comments>
		<pubDate>Mon, 31 May 2010 19:27:16 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=148</guid>
		<description><![CDATA[Builders apprentices often get sent on pointless endeavours, such as going for &#8220;a long stand&#8221;, &#8220;tartan paint&#8221; or a &#8220;sky hook&#8221;. I think I saw the programming equivalent today &#8211; proving that a GUID is not unique. The poor programmer does get a bit much stick, but he has just tried to write a loop [...]]]></description>
			<content:encoded><![CDATA[<p>Builders apprentices often get sent on pointless endeavours, such as going for &#8220;a long stand&#8221;, &#8220;tartan paint&#8221; or a &#8220;sky hook&#8221;.</p>
<p>I think I saw the programming equivalent today &#8211; <a href="http://stackoverflow.com/questions/1705008/simple-proof-that-guid-is-not-unique">proving that a GUID is not unique</a>.</p>
<p>The poor programmer does get a bit much stick, but he has just tried to write a loop that will take 10790283070806014188970 years to compute. He then asks if using multiple threads will help solve his problem&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2010/05/the-programming-equivalent-of-a-long-stand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clojure Resources</title>
		<link>http://www.adrianmouat.com/bit-bucket/2010/05/clojure-resources/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2010/05/clojure-resources/#comments</comments>
		<pubDate>Thu, 13 May 2010 20:03:00 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=136</guid>
		<description><![CDATA[I&#8217;ve recently been learning Clojure, a form of Lisp that runs on the JVM.  There are already a lot of resources about Clojure on the internet, but they vary in depth and usefulness. Therefore, I&#8217;ve compiled a bit of an overview of the various resources, in the hope that it helps the new Clojure (and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently been learning <a href="http://www.clojure.org">Clojure</a>, a form of Lisp that runs on the JVM.  There are already a lot of resources about Clojure on the internet, but they vary in depth and usefulness. Therefore, I&#8217;ve compiled a bit of an overview of the various resources, in the hope that it helps the new Clojure (and Lisp) programmer get started:</p>
<ul>
<li> Why you might want to consider learning/using Clojure is concisely covered by <a href="http://clojure.org/rationale">Rich Hickey here</a>.</li>
<li>One of the first decisions you will face is which editor to use. Unfortunately, this isn&#8217;t necessarily an easy decision. Clojure and Lisp programmers typically use a REPL to interact with their programs as they are writing them. You want your editor to have some level of integration with a Clojure REPL. This <a href="http://www.assembla.com/wiki/show/clojure/Getting_Started">Getting Started</a> resource covers most of the common choices. It&#8217;s probably worth saying that Emacs offers one of the most mature and powerful environments and is a good choice if you are already comfortable with the editor. If you&#8217;re on Windows, <a href="http://clojure.bighugh.com/">Clojure Box</a> offers a quick way to get started with Clojure and Emacs. Personally, I&#8217;ve tried  the Eclipse plug-in <a href="http://code.google.com/p/counterclockwise/">counter-clockwise</a>, but had some problems with it and I currently use Vim set-up according to<a href="http://writequit.org/blog/?p=386"> this guide at write-quit</a>. (I see counter-clockwise has had a new release since I tested it, so it may well be worth revisiting).</li>
<li>Once you have your environment set up, you will probably want some sort of quick start guide. One of the most commonly referenced tutorials is <a href="http://java.ociweb.com/mark/clojure/article.html">R. Mark Volkmann&#8217;s at ociweb</a>. This is certainly a very valuable and authoritative resource, but I found it rather hard-going for a first contact. The <a href="http://www.youtube.com/watch?v=Aoeav%5FT1ARU&amp;feature=PlayList&amp;p=AC43CFB134E85266&amp;index=0">Intro to Clojure</a> video series was highly rated by <a href="http://stackoverflow.com/questions/599519/which-tutorial-on-clojure-is-best">this stackoverflow question</a>, but I can&#8217;t say I want to use videos to learn a language. Satish Talim suggested <a href="http://clojure-notes.rubylearning.org/">Clojure Notes</a>, which looks like a good introduction and may be the best place to start.</li>
<li>Regarding books, Stuart Halloway has <a href="http://thinkrelevance.com/blog/2008/09/16/pcl-clojure.html">ported some of the Practical Common Lisp</a> book (<a href="http://www.gigamonkeys.com/book/">original available free here</a>) to Clojure. This leads me onto his <a href="http://www.pragprog.com/titles/shcloj/programming-clojure">Programming Clojure</a> book, which is the best resource I have found so far (but not free). There is also <a href="http://en.wikibooks.org/wiki/Learning_Clojure">a wikibook</a> available, but it seems incomplete.</li>
<li><a href="http://planet.clojure.in">Planet Clojure</a> is your best reference for new and interesting Clojure posts (they describe themselves as a &#8220;meta-blog&#8221; of various Clojure hackers and contributors).</li>
</ul>
<p>Hope this helps someone!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2010/05/clojure-resources/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>The Pain of Premiere Pro</title>
		<link>http://www.adrianmouat.com/bit-bucket/2009/11/the-pain-of-premiere-pro/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2009/11/the-pain-of-premiere-pro/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 20:46:48 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=111</guid>
		<description><![CDATA[Permiere Pro has lately proven itself to be the singular worst piece of software I have ever had the misfortune to use. It has cost us far more time than it has saved, certainly several times its RRP in wasted hours. Normally I&#8217;m a software developer, but a project I was working on required me [...]]]></description>
			<content:encoded><![CDATA[<p>Permiere Pro has lately proven itself to be the singular worst piece of software I have ever had the misfortune to use. It has cost us far more time than it has saved, certainly several times its RRP in wasted hours. Normally I&#8217;m a software developer, but a project I was working on required me to do some basic video editing and I was shocked by the poor quality of the software being used.</p>
<p>In case you don&#8217;t know, Premiere Pro is &#8220;professional&#8221; video editing software, in a similar category to Avid Xpress and Apple&#8217;s Final Cut Pro. And to be fair, Premiere certainly seems to be fully featured. It&#8217;s just that it doesn&#8217;t work. It randomly crashes. Constantly. And when it&#8217;s not randomly crashing, it&#8217;s repeatedly crashing at the same point.</p>
<p style="text-align: left;">The first thing that irritated me is that I&#8217;m running it on a split new laptop with the maximum amount of memory (which is admittedly constrained to &lt; 4 GB as I&#8217;m using 32-bit Windows XP) and yet it gives me messages such as &#8220;Adobe is running low on system memory. Please save your project and proceed with caution.&#8221;. Quickly you realise that it&#8217;s best to give Adobe full run of the machine and close any other programs which use memory (like Web browsers).</p>
<p style="text-align: left;">The next thing that perplexed me was that <em>every</em> time I close Premiere, I get a message telling me that Premiere unexpectedly quit and offering to send Adobe the crash report. No, Adobe, the quit wasn&#8217;t unexpected &#8212; I normally exited the application &#8212; but apparently you shouldn&#8217;t do that in Adobe land. This started to bug me, so I filled in the crash report and attempted to send it. Except I can&#8217;t, because my e-mail address isn&#8217;t valid according to Adobe<sup><a href="http://www.adrianmouat.com/bit-bucket/2009/11/the-pain-of-premiere-pro/#footnote_0_111" id="identifier_0_111" class="footnote-link footnote-identifier-link" title="I think this must be because my work address contains too many dots for Adobe. I&amp;#8217;ve redacted my address as this post does not represent the views of my employer, just me. But trust me, it&amp;#8217;s valid.">1</a></sup>.</p>
<p style="text-align: center;"><img class="size-full wp-image-119 aligncenter" title="Premiere Pro Crash Report" src="http://www.adrianmouat.com/bit-bucket/wp-content/uploads/2009/11/crash_report_e-mail1.png" alt="crash_report_e-mail" width="550" height="506" /></p>
<p>Quite often, Premiere doesn&#8217;t want to import certain media. Sometimes it tells you this, other times it imports the footage but only displays a blank screen or inverted colours. This is irritating, but can normally be worked around by using free software such as ffmpeg or Virtual Dub to re-encode the footage. (Yes, these free programs seem to handle various video formats better than Adobe&#8217;s £750 payware. Adobe even <a href="http://kb2.adobe.com/cps/406/kb406449.html#format">suggest using VirtualDub themselves</a> (see Solution 6)).</p>
<p>However, these issues pale into insignificance once you face the beast that goes by the name of &#8220;Export Media&#8221;. This launches what is sort of an associated application known as &#8220;Adobe Media Encoder&#8221;, which renders your project into your final move file (e.g. .mov, .avi or .mpg). Sometimes this works flawlessly.  Sometimes it will stop at a seemingly random point in the encoding and the logfile will contain such revelations as:</p>
<blockquote>
<pre>...
 - Encoding Time: 00:01:07

2009-10-28 14:18:47 : Encoding Failed

-----------------------------------------

Error compiling movie.

 Unknown error.

-----------------------------------------</pre>
</blockquote>
<p>Hmm, &#8220;Unknown Error&#8221;. Doesn&#8217;t really help, does it? Restarting the export will result in it stopping at exactly the same point. This forces you to come up with random hypotheses as to what caused it crash, testing them in order until you either fix the problem or give up. Sometimes re-encoding the original video footage can fix things, which would suggest the video is corrupted (although it will play fine in Premiere and other video software).</p>
<p>I had thought &#8220;Unknown Error&#8221; was the least useful error message I&#8217;d seen. I was wrong. Sometimes the encoding fails part-way, yet Media Encoder reports &#8220;Encoding completed successfully&#8221;. I don&#8217;t want to take personal offence from a bit of software, but it stopped with the progress bar halfway, created half a video file then declared it was happily done. Surely that&#8217;s simply rude?</p>
<p>Of course, you can attempt to find and follow <a href="http://kb2.adobe.com/cps/332/332331.html">the official Adobe advice</a>. The first &#8220;note&#8221; here tells you to restart your computer &#8220;to refresh its memory&#8221; (read: not only is our software full of bugs, its also full of memory leaks). Solution 1 is to turn various effects off (read: lots of our effects have bugs). Solution 2 is to change the encoding (read: our codecs have bugs). The third solution annoys me even more: &#8220;Quit any applications that may be interfering with the render process&#8221;. Why? Surely Adobe should be able to share memory and resources with other processes? Solution 4 is &#8220;Use a different codec for your export&#8221; (read: our export function is full of bugs). Solution 5 is &#8220;Disable Auto Save&#8221; (read: our basic functionality breaks our other functions). I tried all of these; no dice.</p>
<p>In the interest of of ending on a positive, helpful note, I have the following suggestions for how Adobe can make things better:</p>
<ul>
<li>Replace &#8220;Unkown Error&#8221; wherever it occurs in the codebase. Handle exceptions properly &#8211; you&#8217;re meant to be a professional company and this is an very sloppy coding practice.</li>
<li>Test the software. I&#8217;m using a split new machine from a vary large vendor. Why on earth doesn&#8217;t it work? There must be huge flaws in the testing process at Adobe.</li>
<li>Remove support for features that don&#8217;t work. A particular encoding doesn&#8217;t work a given percentage of the time? Either fix it, or don&#8217;t pretend to support it.</li>
<li>Look at <a href="http://kb2.adobe.com/cps/332/332331.html">your own advice</a>. Most of these &#8220;solutions&#8221; indicate deficiencies in the underlying software.</li>
<li>Provide some sort of cuddly toy with each purchase of Premiere Pro. Although this won&#8217;t make the software any better, it will reduce stress by giving users a representation of Adobe that can be tortured during periods of stress brought on by attempting to use the software.</li>
</ul>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 690px; width: 1px; height: 1px;">- Source File: C:\DOCUME~1\amouat\LOCALS~1\Temp\adobe_sucks.prproj</p>
<p>- Output File: C:\beingrid\be-demos\doc\WP6.2-DemoDevelopment\BE03\video\demo-video\with_titles\adobe_sucks_1.mov</p>
<p>- Preset Used: Custom</p>
<p>- Video: 1024&#215;768, 15 [fps], Progressive, Quality 100</p>
<p>- Audio: 48000 Hz, Mono, 16 bit</p>
<p>- Bitrate: H.264</p>
<p>- Encoding Time: 00:01:07</p>
<p>2009-10-28 14:18:47 : Encoding Failed</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Error compiling movie.</p>
<p>Unknown error.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
</div>
<ol class="footnotes"><li id="footnote_0_111" class="footnote">I think this must be because my work address contains too many dots for Adobe. I&#8217;ve redacted my address as this post does not represent the views of my employer, just me. But trust me, it&#8217;s valid.</li></ol>]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2009/11/the-pain-of-premiere-pro/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cloud for Academia?</title>
		<link>http://www.adrianmouat.com/bit-bucket/2009/10/cloud-for-academia/</link>
		<comments>http://www.adrianmouat.com/bit-bucket/2009/10/cloud-for-academia/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 21:15:33 +0000</pubDate>
		<dc:creator>Adrian Mouat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adrianmouat.com/bit-bucket/?p=107</guid>
		<description><![CDATA[GridVoices have published my article &#8220;Cloud for Academia&#8220;, which takes a brief look at how various Cloud offerings could be used for HPC applications. UPDATE 4/11/2009: This article has now been syndicated (if that&#8217;s the right word!) on HPCWire.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gridipedia.eu/grid_voices/">GridVoices</a> have published my article &#8220;<a href="http://www.gridipedia.eu/grid_voices/?p=174">Cloud for Academia</a>&#8220;, which takes a brief look at how various Cloud offerings could be used for HPC applications.</p>
<p><strong>UPDATE 4/11/2009</strong>: This article has now been syndicated (if that&#8217;s the right word!) on <a href="http://www.hpcwire.com/specialfeatures/cloud_computing/features/Cloud-for-Academia-68614567.html">HPCWire.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.adrianmouat.com/bit-bucket/2009/10/cloud-for-academia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

