<?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>isambard</title>
	<atom:link href="http://isambard.com.au/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://isambard.com.au/blog</link>
	<description>musings on information design and architecture</description>
	<lastBuildDate>Mon, 30 Jan 2012 04:20:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>UI Rule #92 &#8211; Don&#8217;t sacrifice the useful to fit your design</title>
		<link>http://isambard.com.au/blog/2012/01/30/ui-rule-92-dont-sacrifice-the-useful-information-to-fit-your-design/</link>
		<comments>http://isambard.com.au/blog/2012/01/30/ui-rule-92-dont-sacrifice-the-useful-information-to-fit-your-design/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 04:15:58 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=774</guid>
		<description><![CDATA[Everybody needs a lego moleskine. Comparison shopping at the UK Book Depository proved troublesome because they decided to cut the product title short, removing the information that actually differentiated the products being chosen: Hard to tell which one to choose when everything you want to know about the choices is unavailable. Should I get the [...]]]></description>
			<content:encoded><![CDATA[<p>Everybody needs a lego moleskine.  Comparison shopping at the <a href="http://www.bookdepository.co.uk/search?searchTerm=lego+moleskine&#038;search=search">UK Book Depository</a> proved troublesome because they decided to cut the product title short, removing the information that actually differentiated the products being chosen:</p>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2012/01/bookDepository.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2012/01/bookDepository.png" alt="" title="bookDepository" width="766" height="659" class="alignleft size-full wp-image-775" /></a></p>
<p>Hard to tell which one to choose when everything you want to know about the choices is unavailable. Should I get the &#8220;Lego Y..&#8221; or, mmmmm, the other &#8220;Lego Y..&#8221;?</p>
<p>Compare to Amazon, who manage to fit the full name in without issue:</p>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2012/01/amazon.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2012/01/amazon.png" alt="" title="amazon" width="785" height="401" class="alignleft size-full wp-image-776" /></a></p>
<p>If you&#8217;re going to allow a certain number of characters for a value, assume all of those characters may be important at some point.  And make sure somewhere on your interface you let them all get their moment in the sun.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2012%2F01%2F30%2Fui-rule-92-dont-sacrifice-the-useful-information-to-fit-your-design%2F&amp;title=UI%20Rule%20%2392%20%26%238211%3B%20Don%26%238217%3Bt%20sacrifice%20the%20useful%20to%20fit%20your%20design" id="wpa2a_2"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2012/01/30/ui-rule-92-dont-sacrifice-the-useful-information-to-fit-your-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want your iPad calendar to start the week on Monday?  Move to Namibia</title>
		<link>http://isambard.com.au/blog/2012/01/25/want-your-ipad-calendar-to-start-the-week-on-monday-move-to-namibia/</link>
		<comments>http://isambard.com.au/blog/2012/01/25/want-your-ipad-calendar-to-start-the-week-on-monday-move-to-namibia/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 01:49:58 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=769</guid>
		<description><![CDATA[Frustratingly, my iPad calendar appeared to unilaterally decide that the first day of the week was Sunday. And there was no obvious setting to change it, like there is for Calendar on the Mac. Turns out this &#8220;feature&#8221; is decided by Apple based on your region. They believe Australian weeks start on Sunday so that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Frustratingly, my iPad calendar appeared to unilaterally decide that the first day of the week was Sunday.  And there was no obvious setting to change it, like there is for Calendar on the Mac.</p>
<p>Turns out this &#8220;feature&#8221; is decided by Apple based on your region.  They believe Australian weeks start on Sunday so that&#8217;s the way it is.  To change the day, change your region.</p>
<p>For Australians wanting their calendar to start on a Monday:</p>
<ol>
<li>Launch settings</li>
<li>Select General > International</li>
<li>change region format to Namibia</li>
</ol>
<p>This bizarre choice seems to have the best option for calendar setting, as well as changes it makes to keyboards (what currency symbol you see), date and time formats, even which google you default to when you search.  Namibia appears to leave all the other settings &#8220;just like Australia&#8221;, and still default to google.com.au for searching in Safari.</p>
<p>Thanks to the clever chaps on the <a href="http://forums.whirlpool.net.au/archive/1793827">Whirlpool forums</a>, particularly dokh22, for uncovering this.  Now how long before Apple gives us a calendar setting to do it properly?</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2012%2F01%2F25%2Fwant-your-ipad-calendar-to-start-the-week-on-monday-move-to-namibia%2F&amp;title=Want%20your%20iPad%20calendar%20to%20start%20the%20week%20on%20Monday%3F%20%20Move%20to%20Namibia" id="wpa2a_4"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2012/01/25/want-your-ipad-calendar-to-start-the-week-on-monday-move-to-namibia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple image (frame-by-frame) animation in IOS and Xcode</title>
		<link>http://isambard.com.au/blog/2011/11/05/simple-image-animation-in-ios-and-xcode/</link>
		<comments>http://isambard.com.au/blog/2011/11/05/simple-image-animation-in-ios-and-xcode/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 02:19:32 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=720</guid>
		<description><![CDATA[Adding frame-by-frame animations to your iOS application is simple once you find out that a UIImageView can be initialised with an array of images, not just one image. This post was inspired by a colleague who had not uncovered that fact, and so had spent time arduously linking separate views with timers. This post shows [...]]]></description>
			<content:encoded><![CDATA[<p>Adding frame-by-frame animations to your iOS application is simple once you find out that a UIImageView can be initialised with an array of images, not just one image. </p>
<p>This post was inspired by a colleague who had not uncovered that fact, and so had spent time arduously linking separate views with timers.  This post shows how to use a single view and 3 lines of animation code to do all the work.</p>
<h2>What to do?</h2>
<p>What we&#8217;ll do as a test is animate the blinking eyes on a tennis-playing ninja splash screen.  To trigger the animation will add a &#8220;blink&#8221; button on the same screen.</p>
<p>Don&#8217;t ask how we ended up with that as the example (thanks to the friend).  But you can download the entire project, or just the images if wanting to join in.<br />
<span id="more-720"></span></p>
<ul>
<li><a href='http://isambard.com.au/blog/wp-content/uploads/2011/11/ninjaProject.zip'>download the project</a></li>
<li><a href='http://isambard.com.au/blog/wp-content/uploads/2011/11/ninjaImages.zip'>download the images</a></li>
</ul>
<p>The steps:</p>
<ol>
<li>prepare the images</li>
<li>create the project</li>
<li>create/update a XIB with the image and button</li>
<li>add the animation code and link to the same image and button</li>
</ol>
<blockquote><p>
All the neat animation stuff is described in the 4th step, so feel free to scroll straight to it.  The previous three steps cover all that&#8217;s needed to get your project ready to animate.  I&#8217;ve included it because I hate reading articles  that assume you&#8217;ve covered all the basics already.  Or worse just dismiss it with one line (first step, invent time travel).
</p></blockquote>
<p>Note this process was captured in xCode4/IOS5.  None of the code in here has changed much in recent releases but you may have to adjust some of the steps if running an earlier setup (one thing that has changed in this version is the options when creating a project).</p>
<h2>(1) prepare the images</h2>
<p>Your imagery is limited only by your artistic talents, or abilities to search Google Images or Flickr (remember to honour their copyright, boys and girls).  </p>
<p>Only suggestion is to limit the animation element to the smallest possible; keeps sizes small.  For example, for the blinking ninja, instead of 3 different ninjas with different eye positions (open, half closed, closed), I created one ninja with no eyes, and then three images of just the different eyes.  What we&#8217;ll do in the project is then add the main ninja as one image view, and put the eyes over the top in a separate image.</p>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/11/ninja-AllImages.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/11/ninja-AllImages.png" alt="" title="ninja-AllImages" width="362" height="339" class="aligncenter size-full wp-image-747" /></a></p>
<p>Whatever approach you take, ensure all the images that will be animated are the same size.  This will ensure when animated they appear over each other.</p>
<h2>create the project</h2>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/10/project-01-create.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/10/project-01-create-300x200.png" alt="" title="project-01-create" width="300" height="200" class="alignright size-medium wp-image-729" /></a><br />
Crack open Xcode and choose <strong>File > New Project</strong>.  I&#8217;m in the latest and greatest (4.2) so your options may vary, but for this version:</p>
<ul>
<li>choose <strong>Single View Application</strong></li>
<li>choose not to use storyboard (so we get a XIB to mess with)</li>
</ul>
<p>Once created we have a simple project containing the key source files:</p>
<ul>
<li>appDelegate.h</li>
<li>appDelegate.m</li>
<li>ViewController.h</li>
<li>ViewController.m</li>
<li>ViewController.xib</li>
</ul>
<blockquote><p>The good news is we&#8217;re only going to be editing the three ViewController files.  Which means you can pretty much follow all of these steps to add an animation to an existing view within your current application;  just join in from the next step.</p></blockquote>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/10/project-02-addFiles.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/10/project-02-addFiles-269x300.png" alt="" title="project-02-addFiles" width="269" height="300" class="alignright size-medium wp-image-736" /></a>Now add your animation images to the project.  Either right-click in the folder view and select <strong>Add Files To..</strong>, or choose <strong>File > Add Files To..</strong> from the menu.</p>
<h2>(2) create/update XIB with the image and button</h2>
<p>Our XIB has already been created in the project.  What to do now is setup the images and buttons we meed, including the outlets needed so we can communicate with them from our code.</p>
<p>Firstly the images.  Remember we need to add two:  1 as the background (which we don&#8217;t need to interact with) and one for the animated eyes (which we will need to talk to).</p>
<p>To hook things up let&#8217;s create the outlets first, and then link in the XIB. Open ViewController.h and add our definition (new text in bold):</p>
<pre>
#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {
    <strong>IBOutlet UIImageView *eyesImage;</strong>
    <strong>IBOutlet UIButton *blinkButton;</strong>
}

<strong>@property (nonatomic, retain) IBOutlet UIImageView *eyesImage;</strong>
<strong>@property (nonatomic, retain) IBOutlet UIButton *blinkButton;</strong>

@end;
</pre>
<p>Then switch over to ViewController.m (tip: 3 fingers down gesture if using a trackpad) and synthesize them:</p>
<pre>
@import "ViewController.h"

@implementation ViewController

<strong>@synthesize eyesImage;</strong>
<strong>@synthesize blinkButton;</strong>
</pre>
<p>Remember if we create them, we should also destroy them:</p>
<pre>
- (void)viewDidUnload
{
    [superviewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    <strong>self.eyesImage = nil;</strong>
    <strong>self.blinkButton = nil;</strong>
}
</pre>
<p>That gives us our outlets so we can link to, and manipulate these items on our XIB.  Note we don&#8217;t currently need to manipulate the button but the outlet is there just in case (for example if needing to disable the button at some point).</p>
<p>The only other item to add in the code before we edit the XIB is the method to be called when we click the button.</p>
<p>Back into viewController.h and add the definition:</p>
<pre>
#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {
    IBOutlet UIImageView *eyesImage;
    IBOutlet UIButton *blinkButton;
}

@property (nonatomic, retain) IBOutlet UIImageView *eyesImage;
@property (nonatomic, retain) IBOutlet UIButton *blinkButton;

<strong>- (IBAction) blink;</strong>

@end;
</pre>
<p>And then back to ViewController.m, and insert the method somewhere in the list:</p>
<pre><strong>
- (IBAction) blink {
  //blink
}
</strong></pre>
<p>Save the files and we&#8217;re ready to connect them to elements in the XIB.</p>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/11/imageView.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/11/imageView-300x113.png" alt="" title="imageView" width="300" height="113" class="alignright size-medium wp-image-746" /></a><br />
Firstly open the XIB and drag an imageView onto the work area.<br />
Set the size and content to be our background/static image for the animation.    Don&#8217;t worry with any outlets as we never need to talk to this image.</p>
<p>Now add a 2nd image view to the work area.  Set its position and size to match where the animation is to be presented.  If it helps you with positioning, set the default image to the first of your animation frames.</p>
<p>Once the animated image view is in place, hook up the outlet.  We need to link this to our eyesImage outlet so we can manipulate it.  Just select the Outlets panel for the view, click in the circle for Referencing Outlet and then drag to File&#8217;s Owner on the left side of the work area.  if all has worked you&#8217;ll then get a dropdown list in which you can select eyesImage.  Once selected your outlet will be added.</p>
<p>That&#8217;s all you need to do for the animation.  Now for the button.</p>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/11/button.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/11/button-300x109.png" alt="" title="button" width="300" height="109" class="alignright size-medium wp-image-763" /></a>Drag a Round Rect Button onto the work area and position somewhere appropriate.  Then add a suitable label (&#8220;blink&#8221; comes to mind).  View the Outlets panel for the button and drag from the Referencing Outlet to File&#8217;s Owner (as we did for the image) and select the blinkButton outlet.  And then, to link to our blink method, drag from the TouchUpInside outlet to the same File&#8217;s Owner.  If all has worked you&#8217;ll then be able to select <code>blink</code> and connect it up.</p>
<p>So that&#8217;s all the XIB sorted.  We&#8217;ve got a background/static image.  We&#8217;ve got a smaller image with an eyesImage outlet for the animation.  And we&#8217;ve got a button that when clicked will trigger our <code>blink()</code> method.  Only one step to go.</p>
<table width="100%">
<tr>
<td valign=top><a href="http://isambard.com.au/blog/wp-content/uploads/2011/11/imageOutlets2.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/11/imageOutlets2-198x300.png" alt="" title="imageOutlets" width="198" height="300" class="alignnone size-medium wp-image-760" /></a></td>
<td valign=top><a href="http://isambard.com.au/blog/wp-content/uploads/2011/11/buttonOutlets.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/11/buttonOutlets-187x300.png" alt="" title="buttonOutlets" width="187" height="300" class="alignnone size-medium wp-image-760" /></a></td>
</tr>
</table>
<p>Save your XIB and then run your project.  You won&#8217;t see anything moving but at least your background image should be in view.</p>
<h2>add the animation code and link to the image and button</h2>
<p>Now for the fun part.</p>
<p>To animate an image we load up the image view with an array of images, set some parameters for how fast and how long the animation runs, and then start it off.  For efficiency we&#8217;ll put all the animation setup into <code>viewDidLoad</code> (so done once when the view first appears), and then just trigger the animation each time we click the button.</p>
<p>So back into viewController.m, let&#8217;s first setup the animation:</p>
<pre>
- (void)viewDidLoad
{
    [superviewDidLoad];
    
        <strong>
       //setup animation
    NSArray *eyeFrames = [NSArrayarray];
    eyeFrames = [[NSArrayalloc] initWithObjects:
                 [UIImageimageNamed:@"eyes1-open.png"],
                 [UIImageimageNamed:@"eyes2-half.png"],
                 [UIImageimageNamed:@"eyes3-closed.png"],
                 nil];
    eyesImage.animationImages = eyeFrames;
    eyesImage.animationDuration = 0.25;
    eyesImage.animationRepeatCount = 1;
    [eyeFrames release];   
    </strong>

}
</pre>
<p>We&#8217;ve added an array of three images to our eyesImage outlet. The animation will take a quarter of a second and will only run once.  Once implemented you&#8217;ll return to these settings (often!) to get the appearance just right.</p>
<p>Once setup, triggering it is just one line of code:</p>
<pre>
- (void) blink {
    <strong>[eyesImage startAnimating];</strong>
}
</pre>
<p>Save and run your project. Then everytime you click the button, magic happens.</p>
<h2>Conclusion</h2>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/11/finished.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/11/finished-159x300.png" alt="" title="finished" width="159" height="300" class="alignright size-medium wp-image-761" /></a> While it took a while to get there, animating our image took only 7 lines of code.  Armed with that code you are limited by only your graphical capabilities.  Just build your images, repeat the 7 lines, and then spend an age tweaking the duration to get it looking right.  </p>
<p>After a while you may find this approach a bit too limited as it scrolls through the image frames at a regular pace.  If wanting a bit more control over the animation  pace, then you&#8217;ll need to step up and start using proper animation blocks.  Next time.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F11%2F05%2Fsimple-image-animation-in-ios-and-xcode%2F&amp;title=Simple%20image%20%28frame-by-frame%29%20animation%20in%20IOS%20and%20Xcode" id="wpa2a_6"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/11/05/simple-image-animation-in-ios-and-xcode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quote of the Week (31 October)</title>
		<link>http://isambard.com.au/blog/2011/10/31/quote-of-the-week-31-october/</link>
		<comments>http://isambard.com.au/blog/2011/10/31/quote-of-the-week-31-october/#comments</comments>
		<pubDate>Mon, 31 Oct 2011 05:17:19 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Quote of the Week]]></category>
		<category><![CDATA[Project Mgt]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=740</guid>
		<description><![CDATA[Quoted in a Zach Holman presentation on GitHub, but originally from Merlin Mann: Making something a BIG RED TOP TOP BIG HIGHEST #1 PRIORITY changes nothing but text styling. if it were really important, it&#8217;d already be done. Period.]]></description>
			<content:encoded><![CDATA[<p>Quoted in a <a href="http://zachholman.com/talk/how-github-uses-github-to-build-github">Zach Holman presentation on GitHub</a>, but originally from <a href="http://www.43folders.com/2009/04/28/priorities">Merlin Mann</a>:</p>
<blockquote><p>Making something a <strong><span style="color: #ff0000;">BIG RED TOP TOP BIG HIGHEST #1 PRIORITY</span></strong> changes nothing but text styling.</p>
<p>if it were really important, it&#8217;d already be done. Period.</p></blockquote>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F10%2F31%2Fquote-of-the-week-31-october%2F&amp;title=Quote%20of%20the%20Week%20%2831%20October%29" id="wpa2a_8"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/10/31/quote-of-the-week-31-october/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IOS5 &#8211; Wireless sync is the gravy</title>
		<link>http://isambard.com.au/blog/2011/10/28/ios5-wireless-sync-is-the-gravy/</link>
		<comments>http://isambard.com.au/blog/2011/10/28/ios5-wireless-sync-is-the-gravy/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 03:10:57 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[IOS]]></category>
		<category><![CDATA[iPad]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=733</guid>
		<description><![CDATA[Finally managed to download and install the IOS5 update for the iPad. Most of the new features are unobtrusive, although still trying to find some of them. However what wins is the wireless synchronisation feature. Now I can update my library (songs, books, tv) on my computer and click Sync. And the iPad gets updated [...]]]></description>
			<content:encoded><![CDATA[<p>Finally managed to download and install the IOS5 update for the iPad.  Most of the new features are unobtrusive, although still trying to find some of them.</p>
<p>However what wins is the wireless synchronisation feature.  Now I can update my library (songs, books, tv) on my computer and click Sync.  And the iPad gets updated while not connected.  While not even switched on.  While in my briefcase in another room.  </p>
<p>Sweet.</p>
<p>[Although I'll admit it's probably sweet because Apple kept us tethered for far too long!]</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F10%2F28%2Fios5-wireless-sync-is-the-gravy%2F&amp;title=IOS5%20%26%238211%3B%20Wireless%20sync%20is%20the%20gravy" id="wpa2a_10"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/10/28/ios5-wireless-sync-is-the-gravy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quote of the Week (6 Oct)</title>
		<link>http://isambard.com.au/blog/2011/10/07/quote-of-the-week-6-oct/</link>
		<comments>http://isambard.com.au/blog/2011/10/07/quote-of-the-week-6-oct/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 20:42:24 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Quote of the Week]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=707</guid>
		<description><![CDATA[So long Steve]]></description>
			<content:encoded><![CDATA[<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/10/Apple1997.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/10/Apple1997.png" alt="" title="Apple1997" width="458" height="700" class="aligncenter size-full wp-image-708" /></a></p>
<p>So long Steve</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F10%2F07%2Fquote-of-the-week-6-oct%2F&amp;title=Quote%20of%20the%20Week%20%286%20Oct%29" id="wpa2a_12"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/10/07/quote-of-the-week-6-oct/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quote of the Week (11 July)</title>
		<link>http://isambard.com.au/blog/2011/07/14/quote-of-the-week-11-july/</link>
		<comments>http://isambard.com.au/blog/2011/07/14/quote-of-the-week-11-july/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 01:53:15 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Quote of the Week]]></category>
		<category><![CDATA[Project Mgt]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=703</guid>
		<description><![CDATA[From Hall of Fame basketball player/coach John Wooden: &#8220;If You Don’t Have Time to Do It Right, When Will You Have Time to Do It Over?&#8221; Thanks Lifehacker for the discovery.]]></description>
			<content:encoded><![CDATA[<p>From Hall of Fame basketball player/coach John Wooden:</p>
<blockquote><p>
&#8220;If You Don’t Have Time to Do It Right, When Will You Have Time to Do It Over?&#8221; </p></blockquote>
<p>Thanks <a href="http://lifehacker.com/5818760/if-you-dont-have-time-to-do-it-right-when-will-you-have-time-to-do-it-over">Lifehacker</a> for the discovery.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F07%2F14%2Fquote-of-the-week-11-july%2F&amp;title=Quote%20of%20the%20Week%20%2811%20July%29" id="wpa2a_14"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/07/14/quote-of-the-week-11-july/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to improve UPK: bonus item</title>
		<link>http://isambard.com.au/blog/2011/06/27/how-to-improve-upk-bonus-item/</link>
		<comments>http://isambard.com.au/blog/2011/06/27/how-to-improve-upk-bonus-item/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 06:14:27 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[UPK]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=698</guid>
		<description><![CDATA[I&#8217;m in the midst of collating a series of issues/quirks with UPK 3.6.1, hoping that Oracle are listening. While organising here&#8217;s a bonus item. When I&#8217;m editing frame properties, don&#8217;t present a tooltip that has the unerring habit of appearing directly over the top of where I&#8217;m trying to type!! B!@#y annoying.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the midst of collating a series of issues/quirks with UPK 3.6.1, hoping that Oracle are listening.  While organising here&#8217;s a bonus item.</p>
<p><a href="http://isambard.com.au/blog/wp-content/uploads/2011/06/UPK-Fix-26-kill-tooltip.png"><img src="http://isambard.com.au/blog/wp-content/uploads/2011/06/UPK-Fix-26-kill-tooltip.png" alt="" title="UPK-Fix-26-kill-tooltip" width="248" height="155" class="aligncenter size-full wp-image-700" /></a></p>
<p>When I&#8217;m editing frame properties, don&#8217;t present a tooltip that has the unerring habit of appearing directly over the top of where I&#8217;m trying to type!!  B!@#y annoying.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F06%2F27%2Fhow-to-improve-upk-bonus-item%2F&amp;title=How%20to%20improve%20UPK%3A%20bonus%20item" id="wpa2a_16"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/06/27/how-to-improve-upk-bonus-item/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing a Calendar in Sharepoint 2007 &#8211; Part II</title>
		<link>http://isambard.com.au/blog/2011/05/19/sharing-a-calendar-in-sharepoint-2007-part-ii/</link>
		<comments>http://isambard.com.au/blog/2011/05/19/sharing-a-calendar-in-sharepoint-2007-part-ii/#comments</comments>
		<pubDate>Thu, 19 May 2011 04:45:25 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Techniques]]></category>
		<category><![CDATA[interface design]]></category>
		<category><![CDATA[Sharepoint]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=653</guid>
		<description><![CDATA[Earlier I wrote about how you can use XML+XSL to get around the limitation in Sharepoint 2007 of sharing calendars across multiple sites. This technique stores your events as XML and allows you to publish entries wherever and however you wish. This article expands that earlier introduction with some tips and tricks we collating when [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://isambard.com.au/blog/2011/01/10/sharing-a-calendar-in-sharepoint-2007/">Earlier</a> I wrote about how you can use XML+XSL to get around the limitation in Sharepoint 2007 of sharing calendars across multiple sites.  This technique stores your events as XML and allows you to publish entries wherever and however you wish.</p>
<p>This article expands that earlier introduction with some tips and tricks we collating when implementing this for one client:</p>
<ul>
<li>working outside Sharepoint</li>
<li>presenting a URL</li>
<li>sorting items</li>
<li>grouping items</li>
<li>showing a message if a filter set is empty</li>
</ul>
<p>Note:  You can <a href="http://isambard.com.au/blog/wp-content/uploads/2011/05/calendar-v2.zip">download sample XML and XSL</a> here.  These files show all the techniques described in this article.</p>
<table>
<tbody>
<tr>
<td><a href="http://isambard.com.au/blog/wp-content/uploads/2011/05/image-xml.png"><img class="alignnone size-thumbnail wp-image-660" title="image-xml" src="http://isambard.com.au/blog/wp-content/uploads/2011/05/image-xml-150x150.png" alt="" width="150" height="150" /></a></td>
<td><a href="http://isambard.com.au/blog/wp-content/uploads/2011/05/image-filter.png"><img class="alignnone size-thumbnail wp-image-661" title="image-filter" src="http://isambard.com.au/blog/wp-content/uploads/2011/05/image-filter-150x150.png" alt="" width="150" height="150" /></a></td>
<td><a href="http://isambard.com.au/blog/wp-content/uploads/2011/05/image-group.png"><img class="alignnone size-thumbnail wp-image-662" title="image-group" src="http://isambard.com.au/blog/wp-content/uploads/2011/05/image-group-150x150.png" alt="" width="150" height="150" /></a></td>
</tr>
<tr>
<td>the original XML</td>
<td>filtered view</td>
<td>grouped view</td>
</tr>
</tbody>
</table>
<p><span id="more-653"></span></p>
<h2>Working outside SharePoint</h2>
<p>It can be painful to develop your XML/XSL solution in Sharepoint because of the need to upload new versions (or edit webparts), then refresh to see the results, or lack thereof.  Easier to work outside and just upload when done.</p>
<p>To link your XML and XSL outside SharePoint edit your XML file to include a link to your XSL file:</p>
<pre>&lt;!--?xml version="1.0" encoding="utf-8"?--&gt;
<strong>&lt;!--?xml-stylesheet type="text/xsl" href="calendar.xsl"?--&gt;</strong>
....</pre>
<p>Now when you open your XML file in a browser it will use your XSL to present.</p>
<p>Save your XLS as a file with a name to match the XML link and you&#8217;re nearly there.  The only other change you may need to make is to extend your XSL so it generates a full webpage, not just a fragment.</p>
<p>For example our standard calendar presentation XSL generates a paragraph:</p>
<pre>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:template match="calendar"&gt;
&lt;p&gt;
&lt;xsl:for-each select="event[program='Leadership Foundations']"&gt;
...
&lt;/xsl:for-each&gt;
&lt;/p&gt;
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre>
<p>To work outside SharePoint it needs to generate a proper page; make it do so by simply adding HTML and BODY tags:</p>
<pre>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&lt;xsl:template match="calendar"&gt;
<strong>&lt;html&gt;</strong>
<strong>&lt;body&gt;</strong>
&lt;p&gt;
&lt;xsl:for-each select="event[program='Leadership Foundations']"&gt;
...
&lt;/xsl:for-each&gt;
&lt;/p&gt;
<strong>&lt;body&gt;</strong>
<strong>&lt;html&gt;</strong>
&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;</pre>
<p>Just remember to remove these bonus lines when re-inserting into your SharePoint site.</p>
<h2>Presenting a URL</h2>
<p>If one element you&#8217;re recorded in your XML is a URL then chances are you&#8217;ll want to use XSL to convert that into a link.  And the obvious approach you&#8217;d think would be the simplest:</p>
<pre>&lt;a href='&lt;xsl:value-of select="link"&gt;'&gt;link text&lt;/a&gt;</pre>
<p>Other than the issue over nested quotes, all looks pretty straightforward.  Except it doesn&#8217;t work.</p>
<p>The solution is to use a different format for the URL selection:</p>
<pre>&lt;a href="{link}"&gt;link text&lt;/a&gt;</pre>
<p>Now it works fine.</p>
<h2>Sorting items</h2>
<p>One feature we wanted to implement was the automatic sorting of results.  This meant anyone maintaining the master XML list did not need to worry about where to add individual items to preserve their order.  They could just add anywhere in the file and be confident they&#8217;d appear in the correct sequence when displayed.</p>
<p>To sort results, add the <code>&lt;xsl:sort&gt;</code> command as the first element within your  loop. For example to sort by a date element:</p>
<pre>&lt;xsl:for-each select="event"&gt;
    &lt;xsl:sort select="date" /&gt;
    ...
&lt;/xsl:for-each&gt;</pre>
<p>Check <a href="www.w3schools.com/xsl/el_sort.asp">W3Schools</a> if wanting to do something more complicated than an ascending text order.</p>
<p>As you can see from this example, what we were wanting to search on were dates.  And early on we&#8217;d decided that users would enter dates in &#8220;human&#8221; format (ie &#8217;23 May 2011&#8243;, not 20110523).   One issue we had on sorting dates was the chestnut of how to sort &#8220;2 May 2011&#8243; to appear before &#8220;15 May 2011&#8243;.  Our solution was to require all dates in the XML to be two characters (&#8220;02 May 2011&#8243; not &#8220;2 May 2011&#8243;) and then use XSL to remove the ugly leading zero when displayed.  The code to remove that zero is straightforward:</p>
<pre>&lt;xsl:choose&gt;
    &lt;xsl:when test="substring(date,1,1)=0"&gt;
         &lt;xsl:value-of select="substring(date,2)" /&gt;
    &lt;xsl:otherwise&gt;
&lt;/xsl:choose&gt;</pre>
<p>You have to use the <code>&lt;xsl:choose&gt;</code> construct because while XSL does have an IF statement (not surprisingly <code>&lt;xsl:if&gt;</code>), it does not have an equivalent ELSE.</p>
<p>Note:  The alternative would be to define the date in a nice sortable format (I vote for YYYYMMDD).  And then use similar XSL transformations to present in a more readable format.  Either way you&#8217;re putting some overhead on the user.  We stuck with this simple approach because it was (a) less user effort and (b) allowed a wider range of dates to be acceptable.  For example we had some programs that only specified a month.  Sorting this way meant we could accept &#8220;May 2011&#8243; as a valid date.</p>
<h2>Grouping items</h2>
<p>Now this I thought would be easy. Since we&#8217;re working on a calendar, let&#8217;s group entries according to the month.  ie:</p>
<p>April 2011<br />
- This course (12 April, London)<br />
- That course (19 April, Helsinki)<br />
May 2011<br />
- That course (2 May, Romford)<br />
- The other course (30 May, Malaka)</p>
<p>After several false starts, all roads do eventually lead to a fabled Meunchian method.  Trouble is, even after building it, I&#8217;ve no idea how it works.  Of all the articles uncovered to try and explain it, <a href="docstore.mik.ua/orelly/xml/xslt/ch06_02.htm">this one came closest</a>.  Cut&amp;paste their approach (or <a href="http://isambard.com.au/blog/wp-content/uploads/2011/05/calendar-v2.zip">our example</a> using it) and you should be able to get it to work.</p>
<h2>Showing a message if the filter set is empty</h2>
<p>In the <a href="http://isambard.com.au/blog/2011/01/10/sharing-a-calendar-in-sharepoint-2007/">first article</a> we covered how simple it is to present a subset of your entries. However once implemented we discovered we needed to address the situation where a subset was empty.  Rather than just showing a blank list we wanted to show a messsage directing the visitor to other sources.</p>
<p>Simplest way to implement this is to repeat the same filter query used to generate the subset. Just place within a COUNT() and use as a test:</p>
<pre>&lt;xsl:choose&gt;
     &lt;xsl:when test="count(event[program='First Program']) &gt; 0"&gt;

          &lt;xsl:for-each select="event[program='First Program']"&gt;
          ...
          &lt;/xsl:for-each&gt;

     &lt;/xsl:when&gt;
     &lt;xsl:otherwise&gt;
          &lt;xsl:text&gt;No events recorded for this program.&lt;/xsl:text&gt;
     &lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;</pre>
<p>Only potential issue may be around your formatting.  Be mindful of where your layout tags appear depending on which data is presented.</p>
<h2>Conclusion</h2>
<p>With just these techniques you can present and manipulate your content in quite ingenious ways.  Just good luck trying to understand the Muench.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F05%2F19%2Fsharing-a-calendar-in-sharepoint-2007-part-ii%2F&amp;title=Sharing%20a%20Calendar%20in%20Sharepoint%202007%20%26%238211%3B%20Part%20II" id="wpa2a_18"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/05/19/sharing-a-calendar-in-sharepoint-2007-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quote of the week (28 February)</title>
		<link>http://isambard.com.au/blog/2011/03/01/quote-of-the-week-28-february/</link>
		<comments>http://isambard.com.au/blog/2011/03/01/quote-of-the-week-28-february/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 22:08:58 +0000</pubDate>
		<dc:creator>steven</dc:creator>
				<category><![CDATA[Quote of the Week]]></category>

		<guid isPermaLink="false">http://isambard.com.au/blog/?p=647</guid>
		<description><![CDATA[From an old neighbour of mine, Douglas Adams. Comes from Salmon of Doubt, uncovered by 37 Signals: Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works. Anything that’s invented between when you’re fifteen and thirty-five is new and exciting [...]]]></description>
			<content:encoded><![CDATA[<p>From an old neighbour of mine, Douglas Adams.  Comes from <a href="http://en.wikipedia.org/wiki/The_Salmon_of_Doubt">Salmon of Doubt</a>, uncovered by <a href="http://37signals.com/svn/posts/2793-anything-that-is-in-the-world-when-you8217">37 Signals</a>:</p>
<blockquote><p>Anything that is in the world when you’re born is normal and ordinary and is just a natural part of the way the world works. Anything that’s invented between when you’re fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you’re thirty-five is against the natural order of things.</p></blockquote>
<p>That explains my bafflement at Twitter then.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fisambard.com.au%2Fblog%2F2011%2F03%2F01%2Fquote-of-the-week-28-february%2F&amp;title=Quote%20of%20the%20week%20%2828%20February%29" id="wpa2a_20"><img src="http://isambard.com.au/blog/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://isambard.com.au/blog/2011/03/01/quote-of-the-week-28-february/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

