<?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>My So Called Website</title>
	<atom:link href="http://www.delineneo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.delineneo.com</link>
	<description>Rambles, musings, thoughts</description>
	<lastBuildDate>Mon, 01 Apr 2013 03:02:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>10 years of blogging?!?</title>
		<link>http://www.delineneo.com/2012/11/21/10-years-of-blogging/</link>
		<comments>http://www.delineneo.com/2012/11/21/10-years-of-blogging/#comments</comments>
		<pubDate>Wed, 21 Nov 2012 08:24:40 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1136</guid>
		<description><![CDATA[Edit: So this was attempt 2 of this post. Thank goodness for Google cache! Don&#8217;t start a migration to a new server whilst still updating your site So after having my WordPress install nag at me to update for ages, I finally got round to it. Also took the opportunity to clean up my FTP [...]]]></description>
			<content:encoded><![CDATA[<p><em>Edit: So this was attempt 2 of this post. Thank goodness for Google cache! Don&#8217;t start a migration to a new server whilst still updating your site <img src='http://www.delineneo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </em></p>
<p>So after having my WordPress install nag at me to update for ages, I finally got round to it. Also took the opportunity to clean up my FTP directory which has had bits and pieces lying around for years.</p>
<p>With this update, we now have a new theme, some nice random header images and Archives! I took a quick look at it and realised I’ve been blogging off and on for the last decade! I remember starting back on <a title="Blogger" href="http://www.delineneo.com/2012/11/19/10-years-of-blogging/www.blogger.com">Blogger</a> back in the day and then migrating to WordPress. Those blog posts from back then didn’t migrate that well, hence the numbers as post titles. And I also think I’m possibly missing a few weeks or months of the very start of my blogging foray… <img src="http://www.delineneo.com/wp-includes/images/smilies/icon_sad.gif" alt=":-(" /></p>
<p>From WordPress was the migration to Drupal where I blogged periodically for a number of years and then the painful migration back. It’s just a little bit crazy to know I’ve still basically got 10 years of posts intact! There’s a couple of years in between where the posting is sporadic, but hopefully I’ll keep this guy more up to date with my ramblings, musings and thoughts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2012/11/21/10-years-of-blogging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C Feature Availability</title>
		<link>http://www.delineneo.com/2012/10/28/objective-c-feature-availability/</link>
		<comments>http://www.delineneo.com/2012/10/28/objective-c-feature-availability/#comments</comments>
		<pubDate>Sun, 28 Oct 2012 05:41:23 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1127</guid>
		<description><![CDATA[Just a quick follow up to the last post. Here&#8217;s a link to the Apple docs on the Objective-C Feature Availability. Is worth a look if you haven&#8217;t dabbled in a while&#8230;]]></description>
			<content:encoded><![CDATA[<p>Just a quick follow up to the last post. Here&#8217;s a link to the Apple docs on the <a href="http://developer.apple.com/library/mac/#releasenotes/ObjectiveC/ObjCAvailabilityIndex/_index.html">Objective-C Feature Availability</a>. Is worth a look if you haven&#8217;t dabbled in a while&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2012/10/28/objective-c-feature-availability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective C, Xcode revisted</title>
		<link>http://www.delineneo.com/2012/10/10/objective-c-xcode-revisted/</link>
		<comments>http://www.delineneo.com/2012/10/10/objective-c-xcode-revisted/#comments</comments>
		<pubDate>Wed, 10 Oct 2012 12:06:49 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1123</guid>
		<description><![CDATA[It&#8217;s been a few years since I&#8217;ve written in Objective C for iOS and used Xcode, and I must say it has changed/matured a lot since then. The first time, thrown into the middle of an intense project, was a crash course in the intricacies of the language and IDE. And being mainly a Java [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a few years since I&#8217;ve written in Objective C for iOS and used Xcode, and I must say it has changed/matured a lot since then.</p>
<p>The first time, thrown into the middle of an intense project, was a crash course in the intricacies of the language and IDE. And being mainly a Java front end dev back then with very limited C experience was interesting to say the least.</p>
<p>But I&#8217;m glad to say that alot has changed since then, and for the better. After giving some documentation a once over and playing around with things, lots of the oddities that I saw coming to the language as a Java developer have now been improved.</p>
<p>The biggest things for me (so far) I think were:</p>
<ul>
<li>Automatic synthesizing of properties.</li>
<li>Automatic reference counting (ARC). It puzzled me that writing code for the OS had memory management, but you had to manually manage for iOS.</li>
<li>Setting up your project with unit tests is a breeze.</li>
</ul>
<p>There are other things, and if you haven&#8217;t looked at it in a while you might be pleasantly surprised.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2012/10/10/objective-c-xcode-revisted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Test post from iPad</title>
		<link>http://www.delineneo.com/2012/07/14/test-post-from-ipad/</link>
		<comments>http://www.delineneo.com/2012/07/14/test-post-from-ipad/#comments</comments>
		<pubDate>Sat, 14 Jul 2012 05:04:36 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/2012/07/14/test-post-from-ipad/</guid>
		<description><![CDATA[Testing posting from WordPress app for iPad&#8230;]]></description>
			<content:encoded><![CDATA[<p>Testing posting from WordPress app for iPad&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2012/07/14/test-post-from-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitor your Jenkins build with an Arduino (and some Java code)</title>
		<link>http://www.delineneo.com/2012/03/06/monitor-your-jenkins-build-with-an-arduino-and-some-java-code/</link>
		<comments>http://www.delineneo.com/2012/03/06/monitor-your-jenkins-build-with-an-arduino-and-some-java-code/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 11:35:45 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1092</guid>
		<description><![CDATA[So I got my hands on an Arduino kit a while back but hadn&#8217;t played around with it much. Whilst I await for some books to arrive so I can learn basic electronics and circuits (am a developer without engineering/electronics background&#8230;) I thought it&#8217;d be fun to see if I could write something simple that [...]]]></description>
			<content:encoded><![CDATA[<p>So I got my hands on an Arduino kit a while back but hadn&#8217;t played around with it much. Whilst I await for some books to arrive so I can learn basic electronics and circuits (am a developer without engineering/electronics background&#8230;) I thought it&#8217;d be fun to see if I could write something simple that could be useful in my day to day job as a Java developer.</p>
<p>One of the tools we use is <a title="Jenkins" href="http://http://jenkins-ci.org/">Jenkins</a> and whilst we get emails and check the Jenkins Dashboard to see if a build has failed,  developers often have a tendency to not check their emails or check Jenkins to see what the state of the build is&#8230; As a result it may be hours or even a few days before someone realises the build is not passing&#8230;</p>
<p>So it seemed fitting to write some code to get a LED light to blink if the build is failing. To do this you&#8217;ll need the following:</p>
<ul>
<li>Jenkins with the build you want to monitor setup</li>
<li>Arduino (I&#8217;m using an Uno)</li>
<li>A LED (though for test purposes if you&#8217;re using an Uno pin 13 has a LED built in which should be sufficient)</li>
</ul>
<ol>
<li>Wire up your LED to one of the pins or do what I did and use the built in LED on pin 13.</li>
<li>Write some code in your language of choice to grab the build status from Jenkins and send it serially to the Arduino. I chose to grab the status as JSON, but there are <a href="https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API">other options available</a>. I used Java and the Spring Framework to schedule a process to run every 5 seconds to grab the Jenkins status and send it across to the Arduino with the main grunt work being the code below:
<pre class="brush: java; title: ; notranslate">
package com.delineneo.processor;

import com.delineneo.communication.SerialCommunicator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import java.io.IOException;

import static org.apache.commons.lang.StringUtils.contains;

/**
 * Created by IntelliJ IDEA.
 * User: deline
 * Date: 2/03/12
 * Time: 8:33 PM
 */
@Component
public class JenkinsStatusProcessor {
    private static final String JENKINS_URL = &quot;http://localhost:8080/job/JenkinsStatus/api/json&quot; ;
    private static final String SUCCESS_BUILD_COLOR = &quot;blue&quot;;
    public static final char BUILD_FAIL = '0';
    public static final char BUILD_SUCCESS = '1';

    private RestTemplate restTemplate;
    private SerialCommunicator serialCommunicator;

    @Scheduled(fixedDelay=5000)
    public void process() {

        String jsonString = restTemplate.getForObject(JENKINS_URL, String.class);

        boolean buildSuccess = isBuildSuccessful(jsonString);
        try {
            serialCommunicator.send(buildSuccess ? BUILD_SUCCESS : BUILD_FAIL);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    private boolean isBuildSuccessful(String jsonString) {
        if (contains(jsonString, SUCCESS_BUILD_COLOR)) {
            return true;
        }
        return false;
    }

    @Autowired
    public void setRestTemplate(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }

    @Autowired
    public void setSerialCommunicator(SerialCommunicator serialCommunicator) {
        this.serialCommunicator = serialCommunicator;
    }
}
</pre>
<p>In the <strong>process</strong> method we grab the status as JSON using Spring&#8217;s <a href="http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/client/RestTemplate.html">RestTemplate</a> then search for the build status colours in the string. Blue represents success and I treat any other colour (yellow and red are the other ones) as a failure. We then send either a &#8217;0&#8242; or &#8217;1&#8242; for fail or success respectively.</p>
<p>You might wonder why we send a char instead of a boolean&#8230; Serial write to the Arduino is as an int or byte array, and on the Arduino side read is done either as an int or a char. For example sending &#8216;A&#8217; will be received via the Arduino as either the char &#8216;A&#8217; or the int value 65 (the ascii value). This post on <a href="http://bildr.org/2011/01/arduino-serial/">bildr</a> gives you a bit more info on why one might choose to read values as and int instead of a char.</li>
<li>Write some code for the Arduino to process the received data and set the LED to flashing if the build has failed. The code below listens on the serial port:
<pre class="brush: cpp; title: ; notranslate">
/* JenkinsStatus will turn the LED at pin 13 on/off depending
 * on the value serially read.
 */
const int BUILD_SUCCESS = 49;
int inByte;
int currentPinValue = 0;

void setup() {
    Serial.begin(9600);
    pinMode(13, OUTPUT);
}

void loop() {
    if (Serial.available() &gt; 0) {
        inByte = Serial.read();
        if (inByte == BUILD_SUCCESS) {
            digitalWrite(13, LOW);
        } else{
            digitalWrite(13, HIGH);
        }
    } else {
        currentPinValue = digitalRead(13);
        if (currentPinValue == HIGH) {
            delay(1000);
            digitalWrite(13, LOW);
            delay(1000);
            digitalWrite(13, HIGH);
        }
    }
}
</pre>
<p>In the <strong>loop</strong> if there&#8217;s data to be read we read it then determine if what state the LED on pin 13 needs to be in. The pin needs to be LOW (i.e. off) if the build is passing and HIGH (on) otherwise. Additionally, if there is no data to be read we want to keep the LED in a flashing state if it was set to HIGH (last read indicated build had failed).</li>
</ol>
<p>So that&#8217;s pretty much the long short of it, the full code is available on my Git repo &#8211; <a href="https://github.com/deline/JenkinsStatus">https://github.com/deline/JenkinsStatus</a></p>
<p>Some thoughts on how JenkinsStatus could be improved:</p>
<ul>
<li>Allow config of Jenkins details via properties files</li>
<li>Allow more than one Jenkins job to be monitored</li>
<li>Put in more LEDs for other states</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2012/03/06/monitor-your-jenkins-build-with-an-arduino-and-some-java-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Goodbye weekends hello house hunting &#8211; week 1</title>
		<link>http://www.delineneo.com/2011/03/06/goodbye-weekends-hello-house-hunting-week-1/</link>
		<comments>http://www.delineneo.com/2011/03/06/goodbye-weekends-hello-house-hunting-week-1/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 08:34:29 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1087</guid>
		<description><![CDATA[So the decision has been made to make the foray into the crazy realms of the Sydney real estate market, the objective to find a place to live in. So with that means a lot of spare time surfing domain.com.au and weekends spent looking at &#8216;open for inspections&#8217;. Highlights for this week: House going under [...]]]></description>
			<content:encoded><![CDATA[<p>So the decision has been made to make the foray into the crazy realms of the Sydney real estate market, the objective to find a place to live in. So with that means a lot of spare time surfing domain.com.au and weekends spent looking at &#8216;open for inspections&#8217;. Highlights for this week:</p>
<ul>
<li>House going under contract the night before were to check it out <img src='http://www.delineneo.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </li>
<li>Number 1&#8242;s still left in the kids potty in the bathroom</li>
<li>House&#8217;s that were in a terrible state &#8211; carpet that was frayed and separated, walls that were separating, paint jobs that looked like the person wasn&#8217;t even trying (it looked like outdoor paint too!)</li>
</ul>
<p>Let&#8217;s say it&#8217;s easily noticeable whether a property being sold is a rental or an owner occupied&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2011/03/06/goodbye-weekends-hello-house-hunting-week-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When social media works</title>
		<link>http://www.delineneo.com/2011/01/27/when-social-media-works/</link>
		<comments>http://www.delineneo.com/2011/01/27/when-social-media-works/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 09:14:36 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1083</guid>
		<description><![CDATA[Kudos to the @Optus social media team for utilising social media channels effectively to help their customers. I&#8217;ve had this ongoing saga for a few years where my internet drops out when the weather is extremely hot (around 35+ degrees Celsius). And with this many horrible experiences of Optus customer support &#8211; being on hold [...]]]></description>
			<content:encoded><![CDATA[<p>Kudos to the <a href="http://twitter.com/optus">@Optus</a> social media team for utilising social media channels effectively to help their customers. I&#8217;ve had this ongoing saga for a few years where my internet drops out when the weather is extremely hot (around 35+ degrees Celsius). And with this many horrible experiences of Optus customer support &#8211; being on hold for 1+ hour then dropped out of the phone queue, passed between many departments, technicians not turning up because tech support decided there wasn&#8217;t an issue and cancelling the booking yet the next support person could clearly see the issue was still there based on the modem logs. After 3 or so call outs a new modem was provided about a year ago but since then there hasn&#8217;t really been a bunch of extremely hot days in a row.</p>
<p>Until yesterday&#8230; and woah behold when I came home in the evening no internet. Just the same flashing light sequence I&#8217;m more than familiar with. Usual tricks didn&#8217;t work and I was dreading having to call Optus tech support&#8230; Have you even been asked if you&#8217;ve power cycled you&#8217;re modem 3 times after you&#8217;ve already said yes twice? Not to mention the stuff arounds last time as mentioned above. So when it still didn&#8217;t work this morning, it was time to take to Twitter as I knew Optus have an account they they respond to.</p>
<p>Posted on the way to work, and got a reply within a few hours, and after providing a bit more info a guy from the social media team rang me &#8211; yes a real person! Turns out there were some issues which they knew about but with no ETA (odd that there network status page didn&#8217;t say anything). Anyways he said he&#8217;d try to keep my in the loop either via Twitter or ring me, and I got a phone call with an update in the afternoon that the issue had been fixed but there was someone else on my street experiencing the same issue so if it wasn&#8217;t fixed when I got home to get in touch. As I don&#8217;t get home till after the social media team finish for the day the guy updated the account notes with details in case I had to ring tech support for further help (tech support is offshore). Got home and lucky for me the internet was working again. Was it heat related? Don&#8217;t know the real answer but I wouldn&#8217;t be surprised if it was. The cables running from the house have to tap to the main line, so extreme heat could cause connector issues with expansion and all of joins.</p>
<p>That all aside, I was very happy with the customer service and give a +1 to Optus for embracing social media. The internet has reinvented the way people work, communicate and share. Businesses need to recognise and embrace these changes/technologies as they&#8217;re not going to go away. Operating models change over time and Optus is proving that they can address customer service in ways different from traditional means. Will customer service/support by social media become mainstream? Probably not, but it&#8217;s a market they have to catch as increasingly more people turn to the web for their needs (e.g. the whole online shopping debacle).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2011/01/27/when-social-media-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wisdoms from a fortune cookie</title>
		<link>http://www.delineneo.com/2011/01/24/wisdoms-from-a-fortune-cookie/</link>
		<comments>http://www.delineneo.com/2011/01/24/wisdoms-from-a-fortune-cookie/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 07:40:50 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1080</guid>
		<description><![CDATA[Fortune cookie words of wisdom are awesome.. these are a few of late (not that I make a habit of eating fortune cookies or anything :-p ) There will be no harm in asking If you put little effort in a task you can expect very little success You will be singled out for promotion]]></description>
			<content:encoded><![CDATA[<p>Fortune cookie words of wisdom are awesome.. these are a few of late (not that I make a habit of eating fortune cookies or anything :-p )</p>
<ul>
<li><em>There will be no harm in asking</em></li>
<li><em>If you put little effort in a task you can expect very little success</em></li>
<li><em>You will be singled out for promotion<br />
</em></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2011/01/24/wisdoms-from-a-fortune-cookie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple RegEx and Closure example in Groovy</title>
		<link>http://www.delineneo.com/2011/01/15/simple-regex-and-closure-example-in-groovy/</link>
		<comments>http://www.delineneo.com/2011/01/15/simple-regex-and-closure-example-in-groovy/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 11:58:54 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1051</guid>
		<description><![CDATA[I&#8217;ve been intermittently reading Groovy in Action for the last few nights and whilst it all seems pretty straight forward, for me the real grasping of an understanding comes by writing some code to affirm what was read. That posed the dilemma of what to write, as since leaving uni most of my learning experiences [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been intermittently reading <a href="http://www.amazon.com/Groovy-Action-Dierk-Koenig/dp/1932394842">Groovy in Action</a> for the last few nights and whilst it all seems pretty straight forward, for me the real grasping of an understanding comes by writing some code to affirm what was read. That posed the dilemma of what to write, as since leaving uni most of my learning experiences in Java (and development concepts in general) have been in relation to real world business style scenarios. I gave a thought back to my high school days where I learnt how to program. Why not just start with a somewhat simple/trivial problem &#8211; e.g. a factorial calculator, or sentence word reverser and go from there? Sure it&#8217;s not anything too swish, but it seems a good way to get an understanding of the language.</p>
<p>So here I present a simple solution in Groovy that uses RegEx and Closures to captalise the first letter of each word in a string. I&#8217;ll also show you an even neater solution after&#8230;.</p>
<p>First up:</p>
<pre class="brush: groovy; title: ; notranslate">

String testString = 'the quick brown fox jumped over the lazy dog'
String regex = /\b\w*\s?\b/

testString.eachMatch(regex) { match -&gt;
    print match.capitalize()
}

</pre>
<p>Lines 1 and 2 should be pretty self explanatory. We&#8217;ve based our regex of the basis that a word consists of word characters only, may have a space after the last word character and has a word boundary on either side.</p>
<p>Lines 4-6 is where the cool stuff happens, as for each word match we make we want to upper case the first letter and print it out. The method <strong>eachMatch</strong> takes two arguments a String regex and a closure. From the <a href="http://groovy.codehaus.org/Closures">Groovy docs</a> &#8211; <em>&#8216;A Groovy Closure is like a &#8220;code block&#8221; or a method pointer. It is a  piece of code that is defined and then executed at a later point.&#8217;</em> In the example above we have defined the closure inline with one parameter <strong>match</strong> &#8211; parameters are listed before the <strong>-&gt;</strong>. The closure calls <strong>capitalize</strong> on the match and prints it out.</p>
<p>We could have easily defined the closure separatley and provided it to <strong>eachMethod</strong> as such:</p>
<pre class="brush: groovy; title: ; notranslate">
Closure capitalize = { match -&gt; print match.capitalize() }
testString.eachMatch(regex, capitalize)
</pre>
<p>Seems pretty easy right? Not many lines of code and quite succinct about what is happening. Well as is often the case, I did a little Google and here&#8217;s an even easier solution:</p>
<pre class="brush: groovy; title: ; notranslate">
String testString = 'the quick brown fox jumped over the lazy dog'
print testString.split(' ').collect{ it.capitalize() }.join(' ')
</pre>
<p>In the end my solution was a first attempt into using Groovy to solve a problem without having much exposure to the language whilst at the same time trying not to use my Java mindset. After seeing the alternative solution on the Internet it kind of shows that if you know what to use Groovy can make things even simpler as it&#8217;s definitely cleaner without using the RegEx.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2011/01/15/simple-regex-and-closure-example-in-groovy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Groovy on a Mac</title>
		<link>http://www.delineneo.com/2011/01/13/installing-groovy-on-a-mac/</link>
		<comments>http://www.delineneo.com/2011/01/13/installing-groovy-on-a-mac/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 10:37:42 +0000</pubDate>
		<dc:creator>Del</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.delineneo.com/?p=1043</guid>
		<description><![CDATA[Having heard about Groovy and Grails for the last few years but not having actually had a look at it I installed Groovy on my Mac the other week for a bit of a play. It&#8217;s always good and fun to have a look at a different language even if if you&#8217;re not going to [...]]]></description>
			<content:encoded><![CDATA[<p>Having heard about Groovy and Grails for the last few years but not having actually had a look at it I installed Groovy on my Mac the other week for a bit of a play. It&#8217;s always good and fun to have a look at a different language even if if you&#8217;re not going to use it in your day to day job. Coming from predominantly a Java background Groovy seemed like a good choice as it runs on the Java platform and the language is similar. Having had the opportunity to use Objective-C for a few months last year and seeing how in some ways it was more powerful than Java (but also in other ways frustrating), I was curious to see what power Groovy gave to a developer.</p>
<p>The first step though was to get Groovy installed on my Mac. So I thought I&#8217;d put a post up mainly for anyone new to developing on a Mac. Whilst I&#8217;ve had my Mac for a year or so, I hadn&#8217;t really had it setup for anything other than Java until recently, and there were definitely some things that were a little different to what I was used to on Windows as well from my prior limited stint in Ubuntu land.</p>
<p>These instructions are based on a setup for OS X. I&#8217;d imagine the setup may be similar on any other version?</p>
<ol>
<li>Java should already be installed on your machine. Confirm this by opening up a Terminal and typing in &#8216;<strong>java -version</strong>&#8216;.</li>
<li>Download the binary Zip release of Groovy <a href="http://groovy.codehaus.org/">from the Groovy site</a>.</li>
<li>Extract the contents into <strong>/usr/local</strong> &#8211; e.g. my install location is <strong>/usr/local/groovy-1.7.6/</strong>. You will probably need to need to use the <strong>sudo</strong> command for the extract as you will need to be superuser to write to the location.</li>
<li>Check if a file called <strong>environment.plist</strong> exists in the following location <strong>/Users/YOUR_USER_NAME/.MacOSX</strong>. If it doesn&#8217;t create it.</li>
<li>Open environment.plist in the Property List Editor</li>
<li>Add an entry for <strong>JAVA_HOME</strong> if not present, ensure the value is the location of your Java installation. This should be <strong>/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home</strong></li>
<li>Add an entry for <strong>GROOVY_HOME</strong> if not present and ensure the value is the location Groovy is installed. E.g. <strong>/usr/local/groovy-1.7.6</strong></li>
<li>Add an entry for <strong>PATH</strong> if not present, and ensure the Groovy bin and Java bin directories are present by adding  <strong>$JAVA_HOME:$GROOVY_HOME/bin</strong></li>
<li>Log out and re log back in for the changes to take effect.</li>
<li>Check that everything is all setup correctly by opening a Terminal and running <strong>groovy -version</strong> which should show you which version of Groovy is installed.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.delineneo.com/2011/01/13/installing-groovy-on-a-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
