<?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>Words by Dan</title>
	<atom:link href="http://dan.munckton.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.munckton.co.uk/blog</link>
	<description>Ramblings about tech, software and music</description>
	<lastBuildDate>Sat, 04 May 2013 08:20:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>How to Install Python Packages Q2-2013-stylee</title>
		<link>http://dan.munckton.co.uk/blog/2013/05/04/how-to-install-python-packages-q2-2013-stylee/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/05/04/how-to-install-python-packages-q2-2013-stylee/#comments</comments>
		<pubDate>Sat, 04 May 2013 08:16:45 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Distribute]]></category>
		<category><![CDATA[easy_install]]></category>
		<category><![CDATA[Packaging]]></category>
		<category><![CDATA[pip]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[setuptools]]></category>
		<category><![CDATA[virtualenv]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=356</guid>
		<description><![CDATA[The Python world appears to be moving away from the setuptools/easy_install approach to installing/maintaining 3rd party Python packages. So what is the current recommended approach? Answer: Distribute - a drop-in replacement for setuptools pip - a command-line Python package management utility virtualenv - allows you to create a sandbox environment to install packages into without having to install to [...]]]></description>
				<content:encoded><![CDATA[<p>The Python world appears to be <a href="http://stackoverflow.com/questions/3220404/why-use-pip-over-easy-install">moving away from the setuptools/easy_install</a> approach to installing/maintaining 3rd party Python packages. So what is the current recommended approach? Answer:</p>
<ul>
<li><a href="http://pythonhosted.org/distribute/">Distribute</a> - a drop-in replacement for setuptools</li>
<li><a href="http://www.pip-installer.org/">pip</a> - a command-line Python package management utility</li>
<li><a href="http://www.virtualenv.org/">virtualenv</a> - allows you to create a sandbox environment to install packages into without having to install to your global Python site-packages folder. This presents a solution for conflicts between applications that require different versions of the same package.</li>
</ul>
<p>The distribute documentation has a nice info graphic that <a href="http://guide.python-distribute.org/introduction.html#current-state-of-packaging">illustrates the current direction</a>:</p>
<div class="wp-caption aligncenter" style="width: 547px"><img alt="The current state of Python packaging" src="http://guide.python-distribute.org/_images/state_of_packaging.jpg" width="537" height="307" /><p class="wp-caption-text">The current state of Python packaging</p></div>
<p>Here&#8217;s another one, also from the <a href="http://pythonhosted.org/distribute/">distribute documentation</a>; slightly subtler:</p>
<div class="wp-caption aligncenter" style="width: 710px"><img alt="Setuptools+easy_install are old and busted; distribute+pip are the new hotness" src="http://python-distribute.org/pip_distribute.png" width="700" height="525" /><p class="wp-caption-text">Python packaging public service announcement info graphic</p></div>
<p> <img src='http://dan.munckton.co.uk/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>For information on how to create a Python package, see the <a href="http://guide.python-distribute.org/index.html">Hitchhiker&#8217;s Guide to Packaging</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/05/04/how-to-install-python-packages-q2-2013-stylee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Algorithms: Insertion Sort</title>
		<link>http://dan.munckton.co.uk/blog/2013/05/01/algorithms-insertion-sort/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/05/01/algorithms-insertion-sort/#comments</comments>
		<pubDate>Wed, 01 May 2013 07:07:22 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Algorithms & Data Structures]]></category>
		<category><![CDATA[Insertion Sort]]></category>
		<category><![CDATA[Sorting]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=179</guid>
		<description><![CDATA[So, finally, here is my first post on algorithms. A nice simple one to start with: insertion sort. Insertion sort is a simple iterative, incremental sorting algorithm.  Although its running time grows quadratically, it is relatively efficient and simple to implement, making it a good choice for sorting small data sets. Description It is designed [...]]]></description>
				<content:encoded><![CDATA[<p>So, finally, here is my first post on algorithms. A nice simple one to start with: insertion sort.</p>
<p>Insertion sort is a simple iterative, incremental sorting algorithm.  Although its running time grows quadratically, it is relatively efficient and simple to implement, making it a good choice for sorting small data sets.</p>
<h2>Description</h2>
<p>It is designed around two loops:</p>
<ul>
<li>An <em>outer</em> loop that traverses up from the second element in the input array to the last. It places each element, or <em>key</em>, into sorted position as it goes.</li>
<li>An <em>inner</em> loop that iterates down through the already sorted elements towards the first element of the input. It shifts elements upwards until the current <em>key&#8217;s</em> position is found. As soon as the correct position is found it can stop working, so it does not have to visit every element in the sorted sub-array every time.</li>
</ul>
<p>At the start of each iteration of the <em>outer</em> loop, the elements in the sub-array <em>a</em>[<em>0..j-1</em>] will be in sorted order (the <em>loop invariant)</em>.</p>
<p>Here is an example implementation written the <a href="http://golang.org/">Go language</a>:</p><pre class="crayon-plain-tag">/*
 Sort an array of integers, in place, using the insertion sort algorithm.
 */
func InsertionSort(a []int) {
    // Iterate up from the second element to the last
    for j := 1; j &lt; len(a); j++ {
        key := a[j]
        i := j - 1

        // Iterate down through the sorted subset [j-1..0], shifting
        // elements upwards until key's position is found
        for i &gt;= 0 &amp;&amp; a[i] &gt; key {
            a[i+1] = a[i]
            i--
        }

        // Insert key into its position in the sorted subset
        a[i+1] = key
    }
}</pre><p>You can get <a href="https://github.com/munckymagik/gosort/blob/master/insertionsort.go">this</a> from my <a href="https://github.com/munckymagik/gosort">gosort</a> repository on GitHub.</p>
<h2>Characteristics</h2>
<p>Insertion sort has the following characteristics:</p>
<table>
<tbody>
<tr>
<th>Style:</th>
<td>Incremental, in-place, comparison</td>
</tr>
<tr>
<th>Worst case running time:</th>
<td>Θ(n²)</td>
</tr>
<tr>
<th>Average case running time:</th>
<td>Θ(n²)</td>
</tr>
<tr>
<th>Best case running time:</th>
<td>Θ(n), occurs when input is already sorted</td>
</tr>
<tr>
<th>Memory efficiency:</th>
<td>Θ(n) + Θ(1)</td>
</tr>
<tr>
<th>Stable:</th>
<td>Yes</td>
</tr>
<tr>
<th>Online:</th>
<td>Yes</td>
</tr>
</tbody>
</table>
<h2>Uses</h2>
<p>Because of its simplicity and relatively small constant factors, it can be used to handle the base case in composite divide and conquer algorithms, when the number of elements is small (<a href="http://www.mpi-inf.mpg.de/~mehlhorn/ftp/Toolbox/SortingAndSelection.pdf">Mehlhorn</a> suggests n &lt;= 10). The Go language&#8217;s <a href="http://golang.org/pkg/sort/">sort</a> implementation <a href="https://code.google.com/p/go/source/browse/src/pkg/sort/sort.go?name=go1">provides a real example of this</a>: insertion sort is used within the quick sort implementation when the number of elements is less than 7 (see lines 181 to 183).</p>
<p>Because it processes its input serially, piece-by-piece, it can be used to sort data directly from a stream (online).</p>
<h2>Further reading</h2>
<p>More information can be found on this algorithm in the following sources:</p>
<ul>
<li><a href="http://www.mpi-inf.mpg.de/~mehlhorn/ftp/Toolbox/SortingAndSelection.pdf">Section 5.1</a> of <a href="http://www.mpi-inf.mpg.de/~mehlhorn/Toolbox.html">Data Structures and Algorithms by Mehlhorn and Sanders</a></li>
<li>Section 2.2 of <a href="http://mitpress.mit.edu/books/introduction-algorithms">Introduction to Algorithms by Cormen et al</a></li>
<li>And good old Wikipedia: <a href="http://en.wikipedia.org/wiki/Insertion_sort">Insertion Sort</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/05/01/algorithms-insertion-sort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing Your Creativity</title>
		<link>http://dan.munckton.co.uk/blog/2013/03/31/developing-your-creativity/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/03/31/developing-your-creativity/#comments</comments>
		<pubDate>Sun, 31 Mar 2013 19:02:31 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Creativity]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Play]]></category>
		<category><![CDATA[Problem Solving]]></category>
		<category><![CDATA[Psychology]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=297</guid>
		<description><![CDATA[I recently watched a fascinating documentary in the BBC Horizon science series called: The Creative Brain: How Insight Works. This is a quick note of some key ideas I took from watching it. Unfortunately, this is from memory, and sadly I can&#8217;t remember the names of the scientists whose research was featured. But I have to say [...]]]></description>
				<content:encoded><![CDATA[<p>I recently watched a fascinating documentary in the BBC Horizon science series called: <a href="http://www.bbc.co.uk/programmes/b01rbynt">The Creative Brain: How Insight Works</a>. This is a quick note of some key ideas I took from watching it. Unfortunately, this is from memory, and sadly I can&#8217;t remember the names of the scientists whose research was featured. But I have to say it is well worth watching if it gets repeated.</p>
<ol>
<li><strong>Feed your creativity</strong>. To positively enhance your creativity, seek unfamiliar experiences. Actively break habits and patterns. New experiences provide new concepts to mix up with your existing knowledge, which leads to new ideas. <em>Amazingly</em>, it was even shown that something as mundane as deliberately putting a sandwich together in a different order than usual, contributes to this effect.</li>
<li><strong>Play with things</strong>. Whenever you learn or experience something new, spend some time brainstorming things you could use it for. Be creative with it. It was amazing watching volunteers in the experiments brainstorming things that a <em>brick</em> could be used for other than building a house. In fact, I used to do this with my guitar; whenever I learned a new soloing technique or chord I used to toy with it until I had several new ideas based on the original. This digestive process helped me learn <em>and</em> create.</li>
<li><strong>Busting mental blocks</strong>. When you are &#8220;stuck in a rut&#8221; stop what you are doing, but don&#8217;t do nothing. Instead, switch to some other undemanding task. When you return to the original task later you should be in a more creative state. The programme featured an experiment where 3 people&#8217;s creativity was tested (I think it was the brainstorming things you could do with a brick moment). Then one was told to stop and do nothing, the second was given a simple pleasurable task (arranging Lego bricks by colour), and the third was given something hard to do (can&#8217;t remember what this task was, maybe building something with the Lego). Surprisingly, the person who returned to the <em>brick-brainstorming</em> and had the most new ideas, was the person who had been given the simple, pleasurable and non-taxing task.</li>
<li><strong>Check your assumptions</strong>. One of the biggest difficulties in problem solving is the fact that our brains sometimes make huge sweeping assumptions that may not really be a part of the problem. On the programme this was demonstrated by an experiment where a dollar bill was pinned under a large upside-down pyramid. The participants were challenged to remove the bill without moving or lifting the pyramid. They were stumped for quite a while until someone had a flash of inspiration that there was actually no requirement to keep the bill intact; the bill could be removed by <em>burning</em> it. Because the item to be moved was perceived as having value, the idea of destroying it was intuitively rejected even though the problem statement didn&#8217;t require this.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/03/31/developing-your-creativity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Go Programming Language</title>
		<link>http://dan.munckton.co.uk/blog/2013/03/15/the-go-programming-language/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/03/15/the-go-programming-language/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 22:33:19 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Go Lang]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=174</guid>
		<description><![CDATA[I am always on the look out for new programming languages. It is my vain hope that some day a language will be developed that will distil all the lessons we have learned about programming language design so far and will unlock new highs of productivity and creativity.  In my opinion, the &#8216;Go&#8217; programming language [...]]]></description>
				<content:encoded><![CDATA[<p>I am always on the look out for new programming languages. It is my vain hope that some day a language will be developed that will distil all the lessons we have learned about programming language design so far and will unlock new highs of productivity and creativity.  In my opinion, the &#8216;Go&#8217; programming language is a very good attempt at doing this for system engineering.</p>
<h2>Background</h2>
<div id="attachment_196" class="wp-caption alignright" style="width: 210px"><a href="http://dan.munckton.co.uk/blog/2013/03/15/the-go-programming-language/frontpage/" rel="attachment wp-att-196"><img class=" wp-image-196  " title="The Go Gopher by Renée French" alt="The Go Gopher by Renée French" src="http://dan.munckton.co.uk/blog/wp-content/uploads/2013/01/frontpage.png" width="200" height="272" /></a><p class="wp-caption-text">The Go Gopher by Renée French</p></div>
<p>Go is just 3 years old and only recently achieved its first stable milestone release, <a href="http://blog.golang.org/2012/03/go-version-1-is-released.html">version 1.0.0, in March 2012</a>. It has been designed and <a href="http://golang.org/doc/faq#history">built internally at Google</a> by <a href="http://research.google.com/pubs/r.html">Rob Pike</a> and <a href="https://www.google.co.uk/search?q=ken+thompson">Ken Thompson</a> (both known for the Plan9 operating system, UTF-8 and Unix), <a href="http://research.google.com/pubs/author96.html">Robert Griesemer</a> (who worked on Strongtalk and the Hotspot JVM), and others. Their remit was to design a language that could scale to cope with the huge number of interconnected systems, users, engineers, and lines of code that Google needs to deal with day to day.</p>
<h2>So what does it look like then?</h2>
<p>It is a statically typed, garbage collected language that sits at the level somewhere between C/C++ and Java/C#, and compiles down to platform native code.</p>
<p>Although it has a C-like syntax, it also includes high-level features like built-in dictionary/map support similar to scripting languages like JavaScript or Python, and function closures like JavaScript.</p>
<p>Here&#8217;s an example, taken from <a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=f6kdp27TYZs">Rob Pike&#8217;s &#8220;Go Concurrency Patterns&#8221; talk</a>, that demonstrates several important features:</p><pre class="crayon-plain-tag">package main

import (
    "fmt"
    "math/rand"
    "time"
)

func main() {
    // A function returning a channel
    c := boring("boring!")

    for i := 0; i &lt; 5; i++ {
        // Read a string from the channel and print it
        fmt.Printf("You say: %q\n", &lt;-c)
    }

    fmt.Println("You're boring; I'm leaving.")
}

// A generator function that returns a receive-only channel of strings.
func boring(msg string) &lt;-chan string {
    // Create the channel of strings
    c := make(chan string)

    // Define an anonymous function and run it as a goroutine
    go func() {
        for i := 0; ; i++ {
            // Send a message to the channel
            c &lt;- fmt.Sprintf("%s %d", msg, i)
            time.Sleep(time.Duration(rand.Intn(1e3)) * time.Millisecond)
        }
    }()

    // Return the channel to the caller
    return c
}</pre><p>I&#8217;ll <a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=f6kdp27TYZs#t=867s">leave it to Rob to explain</a> what&#8217;s going on here in detail.  Admittedly, this may be a little challenging to understand if you are not already familiar with the basics of the language.  For a quick step-by-step introduction <a href="http://tour.golang.org/">take the tour</a>.</p>
<p>Probably the most important feature is its support for parallelism and concurrency.  For this, <a href="http://talk.golang.org/doc/faq#csp">Go&#8217;s designers refer to</a> ideas from a 1978 paper (really has it take us the length of my entire lifetime to get here?) by Tony Hoare called <a href="http://www.usingcsp.com/cspbook.pdf">&#8220;Communicating Sequential Processes&#8221;</a>. These are realised in Go by g<em>oroutines</em>, which are concurrent processes that communicate with each other by sending messages over <em>channels</em>. The idea is, by coordinating through message passing, rather than shared memory, it enables <em>lock-free</em> programming.</p>
<h2>What I like about it so far</h2>
<p>I have only been investigating it for a few weeks, and haven&#8217;t built anything significant with it yet. However, there are already a number of features that appeal to me.  I had intended to keep this list small, but to hell with it, there are a lot of things I like about it already <img src='http://dan.munckton.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   here we go:</p>
<ul>
<li>It has a C-like syntax, but its terser. Semi-colons are not required, braces around for and if  statements are dropped, and if variables are assigned where they are declared you can drop the type specification.</li>
<li>Capitalisation of names is used to control public/private access, which eliminates a lot of extra syntax.</li>
<li>It has borrowed some conveniences from Python: array slices, a built-in map type, and <span style="text-decoration: underline;" data-mce-mark="1">functions can return multiple values</span>.</li>
<li>It has first class functions, which are full closures.  Enabling a tonne of great programming paradigms that are in common use in languages like JavaScript and Ruby.</li>
<li>It is <a href="http://golang.org/doc/faq#Is_Go_an_object-oriented_language" target="_blank">sort-of object oriented</a>, but more like the way C is, in that objects are declared as structures with methods defined outside of the structure declaration. It does <a href="http://golang.org/doc/faq#inheritance" target="_blank">not support inheritance</a>.  Instead it provides a <em>mixin-like</em> style of extension, known as <em>embedding</em>, where new types can be created by mixing together existing types or interfaces to produce a type which is a union of the features of the types it combines.</li>
<li>It supports the concept of <em>interfaces</em> like C++/Java/C#, <a title="Interfaces are satisfied implicitly" href="http://tour.golang.org/#54" target="_blank">but with additional flexibility</a> because it follows a sort of static version of the <a href="http://en.wikipedia.org/wiki/Duck_typing" target="_blank"><em>duck typing</em> idiom</a>: any object can implement an interface simply by defining functions that match the signatures declared in that interface.  There is no need to explicitly declare that an object <em>implements</em> an interface.  The benefit this brings is that it makes it possible to write polymorphic code without requiring the individual types involved to have been pre-designed for use in this way.</li>
<li>You can create new types <a href="http://tour.golang.org/#51" target="_blank">from anything</a>, even an int, and can then add methods to your new type.</li>
<li>It has a well thought out <a href="http://golang.org/doc/articles/gos_declaration_syntax.html" target="_blank">declaration syntax</a>, with intent of straightening out the complicated C declaration rules to produce something that is easier to parse by eye or machine.</li>
<li>They <a href="http://tour.golang.org/#41" target="_blank">fixed the <em>switch statement</em></a> (hurray!) so that <em>cases</em> break by default, and enhanced it so that any type can be the switch condition.  Plus, there is a <a href="http://tour.golang.org/#43" target="_blank">switch with no condition</a>, which has an <em>implicit</em> condition that defaults to true, and provides a compact replacements for long if-else chains.</li>
<li>It has a logically named <a href="http://tour.golang.org/#23" target="_blank">set of basic types</a>, including <code>&lt;stdint.h&gt;</code> style explicit precision versions: bool, int, int8, int16, int32, int64, uint, uint8, and so on.</li>
<li>It has a built-in unicode string type.</li>
<li>It supports pointers for those times when you need to pass by reference instead of passing by value.  However, <a href="http://golang.org/doc/faq#no_pointer_arithmetic">pointer arithmetic is not supported</a>.</li>
<li>It compiles to platform native binary formats. So no messing around with byte code interpretors or class paths required to run an application. In fact, I had a quick look at what DLLs a simple &#8216;hello world&#8217; style Go binary links with on Windows: only <code>kernel32.dll</code> and <code>winmm.dll</code> for a multimedia timer API. On Linux there are no dynamically linked dependencies at all. So the resulting binaries don&#8217;t require the user to install a Go runtime, which makes them refreshingly portable.</li>
<li>It has a <a href="http://golang.org/doc/faq#garbage_collection">garbage collector</a>, so you don&#8217;t have to worry about the large majority of memory leak issues that you have to in C.</li>
</ul>
<p>Oh, it also has a cute mascot called the &#8216;Gopher&#8217; [see the image above] <img src='http://dan.munckton.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h2>Toolchain and workflow</h2>
<p>What is also excellent about Go is that the tool-chain has not been left an after-thought.</p>
<p>It comes bundled with more than just a compiler, so there is no need to mess around with makefiles!! <img src='http://dan.munckton.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   This makes it very easy to get up and running.</p>
<p>The main way of building Go source code is by using the <a href="http://talk.golang.org/cmd/go/"><em>go</em> front-end command-line tool</a>. It has a simple Git/Subversion inspired interface, with sub-commands for building, installing, testing, formatting, and various other tasks.</p>
<p>It also has a <em>run</em> sub-command that builds and runs in one step.  Impressively, because the compiler is fast enough, this means that Go can be used almost as if it is a scripting language. A simple idea really, but a nice touch that makes it so easy to code up small experiments and small tasks. I have often created shell scripts to do the same in C when trying to hack out a small idea quickly.</p>
<p>As far as I can tell at the moment, there are two main schemes for source organisation:</p>
<ul>
<li>All project sources in one directory &#8211; for example the <em>go</em> command sources are organised like this (see $(GOROOT)/src/cmd/go in your installation). Typically, twenty to thirty source files all in one directory along with any scripts and README files etc.</li>
<li>Sources organised into a directory hierarchy of <em>packages</em> called a <a href="http://talk.golang.org/doc/code.html">Go workspace</a>.  Each package sub-directory may be a separate project or source repository.</li>
</ul>
<p>Interestingly, it appears there is no middle ground here: if you take the first scheme and try to organise some of your code into packages in sub-directories, the compiler just cannot find the nested sources. Granted, there may be a way around this but I need to dig deeper (please leave a comment if you know this is wrong). Anyway, for more on this topic see: <a href="https://groups.google.com/d/topic/golang-nuts/mwLeVoNkvPw/discussion" target="_blank">here</a>.</p>
<h2>What types of tasks is it good for?</h2>
<p>At the moment it appears to be targeted at writing network and system services. But, I guess this may expand in time. Here&#8217;s <a href="https://code.google.com/p/go-wiki/wiki/Projects">a big list of projects written in Go</a>.</p>
<p>SoundCloud are using it <a href="http://backstage.soundcloud.com/2012/07/go-at-soundcloud/" target="_blank">to write back-end systems</a>.</p>
<h2>Further reading</h2>
<p>Here are some other interesting sources of information:</p>
<ul>
<li>The project home page <a href="http://golang.org/" target="_blank">http://golang.org/</a>.</li>
<li>The <a href="http://tour.golang.org/#1" target="_blank">Go Tour</a> &#8211; an interactive online tutorial</li>
<li>The <a href="http://golang.org/doc/faq" target="_blank">Design FAQ</a></li>
<li><a href="http://golang.org/doc/effective_go.html" target="_blank">Effective Go</a></li>
<li><a href="http://www.artima.com/weblogs/viewpost.jsp?thread=333589" target="_blank">Calling Go from Python via JSON-RPC</a> by Bruce Eckel</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/03/15/the-go-programming-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choosing a Programming Language for Examples</title>
		<link>http://dan.munckton.co.uk/blog/2013/01/23/choosing-a-programming-language-for-examples/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/01/23/choosing-a-programming-language-for-examples/#comments</comments>
		<pubDate>Wed, 23 Jan 2013 17:33:49 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Algorithms & Data Structures]]></category>
		<category><![CDATA[Go Lang]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=166</guid>
		<description><![CDATA[I have made a decision to use the Go programming language for the code examples in the series of articles I want to write on algorithms and data structures. It satisfies all the criteria I have: Clarity: it has a pretty terse syntax that absorbs ideas from C style languages and scripting languages like Python. Also, because [...]]]></description>
				<content:encoded><![CDATA[<p>I have made a decision to use the <a href="http://golang.org/" target="_blank">Go programming language</a> for the code examples in the <a title="Algorithms and Data Structures Series: The Plan" href="http://dan.munckton.co.uk/blog/2013/01/05/algorithms-and-data-structures-series-the-plan/">series of articles I want to write on algorithms and data structures</a>. It satisfies all the criteria I have:</p>
<ul>
<li>Clarity: it has a pretty terse syntax that absorbs ideas from C style languages and scripting languages like Python. Also, because it is a garbage-collected language there is no extra boiler-plate code required to handle memory management. Overall I think it will make the intent of the algorithms clear and easy to understand.</li>
<li>Familiarity: its syntax is close enough to C that it should be easy to follow for anyone who knows a language in the C family.</li>
<li>Modernity: it is a very new language, only about 3 years old.  Consequently, it realizes contemporary language design ideas such as: a safe version of the switch statement (not that this is a new idea, I know), function closures, <em>mixin</em> style type extension and so on.  Plus it includes a great tool-chain that allows you to get up and running quite quickly.  Of course, this also means I get to learn a new language as part of this exercise, which adds additional motivational value for me <img src='http://dan.munckton.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>I have started drafting a more detailed intro to Go in another blog post too, because I want to talk about some of the things I like about it so far.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/01/23/choosing-a-programming-language-for-examples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Algorithms and Data Structures Series: The Plan</title>
		<link>http://dan.munckton.co.uk/blog/2013/01/05/algorithms-and-data-structures-series-the-plan/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/01/05/algorithms-and-data-structures-series-the-plan/#comments</comments>
		<pubDate>Sat, 05 Jan 2013 12:10:20 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Algorithms & Data Structures]]></category>
		<category><![CDATA[Plan]]></category>
		<category><![CDATA[Trello]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=159</guid>
		<description><![CDATA[Update April &#8217;13: So, the series didn&#8217;t happen. Why? Well, when I set out to do this I was looking to invent reasons to write.  I have since discovered that I have plenty to write about, too much in fact, and having to write a series to an artificial deadline is too restrictive, and a [...]]]></description>
				<content:encoded><![CDATA[<h2>Update April &#8217;13:</h2>
<p>So, the series didn&#8217;t happen. Why? Well, when I set out to do this I was looking to invent reasons to write.  I have since discovered that I have plenty to write about, too much in fact, and having to write a series to an artificial deadline is too restrictive, and a practical impossibility with pressures from work and responsibilities at home.</p>
<p>So what am I going to do instead? I will publish some posts on algorithms because I have started drafting some already.  They will probably not be published in a particularly logical order; just when they are ready.  I also intend to write freely about whatever I feel like writing about.</p>
<h2>Original Post:</h2>
<p>Following on from <a title="New Series on Algorithms and Data Structures" href="http://dan.munckton.co.uk/blog/2013/01/04/new-series-on-algorithms-and-data-structures/" target="_blank">my previous post</a>, I have now worked out a plan for how I will work through this series.</p>
<p>I want to complete a meaningful first set of articles within the first few months of this year, then be able to stop, evaluate what I have achieved and plan what to focus on next.  So as a start, I have decided to limit my focus to sorting and searching algorithms, and basic data structures.</p>
<p>Also, instead of working through these topics in order, I am going to try to cover two algorithms from each topic, each month. I feel it is important not to be stuck on one topic area for too long.  So, by doing it this way I can progress both topics in parallel, and by sticking with just two topics I will still be able to complete something meaningful in a sensible amount of time.</p>
<p>So here is the initial plan:</p>
<p>January 2013</p>
<ul>
<li>Algorithmic Complexity Analysis &#8211; a short note on this.</li>
<li>Insertion Sort</li>
<li>Merge Sort</li>
<li>Stack</li>
<li>Queue</li>
</ul>
<p>February 2013</p>
<ul>
<li>Heap Sort</li>
<li>Quick Sort</li>
<li>Linked List</li>
<li>Hash Tables</li>
</ul>
<p>March 2013</p>
<ul>
<li>Counting Sort</li>
<li>Radix Sort</li>
<li>Binary Search Tree</li>
<li>Red-Black Tree</li>
</ul>
<p>April 2013</p>
<ul>
<li>Binary Search</li>
<li>Bucket Sort</li>
<li>Graphs</li>
</ul>
<p>So as you can see, basic core stuff. There are deadlines at the end of each month, and a final deadline on the last day of April. <del>I have created a public <a href="http://trello.com/" target="_blank">Trello </a>board to track my work: <a href="https://trello.com/b/MEnlz31y" target="_blank">https://trello.com/b/MEnlz31y</a>.</del></p>
<p>As my primary guide I will be using <a href="http://www.amazon.co.uk/Introduction-Algorithms-T-Cormen/dp/0262533057" target="_blank">Introduction to Algorithms by T. Cormen et al</a>.  But, I will also be referring to other sources to find alternative ideas if useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/01/05/algorithms-and-data-structures-series-the-plan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Series on Algorithms and Data Structures</title>
		<link>http://dan.munckton.co.uk/blog/2013/01/04/new-series-on-algorithms-and-data-structures/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/01/04/new-series-on-algorithms-and-data-structures/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 11:42:53 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Algorithms & Data Structures]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[Data Structures]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=145</guid>
		<description><![CDATA[One of my new year&#8217;s resolutions is to write more in general. Specifically, I want to use my blog as a platform to do that. So, what I have decided to do is to write a regular series of posts on core software engineering issues such as algorithms, data structures, design patterns and so on. [...]]]></description>
				<content:encoded><![CDATA[<p>One of my new year&#8217;s resolutions is to write more in general. Specifically, I want to use my blog as a platform to do that. So, what I have decided to do is to write a regular series of posts on core software engineering issues such as algorithms, data structures, design patterns and so on. The idea being to document the knowledge of my trade and create a useful reference resource for myself and (hopefully) others.</p>
<p>A big question I have here is: what programming language to use for the examples? Or even, whether to use a real language at all, e.g. should I use pseudo-code? Being a bit of a software generalist, there are several languages I would potentially choose.</p>
<p>Well, pseudo-code can immediately be crossed off of the list because it cannot be compiled and tested. I don&#8217;t really want to use a pure functional language such as Erlang, Haskell or Clojure, because they still don&#8217;t appear to be as widely used as imperative, procedural or object-oriented languages, and although interesting, may be rather too specialist for this endeavour.</p>
<p>The other choices really fall into to three camps for me:</p>
<ol>
<li>Simple, terse scripting languages &#8211; such as Python or Ruby &#8211; that are close to pseudo-code in terms of readability, and do not require large amounts of tiresome boiler plate structural code so the algorithms themselves can be communicated as clearly as possible.  (Note, I couldn&#8217;t bring myself to include JavaScript in this category because I just feel it is a step closer to C or Java than it is to pseudo-code).</li>
<li>Well known, or general software engineering languages &#8211; such as C, C++, Java, JavaScript or C#.  These are the common denominators; the languages a very large number of people know or can at least read.</li>
<li>New generation languages &#8211; such as Go, CoffeeScript or Scala.  Using any of these would motivate me (because I like learning new things), and potentially make the resulting work more interesting and unique.</li>
</ol>
<p>So how to decide? Clarity, universality or modernity?  I need to think about this.</p>
<p>Next step: <a title="Algorithms and Data Structures Series: The Plan" href="http://dan.munckton.co.uk/blog/2013/01/05/algorithms-and-data-structures-series-the-plan/">make a plan</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/01/04/new-series-on-algorithms-and-data-structures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Out Crayon Syntax Highlighter</title>
		<link>http://dan.munckton.co.uk/blog/2013/01/03/testing-out-crayon-syntax-highlighter/</link>
		<comments>http://dan.munckton.co.uk/blog/2013/01/03/testing-out-crayon-syntax-highlighter/#comments</comments>
		<pubDate>Thu, 03 Jan 2013 11:59:19 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://dan.munckton.co.uk/blog/?p=130</guid>
		<description><![CDATA[Have just installed the <a href="http://wordpress.org/extend/plugins/crayon-syntax-highlighter/" target="_blank">Crayon Syntax Highlighter</a>. Here are a few snippets to test it out.]]></description>
				<content:encoded><![CDATA[<p>Have just installed the <a href="http://wordpress.org/extend/plugins/crayon-syntax-highlighter/" target="_blank">Crayon Syntax Highlighter</a>. Here are a few snippets to test it out. First up, Python:</p><pre class="crayon-plain-tag">class HelloWorld(object):
    def __init__(self, name):
        self.name = name.title()

    def sayHello(self):
        print "Hello from {0}!".format(self.name)

hello = HelloWorld("python")
hello.sayHello()</pre><p>How about some Erlang?</p><pre class="crayon-plain-tag">-module(hello).
-export([hello_world/0]).

hello_world() -&gt; io:fwrite("hello from Erlang\n").</pre><p>Ruby?</p><pre class="crayon-plain-tag">class HelloWorld
   def initialize(name)
      @name = name.capitalize
   end
   def sayHi
      puts "Hello #{@name}!"
   end
end

hello = HelloWorld.new("World")
hello.sayHi</pre><p></p>
<p>How about some over-the-top OO style C?</p>
<p></p><pre class="crayon-plain-tag">#include &lt;stdio.h&gt;
#include &lt;string.h&gt;

const size_t HELLO_WORLD_NAME_MAX = 32;

typedef struct
{
    char name[HELLO_WORLD_NAME_MAX];
} HelloWorld;

void helloworld_init(HelloWorld *self,
                     const char *name,
                     size_t name_length)
{
    self-&gt;name[0] = '\0';

    if (NULL != name &amp;&amp;
        name_length &lt; HELLO_WORLD_NAME_MAX)
    {
        strncpy(self-&gt;name, name, name_length);
        self-&gt;name[name_length] = '\0';
    }
}

void helloworld_say_hi(HelloWorld *self)
{
    printf("Hello from %s!", self-&gt;name);
}

int main(int argc, char* argv[])
{
    const char *name = "C";
    HelloWorld hello;

    helloworld_init(&amp;hello, name, strlen(name));
    helloworld_say_hi(&amp;hello);

    return 0;
}</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2013/01/03/testing-out-crayon-syntax-highlighter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silence stdout for an entire shell script</title>
		<link>http://dan.munckton.co.uk/blog/2010/03/22/silence-stdout-for-an-entire-shell-script/</link>
		<comments>http://dan.munckton.co.uk/blog/2010/03/22/silence-stdout-for-an-entire-shell-script/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 18:17:08 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://munckfish.net/blog/?p=95</guid>
		<description><![CDATA[To silence stdout in a Linux shell script use the following line: This redirects the file stream to the /dev/null device which silently swallows the output. This is useful if for instance you are writing a cron job which you want to have log it&#8217;s steps while you are developing or debugging it, but don&#8217;t [...]]]></description>
				<content:encoded><![CDATA[<p>To silence stdout in a Linux shell script use the following line:</p><pre class="crayon-plain-tag">exec 1&gt;/dev/null</pre><p>This redirects the file stream to the /dev/null device which silently swallows the output.</p>
<p>This is useful if for instance you are writing a cron job which you want to have log it&#8217;s steps while you are developing or debugging it, but don&#8217;t want any output except the stderr once it&#8217;s running.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2010/03/22/silence-stdout-for-an-entire-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display list of all predefined macros in GCC</title>
		<link>http://dan.munckton.co.uk/blog/2010/01/22/display-list-of-all-predefined-macros-in-gcc/</link>
		<comments>http://dan.munckton.co.uk/blog/2010/01/22/display-list-of-all-predefined-macros-in-gcc/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 17:17:04 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[C/C++]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[Preprocessor]]></category>

		<guid isPermaLink="false">http://munckfish.net/blog/?p=92</guid>
		<description><![CDATA[Something I always forget and have to look up. 1) Print predefined macros: 2) Print predefined macros and macros introduced by a specific header Reference for -dM is in the cpp man page.]]></description>
				<content:encoded><![CDATA[<p>Something I always forget and have to look up.</p>
<p>1) Print predefined macros:</p><pre class="crayon-plain-tag">gcc -dM -E - &lt;/dev/null | sort | less</pre><p>2) Print predefined macros and macros introduced by a specific header</p><pre class="crayon-plain-tag">echo &quot;#include &lt;stdlib.h&gt;&quot; &gt; foo.h
gcc -dM -E foo.h | sort | less</pre><p>Reference for -dM is in the cpp man page.</p>
]]></content:encoded>
			<wfw:commentRss>http://dan.munckton.co.uk/blog/2010/01/22/display-list-of-all-predefined-macros-in-gcc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
