<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Dream Pixel :: Weblog</title>
    <link>http://www.dreampixel.co.uk/</link>
    <description>Blog articles from Dream Pixel, home of Developer Dan Hunter. Thoughts on Java, Spring, Ruby, Ruby on Rails and developing on Macs</description>
    <language>en-us</language>
    <item>
      <title>Subversion With Mac OS X</title>
      <description>&lt;p&gt;Looking for a way of updating &lt;a href="http://en.wikipedia.org/wiki/Subversion_(software)" target="_blank"&gt;subversion&lt;/a&gt; that comes on Mac OS X, I came across this excellent tutorial @ Ruby Robot:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.rubyrobot.org/tutorial/subversion-with-mac-os-x" target="_blank"&gt;http://www.rubyrobot.org/tutorial/subversion-with-mac-os-x&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not only does Ruby Robot provide this valuable information, but also provided is a run through using subversion on the Terminal. Everything from creating a simple repository to 'checking out', 'updating' and 'committing' changes.&lt;/p&gt;

&lt;p&gt;I have always found the svn diff function on the Terminal (or any other command line) pretty painful to use. I like FileMerge on Mac so I wondered is it possible to use FileMerge for diff and merging?&lt;/p&gt;

&lt;p&gt;FileMerge is an app provided as part of the &lt;a href="http://www.apple.com/macosx/developer/" target="_blank"&gt;Apple Developer Tools&lt;/a&gt;. It's very simple to use (I believe it has some history from the &lt;a href="http://en.wikipedia.org/wiki/NeXT" target="_blank"&gt;NeXT&lt;/a&gt; days).&lt;/p&gt;

&lt;p&gt;Launching FileMerge from svn on the Terminal would be very handy indeed...&lt;/p&gt; 

&lt;p&gt;...So the search began, which brought up this groovy little result:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ssel.vub.ac.be/ssel/internal:fmdiff" target="_blank"&gt;Using FileMerge as a diff command for Subversion&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Volia sorted for SVN!
&lt;/p&gt;


 </description>
      <author>Dan Hunter</author>
      <pubDate>Tue, 14 Apr 2009 00:00:00 +0100</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/18</link>
    </item>
    <item>
      <title>Spanning Sync</title>
      <description>&lt;p&gt;Synchronize iCal and Address Book with Google Calendar and Gmail Contacts. Share calendars and contacts among multiple Macs. And while you're at it, connect Google Apps to your iPhone or iPod.&lt;/p&gt;

&lt;p&gt;
&lt;a href='http://spanningsync.com/?r=34FBC9'&gt;&lt;img src='http://spanningsync.com/s5m5-badge_150x150.gif' width='150' height='150' border='0'&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It all sounds very good. I am just a walking advert? Well the truth is I actually think Spanning Sync is a great tool. I first discovered Spanning Sync before &lt;a href="http://www.google.com/support/calendar/bin/answer.py?answer=99357" target="_blank"&gt;Google CalDAV&lt;/a&gt; came about.&lt;/p&gt;

&lt;p&gt;When attempting to organise my life I started using Google Calender back in 2006. Then after getting a Mac I wanted to use iCal. So I soon found myself searching high an low for a tool to sync up Google Calendar and iCal. Spanning Sync was the first tool I tried and in typical Mac style it is simple to use.&lt;/p&gt;

&lt;p&gt;Spanning Sync so far has got by with practically no advertising, purely relying on recommendations and word of mouth. Their save 5 make 5 idea has been a great success by actually giving $5 back to its users! One guy has made $1,000, which is pretty amazing. Having been so impressed with the software I didn't mind actually paying for it, and I have gone ahead and purchased a lifetime subscription.&lt;/p&gt;

&lt;p&gt;Check out the video to see how simple it is: &lt;a href="http://spanningsync.com/screencasts/intro/" target="_blank"&gt;http://spanningsync.com/screencasts/intro/&lt;/a&gt;</description>
      <author>Dan Hunter</author>
      <pubDate>Sat, 28 Feb 2009 00:00:00 +0000</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/17</link>
    </item>
    <item>
      <title>Validate JavaScript variables with WATIR</title>
      <description>&lt;p&gt;Recently I was required to add 3rd party JavaScript Tracking Tags to an order confirmation page. The JavaScript passed the quantities of products purchased onto the 3rd party.&lt;/p&gt;

&lt;p&gt;I wanted to validate the tags using &lt;a href="http://wiki.seleniumhq.org/display/WTR/Project+Home" target="_blank"&gt;Watir&lt;/a&gt;. It is easy enough to access the DOM using &lt;a href="http://wiki.seleniumhq.org/display/WTR/Project+Home" target="_blank"&gt;Watir&lt;/a&gt; and previously I have validated tracking tags placed in an iFrame url using xpath:&lt;/p&gt;

