<?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>slateblue.org</title>
	<atom:link href="http://www.slateblue.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slateblue.org</link>
	<description>Some random scribblings on Home Automation and ColdFusion</description>
	<lastBuildDate>Sun, 30 May 2010 13:29:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Scotch on the Rocks 2010</title>
		<link>http://www.slateblue.org/2010/05/30/scotch-on-the-rocks-2010/</link>
		<comments>http://www.slateblue.org/2010/05/30/scotch-on-the-rocks-2010/#comments</comments>
		<pubDate>Sun, 30 May 2010 13:29:07 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.slateblue.org/?p=449</guid>
		<description><![CDATA[I was fortunate enough to be able to attend my first ColdFusion conference last week, Scotch on the Rocks 2010, but only for the first of the two days.  Since our employer was funding the trip, colleague Mister Dai and I mostly went to different sessions to get the maximum value out of the day. The folowing is a quick [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="SOTR2010 Attendee" src="/images/attendee.png" alt="" width="250" height="125" />I was fortunate enough to be able to attend my first ColdFusion conference last week, <a href="http://www.scotch-on-the-rocks.co.uk/">Scotch on the Rocks 2010</a>, but only for the first of the two days.  Since our employer was funding the trip, colleague <a href="http://misterdai.wordpress.com/">Mister Dai</a> and I mostly went to different sessions to get the maximum value out of the day. The folowing is a quick roundup of the sessions I attended, <span id="more-449"></span>minus the two that we both went to as Dave has already <a href="http://misterdai.wordpress.com/2010/05/26/sotr2010-day-1-notes/">covered them on his blog</a>:</p>
<h3>Geting Started with Adobe AIR</h3>
<p>(<a href="http://www.mattgifford.co.uk/blog/">Matt Gifford</a>, <a href="http://www.fuzzyorange.co.uk/">Fuzzy Orange</a>)</p>
<p>Despite being hampered by lack of Internet connectivity, Matt demonstrated a couple of Flex-based AIR apps built using Flash Builder 4 &#8211; a Twitter search and a music player.  Unfortunately I don&#8217;t have much a a clue when it comes to Flex, so a lot of it was a little over my head, and some of my notes don&#8217;t make an awful lot of sense, but Matt certainly made it look easy.  He also demonstrated the ease of adding automatic updates to an AIR app and mentioned that AIR 2 features an HTML5-capable Webkit browser.  I&#8217;m not sure that AIR is something I&#8217;ll have much of an opportunity to use in my day job, but it&#8217;s definitely something I want to look at for my own interest.</p>
<h3>A Whistlestop Tour of HTML5 and CSS3</h3>
<p>(<a href="http://my.opera.com/chrismills/blog/">Chris Mills</a>, <a href="http://www.opera.com/">Opera</a>)</p>
<p>I have to admit I haven&#8217;t really paid much attention to the new features in HTML5, so Chris&#8217;s introduction was a good session for me. He covered the background to the development of HTML5 and described some of the new features in the areas of semantics, forms, dynamic graphics and multimedia, followed by some of the feature in CSS3 (transparency, shadows, corner rounding, transitions etc)</p>
<p>Chris&#8217;s slides are <a href="http://www.slideshare.net/chrisdavidmills/html5-and-css3-shizzle">available on line</a> so I won&#8217;t reproduce my copious notes here but I will add that a couple of questions were asked about fine control of the new features (date formating for example &#8211; the date returned from the calendar control in the demo was returned as YYY-MM-DD).  The answer seemed to be that HTML5 didn&#8217;t cater for that specifically, but JavaScript could come to the rescue.</p>
<p>The take away message was that despite lack of support in some browsers (OK, just Internet Explorer) there is no reason not to use HTML5  now as it is designed for Backwards compatibility and graceful degradation.</p>
<p>As a side effect, Chris&#8217;s presentation also prompted me to dig out my old copy of <a href="http://www.amazon.co.uk/gp/product/B000002JLJ?ie=UTF8&amp;tag=slateblueorg-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=B000002JLJ">Fighting the World</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.co.uk/e/ir?t=slateblueorg-21&amp;l=as2&amp;o=2&amp;a=B000002JLJ" border="0" alt="" width="1" height="1" /> which I can&#8217;t have listened to in about 20 years.  Other bands play, Manowar kills!</p>
<h3>How Catalyst will Transform the ColdFusion Developer</h3>
<p>(<a href="http://www.terrenceryan.com/">Terry Ryan</a>, <a href="http://www.adobe.com/">Adobe</a>)</p>
<p>Terry had briefly introduced and demonstrated Adobe&#8217;s interaction design tool Catalyst in the Keynote, and this session was basically a more in depth treatment of the subject.  He demonstrated a mobile-targeted speaker search app developed for a presentation at the Australian <a href="http://www.webdu.com.au/">WebDU</a> event.  Again he walked through the process of importing static images into Catalyst and defining the behaviour of certain areas (text box, vertical scroll bar, button etc).  He then added effects to button states, created different stages (search, list, detail) and set up transition effects for moving between them and then linked to CFCs to provide the data.</p>
<h3>The Art of Emotional Design: A story of pleasure, joy and delight</h3>
<p>(<a href="http://aralbalkan.com/">Aral Balkan</a>)</p>
<p>Aral&#8217;s session was well attended and he seemed a little concerned that he might be in for a hard time from the audience so he started with an apology/clarification concerning some <a href="http://aralbalkan.com/1864">previous comments</a> on the future of ColdFusion.  Fortunately no-one seemed to have taken it too badly!</p>
<p>This was the presentation that appealed to me most when I first read the description in the programme and Aral didn&#8217;t disappoint.  Although it wasn&#8217;t technical in nature, this was may favourite presentation of the day.  The message (Don&#8217;t just make software that works, make software that people actually <em>want</em> to use) was simple and well-presented and illustrated, and Aral&#8217;s presentation skills are first class.</p>
<p>Again, I won&#8217;t reproduce my notes here as there is a <a href="http://vimeo.com/11919491">video of this presentation</a> available (albeit a slightly different version given from the <a href="http://futureofwebdesign.com/">Future of Web Design</a>).  It&#8217;s well worth a watch.</p>
<p>Overall, I really enjoyed the day, though traveling to London and back from Cardiff on the day made it pretty tiring, and sneaking out after the last presntation to catch the train home meant that I missed picking up a prize in the raffle :(.  With any luck I&#8217;ll get to go to next year&#8217;s event in Edinburgh, and stay for the full experience. </p>
<p>Thanks to the organisers and all the speakers for a great event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slateblue.org/2010/05/30/scotch-on-the-rocks-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>xPLCurrentCost source now on Google Code</title>
		<link>http://www.slateblue.org/2010/03/29/xplcurrentcost-source-now-on-google-code/</link>
		<comments>http://www.slateblue.org/2010/03/29/xplcurrentcost-source-now-on-google-code/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 21:15:38 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[xPL]]></category>
		<category><![CDATA[xPLCurrentCost]]></category>

		<guid isPermaLink="false">http://www.slateblue.org/?p=443</guid>
		<description><![CDATA[The xPL project subversion repository has been moved over to Google Code which has given me the nudge I needed to finally get the xPLCurrentCost source into svn.  Check it out (did you see what I did there?) at http://code.google.com/p/xplproject/.
]]></description>
			<content:encoded><![CDATA[<p>The xPL project subversion repository has been moved over to Google Code which has given me the nudge I needed to finally get the <a href="http://www.slateblue.org/xplcurrentcost/">xPLCurrentCost</a> source into svn.  Check it out (did you see what I did there?) at <a href="http://code.google.com/p/xplproject/">http://code.google.com/p/xplproject/</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slateblue.org/2010/03/29/xplcurrentcost-source-now-on-google-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL Encoding with CFML</title>
		<link>http://www.slateblue.org/2009/08/29/url-encoding-with-cfml/</link>
		<comments>http://www.slateblue.org/2009/08/29/url-encoding-with-cfml/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 15:19:17 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazonsig]]></category>
		<category><![CDATA[cfml]]></category>

		<guid isPermaLink="false">http://www.slateblue.org/?p=400</guid>
		<description><![CDATA[Some feedback about my Amazon Product Advertising API Signature Generator (yes, I know it needs a better name) has caused me to look at URL encoding in more detail than I ever have before, and it turns out it&#8217;s not as straightforward as you might think.
The first problem was that I&#8217;d forgotten that I needed to [...]]]></description>
			<content:encoded><![CDATA[<p>Some feedback about my <span><a href="http://amazonsig.riaforge.org/">Amazon Product Advertising API Signature Generator</a> (yes, I know it needs a better name) has caused me to look at URL encoding in more detail than I ever have before, and it turns out it&#8217;s not as straightforward as you might think.<span id="more-400"></span></span></p>
<p><span>The first problem was that I&#8217;d forgotten that I needed to URL encode the parameter values.  No problem, Coldfusion&#8217;s built in <a href="http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_t-z_10.html"><code>URLEncodedFormat()</code></a> function should sort that out with minimal effort.  At least that was the theory.  The trouble is, while it worked most of the time, occasionally I was getting <span>SignatureDoesNotMatch errors.  </span></span></p>
<p><span><span>A look at the <a href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html">API docs</a> told me that Amazon were expecting me to encode to <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>.  They also helpfully noted that a couple of commonly used escaping methods (for Perl and Java) do not strictly follow RFC 3986.  To see exactly what <code>URLEncodedFormat()</code> was doing, I threw together a quick test:</span></span></p>
<pre class="brush:cf gutter:false">&lt;cfloop from="32" to ="127" index="i"&gt;
	&lt;cfoutput&gt;
		#i# - #chr(i)# - #urlencodedformat(chr(i))#&lt;hr&gt;
	&lt;/cfoutput&gt;
&lt;/cfloop&gt;</pre>
<p>It turns out that URLEncodedFormat() encodes <em>all</em> characters that are not in the ranges a-z, A-Z or 0-9.  Unfortunately this includes a number of characters that RFC 3986 says should not be encoded, specifically &#8220;.&#8221; (period/dot),  &#8221;-&#8221; (hypen/minus), &#8220;_&#8221; (underscore) and &#8220;~&#8221; (tilde).  This doesn&#8217;t seem to matter too much when just encoding a URL to make an HTTP request, for example, but when the encoded message is used to calculate a digital signature, both parties need to be using exactly the same encoding scheme or the signatures will not match.</p>
<p>The obvious alternative for a CF developer, Java&#8217;s <code>URLEncoder.encode</code>, does slightly better with only 3 &#8220;mistakes&#8221; (as pointed out in the <a href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html">API docs</a>).  To achieve RFC 3986 compliant encoding, I was going to have to correct some mistakes made by the functions available to me (or write my own from scratch which I didn&#8217;t much fancy), but which one to choose?</p>
<p>I tried two different functions to do the encoding and fix the problems, returning an RFC 3986 encoded string. </p>
<p><strong>Version 1:</strong></p>
<pre class="brush:cf gutter:false">&lt;cffunction name="rfc3986EncodedFormat1" returntype="string" output="false"&gt;

	&lt;cfargument name="text" required="yes" type="string"&gt;

	&lt;cfreturn replacelist(urlencodedformat(arguments.text), "%2D,%2E,%5F,%7E", "-,.,_,~")&gt;

&lt;/cffunction&gt;</pre>
<p><strong>Version 2:</strong></p>
<pre class="brush:cf; gutter:false">&lt;cffunction name="rfc3986EncodedFormat2" returntype="string" output="false"&gt;

	&lt;cfargument name="text" required="yes" type="string"&gt;

	&lt;cfset var lc = structnew()&gt;

	&lt;cfset lc.objNet = createObject("java","java.net.URLEncoder")&gt;
	&lt;cfset lc.encodedText = lc.objNet.encode(arguments.text, 'utf-8').replace("+", "%20").replace("*", "%2A").replace("%7E", "~")&gt;

	&lt;cfreturn lc.encodedText&gt;

&lt;/cffunction&gt;</pre>
<p class="brush:cf; gutter:false">Comparing the two, there didn&#8217;t seem to be a perceptible difference in performance for single calls, but scaling up to 1000 calls in a loop there was a clear winner, with <code>URLEncoder</code> consistently taking between 1000 and 2000 milliseconds, and the <code>URLEncodedFormat()</code> version taking between 2000 and 4000.  Version 2 has made it into version 1.1 of Amazonsig, available from <a href="http://amazonsig.riaforge.org/">amazonsig.riaforge.org</a>.</p>
<p class="brush:cf; gutter:false">As a happy side effect of this, Amazonsig also now encodes extended characters correctly, allowing values like Motörhead to be passed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slateblue.org/2009/08/29/url-encoding-with-cfml/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Signing Amazon Product Advertising API requests with CFML</title>
		<link>http://www.slateblue.org/2009/08/28/signing-amazon-product-advertising-api-requests-with-cfml/</link>
		<comments>http://www.slateblue.org/2009/08/28/signing-amazon-product-advertising-api-requests-with-cfml/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 20:35:27 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[amazonsig]]></category>
		<category><![CDATA[cfml]]></category>

		<guid isPermaLink="false">http://www.slateblue.org/?p=328</guid>
		<description><![CDATA[From 15th August 2009, all requests to Amazon&#8217;s Product Advertising API must be authenticated with a message authentication code.  This requires that a signature be generated using your secret key and appended to the request.  When Amazon get the request, they calculate the signature themselves, and if it matches the signature you sent they know that the message is [...]]]></description>
			<content:encoded><![CDATA[<p>From 15th August 2009, all requests to <a href="https://affiliate-program.amazon.co.uk/gp/advertising/api/detail/main.html">Amazon&#8217;s Product Advertising API</a> must be authenticated with a <a href="http://en.wikipedia.org/wiki/Message_authentication_code">message authentication code</a>.  This requires that a signature be generated using your secret key and appended to the request.  When Amazon get the request, they calculate the signature themselves, and if it matches the signature you sent they know that the message is from you, and that it hasn&#8217;t been tampered with en route. </p>
<p>Amazon have been warning developers about that this change  since May, but I&#8217;ve been putting off doing anything about it, telling myself that there&#8217;s plenty of time before it needs to be done.  At least until my requests started failing with 400 Bad Request errors and &#8220;The request must contain the parameter Signature&#8221; messages&#8230;<span id="more-328"></span></p>
<p>The <a href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html">signature generation process</a> is actually pretty straightforward, the trickiest part looked like being calculation of the <a href="http://en.wikipedia.org/wiki/HMAC">HMAC</a> signature, until I found <a href="http://developer.amazonwebservices.com/connect/thread.jspa?threadID=33028">a post</a> on the Amazon Developer Forum showing how to use Java to produce the signature (looks like the original credit for the technique goes to <a href="http://www.barneyb.com/barneyblog/projects/amazon-s3-cfc/">Barney Boisvert</a>).  Coupled with a chunk of code for manipulating the request URL, the amazonsig component was born.  This contains a function that takes an existing request, and returns it complete with a signature, allowing me to simply update my exiting code by replacing</p>
<pre class="brush:cf; gutter:false; toolbar:false;">&lt;cfhttp url="#requrl#" method="GET" /&gt;</pre>
<p>with</p>
<pre class="brush:cf; gutter:false; toolbar:false;">&lt;cfhttp url="#amazonsig.signrequest(requrl, secretKey)#" method="GET" /&gt;</pre>
<p>In the hope that it might be useful, or save someone else a few hours work, I&#8217;ve made it available via RIAForge &#8211; <a href="http://amazonsig.riaforge.org/">amazonsig.riaforge.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.slateblue.org/2009/08/28/signing-amazon-product-advertising-api-requests-with-cfml/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New Site</title>
		<link>http://www.slateblue.org/2009/03/15/new-site/</link>
		<comments>http://www.slateblue.org/2009/03/15/new-site/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 21:23:51 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.slateblue.org/?p=75</guid>
		<description><![CDATA[So I&#8217;ve written an application, released it and even written some documentation for it.  All I need now is somewhere to keep it.  And here it is, my new WordPress site.
It&#8217;s more than is strictly necessary to publish details about a single fairly simple application, but in the (more than) ten years I&#8217;ve been into home [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ve written an <a href="http://www.slateblue.org/xplcurrentcost/">application</a>, <a href="http://www.xpl-home.org/forums/viewtopic.php?t=669">released it</a> and even written some documentation for it.  All I need now is somewhere to keep it.  And here it is, my new WordPress site.</p>
<p>It&#8217;s more than is strictly necessary to publish details about a single fairly simple application, but in the (more than) ten years I&#8217;ve been into home automation, I&#8217;ve always found reading about other people&#8217;s experiences to be interesting if not inspirational.  I&#8217;ve often thought it would be a nice idea to write up some of my stuff and give something back and here is my chance.  Trouble is, I&#8217;m apparently more of a starter than a finisher, so it remains to be seen whether I ever manage to post anything else&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slateblue.org/2009/03/15/new-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
