<?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>Jonathan Holloway</title>
	<atom:link href="http://www.jonathanholloway.co.uk/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jonathanholloway.co.uk</link>
	<description>www.jonathanholloway.co.uk</description>
	<lastBuildDate>Thu, 13 Jun 2013 19:13:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>R and Shiny Web Applications</title>
		<link>http://www.jonathanholloway.co.uk/java/r-and-shiny-web-applications?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=r-and-shiny-web-applications</link>
		<comments>http://www.jonathanholloway.co.uk/java/r-and-shiny-web-applications#comments</comments>
		<pubDate>Thu, 13 Jun 2013 19:03:02 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=661</guid>
		<description><![CDATA[Shiny and R Talk @ Mango-Solutions First up, we&#8217;re doing a talk on R, Shiny and Web Applications @ Chippenham Tech Chat on Weds June 19th 2013. More info here: If you&#8217;ve not come across it Shiny is a reactive programming web application framework built around R for exposing analytic applications. It&#8217;s made by the ...]]></description>
				<content:encoded><![CDATA[<p><strong>Shiny and R Talk @ Mango-Solutions</strong></p>
<p><a href="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/01/mangologo.jpg" rel="lightbox[661]"><img src="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/01/mangologo-300x84.jpg" alt="mangologo" width="300" height="84" class="aligncenter size-medium wp-image-623" /></a></p>
<p>First up, we&#8217;re doing a talk on R, Shiny and Web Applications @ Chippenham Tech Chat on Weds June 19th 2013.  More info here:</p>
<p><a href="http://www.meetup.com/Chippenham-Tech-Chat/events/120262432/" title="http://www.meetup.com/Chippenham-Tech-Chat/events/120262432/"></a></p>
<p><a href="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/06/hello-shiny.png" rel="lightbox[661]"><img src="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/06/hello-shiny-300x180.png" alt="hello-shiny" width="500" height="280" class="aligncenter size-medium wp-image-671" /></a></p>
<p>If you&#8217;ve not come across it Shiny is a reactive programming web application framework built around R for exposing analytic applications.</p>
<p>It&#8217;s made by the guys from RStudio, who also provide the great IDE that lots of us use.  </p>
<p>An introduction to Shiny from RStudio:<br />
<a href="http://rstudio.github.io/shiny/tutorial/">http://rstudio.github.io/shiny/tutorial/</a></p>
<p>An introduction to Shiny from the Dallas R users group here:<br />
<a href="https://github.com/trestletech/shiny-sandbox/blob/master/shiny_introduction.pdf">https://github.com/trestletech/shiny-sandbox/blob/master/shiny_introduction.pdf</a></p>
<p>and a good overview of deploying Shiny on Amazon EC2 here:<br />
<a href="http://www.r-bloggers.com/deploying-shiny-server-on-amazon-ec2/">http://www.r-bloggers.com/deploying-shiny-server-on-amazon-ec2/</a></p>
<p>I guess there&#8217;s a few notable things from my side that I thought were pretty great when working with Shiny.</p>
<p><strong>Installation</strong></p>
<p>Get up and running by installing with the following:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
install.packages<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;shiny&quot;</span>, <span style="color: #007800;">repos</span>=<span style="color: #ff0000;">&quot;http://shiny.rstudio.com&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p>and then run the example (starts a webserver on port 8100 and invokes xdg-open on Linux)</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
library<span style="color: #7a0874; font-weight: bold;">&#40;</span>shiny<span style="color: #7a0874; font-weight: bold;">&#41;</span>
runExample<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;01_hello&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p><strong>Application Structure</strong></p>
<p>The application consists of two main parts:</p>
<p><i>User Interface &#8211; ui.R</i><br />
* Layouts<br />
* Panels<br />
* Inputs (selectInput, numericInput etc&#8230;)</p>
<p><i>Serverside &#8211; server.R</i><br />
* function listeners</p>
<p><strong>Architecture</strong></p>
<p>The Shiny architecture is made up of a number of parts internally, namely a set of web/browser components including:</p>
<ul>
<li>Twitter Bootstrap &#8211; a UI library that provides scaffolding in terms of layouts with HTML and CSS</li>
<li>Websockets &#8211; a way to do bi-directional communication with a browser/webserver.</li>
</ul>
<p>Serverside Shiny makes use of Node.js for hosting (it doesn&#8217;t have to), but this to probably the most scalable approach.</p>
<p>Finally, it&#8217;s based on the concept of reactive programming which provides a number of parts:</p>
<ul>
<li>Triggers/Inputs &#8211; Source (Shiny Reactive Value)</li>
<li>Sinks/Outputs &#8211; Endpoint (Shiny Observer)</li>
</ul>
<p>The triggers are executed when dependencies  (inputs) change resulting in a change to the output:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
shinyServer<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>input, output<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
 output<span style="color: #007800;">$plotOut</span> <span style="color: #000000; font-weight: bold;">&lt;</span>- renderPlot<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
   hist<span style="color: #7a0874; font-weight: bold;">&#40;</span>faithful<span style="color: #007800;">$eruptions</span>, breaks = as.numeric<span style="color: #7a0874; font-weight: bold;">&#40;</span>input<span style="color: #007800;">$nBreaks</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>input<span style="color: #007800;">$individualObs</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
     rug<span style="color: #7a0874; font-weight: bold;">&#40;</span>faithful<span style="color: #007800;">$eruptions</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
 <span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
 output<span style="color: #007800;">$tableOut</span> <span style="color: #000000; font-weight: bold;">&lt;</span>- renderTable<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>input<span style="color: #007800;">$individualObs</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
     faithful
   <span style="color: #000000; font-weight: bold;">else</span>
     NULL
 <span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p>In some cases, changes could take a long time to run (accessing database, read from file).  Shiny proposes conductors to encapsulate these operations.  Shiny calls these reactive expressions</p>
<p>More info here &#8211; http://rstudio.github.io/shiny/tutorial/#reactivity-overview</p>
<p><strong>Deployment</strong></p>
<p>In terms of deployment you have a number of options:</p>
<p>1. You can deploy apps on hosted Shiny Server</p>
<p>2. Run from a Github paste (Gist) or from Github (this is an awesome feature)</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
shiny::runGist<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'3239667'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
shiny::runGitHub<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">'shiny_example'</span>, <span style="color: #ff0000;">'rstudio'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p>3. Deploy on Amazon EC2</p>
<p>4. Host yourself by installing Apache and NodeJS</p>
<p>Hope that gives you a good overview of Shiny, come along to the meetup if you want to learn more about it.</p>
<p><strong>Recruitment Plug Here -></strong> </p>
<p>Yeah, yeah we&#8217;re also recruiting for Java developers, Javascript developers for our devops and development teams here: </p>
<p><a href="http://www.mango-solutions.com/careers.html" title="http://www.mango-solutions.com/careers.html">http://www.mango-solutions.com/careers.html</a></p>
<p>plus R developers : )</p>
<p>Our Stackoverflow company page is here &#8211; <a href="http://careers.stackoverflow.com/company/mango-solutions" title="http://careers.stackoverflow.com/company/mango-solutions">http://careers.stackoverflow.com/company/mango-solutions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/r-and-shiny-web-applications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play Framework &#8211; Scala TodoList</title>
		<link>http://www.jonathanholloway.co.uk/java/play-framework-scala-todolist?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=play-framework-scala-todolist</link>
		<comments>http://www.jonathanholloway.co.uk/java/play-framework-scala-todolist#comments</comments>
		<pubDate>Wed, 20 Mar 2013 23:42:20 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=646</guid>
		<description><![CDATA[I&#8217;ve just finished going through the Scala TodoList sample application in the Play Framework: http://www.playframework.com/documentation/2.1.0/ScalaTodoList It&#8217;s not exactly the most straightforward written tutorial I&#8217;ve come across from a framework so I thought I&#8217;d post the full sources here along with an archive of everything: Download for people to refer to if they get stuck. One ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just finished going through the Scala TodoList sample application in the Play Framework:</p>
<p><a href="http://www.playframework.com/documentation/2.1.0/ScalaTodoList" title="ScalaTodoList">http://www.playframework.com/documentation/2.1.0/ScalaTodoList</a></p>
<p>It&#8217;s not exactly the most straightforward written tutorial I&#8217;ve come across from a framework so I thought I&#8217;d post the full sources here along with an archive of everything:</p>
<p><a href="http://www.jonathanholloway.co.uk/downloads/todolist.zip" title="Download Archive">Download</a></p>
<p>for people to refer to if they get stuck.</p>
<p>One other thing, it doesn&#8217;t tell you to enable database evolutions by default in the application.conf file so make sure you do, it&#8217;s not a showstopper by any means, but it&#8217;s handy to know.</p>
<p>The application consists of the following sources:</p>
<p>* app/controllers/Application.scala &#8211; Main Controller<br />
* app/models/Task.scala &#8211; Task Companion Object<br />
* app/views/index.scala.html &#8211; Index Template<br />
* conf/application.conf &#8211; Configuration<br />
* conf/routes &#8211; Routes<br />
* conf/evolutions/default/1.sql &#8211; Database Evolution/Migration</p>
<p><strong>Application.scala</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Scala"><div class="devcodeoverflow">
<span style="color: #0000ff; font-weight: bold;">package</span> controllers
&nbsp;
<span style="color: #0000ff; font-weight: bold;">import</span> play.<span style="color: #000000;">api</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> play.<span style="color: #000000;">api</span>.<span style="color: #000000;">mvc</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> play.<span style="color: #000000;">api</span>.<span style="color: #000000;">data</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> play.<span style="color: #000000;">api</span>.<span style="color: #000000;">data</span>.<span style="color: #000000;">Forms</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> models.<span style="color: #000000;">Task</span>
&nbsp;
<span style="color: #008000; font-style: italic;">// Controller</span>
<span style="color: #0000ff; font-weight: bold;">object</span> Application <span style="color: #0000ff; font-weight: bold;">extends</span> Controller <span style="color: #F78811;">&#123;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">val</span> taskForm <span style="color: #000080;">=</span> Form<span style="color: #F78811;">&#40;</span>
		<span style="color: #6666FF;">&quot;label&quot;</span> -<span style="color: #000080;">&gt;</span> nonEmptyText
	<span style="color: #F78811;">&#41;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> index <span style="color: #000080;">=</span> Action <span style="color: #F78811;">&#123;</span> 
		Redirect<span style="color: #F78811;">&#40;</span>routes.<span style="color: #000000;">Application</span>.<span style="color: #000000;">tasks</span><span style="color: #F78811;">&#41;</span> 
	<span style="color: #F78811;">&#125;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> newTask <span style="color: #000080;">=</span> Action <span style="color: #F78811;">&#123;</span> <span style="color: #0000ff; font-weight: bold;">implicit</span> request <span style="color: #000080;">=&gt;</span>
	  taskForm.<span style="color: #000000;">bindFromRequest</span>.<span style="color: #000000;">fold</span><span style="color: #F78811;">&#40;</span>
	    errors <span style="color: #000080;">=&gt;</span> BadRequest<span style="color: #F78811;">&#40;</span>views.<span style="color: #000000;">html</span>.<span style="color: #000000;">index</span><span style="color: #F78811;">&#40;</span>Task.<span style="color: #000000;">all</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>, errors<span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span>,
	    label <span style="color: #000080;">=&gt;</span> <span style="color: #F78811;">&#123;</span>
	      Task.<span style="color: #000000;">create</span><span style="color: #F78811;">&#40;</span>label<span style="color: #F78811;">&#41;</span>
	      Redirect<span style="color: #F78811;">&#40;</span>routes.<span style="color: #000000;">Application</span>.<span style="color: #000000;">tasks</span><span style="color: #F78811;">&#41;</span>
	    <span style="color: #F78811;">&#125;</span>
	  <span style="color: #F78811;">&#41;</span>
	<span style="color: #F78811;">&#125;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> tasks <span style="color: #000080;">=</span> Action <span style="color: #F78811;">&#123;</span>
	  Ok<span style="color: #F78811;">&#40;</span>views.<span style="color: #000000;">html</span>.<span style="color: #000000;">index</span><span style="color: #F78811;">&#40;</span>Task.<span style="color: #000000;">all</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>, taskForm<span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> deleteTask<span style="color: #F78811;">&#40;</span>id<span style="color: #000080;">:</span> Long<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> Action <span style="color: #F78811;">&#123;</span> 
		Task.<span style="color: #000000;">delete</span><span style="color: #F78811;">&#40;</span>id<span style="color: #F78811;">&#41;</span>
  		Redirect<span style="color: #F78811;">&#40;</span>routes.<span style="color: #000000;">Application</span>.<span style="color: #000000;">tasks</span><span style="color: #F78811;">&#41;</span>
	<span style="color: #F78811;">&#125;</span> 
<span style="color: #F78811;">&#125;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p><strong>Task.scala</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Scala"><div class="devcodeoverflow">
<span style="color: #0000ff; font-weight: bold;">package</span> models
&nbsp;
<span style="color: #0000ff; font-weight: bold;">import</span> anorm.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> anorm.<span style="color: #000000;">SqlParser</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> play.<span style="color: #000000;">api</span>.<span style="color: #000000;">db</span>.<span style="color: #000080;">_</span>
<span style="color: #0000ff; font-weight: bold;">import</span> play.<span style="color: #000000;">api</span>.<span style="color: #000000;">Play</span>.<span style="color: #000000;">current</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">case</span> <span style="color: #0000ff; font-weight: bold;">class</span> Task<span style="color: #F78811;">&#40;</span>id<span style="color: #000080;">:</span> Long, label<span style="color: #000080;">:</span> String<span style="color: #F78811;">&#41;</span>
&nbsp;
<span style="color: #008000; font-style: italic;">// Task companion object</span>
<span style="color: #0000ff; font-weight: bold;">object</span> Task <span style="color: #F78811;">&#123;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">val</span> task <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
	  get<span style="color: #F78811;">&#91;</span>Long<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;id&quot;</span><span style="color: #F78811;">&#41;</span> ~ 
	  get<span style="color: #F78811;">&#91;</span>String<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;label&quot;</span><span style="color: #F78811;">&#41;</span> map <span style="color: #F78811;">&#123;</span>
	    <span style="color: #0000ff; font-weight: bold;">case</span> id~label <span style="color: #000080;">=&gt;</span> Task<span style="color: #F78811;">&#40;</span>id, label<span style="color: #F78811;">&#41;</span>
	  <span style="color: #F78811;">&#125;</span>
	<span style="color: #F78811;">&#125;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> all<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span><span style="color: #000080;">:</span> List<span style="color: #F78811;">&#91;</span>Task<span style="color: #F78811;">&#93;</span> <span style="color: #000080;">=</span> DB.<span style="color: #000000;">withConnection</span> <span style="color: #F78811;">&#123;</span> <span style="color: #0000ff; font-weight: bold;">implicit</span> c <span style="color: #000080;">=&gt;</span>
  		SQL<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;select * from task&quot;</span><span style="color: #F78811;">&#41;</span>.<span style="color: #000000;">as</span><span style="color: #F78811;">&#40;</span>task <span style="color: #000080;">*</span><span style="color: #F78811;">&#41;</span>
	<span style="color: #F78811;">&#125;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> create<span style="color: #F78811;">&#40;</span>label<span style="color: #000080;">:</span> String<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
	  DB.<span style="color: #000000;">withConnection</span> <span style="color: #F78811;">&#123;</span> <span style="color: #0000ff; font-weight: bold;">implicit</span> c <span style="color: #000080;">=&gt;</span>
	    SQL<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;insert into task (label) values ({label})&quot;</span><span style="color: #F78811;">&#41;</span>.<span style="color: #000000;">on</span><span style="color: #F78811;">&#40;</span>
	      <span style="color: #CC66FF;">'label</span> -<span style="color: #000080;">&gt;</span> label
	    <span style="color: #F78811;">&#41;</span>.<span style="color: #000000;">executeUpdate</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>
	  <span style="color: #F78811;">&#125;</span>
	<span style="color: #F78811;">&#125;</span>
&nbsp;
	<span style="color: #0000ff; font-weight: bold;">def</span> delete<span style="color: #F78811;">&#40;</span>id<span style="color: #000080;">:</span> Long<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
	  DB.<span style="color: #000000;">withConnection</span> <span style="color: #F78811;">&#123;</span> <span style="color: #0000ff; font-weight: bold;">implicit</span> c <span style="color: #000080;">=&gt;</span>
	    SQL<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;delete from task where id = {id}&quot;</span><span style="color: #F78811;">&#41;</span>.<span style="color: #000000;">on</span><span style="color: #F78811;">&#40;</span>
	      <span style="color: #CC66FF;">'id</span> -<span style="color: #000080;">&gt;</span> id
	    <span style="color: #F78811;">&#41;</span>.<span style="color: #000000;">executeUpdate</span><span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span>
	  <span style="color: #F78811;">&#125;</span>
	<span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p><strong>index.scala.html</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Scala"><div class="devcodeoverflow">
&nbsp;
<span style="color: #000080;">@</span><span style="color: #F78811;">&#40;</span>tasks<span style="color: #000080;">:</span> List<span style="color: #F78811;">&#91;</span>Task<span style="color: #F78811;">&#93;</span>, taskForm<span style="color: #000080;">:</span> Form<span style="color: #F78811;">&#91;</span>String<span style="color: #F78811;">&#93;</span><span style="color: #F78811;">&#41;</span>
<span style="color: #000080;">@</span><span style="color: #0000ff; font-weight: bold;">import</span> helper.<span style="color: #000080;">_</span>
<span style="color: #000080;">@</span>main<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;Todo list&quot;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
&nbsp;
    <span style="color: #000080;">&lt;</span>h1<span style="color: #000080;">&gt;@</span>tasks.<span style="color: #000000;">size</span> task<span style="color: #F78811;">&#40;</span>s<span style="color: #F78811;">&#41;</span><span style="color: #000080;">&lt;</span>/h1<span style="color: #000080;">&gt;</span>
&nbsp;
    <span style="color: #000080;">&lt;</span>ul<span style="color: #000080;">&gt;</span>
        <span style="color: #000080;">@</span>tasks.<span style="color: #000000;">map</span> <span style="color: #F78811;">&#123;</span> task <span style="color: #000080;">=&gt;</span>
            <span style="color: #000080;">&lt;</span>li<span style="color: #000080;">&gt;</span>
                <span style="color: #000080;">@</span>task.<span style="color: #000000;">label</span>
&nbsp;
                <span style="color: #000080;">@</span>form<span style="color: #F78811;">&#40;</span>routes.<span style="color: #000000;">Application</span>.<span style="color: #000000;">deleteTask</span><span style="color: #F78811;">&#40;</span>task.<span style="color: #000000;">id</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
                    <span style="color: #000080;">&lt;</span>input <span style="color: #0000ff; font-weight: bold;">type</span><span style="color: #000080;">=</span><span style="color: #6666FF;">&quot;submit&quot;</span> value<span style="color: #000080;">=</span><span style="color: #6666FF;">&quot;Delete&quot;</span><span style="color: #000080;">&gt;</span>
                <span style="color: #F78811;">&#125;</span>
            <span style="color: #000080;">&lt;</span>/li<span style="color: #000080;">&gt;</span>
        <span style="color: #F78811;">&#125;</span>
    <span style="color: #000080;">&lt;</span>/ul<span style="color: #000080;">&gt;</span>
&nbsp;
    <span style="color: #000080;">&lt;</span>h2<span style="color: #000080;">&gt;</span>Add a <span style="color: #0000ff; font-weight: bold;">new</span> task<span style="color: #000080;">&lt;</span>/h2<span style="color: #000080;">&gt;</span>
&nbsp;
    <span style="color: #000080;">@</span>form<span style="color: #F78811;">&#40;</span>routes.<span style="color: #000000;">Application</span>.<span style="color: #000000;">newTask</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
&nbsp;
        <span style="color: #000080;">@</span>inputText<span style="color: #F78811;">&#40;</span>taskForm<span style="color: #F78811;">&#40;</span><span style="color: #6666FF;">&quot;label&quot;</span><span style="color: #F78811;">&#41;</span><span style="color: #F78811;">&#41;</span> 
&nbsp;
        <span style="color: #000080;">&lt;</span>input <span style="color: #0000ff; font-weight: bold;">type</span><span style="color: #000080;">=</span><span style="color: #6666FF;">&quot;submit&quot;</span> value<span style="color: #000080;">=</span><span style="color: #6666FF;">&quot;Create&quot;</span><span style="color: #000080;">&gt;</span>
&nbsp;
    <span style="color: #F78811;">&#125;</span>   
<span style="color: #F78811;">&#125;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p><strong>conf/routes</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow">
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
&nbsp;
# Home page
GET     /                           controllers.Application.index
&nbsp;
# Map static resources from the /public folder to the /assets URL path
GET     /assets/*file               controllers.Assets.at(path=&quot;/public&quot;, file)
&nbsp;
# Tasks          
GET     /tasks                  controllers.Application.tasks
POST    /tasks                  controllers.Application.newTask
POST    /tasks/:id/delete       controllers.Application.deleteTask(id: Long)
</div></pre><!--END_DEVFMTCODE--></p>
<p><strong>application.conf</strong></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow">
...
db.default.driver=org.h2.Driver
db.default.url=&quot;jdbc:h2:mem:play&quot;
...
</div></pre><!--END_DEVFMTCODE--></p>
<p>conf/evolutions/default/1.sql</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="SQL"><div class="devcodeoverflow">
# Tasks schema 
# <span style="color: #808080; font-style: italic;">--- !Ups</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">SEQUENCE</span> task_id_seq;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> task <span style="color: #66cc66;">&#40;</span>
    id <span style="color: #993333; font-weight: bold;">INTEGER</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">DEFAULT</span> <span style="color: #993333; font-weight: bold;">NEXTVAL</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'task_id_seq'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
    label <span style="color: #993333; font-weight: bold;">VARCHAR</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
# <span style="color: #808080; font-style: italic;">--- !Downs</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">TABLE</span> task;
<span style="color: #993333; font-weight: bold;">DROP</span> <span style="color: #993333; font-weight: bold;">SEQUENCE</span> task_id_seq;
</div></pre><!--END_DEVFMTCODE--></p>
<p>Hope that helps !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/play-framework-scala-todolist/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Visualisation and Graphing</title>
		<link>http://www.jonathanholloway.co.uk/java/javascript-graphing?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=javascript-graphing</link>
		<comments>http://www.jonathanholloway.co.uk/java/javascript-graphing#comments</comments>
		<pubDate>Sat, 12 Jan 2013 10:12:01 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=613</guid>
		<description><![CDATA[Javascript data visualisation and graphing is becoming a big deal these days. When I started with web development it was on IE5/6 with Javascript and I can&#8217;t remember the experience as being pleasurable. Nowadays, our modern browsers, Chrome, Firefox and Opera have HTML5 canvas implementations that provide a mechanism for doing 2D graphics that are ...]]></description>
				<content:encoded><![CDATA[<p>Javascript data visualisation and graphing is becoming a big deal these days.  When I started with web development it was on IE5/6 with Javascript and I can&#8217;t remember the experience as being pleasurable.</p>
<p>Nowadays, our modern browsers, Chrome, Firefox and Opera have HTML5 canvas implementations that provide a mechanism for doing 2D graphics that are beginning to approach the capabilities of what Adobe Flash provides &#8211; TweenJS (<a href="http://www.createjs.com/#!/TweenJS">http://www.createjs.com/#!/TweenJS</a>) provides advanced animation and support for tweening whilst demos such as the Madmanimation really show off what is capable of the browser with CSS and HTML5.  If you haven&#8217;t seen it then check it out:</p>
<p><a href="http://stuffandnonsense.co.uk/content/demo/madmanimation/">http://stuffandnonsense.co.uk/content/demo/madmanimation/</a></p>
<p><strong>R Based Graphics</strong></p>
<p>We (Mango Solutions) do lots of work with the open source language R for graphing and charting serving up static images within our applications for advanced reporting and analytics purposes.  Providing interactive mechanisms for this is also possible.  </p>
<p><a href="http://www.rstudio.com/shiny/">http://www.rstudio.com/shiny/</a></p>
<p>Check our R Shiny from the RStudio guys and you&#8217;ll see how they&#8217;ve used HTML5 webworkers and pooled R sessions.  Demos here:</p>
<p><a href="http://glimmer.rstudio.com/winston/stocks/">http://glimmer.rstudio.com/winston/stocks/</a></p>
<p><strong>Interactive Javascript Based Visualisation</strong></p>
<p>There are also some very nice fully HTML5, CSS compliant interactive libraries.  Top of the pile (in my opinion) by far is D3 (a successor to Protovis) that provides a way to create sophisticated interactive visualisations.</p>
<p><img src="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/01/Screen-shot-2013-01-12-at-10.01.58.png" alt="D3 Example" width="600"/></p>
<p>See the Vornoi diagram example here:</p>
<p><a href="http://bl.ocks.org/1734663">http://bl.ocks.org/1734663</a></p>
<p>and the combination of D3 with the Crossfilter Javascript library for large multi-variate datasets within the browser:</p>
<p><a href="http://square.github.com/crossfilter/">http://square.github.com/crossfilter/</a></p>
<p><strong>Realtime Graphing and Charting</strong></p>
<p>Realtime graphing (particularly for time series data etc&#8230;) is fairly recent.  Our first look at this was with a cool little library called Flot.js:</p>
<p><a href="http://www.flotcharts.org/">http://www.flotcharts.org/</a></p>
<p>Another option is HighCharts which provides a wide set of options for graphs and charts in Javascript:</p>
<p><a href="http://www.highcharts.com/">http://www.highcharts.com/</a></p>
<p>This works nicely for basic charts as well and the best bit is that you can use it from Internet Explorer 6 and upwards, performance is obviously an issue in terms of browser and version.</p>
<p><img src="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/01/Screen-shot-2013-02-02-at-14.50.53.png" alt="Screen shot 2013-02-02 at 14.50.53" width="600" class="aligncenter size-medium wp-image-642" /></p>
<p>The dynamic charts appear to make use of SVG extensively for display, example here:</p>
<p><a href="http://www.highcharts.com/demo/dynamic-update">http://www.highcharts.com/demo/dynamic-update</a></p>
<p><strong>Big Data In Bristol</strong></p>
<p>There&#8217;s a big data meetup in Bristol this Friday and Saturday (18th January 2012) to do some hacking on BigData using things like Hadoop (HDFS, MapReduce), Shark and Spark.  Finishing this off with a visualisation with D3 would be a nice touch.  More info on the meetup here:</p>
<p><a href="http://www.meetup.com/south-west-big-data/events/95899692/">http://www.meetup.com/south-west-big-data/events/95899692/</a></p>
<p>Also, we&#8217;re hiring for a Javascript developer currently at Mango Solutions, check out the job posting here:</p>
<p><a href="http://www.jobserve.com/gb/en/search-jobs-in-Chippenham,-Wiltshire,-United-Kingdom/JAVASCRIPT-DEVELOPER-8A8BC205FB4E4766/">http://www.jobserve.com/gb/en/search-jobs-in-Chippenham,-Wiltshire,-United-Kingdom/JAVASCRIPT-DEVELOPER-8A8BC205FB4E4766/</a></p>
<p><a href="http://www.jonathanholloway.co.uk/java/javascript-graphing/attachment/mangologo" rel="attachment wp-att-623"><img src="http://www.jonathanholloway.co.uk/wp-content/uploads/2013/01/mangologo-300x84.jpg" alt="mangologo" width="300" height="84" class="aligncenter size-medium wp-image-623" /></a></p>
<p>There&#8217;s also an opening for Senior Java Developers working with xText, DSL&#8217;s, enterprise messaging and integration.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/javascript-graphing/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion Pre-Commit Hook</title>
		<link>http://www.jonathanholloway.co.uk/java/subversion-pre-commit-hook?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=subversion-pre-commit-hook</link>
		<comments>http://www.jonathanholloway.co.uk/java/subversion-pre-commit-hook#comments</comments>
		<pubDate>Sat, 12 Jan 2013 09:41:05 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=606</guid>
		<description><![CDATA[Rename the pre-commit.tmpl template to drop the .tmpl off the end. The pre-commit script has to be executable as well by the relevant user. cd /usr/local/subversion cp pre-commit.tmpl pre-commit chown apache:apache pre-commit chmod +x pre-commit Pre-commit hooks generally call out to other programs to do their work. It&#8217;s a Bash script by default, but people ...]]></description>
				<content:encoded><![CDATA[<p>Rename the pre-commit.tmpl template to drop the .tmpl off the end.  The pre-commit script has to be executable as well by the relevant user.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>subversion
<span style="color: #c20cb9; font-weight: bold;">cp</span> pre-commit.tmpl pre-commit
<span style="color: #c20cb9; font-weight: bold;">chown</span> apache:apache pre-commit
<span style="color: #c20cb9; font-weight: bold;">chmod</span> +x pre-commit
</div></pre><!--END_DEVFMTCODE--></p>
<p>Pre-commit hooks generally call out to other programs to do their work.  It&#8217;s a Bash script by default, but people tend to write scripts in Perl/Python etc&#8230; as it&#8217;s a bit more readable than plain old Bash.</p>
<p>You can use pre-commit hooks for a number of reasons:</p>
<ul>
<li>To enforce that users enter comments on commit messages</li>
<li>To enforce that users specify issue ID&#8217;s on commit messages to match tickets in bug trackers such as Bugzilla, Jira or Mantis</li>
<li>Running style checking</li>
<li>Preventing BOM&#8217;s in source code</li>
<li>Sending email notifications to a group of people</li>
</ul>
<p>There&#8217;s a fair few good articles already on this:</p>
<ul>
<li>Overview of the whole process &#8211; http://www.agileweboperations.com/leveraging-subversion-hooks-for-fun-and-profit</li>
<li>Some example scripts written in Bash &#8211; http://blog.grimsy.net/2008/07/a-few-svn-pre-commit-hooks/</li>
<li>Perl based pre-commit script &#8211; http://shah-oss.blogspot.co.uk/2011/04/pre-commit-hook-script-for-subversion.html</li>
</ul>
<p>One final note, under Windows things are a bit different, only in the sense that you have to use a batch file instead of a bash script.  I ran into this with VisualSVN and ended up hacking the following Python script and Batch file together to solve the problem:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Python"><div class="devcodeoverflow">
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><span style="color: #66cc66;">;</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span><span style="color: #66cc66;">;</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span><span style="color: #66cc66;">;</span>
&nbsp;
svnlookcmd <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">;</span>
txn <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">;</span>
repo <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">;</span>
logcmd <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">&quot;svnlook log -t &quot;</span> + txn + <span style="color: #483d8b;">&quot; &quot;</span> + repo<span style="color: #66cc66;">;</span>
&nbsp;
line <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">os</span>.<span style="color: black;">popen</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>logcmd<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">match</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\b</span>(?:bug|issue|task)<span style="color: #000099; font-weight: bold;">\s</span>*[#]{0,1}(<span style="color: #000099; font-weight: bold;">\d</span>+)<span style="color: #000099; font-weight: bold;">\b</span>'</span><span style="color: #66cc66;">,</span> line<span style="color: #66cc66;">,</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">I</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Found valid log message: &quot;</span> + line<span style="color: #66cc66;">;</span>
    exit<span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
<span style="color: #ff7700;font-weight:bold;">else</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Error checking log msg: &quot;</span> + line<span style="color: #66cc66;">;</span>
    exit<span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
setlocal
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">SVNLOOK</span>=<span style="color: #ff0000;">&quot;%VISUALSVN_SERVER%\bin\svnlook.exe&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">REPOS</span>=<span style="color: #000000; font-weight: bold;">%</span>1
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">TXN</span>=<span style="color: #000000; font-weight: bold;">%</span>2
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Executing precommit check&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
python c:\repos\scripts\checkcommit.py <span style="color: #000000; font-weight: bold;">%</span>SVNLOOK<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">%</span>TXN<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">%</span>REPOS<span style="color: #000000; font-weight: bold;">%</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">RESULT</span>=<span style="color: #000000; font-weight: bold;">%</span>ERRORLEVEL<span style="color: #000000; font-weight: bold;">%</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Executed check with result: &quot;</span> + <span style="color: #000000; font-weight: bold;">%</span>RESULT<span style="color: #000000; font-weight: bold;">%</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
IF <span style="color: #000000; font-weight: bold;">%</span>RESULT<span style="color: #000000; font-weight: bold;">%</span> == <span style="color: #000000;">0</span> GOTO :NORMAL_EXIT
REM Block commit by default
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Commit msg must reference an issue number in the format: issue 1234 OR bug 1234 OR task 1234&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000; font-weight: bold;">/</span>b <span style="color: #000000;">1</span>
REM All checks passed, so allow the commit.
&nbsp;
:NORMAL_EXIT
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
&nbsp;
</div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/subversion-pre-commit-hook/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parsing Kickstarter Information With PHP5, Curl and XPath</title>
		<link>http://www.jonathanholloway.co.uk/java/parsing-kickstarter-information-with-php5-curl-and-xpath?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=parsing-kickstarter-information-with-php5-curl-and-xpath</link>
		<comments>http://www.jonathanholloway.co.uk/java/parsing-kickstarter-information-with-php5-curl-and-xpath#comments</comments>
		<pubDate>Thu, 13 Dec 2012 20:06:12 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=601</guid>
		<description><![CDATA[I had a simple lightweight task to complete tonight, namely to pull Kickstarter information from the awesome Elite: Dangerous project on Kickstarter. To do it I used a simple PHP5 script with the curl dependency installed with: sudo apt-get install php5-curl along with a bit of XPath, which can be customised whatever way, script is ...]]></description>
				<content:encoded><![CDATA[<p>I had a simple lightweight task to complete tonight, namely to pull Kickstarter information from the awesome Elite: Dangerous project on Kickstarter.</p>
<p>To do it I used a simple PHP5 script with the curl dependency installed with:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get install</span> php5-curl
</div></pre><!--END_DEVFMTCODE--></p>
<p>along with a bit of XPath, which can be customised whatever way, script is as follows:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="PHP"><div class="devcodeoverflow">
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$curl</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.kickstarter.com/projects/1461411552/elite-dangerous'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_FOLLOWLOCATION<span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #339933;">,</span> CURLOPT_USERAGENT<span style="color: #339933;">,</span> <span style="color: #0000ff;">'Mozilla/5.0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$html</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$curl</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadHTML</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$html</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$xpath</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMXPath<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dom</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xpath</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;//data[@data-currency='GBP']&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$pre</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$post</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;/h1&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$r</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$amountstr</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$r</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">childNodes</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">item</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeValue</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">Print</span> <span style="color: #000088;">$pre</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Total Funding: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$amountstr</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
</div></pre><!--END_DEVFMTCODE--></p>
<p>Customise as you see fit, it serves as the beginning for a simple update widget in Ubuntu or other mechanism.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/parsing-kickstarter-information-with-php5-curl-and-xpath/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chippenham Tech Chat</title>
		<link>http://www.jonathanholloway.co.uk/java/chippenham-tech-chat?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=chippenham-tech-chat</link>
		<comments>http://www.jonathanholloway.co.uk/java/chippenham-tech-chat#comments</comments>
		<pubDate>Tue, 17 Jul 2012 21:07:25 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=591</guid>
		<description><![CDATA[There&#8217;s a new meetup group in the South West called Chippenham Tech Chat: http://www.meetup.com/Chippenham-Tech-Chat/ It takes place at the office of Mango Solutions, the company I work for here: View Larger Map The first meetup is on the 18th September 2012, come along if you want to find out more, topic still to be decided.]]></description>
				<content:encoded><![CDATA[<p>There&#8217;s a new meetup group in the South West called Chippenham Tech Chat:</p>
<p><a href="http://www.meetup.com/Chippenham-Tech-Chat/  " title="Chippenham Tech Chat">http://www.meetup.com/Chippenham-Tech-Chat/<br />
</a></p>
<p>It takes place at the office of Mango Solutions, the company I work for here:</p>
<p><iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.uk/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=methuen+park+chippenham&amp;t=h&amp;gl=uk&amp;ie=UTF8&amp;hq=&amp;hnear=Methuen+Park,+Chippenham,+Wiltshire+SN14,+United+Kingdom&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe><br /><small><a href="https://maps.google.co.uk/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=methuen+park+chippenham&amp;t=h&amp;gl=uk&amp;ie=UTF8&amp;hq=&amp;hnear=Methuen+Park,+Chippenham,+Wiltshire+SN14,+United+Kingdom&amp;z=14&amp;iwloc=A" style="color:#0000FF;text-align:left">View Larger Map</a></small></p>
<p>The first meetup is on the 18th September 2012, come along if you want to find out more, topic still to be decided.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/chippenham-tech-chat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jenkins CI Server &#8211; Resetting a build number and cleaning a build</title>
		<link>http://www.jonathanholloway.co.uk/java/jenkins-ci-server-resetting-a-build-number-and-cleaning-a-build?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jenkins-ci-server-resetting-a-build-number-and-cleaning-a-build</link>
		<comments>http://www.jonathanholloway.co.uk/java/jenkins-ci-server-resetting-a-build-number-and-cleaning-a-build#comments</comments>
		<pubDate>Fri, 21 Oct 2011 23:54:47 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=536</guid>
		<description><![CDATA[I&#8217;ve used a script to reset the build number during the migration to a new continuous integration server &#8211; namely Jenkins from Hudson. The following script will remove all the workspace builds from Jenkins that exist, reset the build number for all projects specified in the .hudson/jobs directory. Use it with care. I take no ...]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve used a script to reset the build number during the migration to a new continuous integration server &#8211; namely Jenkins from Hudson.</p>
<p>The following script will remove all the workspace builds from Jenkins that exist, reset the build number for all projects specified<br />
in the .hudson/jobs directory.</p>
<p>Use it with care.  I take no responsibility for misuse of this or bugs etc&#8230;</p>
<p>On another note, there is a plugin available for Jenkins that allows you to change the build number, see: <a href="http://wiki.hudson-ci.org/display/HUDSON/Next+Build+Number+Plugin">http://wiki.hudson-ci.org/display/HUDSON/Next+Build+Number+Plugin</a></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow"><span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Hudson build cleaner</span>
<span style="color: #666666; font-style: italic;"># Cleans out all builds for projects that exist in the directory</span>
<span style="color: #666666; font-style: italic;"># Resets the build number to 1</span>
<span style="color: #666666; font-style: italic;"># Backup all projects before running this</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> cleanbuild <span style="color: #7a0874; font-weight: bold;">&#123;</span>
&nbsp;
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;cleaning $1&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #007800;">$1</span>
  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-l</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-Rf</span> builds<span style="color: #000000; font-weight: bold;">/*</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-Rf</span> lastSuccesful
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-Rf</span> lastStable<span style="color: #000000; font-weight: bold;">/</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-Rf</span> workspace<span style="color: #000000; font-weight: bold;">/*</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-Rf</span> modules<span style="color: #000000; font-weight: bold;">/*</span>
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> lastSuccessful lastStable
  <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> nextBuildNumber
  <span style="color: #c20cb9; font-weight: bold;">touch</span> nextBuildNumber
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> nextBuildNumber
  <span style="color: #7a0874; font-weight: bold;">cd</span> -
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> project <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #660033;">-L</span> <span style="color: #660033;">-maxdepth</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'*'</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-name</span> <span style="color: #ff0000;">'.*'</span> <span style="color: #660033;">-printf</span> <span style="color: #ff0000;">'%f\n'</span> <span style="color: #000000; font-weight: bold;">|</span> column<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
  cleanbuild <span style="color: #007800;">$project</span>
<span style="color: #000000; font-weight: bold;">done</span>
</div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/jenkins-ci-server-resetting-a-build-number-and-cleaning-a-build/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and configuring ps3mediaserver</title>
		<link>http://www.jonathanholloway.co.uk/java/ps3mediaserver-pms-conf?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ps3mediaserver-pms-conf</link>
		<comments>http://www.jonathanholloway.co.uk/java/ps3mediaserver-pms-conf#comments</comments>
		<pubDate>Sat, 24 Sep 2011 23:50:09 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=503</guid>
		<description><![CDATA[I was installing ps3mediaserver on Ubuntu 10.04 server tonight. It&#8217;s a Java based DNLA UPNP server that transcodes/streams on the fly &#8211; very handy for weird mkv file formats that the Playstation 3 doesn&#8217;t support natively. However, it didn&#8217;t prove to be the most straightforward of installs. Just a few tips here based on what ...]]></description>
				<content:encoded><![CDATA[<p>I was installing ps3mediaserver on Ubuntu 10.04 server tonight.  It&#8217;s a Java based DNLA UPNP server that transcodes/streams on the fly &#8211; very handy for weird mkv file formats that the Playstation 3 doesn&#8217;t support natively. </p>
<p>However, it didn&#8217;t prove to be the most straightforward of installs.  Just a few tips here based on what I did:</p>
<p>I checked out the source code from the trunk of the Subversion repository.  The reason I did this was because the binary that was installed didn&#8217;t include a PMS.conf, not sure whether I could have manually created it.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow"><span style="color: #c20cb9; font-weight: bold;">svn checkout</span> http:<span style="color: #000000; font-weight: bold;">//</span>ps3mediaserver.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> ps3mediaserver-read-only</div></pre><!--END_DEVFMTCODE--></p>
<p>then proceeded to build it with ant form the Apache website.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">ant</div></pre><!--END_DEVFMTCODE--></p>
<p>After that it was a case of configuring it.  It appears that it installs the PMS.conf file in:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">$<span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>PMS<span style="color: #000000; font-weight: bold;">/</span>PMS.conf</div></pre><!--END_DEVFMTCODE--></p>
<p>so you need to go there to configure it.</p>
<p>I had to change the network interface that it bound on and the port used.</p>
<p>That proved to be a pain as none of the configuration options are documented.  I ended up digging out the PmsConfiguration.java file from the source, link here:</p>
<p><a href="http://code.google.com/p/ps3mediaserver/source/browse/trunk/ps3mediaserver/net/pms/configuration/PmsConfiguration.java" title="PMSconfiguration.java source">http://code.google.com/p/ps3mediaserver/source/browse/trunk/ps3mediaserver/net/pms/configuration/PmsConfiguration.java</a></p>
<p>That contains all the names of the keys you need so for my purposes I needed the following in PMS.conf:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">network_interface = eth0</div></pre><!--END_DEVFMTCODE--></p>
<p>Starting this up with:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">pms.sh <span style="color: #000000; font-weight: bold;">&amp;</span></div></pre><!--END_DEVFMTCODE--></p>
<p>and scanning via the Playstation 3 Video -> Detect MediaServers brings up my PS3MediaServer.</p>
<p>There&#8217;s also a help forum here:</p>
<p><a href="http://www.ps3mediaserver.org/forum">http://www.ps3mediaserver.org/forum</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/ps3mediaserver-pms-conf/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating a WordPress Site to a new URL</title>
		<link>http://www.jonathanholloway.co.uk/java/migrating-a-wordpress-site-to-a-new-url?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=migrating-a-wordpress-site-to-a-new-url</link>
		<comments>http://www.jonathanholloway.co.uk/java/migrating-a-wordpress-site-to-a-new-url#comments</comments>
		<pubDate>Sun, 12 Jun 2011 22:00:26 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=500</guid>
		<description><![CDATA[Migrating a WordPress site to a different domain can be a bit of a pain. The standard way to do this is detailed in this tutorial on the wordpress website. If you&#8217;re using phpmyadmin to update the database directly the only two changes you have to make are to the site_url and home option-name&#8216;s in ...]]></description>
				<content:encoded><![CDATA[<p>Migrating a WordPress site to a different domain can be a bit of a pain.  The standard way to do this is detailed in <a href="http://codex.wordpress.org/Changing_The_Site_URL">this tutorial</a> on the wordpress website.</p>
<p>If you&#8217;re using phpmyadmin to update the database directly the only two changes you have to make are to the <strong>site_url</strong> and <strong>home</strong> <em>option-name</em>&#8216;s in wp_options.  Make sure you change the <em>option_value</em> for each of these to the new address.</p>
<p>One of the problems you may come across is that your old posts may reference the old domain in same way.  If you want to update these then it&#8217;s laborious and manual task of editing them in the database &#8211; which can be error prone, unless done carefully.  You can run a SQL update to update the domain in the post_content column of the wp_posts table as follows:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="SQL"><div class="devcodeoverflow"><span style="color: #993333; font-weight: bold;">UPDATE</span> wp_posts <span style="color: #993333; font-weight: bold;">SET</span> post_content <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_content<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'olddomain.com'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'newdomain.com'</span><span style="color: #66cc66;">&#41;</span>;</div></pre><!--END_DEVFMTCODE--></p>
<p>I used this method to update the guid column to reference my new domain instead of my old domain.</p>
<p><strong>Make sure you backup your database before running this.</strong>  It&#8217;s a pretty easy process to do the backup of a MySQL database.  </p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">mysqldump <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> <span style="color: #660033;">-v</span> old.db <span style="color: #000000; font-weight: bold;">&gt;</span> old.sql</div></pre><!--END_DEVFMTCODE--></p>
<p>If you&#8217;re also renaming your database in relation to your domain name move you can use the following:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">mysqldump <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> <span style="color: #660033;">-v</span> old.db <span style="color: #000000; font-weight: bold;">&gt;</span> old.sql
mysqladmin <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> create newdb
mysql <span style="color: #660033;">-u</span> username <span style="color: #660033;">-p</span> newdb <span style="color: #000000; font-weight: bold;">&lt;</span> old.sql</div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/migrating-a-wordpress-site-to-a-new-url/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hadoop setup in ten seconds flat</title>
		<link>http://www.jonathanholloway.co.uk/java/hadoop-setup-in-ten-seconds-flat?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hadoop-setup-in-ten-seconds-flat</link>
		<comments>http://www.jonathanholloway.co.uk/java/hadoop-setup-in-ten-seconds-flat#comments</comments>
		<pubDate>Fri, 03 Jun 2011 19:19:14 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jonathanholloway.co.uk/?p=395</guid>
		<description><![CDATA[I needed to get Apache hadoop setup quickly on my local machine recently, I needed to hunt around for the correct ports which I found here: http://www.cloudera.com/blog/2009/08/hadoop-default-ports-quick-reference/ Installation involved downloading the hadoop distribution and creating the right configurations (core-site.xml, hdfs-site.xml and mapred-site.xml). It also involved formatting the namenode and starting everything up. It&#8217;s a pain ...]]></description>
				<content:encoded><![CDATA[<p>I needed to get Apache hadoop setup quickly on my local machine recently, I needed to hunt around for the correct ports which I found here:</p>
<p><a href="http://www.cloudera.com/blog/2009/08/hadoop-default-ports-quick-reference/">http://www.cloudera.com/blog/2009/08/hadoop-default-ports-quick-reference/</a></p>
<p>Installation involved downloading the hadoop distribution and creating the right configurations (core-site.xml, hdfs-site.xml and mapred-site.xml).  It also involved formatting the namenode and starting everything up.  It&#8217;s a pain to do manually so I wrote a <a href="/wp-content/hadoopsetup.sh">script</a> to do the whole lot to save time.  A few caveats:</p>
<ul>
<li>You need to set the JAVA_HOME location on your machine at the top of the script</li>
<li>Specify the distro name (hadoop-0.20.2) to match the apache download link</li>
<li>Configure passwordless SSH for your local machine</li>
</ul>
<p>You can configure passwordless SSH as follows:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> dsa <span style="color: #660033;">-P</span> <span style="color: #ff0000;">''</span> <span style="color: #660033;">-f</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa_for_hadoop
<span style="color: #c20cb9; font-weight: bold;">cat</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa_for_hadoop.pub <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>authorized_keys
</div></pre><!--END_DEVFMTCODE--></p>
<p>Hopefully that&#8217;ll save you a bunch of time! : )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanholloway.co.uk/java/hadoop-setup-in-ten-seconds-flat/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