Access the iframe element using xpath (returns an array):&lt;br /&gt;
&lt;div class="code"&gt;frame = @ie.elements_by_xpath("//[@id='my_iframe_id']")&lt;/div&gt;

&lt;br/&gt;
Access the src of the iframe:&lt;br /&gt;
&lt;div class="code"&gt;frame[0].src&lt;/div&gt;

&lt;p&gt;Then simply assert the src to ensure the right data was been passed via the URL.&lt;/p&gt;

&lt;p&gt;This time I wanted to actually validate variables set up in the JavaScript. At first I was thinking about how I could access the script tag, then a much simpler idea came to me:&lt;/p&gt;

Retrieve the source code!&lt;br/&gt;
&lt;div class="code"&gt;html = @ie.html&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Assert the contents using a regular expression:&lt;br/&gt;
&lt;div class="code"&gt;assert(html.match(/SOME_PRODUCT="\+escape\(1\)/), "SOME_PRODUCT quantity should be: 1")&lt;/div&gt;&lt;br /&gt;

&lt;h3&gt;Watir resources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://wiki.seleniumhq.org/display/WTR/Project+Home" target="_blank"&gt;Watir home page&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.seleniumhq.org/display/WTR/Tutorial" target="_blank"&gt;Watir tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wtr.rubyforge.org/rdoc/" target="_blank"&gt;Watir API&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <author>Dan Hunter</author>
      <pubDate>Sun, 23 Nov 2008 00:00:00 +0000</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/16</link>
    </item>
    <item>
      <title>JAX-WS Tutorial</title>
      <description>&lt;p&gt;Developer and fellow colleague Paul Taylor, has taken the time to write an excellent and easy to follow JAX-WS tutorial.&lt;/p&gt; 

&lt;p&gt;&lt;a href="http://www.javacoda.com/blog/?p=22" target="_blank"&gt;Check it out at JavaCoda&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Lessons covered:
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;Basic JaxWs service with defaults &amp; simple client.&lt;/li&gt;
   &lt;li&gt;Generated client.&lt;/li&gt;
   &lt;li&gt;Annotations &amp; mapping.&lt;/li&gt;
   &lt;li&gt;XmlJavaAdapters&lt;/li&gt;
   &lt;li&gt;SOAPFaults. Handlers.&lt;/li&gt;
   &lt;li&gt;JaxWsPortFactory with timeouts.&lt;/li&gt;
   &lt;li&gt;Asynchronous calls.&lt;/li&gt;
   &lt;li&gt;Spring injection&lt;/li&gt;
   &lt;li&gt;Field/Property mapping quick examples. Marshalling tests.&lt;/li&gt;
&lt;/ol&gt;
</description>
      <author>Dan Hunter</author>
      <pubDate>Sun, 31 Aug 2008 00:00:00 +0100</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/15</link>
    </item>
    <item>
      <title>NetBeans has TextMate style code templates</title>
      <description>&lt;p&gt;Since owning a mac, I have been an avid user of TextMate. Therefore I have picked up some of the TextMate shortcuts for Ruby.&lt;/p&gt;
&lt;p&gt;I mostly develop on Windows in the workplace (not out of choice) so I use NetBeans as my main Ruby IDE on both platforms. So I was surprised to find  NetBeans contains many of the TextMate code template shortcuts (Known as Bundles in TextMate).&lt;/p&gt;
&lt;p&gt;Here are some of the most useful ones:&lt;/p&gt;
&lt;p&gt;To activate a code template type the shortcut name followed by the -&gt;| (TAB key)&lt;/p&gt;

&lt;table class="code"&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Shortcut&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/th&gt;
&lt;tr&gt;
&lt;td width="30%"&gt;rb&lt;/td&gt;
&lt;td&gt;#!/usr/bin/env ruby -wKU&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;req&lt;/td&gt;&lt;td&gt; require ""&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rw&lt;/td&gt; &lt;td&gt;attr_accessor :attr_names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;r&lt;/td&gt;&lt;td&gt;attr_reader :attr_names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;w&lt;/td&gt;
&lt;td&gt;attr_writer :attr_names&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ea&lt;/td&gt;&lt;td&gt;each { |1|  }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;eai&lt;/td&gt;&lt;td&gt;each_index { |1| }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;eak&lt;/td&gt;&lt;td&gt;each_key { |1|  }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;deli&lt;/td&gt;&lt;td&gt;delete_if { |e|  }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;:&lt;/td&gt;&lt;td&gt;:key =&gt; "value",&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;do&lt;/td&gt;&lt;td&gt;do |1|&lt;br /&gt;end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;def&lt;/td&gt;
&lt;td&gt;def method_name&lt;br /&gt;&lt;br /&gt;end
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;if&lt;/td&gt;
&lt;td&gt;if condition&lt;br /&gt;&lt;br /&gt;end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;unless&lt;/td&gt;
&lt;td&gt;unless condition&lt;br /&gt;&lt;br /&gt;end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;while&lt;/td&gt;
&lt;td&gt;while condition&lt;br /&gt;&lt;br /&gt;end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;until&lt;/td&gt;
&lt;td&gt;until condition&lt;br /&gt;&lt;br /&gt;end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dir&lt;/td&gt;&lt;td&gt;Dir.glob() { |3| }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;File&lt;/td&gt;&lt;td&gt;File.foreach("path/to/file") { |3| }&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;begin&lt;/td&gt;&lt;td&gt;begin
&lt;br /&gt;&lt;br /&gt;
rescue Exception =&gt; 1&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;code&lt;br /&gt;
end&lt;/td&gt;
&lt;/tr&gt;
&lt;td&gt;cla&lt;/td&gt;&lt;td&gt;ClassName = Struct.new(:attr_names) do&lt;br /&gt;
  &amp;nbsp;&amp;nbsp;&amp;nbsp;def method_name&lt;br /&gt;	
  &amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;	
end&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
Unit Test code templates:&lt;/p&gt;
&lt;table class="code"&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Shortcut&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Result&lt;/strong&gt;&lt;/th&gt;
&lt;tr&gt;
&lt;td width="30%"&gt;ts&lt;/td&gt;&lt;td&gt;require "test/unit"&lt;br /&gt;
&lt;br /&gt;
require "tc_test_case_file"&lt;br /&gt;
require "tc_test_case_file"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tc&lt;/td&gt;&lt;td&gt;require "test/unit"&lt;br/&gt;
require "library_file_name"&lt;br /&gt;
&lt;br /&gt;
class Test &lt; Test::Unit::TestCase&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;def test_case_name&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br /&gt;
end&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;as&lt;/td&gt;&lt;td&gt;assert(test, "Failure message.")&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ase&lt;/td&gt;&lt;td&gt;assert_equal(expected, actual)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;asne&lt;/td&gt;&lt;td&gt;assert_not_equal(unexpected, actual)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;The main shortcut that is different is 'cla' in NetBeans this creates a new Struct, but in TextMate it gives you a choice of class options.&lt;/p&gt;
&lt;p&gt;Fear not! NetBeans lets you add new code templates by going to: Preferences &gt; Editor &gt; Code Templates.&lt;/p&gt;

&lt;p&gt;They're loads more unit test code templates too.&lt;/p&gt;</description>
      <author>Dan Hunter</author>
      <pubDate>Sat, 09 Aug 2008 00:00:00 +0100</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/14</link>
    </item>
    <item>
      <title>Macs n stuff</title>
      <description>A couple of guys I work with have started a new blog about mac tips and hints:

&lt;br /&gt;
&lt;p&gt;
&lt;a href="http://www.macsnstuff.com/" target="_blank"&gt;www.macsnstuff.com&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;These guys really do live and breath macs.&lt;/p&gt;</description>
      <author>Dan Hunter</author>
      <pubDate>Mon, 04 Aug 2008 00:00:00 +0100</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/13</link>
    </item>
    <item>
      <title>Online, on rails</title>
      <description>At last my new site is online, knocked together with Ruby on Rails.
&lt;p&gt;
I feel it's still in experimentation mode. I may change the design, besides I am continually tweaking the Ruby code :)&lt;/p&gt;
&lt;p&gt;
Never the less dreampixel is online again, this time with a blog flavour to keep me amused whilst I work on the rest of the site.
&lt;/p&gt;
&lt;p&gt;
Although it has taken a while to get the site online, the actual coding took no time at all with Ruby and Rails.&lt;/p&gt;
&lt;p&gt;Resources that guided me in my quest:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.pragprog.com/titles/rails2/agile-web-development-with-rails" target="_blank"&gt;Agile Web Development with Rails&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.pragprog.com/titles/ruby/programming-ruby" target="_blank"&gt;Programming Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://poignantguide.net/ruby/" target="_blank"&gt;Why's (Poignant) Guide to Ruby&lt;/a&gt; (chunky bacon)&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.rubyonrails.org/" target="_blank"&gt;The Rails website&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description>
      <author>Dan Hunter</author>
      <pubDate>Sun, 03 Aug 2008 00:00:00 +0100</pubDate>
      <link>http://www.dreampixel.co.uk/weblog/more/4</link>
    </item>
  </channel>
</rss>
