<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><description>My name is Richard Kettelerij. I’m a software engineer at Avisi. I spend my time designing and building enterprise applications. I’m also a committer on Apache Camel. Feel free to contact me.</description><title>richardlog</title><generator>Tumblr (3.0; @richardlog)</generator><link>http://richardlog.com/</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/richardlog" /><feedburner:info uri="richardlog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://tumblr.superfeedr.com/" /><item><title>Top-down or bottom-up architecture?</title><description>&lt;a href="http://avisi.nl/symposium/wp-content/uploads/2012/09/top-down-or-bottom-up-16-4.pdf"&gt;Top-down or bottom-up architecture?&lt;/a&gt;: &lt;p&gt;Slides of my talk at the &lt;a href="http://avisi.nl/symposium/asas2012"&gt;Agile Software Architecture Symposium 2012&lt;/a&gt; in Elst.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/SoVL5Bu6Ajo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/SoVL5Bu6Ajo/31995049843</link><guid isPermaLink="false">http://richardlog.com/post/31995049843</guid><pubDate>Fri, 21 Sep 2012 20:48:17 +0200</pubDate><category>software architecture</category><feedburner:origLink>http://richardlog.com/post/31995049843</feedburner:origLink></item><item><title>Exploring Kotlin, writing a simple spell checker</title><description>&lt;p&gt;In my last blog I talked about &lt;a&gt;exploring Kotlin&lt;/a&gt;, a JVM language in development by JetBrains. In this blog I&amp;#8217;ll walk through a larger piece of Kotlin code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Spell checker&lt;/strong&gt;&lt;br/&gt;The program we&amp;#8217;re talking about is a simple spell checker. It reads a dictionary of words from a file (&lt;em&gt;/usr/share/dict/words&lt;/em&gt;) into a set. Then it reads a sentence from stdin and checks if every word is in the dictionary. Finally it informs the user whether or not the sentence is spelled correctly, i.e. every word is known in the dictionary.&lt;/p&gt;
&lt;p&gt;The spell checker is available on &lt;a href="https://github.com/rkettelerij/kotlin-java-spellchecker-example" target="_blank"&gt;my GitHub&lt;/a&gt;. Take a moment to study the &lt;a href="https://github.com/rkettelerij/kotlin-java-spellchecker-example/blob/master/src/main/java/com/richardlog/spellcheck/JavaSpellChecker.java" target="_blank"&gt;Java version&lt;/a&gt;, we&amp;#8217;ll discuss the &lt;a href="https://github.com/rkettelerij/kotlin-java-spellchecker-example/blob/master/src/main/kotlin/com/richardlog/spellcheck/KotlinSpellChecker.kt" target="_blank"&gt;Kotlin version&lt;/a&gt; next.&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Entry point&lt;br/&gt;&lt;/strong&gt;The Kotlin program has a main method, or in Kotlin terms a main &lt;em&gt;function&lt;/em&gt;. This function instantiates the KotlinSpellChecker class. Notice how the &amp;#8216;new&amp;#8217; keyword is absent in Kotlin.&lt;/p&gt;
&lt;p&gt;The &amp;#8216;checkSpelling&amp;#8217; function is called with an expression. In Java we probably would have used a ternary operator in this case. Kotlin has none, instead you specify an if/else expression in a single line. The return value is written to stdout with some syntactic sugar called &lt;a href="http://confluence.jetbrains.net/display/Kotlin/Strings" target="_blank"&gt;string templates&lt;/a&gt;. &lt;/p&gt;
&lt;pre&gt;fun main(args : Array) {
    val defaultInput = "Kotlin is an island"
    val valid = KotlinSpellChecker().checkSpelling(if (args.size &amp;gt; 0) args[0] else defaultInput)
    println("Is the text valid? $valid")
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Checking spelling&lt;/strong&gt;&lt;br/&gt;The function below receives a set of words from the &amp;#8216;readDictionary&amp;#8217; function and stores it in a variable named &amp;#8216;words&amp;#8217;. I haven&amp;#8217;t explicitly specified a type for this (immutable) variable since Kotlin is able to infer the type information.&lt;/p&gt;
&lt;p&gt;For-loops in Kotlin have a slightly different syntax compared to Java. In this case we iterate over an array of strings but Kotlin for-loops can also iterate over plain strings.&lt;/p&gt;
&lt;pre&gt;fun checkSpelling(input : String) : Boolean {
   val words = readDictionary()
   for (word in input.toLowerCase().split(" ")) {
        if (!words.contains(word)) {
            println("$word is not in the dictionary");
            return false;
        }
   }
   return true;
}
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Reading a file&lt;/strong&gt;&lt;br/&gt;The following code returns a &lt;em&gt;java.util.HashSet&lt;/em&gt; which is initialized using the &amp;#8216;hashSet&amp;#8217; function from the Kotlin standard library (&lt;a href="https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib" target="_blank"&gt;stdlib&lt;/a&gt;). The higher-order &amp;#8216;forEachLine&amp;#8217; function accepts a function literal which adds each word to the mentioned HashSet.&lt;/p&gt;
&lt;p&gt;Finally see the third line of code. We don&amp;#8217;t have to wrap the FileInputStream in a BufferedInputStream ourselves, instead we just call the &amp;#8216;buffered&amp;#8217; function to do it for us. Here we see &lt;a href="http://confluence.jetbrains.net/display/Kotlin/Extension+functions" target="_blank"&gt;extension functions&lt;/a&gt; in action, &amp;#8216;buffered&amp;#8217; is a generic extension function implemented in stdlib on Java&amp;#8217;s InputStream class.&lt;/p&gt;
&lt;pre&gt;private fun readDictionary() : Set {
    val words = hashSet("kotlin") // add kotlin to dictionary
    val stream = FileInputStream(DICTIONARY_WORDS).buffered();
    try {
         val reader = InputStreamReader(stream, "UTF-8");
         reader.forEachLine( { words.add(it)} )
    } finally {
         stream.close();
    }
    return words;
}
&lt;/pre&gt;
&lt;p&gt;You can fork the code off &lt;a href="https://github.com/rkettelerij/kotlin-java-spellchecker-example" target="_blank"&gt;GitHub&lt;/a&gt; in case you want to play with it. There&amp;#8217;s room for comments below. &lt;em&gt;Update: discussion on &lt;a href="http://news.ycombinator.com/item?id=3843605" target="_blank"&gt;Hacker News&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/G7r6Q_G-m_M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/G7r6Q_G-m_M/21142113656</link><guid isPermaLink="false">http://richardlog.com/post/21142113656</guid><pubDate>Sun, 15 Apr 2012 14:17:00 +0200</pubDate><category>kotlin</category><category>jvm language</category><category>java</category><category>example</category><category>jvm</category><feedburner:origLink>http://richardlog.com/post/21142113656</feedburner:origLink></item><item><title>Exploring Kotlin</title><description>&lt;p&gt;I&amp;#8217;ve been exploring &lt;a href="http://confluence.jetbrains.net/display/Kotlin/Welcome" target="_blank"&gt;Kotlin&lt;/a&gt; recently. Kotlin is a new statically typed JVM language and was announced about half a year ago. This month JetBrains released its first milestone candidate which I decided to have a closer look at.&lt;/p&gt;
&lt;p&gt;First of Kotlin is still in its early stages. A lot of things work pretty well (I&amp;#8217;m especially impressed by the IDE support) but there are still numerous issues. I&amp;#8217;ve hit a &lt;a href="http://youtrack.jetbrains.com/issue/KT-1740" target="_blank"&gt;couple&lt;/a&gt; &lt;a href="http://youtrack.jetbrains.com/issue/KT-1696" target="_blank"&gt;of&lt;/a&gt; &lt;a href="http://youtrack.jetbrains.com/issue/KT-1297" target="_blank"&gt;bugs&lt;/a&gt; so far.&lt;/p&gt;
&lt;p&gt;&lt;!-- more --&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;br/&gt;I&amp;#8217;ll highlight a few language features which I think are interesting (coming from Java).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Null-safety&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;    fun demoVars() {
        val first : String = "abc"
        first = "xyz" // error, variable is immutable
        var second = "abc"
        second = null // error, variable is mutable but non-nullable
        var third : String? = "abc"
        third = null  // ok, variable is marked as nullable ('?')

        foo?.bar?.baz // safe navigation
    }
&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Multi-line strings and string templates&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;    fun demoMultiLineTemplate() {
        val first = "john"
        val second = "doe"
        println("""
          First name: $first
          Second name: $second
        """)
    }
&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Higher-order functions&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;    bar({ println("I'm foobar") })
    bar({ println("I'm foobar") }, { println("I'm foobaz") })

    fun  bar(foobar : () -&amp;gt; T) {
        foobar()
    }

    fun  bar(foobar : () -&amp;gt; T, foobaz : () -&amp;gt; B) {
        foobar()
        foobaz()
    }
&lt;/pre&gt;
&lt;p&gt;These a just some examples refer to the Kotlin docs for more features.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Next blog&lt;br/&gt;&lt;/strong&gt;In my next blog I&amp;#8217;ll show a larger example of Kotlin code and compare it with its Java equivalent.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/cJARM2Me4kg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/cJARM2Me4kg/20714599434</link><guid isPermaLink="false">http://richardlog.com/post/20714599434</guid><pubDate>Sun, 08 Apr 2012 17:56:00 +0200</pubDate><category>kotlin</category><category>jvm language</category><category>intellij</category><category>java</category><category>jvm</category><feedburner:origLink>http://richardlog.com/post/20714599434</feedburner:origLink></item><item><title>NoSQL techday</title><description>&lt;a href="http://blog.avisi.nl/2012/03/27/nosql-techday/"&gt;NoSQL techday&lt;/a&gt;: &lt;p&gt;&lt;span&gt;Recap of the techday that I organized last week at Avisi.&lt;/span&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/BVheTaXJEo8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/BVheTaXJEo8/20010206422</link><guid isPermaLink="false">http://richardlog.com/post/20010206422</guid><pubDate>Tue, 27 Mar 2012 17:28:22 +0200</pubDate><category>nosql</category><category>mongodb</category><category>redis</category><category>hbase</category><category>opentsdb</category><feedburner:origLink>http://richardlog.com/post/20010206422</feedburner:origLink></item><item><title>Disabling caching in Apache Shindig</title><description>&lt;a href="http://blog.avisi.nl/2012/03/14/disabling-caching-in-apache-shindig/"&gt;Disabling caching in Apache Shindig&lt;/a&gt;: &lt;p&gt;&lt;span&gt;I’m currently working on a project that involves using Apache Shindig. &lt;/span&gt;&lt;span&gt;As you may know Shindig relies heavily on caching. &lt;/span&gt;&lt;span&gt;While generally a good thing caching is a pain during development. See my post at the Avisi blog on how to disable this in Shindig.&lt;/span&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/7GaeYRUDJTI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/7GaeYRUDJTI/19294422740</link><guid isPermaLink="false">http://richardlog.com/post/19294422740</guid><pubDate>Wed, 14 Mar 2012 17:53:21 +0100</pubDate><category>OpenSocial</category><category>Apache Shindig</category><category>Apache Rave</category><feedburner:origLink>http://richardlog.com/post/19294422740</feedburner:origLink></item><item><title>Putting Talend Open Studio projects under version control</title><description>&lt;p&gt;When you are working on OS X - I&amp;#8217;m not sure if other OS&amp;#8217;es have the same issue - your Talend Open Studio workspace is located under&lt;/p&gt;
&lt;pre&gt;/Applications/TOS-&amp;lt;version&amp;gt;/TalendOpenStudio-macosx-carbon.app/Contents/MacOS/workspace&lt;/pre&gt;
&lt;p&gt;That&amp;#8217;s right the workspace is placed &lt;em&gt;inside&lt;/em&gt; TalendOpenStudio.app, which isn&amp;#8217;t a very convenient place. Although Talend Open Studio is based on Eclipse it isn&amp;#8217;t keen on moving your workspace to a different location. The easiest way around this issue is to replace the above workspace directory with a symlink: &lt;/p&gt;
&lt;pre&gt;ln -s ~/workspace&lt;/pre&gt;
&lt;p&gt;From now on all your Talend jobs are created in a workspace under your home directory. To put the contents of this workspace under version control I recommend the following principles (source: &lt;a href="http://bowerstudios.com/node/871"&gt;bowerstudios.com&lt;/a&gt;):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;First, avoid Subversion/CVS as they will likely get you into trouble since they add info to each directory that is in version control. Talend Open Studio (TOS) tends to wipe out directories and recreate them, so you will have problems with those two tools complaining that they have lost information. Try to use a tool that does not add per directory entries (like git). I chose git.&lt;/p&gt;
&lt;p&gt;You will need to enter the entire workspace into version control, including the hidden metadata and compilation directories (.metadata, .JETEmitters and .Java). With each commit, make sure you grab all of those files that have changed.&lt;/p&gt;
&lt;p&gt;For each commit, do not commit until after you have exited TOS.&lt;/p&gt;
&lt;p&gt;If sharing across platforms, or with other developers, you may need to keep track of the different paths on your machines:&lt;br/&gt;For example, when you export a job, it will successfully export, but with previously compiled classes if the .classpath file in the .Java directory contains paths not on your local machine. Another way to put it, If someone else commits the project, you check it out, you make changes, you export it, the running code will not reflect the changes you made, even though the source does reflect those changes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;While versioning an entire workspace isn&amp;#8217;t ideal it&amp;#8217;s the one solution that&amp;#8217;s guaranteed to work. If you can suggest better alternatives please let me know.&lt;/p&gt;
&lt;p&gt;Finally to verify whether your workspace is still valid after performing the above, just open a job and click on the &amp;#8216;code&amp;#8217; tab. If you see generated Java code you know your workspace isn&amp;#8217;t corrupted.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/aMonAmJRH4g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/aMonAmJRH4g/15939924496</link><guid isPermaLink="false">http://richardlog.com/post/15939924496</guid><pubDate>Mon, 16 Jan 2012 10:00:06 +0100</pubDate><category>ETL</category><category>Open Studio</category><category>SCM</category><category>Talend</category><category>VCS</category><category>Version control</category><category>Workspace</category><category>Git</category><feedburner:origLink>http://richardlog.com/post/15939924496</feedburner:origLink></item><item><title>Healthy RSS addiction</title><description>&lt;p&gt;I&amp;#8217;ve been a long term fan of RSS feeds. It&amp;#8217;s ideal when following tech news. In the past I used to read my feeds on a computer - using a mail client - but nowadays I prefer my iPad.&lt;/p&gt;
&lt;p&gt;The following screenshot from Google Reader shows my addiction over the past year. &lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/tumblr_lxlragxIsJ1r229k0.png"/&gt;&lt;/p&gt;
&lt;p&gt;Hmmm a little over 7 tech articles/blogs a day, that sounds about right. Although&amp;#8230; this doesn&amp;#8217;t include my reads on Hacker News. Perhaps it&amp;#8217;s more serious than I thought ;)&lt;/p&gt;
&lt;p&gt;Cross posted to &lt;a href="http://blog.avisi.nl/2012/01/13/healthy-rss-addiction/"&gt;&lt;a href="http://blog.avisi.nl/2012/01/13/healthy-rss-addiction/"&gt;http://blog.avisi.nl/2012/01/13/healthy-rss-addiction/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/rmlzCRefdjI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/rmlzCRefdjI/15768890605</link><guid isPermaLink="false">http://richardlog.com/post/15768890605</guid><pubDate>Fri, 13 Jan 2012 10:03:00 +0100</pubDate><category>rss</category><category>google reader</category><feedburner:origLink>http://richardlog.com/post/15768890605</feedburner:origLink></item><item><title>Has Facebook silently killed Open Streams in favor of Open Graph?</title><description>&lt;p&gt;I was looking at the &lt;a href="http://activitystrea.ms/"&gt;JSON Activity Stream&lt;/a&gt; specification today. Facebook is listed as &lt;a href="http://wiki.activitystrea.ms/w/page/24500522/Implementors"&gt;one of the parties&lt;/a&gt; to support this format. Indeed I&amp;#8217;ve found a &lt;a href="https://developers.facebook.com/blog/post/225"&gt;blog post written in April 2009&lt;/a&gt; that confirms Facebook has implemented JSON activity streams. Facebook calls it Open Streams.&lt;/p&gt;
&lt;p&gt;In the meantime all references to the Open Streams developer documentation have been removed. Looking at the &lt;a href="https://developers.facebook.com/tools/explorer/?method=GET&amp;amp;path=me%2Fhome"&gt;current Graph API&lt;/a&gt; it doesn&amp;#8217;t seem to conform to the JSON activity stream 1.0 format. Did Facebook (silently) stopped supporting this format?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/a7y25WDptvw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/a7y25WDptvw/14076234924</link><guid isPermaLink="false">http://richardlog.com/post/14076234924</guid><pubDate>Sun, 11 Dec 2011 20:15:00 +0100</pubDate><category>restful services</category><category>facebook</category><feedburner:origLink>http://richardlog.com/post/14076234924</feedburner:origLink></item><item><title>Integration testing RESTful services in Java</title><description>&lt;a href="http://code.google.com/p/rest-assured/"&gt;Integration testing RESTful services in Java&lt;/a&gt;: &lt;p&gt;Currently I’m using the &lt;a href="http://download.oracle.com/javase/6/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html"&gt;build-in HTTP server in Java 6&lt;/a&gt; for (integration) testing RESTful services. Although this has the advantage of adding zero dependencies, the API of &lt;a href="http://code.google.com/p/rest-assured/"&gt;REST-assured&lt;/a&gt; looks cleaner. Something to keep in mind when you need to test (many) services.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/zxnhVKmLiBU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/zxnhVKmLiBU/13168480016</link><guid isPermaLink="false">http://richardlog.com/post/13168480016</guid><pubDate>Tue, 22 Nov 2011 21:26:00 +0100</pubDate><category>REST</category><category>restful services</category><category>Java</category><feedburner:origLink>http://richardlog.com/post/13168480016</feedburner:origLink></item><item><title>The Architecture of Open Source Applications</title><description>&lt;a href="http://www.aosabook.org/en/index.html"&gt;The Architecture of Open Source Applications&lt;/a&gt;: &lt;p&gt;This book is available for free online under the Creative Commons license.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/qb4EEqbGoLw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/qb4EEqbGoLw/12892177445</link><guid isPermaLink="false">http://richardlog.com/post/12892177445</guid><pubDate>Wed, 16 Nov 2011 21:50:14 +0100</pubDate><category>open source</category><category>software architecture</category><feedburner:origLink>http://richardlog.com/post/12892177445</feedburner:origLink></item><item><title>Playing an agile learning game during scrum training (inspired...</title><description>&lt;img src="http://25.media.tumblr.com/tumblr_luq24cHBB21r5sp11o1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Playing an agile learning game during scrum training (inspired by the XP game). It looks a bit like a kids party considering all the balloons and colored paper :). Useful exercise nonetheless, reminds me a bit about the software process course I attended while in university.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/0fIM65ukJDw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/0fIM65ukJDw/12850258472</link><guid isPermaLink="false">http://richardlog.com/post/12850258472</guid><pubDate>Tue, 15 Nov 2011 22:52:00 +0100</pubDate><category>agile</category><category>scrum</category><feedburner:origLink>http://richardlog.com/post/12850258472</feedburner:origLink></item><item><title>Pretty-printing JSON and XML on Mac OSX</title><description>&lt;p&gt;Like my colleagues at &lt;a href="http://avisi.nl" target="_blank"&gt;Avisi&lt;/a&gt; I&amp;#8217;m an avid OSX user. One of the reasons I like OSX is it gives you the power of Unix right under your fingertips while still providing a nice user interface. &lt;/p&gt;
&lt;p class="p2"&gt;Now suppose you&amp;#8217;re working on RESTful services and you need to verify or debug some JSON output. Digging through an unformatted JSON string can be a real pain. To make a JSON string human readable open up the Terminal and type:&lt;/p&gt;
&lt;p class="p1"&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;cat unformatted.json | python -m json.tool &amp;gt; formatted.json&lt;/pre&gt;
&lt;p class="p2"&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;This will pretty-print the contents of &amp;#8220;unformatted.json&amp;#8221; to a new file called &amp;#8220;formatted.json&amp;#8221;. For this to work you need to have at least Python 2.6 installed. Which is the case when your running Snow Leopard or higher.&lt;/p&gt;
&lt;p class="p1"&gt;The above command assumes you have a file containing the JSON content. When you&amp;#8217;re debugging it&amp;#8217;s more likely you copied a JSON string to your clipboard from a (remote) log file. To pretty-print the JSON content on your clipboard type:&lt;/p&gt;
&lt;pre&gt;pbpaste | python -m json.tool &amp;gt; formatted.json&lt;/pre&gt;
&lt;p class="p2"&gt;&lt;span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p class="p1"&gt;Likewise when you&amp;#8217;re dealing with XML instead of JSON type in:&lt;/p&gt;
&lt;pre&gt;pbpaste | xmllint --format - &amp;gt; formatted.xml&lt;/pre&gt;
&lt;p class="p2"&gt;The xmllint program is part of libxml2 and installed by default on OSX.&lt;/p&gt;
&lt;p class="p1"&gt;Happing pretty-printing!&lt;/p&gt;
&lt;p class="p1"&gt;&lt;em&gt;Update: &lt;a href="http://news.ycombinator.com/item?id=3231196"&gt;Hacker News thread&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/9qig0NhmrMo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/9qig0NhmrMo/12743073497</link><guid isPermaLink="false">http://richardlog.com/post/12743073497</guid><pubDate>Sun, 13 Nov 2011 18:02:00 +0100</pubDate><category>JSON</category><category>Mac OSX</category><category>Pretty-printing</category><category>REST</category><category>XML</category><feedburner:origLink>http://richardlog.com/post/12743073497</feedburner:origLink></item><item><title>Interesting extension of OpenSocial beyond web applications</title><description>&lt;a href="http://www.xobni.com/developer/"&gt;Interesting extension of OpenSocial beyond web applications&lt;/a&gt;: &lt;p&gt;Xobni offers an OpenSocial container &lt;em&gt;inside&lt;/em&gt; Outlook. One example of a useful gadget (at least one that I can relate to) is the &lt;a target="_blank" href="http://www.xobni.com/gadgets/jira"&gt;JIRA gadget&lt;/a&gt;. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/m7JEvI0PkNE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/m7JEvI0PkNE/12412891918</link><guid isPermaLink="false">http://richardlog.com/post/12412891918</guid><pubDate>Sun, 06 Nov 2011 11:58:34 +0100</pubDate><category>xobni</category><category>gadget</category><category>opensocial</category><category>portal</category><category>outlook</category><feedburner:origLink>http://richardlog.com/post/12412891918</feedburner:origLink></item><item><title>Got a brand new MacBook Pro thanks to Avisi. My previous MacBook...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_ltztasp7Dj1r5sp11o1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Got a brand new MacBook Pro thanks to &lt;a href="http://avisi.nl"&gt;Avisi&lt;/a&gt;. My previous MacBook Pro in the back was a late 2008 model. This one should be a lot faster and it’s got Lion preinstalled :).&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/TjLNvBmcW7Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/TjLNvBmcW7Q/12202658274</link><guid isPermaLink="false">http://richardlog.com/post/12202658274</guid><pubDate>Tue, 01 Nov 2011 19:13:00 +0100</pubDate><category>Mac</category><category>OSX</category><feedburner:origLink>http://richardlog.com/post/12202658274</feedburner:origLink></item><item><title>IntelliJ IDEA and Maven: M2_HOME trouble </title><description>&lt;p&gt;There&amp;#8217;s an annoying issue when using Maven from IntelliJ IDEA on OSX. You might encounter the following error when building a Maven project.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The issue is &lt;a href="http://youtrack.jetbrains.net/issue/IDEA-54098"&gt;well known&lt;/a&gt; and there are &lt;a href="http://superuser.com/questions/147126/setting-environment-variables-in-os-x-etc-launchd-conf"&gt;various&lt;/a&gt; &lt;a href="http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x"&gt;solutions&lt;/a&gt; to the problem. The trouble with some is they apply to old versions of OSX, specifically Leopard. If your running Snow Leopard or higher you don&amp;#8217;t need to alter your launchd configuration. The following will suffice:&lt;/p&gt;
&lt;p&gt;1) Check you &lt;em&gt;Maven home&lt;/em&gt; directory.&lt;img src="http://media.tumblr.com/tumblr_ltvyfcQ63O1r229k0.png"/&gt;&lt;/p&gt;
&lt;p&gt;2) Create the following file in &lt;em&gt;~/.MacOSX/environment.plist.&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;{
"M2_HOME"="/usr/share/maven";
M2="/usr/share/maven/bin";
}&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;3) Make sure you enter the correct path as shown in the Maven version info.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4) Reboot your system (I know it&amp;#8217;s annoying).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now you should have no problem starting Maven builds from IDEA.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/v6KkRdLvVno" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/v6KkRdLvVno/12118330250</link><guid isPermaLink="false">http://richardlog.com/post/12118330250</guid><pubDate>Sun, 30 Oct 2011 14:55:00 +0100</pubDate><category>M2_HOME</category><category>IDE</category><category>Java</category><category>Maven</category><category>Mac OSX</category><category>IntelliJ IDEA</category><feedburner:origLink>http://richardlog.com/post/12118330250</feedburner:origLink></item><item><title>Amazon Web Services Architecture Center</title><description>&lt;a href="http://aws.amazon.com/architecture/"&gt;Amazon Web Services Architecture Center&lt;/a&gt;: &lt;p&gt;Take a look at the references architectures in case your wondering how the different AWS services fit together.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/-kG78adeJ-k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/-kG78adeJ-k/12075684788</link><guid isPermaLink="false">http://richardlog.com/post/12075684788</guid><pubDate>Sat, 29 Oct 2011 13:00:00 +0200</pubDate><category>software architecture</category><category>cloud computing</category><feedburner:origLink>http://richardlog.com/post/12075684788</feedburner:origLink></item><item><title>"Extract until you can’t extract any further."</title><description>“Extract until you can’t extract any further.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Robert C. Martin, better known as Uncle Bob, talking about (refactoring) functions.&lt;/em&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/g8bbfgoguxI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/g8bbfgoguxI/12133574738</link><guid isPermaLink="false">http://richardlog.com/post/12133574738</guid><pubDate>Sat, 22 Oct 2011 16:45:00 +0200</pubDate><feedburner:origLink>http://richardlog.com/post/12133574738</feedburner:origLink></item><item><title>First post</title><description>&lt;p&gt;Welcome to my new blog or more accurately &amp;#8220;tumblelog&amp;#8221;. Here I&amp;#8217;ll occasionally share my experiences as a software engineer. Themes include Java, agile, open source, architecture and pretty much anything in between.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/richardlog/~4/fTBAyyeodzY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/richardlog/~3/fTBAyyeodzY/11833411959</link><guid isPermaLink="false">http://richardlog.com/post/11833411959</guid><pubDate>Mon, 17 Oct 2011 22:45:00 +0200</pubDate><feedburner:origLink>http://richardlog.com/post/11833411959</feedburner:origLink></item></channel></rss>
