<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Whomwah.com</title>
	
	<link>http://whomwah.com</link>
	<description>The website of Duncan Robertson, currently working for the BBC in London, Uk</description>
	<lastBuildDate>Thu, 02 Jul 2009 00:00:00 PDT</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/whomwah" type="application/rss+xml" /><item><title>Links for 2009-07-01 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-07-01</link><pubDate>Thu, 02 Jul 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-07-01</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://mugshots.tampabay.com/browse/height-range/5-0/"&gt;Tampa Bay Mug Shots: 5-0&lt;/a&gt;&lt;br/&gt;
Criminals in a web 2.0 stylee&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Links for 2009-06-26 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-06-26</link><pubDate>Sat, 27 Jun 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-06-26</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://lesscss.org/"&gt;LESS - Leaner CSS&lt;/a&gt;&lt;br/&gt;
Less is Leaner css. Less extends css by adding: variables, mixins, operations and nested rules. Looks interesting, not tried it yet.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Links for 2009-06-25 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-06-25</link><pubDate>Fri, 26 Jun 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-06-25</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.pcpro.co.uk/blogs/2009/06/23/upgrading-the-humble-three-pin-about-time/"&gt;Folding up the humble three-pin plug&lt;/a&gt;&lt;br/&gt;
MrMinKyuChoi has come up with an awesome new design for the 3-pin plug. I would love this to catch on&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Links for 2009-06-23 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-06-23</link><pubDate>Wed, 24 Jun 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-06-23</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://tomtaylor.co.uk/projects/clarke/"&gt;Tom Taylor : Projects : Clarke&lt;/a&gt;&lt;br/&gt;
Clarke is a small OS X application for updating your Fire Eagle location quietly, in the background.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Links for 2009-06-17 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-06-17</link><pubDate>Thu, 18 Jun 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-06-17</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://kosmaczewski.net/2009/01/28/10-iphone-memory-management-tips/"&gt;Open Kosmaczewski - 10 iPhone Memory Management Tips&lt;/a&gt;&lt;br/&gt;
Great post, with some really useful tips&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Links for 2009-06-11 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-06-11</link><pubDate>Fri, 12 Jun 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-06-11</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.songkick.com/dashboard"&gt;Songkick - Concerts, tour dates, and festivals for your favorite artists&lt;/a&gt;&lt;br/&gt;
Track artists, venues, festivals, and other fans for upcoming event alerts. See what your friends are going to and share your plans&lt;/li&gt;
&lt;li&gt;&lt;a href="http://hemlock-kills.com/"&gt;Hemlock&lt;/a&gt;&lt;br/&gt;
Hemlock is an open-source framework that combines the richness of Flash with the scalability of XMPP. They guys came in and gave us a little demo today. Nice work.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://hellorip.com/"&gt;Hello Rip.&lt;/a&gt;&lt;br/&gt;
Rip is an attempt to create a next generation packaging system for Ruby.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Links for 2009-06-09 [del.icio.us]</title><link>http://del.icio.us/whomwah#2009-06-09</link><pubDate>Wed, 10 Jun 2009 00:00:00 PDT</pubDate><guid isPermaLink="true">http://del.icio.us/whomwah#2009-06-09</guid><description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.acrossair.com/apps_tvguide.htm"&gt;AcrossAir | TVGuide UK&lt;/a&gt;&lt;br/&gt;
Really nice and simple TV guide for the iPhone. Oh and it&amp;#039;s free&lt;/li&gt;
&lt;li&gt;&lt;a href="http://despair.com/"&gt;Despair, Inc.&lt;/a&gt;&lt;br/&gt;
Found whilst surfing at work. It seemed very poignant indeed.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/p/android-scripting/"&gt;Android-scripting&lt;/a&gt;&lt;br/&gt;
The Android Scripting Environment (ASE) brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device. Ruby not yet supported but it is in the pipeline.&lt;/li&gt;
&lt;/ul&gt;</description></item><item>
		<title>Another iPhone Code Sign Error Fix solution</title>
		<link>http://whomwah.com/2009/05/10/another-iphone-code-sign-error-fix-solution/</link>
		<comments>http://whomwah.com/2009/05/10/another-iphone-code-sign-error-fix-solution/#comments</comments>
		<pubDate>Sun, 10 May 2009 15:10:55 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1498</guid>
		<description><![CDATA[Dam, this took far to long to suss out !!! I even left the London Open Hack 2009 early because I was unable to install development apps I was working on onto my iPhone, and it was proving so frustrating I decided to go home to try and fix it there &#8230; Dam!!!
So the error [...]]]></description>
			<content:encoded><![CDATA[<p>Dam, this took far to long to suss out !!! I even left the <a href="http://www.hackday.org/">London Open Hack 2009</a> early because I was unable to install development apps I was working on onto my <a href="http://apple.com/iphone">iPhone</a>, and it was proving so frustrating I decided to go home to try and fix it there &#8230; Dam!!!</p>
<p>So the error I was getting was:</p>
<pre>
Code Sign error: The identity 'iPhone Developer' doesn't match any valid
certificate/private key pair in the default keychain
</pre>
<p>I won&#8217;t bore you with all the variations, forums, websites read and ways I tried to solve this, and will leave you with the solution in this case. The problem was that the KeyChain App had changed it&#8217;s <em>default</em> keychain over to &#8216;<strong>system</strong>&#8216; and it should have been &#8216;<strong>login</strong>&#8216; as this is where all my keys and certificates are installed. Also, the <em>default</em> keychain is where <a href="http://developer.apple.com/TOOLS/xcode/">Xcode</a> looks.  The default keyChain in the one in the keychains list that is bold. To make one the default, you right click on it and select the &#8216;make default&#8217; item from the list.</p>
<p>Yep, That&#8217;s It!! and to be honest the error message make a little more sense now I&#8217;ve fixed it &#8230; Dam!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=3ZmxvZepzao:FHae1EK6NOY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/05/10/another-iphone-code-sign-error-fix-solution/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Controlling the spotlights at work with Sinatra and OSC</title>
		<link>http://whomwah.com/2009/04/24/controlling-the-spotlights-at-work-with-sinatra-and-osc/</link>
		<comments>http://whomwah.com/2009/04/24/controlling-the-spotlights-at-work-with-sinatra-and-osc/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 20:47:58 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1470</guid>
		<description><![CDATA[Nic bought some spotlights the other week for work, so we could hook them up to our continuous integration server, and they would let us know using the medium of colour, when things had failed!
Before we did that, I thought I&#8217;d have a little play. Tristan and Chris having been building a fun new game [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.aelius.com/njh/">Nic</a> bought some <a href="http://www.soundsavers.com/catalog/all-lighting-177/led-par-cans-231/ledj-eco-led-56-can-black-10mm-led-2985.html">spotlights</a> the other week for work, so we could hook them up to our <a href="http://en.wikipedia.org/wiki/Continuous_Integration">continuous integration server</a>, and they would let us know using the medium of colour, when things had failed!</p>
<p>Before we did that, I thought I&#8217;d have a little play. <a href="http://www.cookinrelaxin.com">Tristan</a> and <a href="http://www.fridayforward.com/">Chris</a> having been building a fun new game (Read more via the <a href="http://www.bbc.co.uk/blogs/radiolabs/">Radio Labs blog</a> soon) which uses <em>nowplaying</em> data from <a href="http://bbc.co.uk/6music">BBC 6 Music</a> to power it. Knowing when a track is starting and ending is also useful, so as a bit of fun, I wrote a little <a href="http://ruby-lang.org/en/">Ruby</a> script that made the spotlights behave like traffic lights:</p>
<ol>
<li>Green &#8211; when a track started playing</li>
<li>Flashing Amber &#8211; when a track was about to finish</li>
<li>Red &#8211; when the track finally finished</li>
</ol>
<p><img src="http://farm4.static.flickr.com/3586/3465581068_67c13f1132.jpg?v=0" alt="spotlight" /><span class="caption">Photo by <a href="http://www.cookinrelaxin.com/">Tristan</a></span></p>
<p>To control the lights we&#8217;re using <a href="http://hans.fugal.net/src/rosc/doc/">ROSC</a> open sound control for <a href="http://ruby-lang.org/en/">Ruby</a>. It&#8217;s very good, but required building to install, and the interface is nice, but not simple enough if all you&#8217;re doing is turning a light on or off and changing it&#8217;s colour. So in order to make the script even more simple, I thought I&#8217;d write a little http proxy so that your could control the lights by just going to a url. It meant even the non-programmers could have fun replicating disco lighting. The urls look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">http://spotlights.local/all/green
http://spotlights.local/all/rgb120-12-200
http://spotlights.local/all/off
http://spotlights.local/all/random</pre></div></div>

<p>The proxy is written using <a href="http://www.sinatrarb.com/">Sinatra</a>. I love <a href="http://www.sinatrarb.com/">Sinatra</a>. If you thought prototyping was simple with <a href="http://rubyonrails.org/">Rails</a>, well with Sinatra + <a href="http://www.modrails.com/">Passenger</a> it takes simplicity to a whole new level.</p>
<p>You can <a href="http://github.com/whomwah/light-controller">download the lightcontroller source</a> from <a href="http://github.com/">Github</a> as normal, you&#8217;ll have to tweak a few settings for your needs. You may even find it a useful template for controlling something else. </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=zp0Cy4qoEhI:9SzOfRyAuwA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/04/24/controlling-the-spotlights-at-work-with-sinatra-and-osc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RevCanonical 1.2, Customise your link tag plus a little more</title>
		<link>http://whomwah.com/2009/04/23/revcanonical-updates-customise-your-link-tag-plus-more/</link>
		<comments>http://whomwah.com/2009/04/23/revcanonical-updates-customise-your-link-tag-plus-more/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 10:33:34 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[revcanonical]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1451</guid>
		<description><![CDATA[I&#8217;ve made a few updates to the RevCanonical Wordpress plugin I built. These updates add a bit of extra functionality, and also allowed me to tidy up the documentation, so that people know what they&#8217;re getting.
First update, is the ability to customise how the link tag is constructed within the head of your page.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a few updates to the <a href="http://whomwah.github.com/revcanonical/">RevCanonical Wordpress plugin</a> I built. These updates add a bit of extra functionality, and also allowed me to tidy up the documentation, so that people know what they&#8217;re getting.</p>
<p>First update, is the ability to customise how the link tag is constructed within the head of your page.  This is due to the large amount of people who have contacted me, asking why I choose to use rev=canonical and not rel= shorturl, rel=shorturl or rel=short_url etc. As I told them, the reason I chose <a href="http://laughingmeme.org/p/4216">rev=canonical</a> was to be honest simply because I liked it, and <a href="http://flickr.com/">many</a> of my <a href="http://dopplr.com/">peers</a> were <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">already</a> using this method on their sites. Simple.</p>
<p>So currently with the plugin you get this out of the box:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rev=&quot;canonical&quot; type=&quot;text/html&quot;  href=&quot;http://your-domain.com/p12p&quot; /&gt;</pre></div></div>

<p>but you could customise it to be like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;shorturl&quot; href=&quot;http://y-doma.in/p12p&quot; /&gt;</pre></div></div>

<p>The reason for this extra customisation is to try and stop people being distracted by the <em>what attribute should I use</em> conversation, and start getting them hosting their own short links they can use. This at least starts solving one problem. When a general consensus, or in deed a standard appears about the attributes, you can simple update and you&#8217;re good-to-go.</p>
<p>At the moment the only place you can see the shortened url is either by looking in the source, or using a <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">bookmarklet</a> like the one <a href="http://simonwillison.net/">Simon</a> wrote. I guess I could of injected the url into the admin interface somewhere, but I generally don&#8217;t want to see it. The idea is, it&#8217;s there for <a href="http://revcanonical.appspot.com/">machines to see</a> if they need to, and if I really need to pass it around I&#8217;ll just use the <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">bookmarklet</a>.</p>
<p>If you want more flexibility, I have added a of a couple of tags you can use in your templates. These simply let you display the shortened url for a specific post.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"># echo the shortened url to the screen
&lt;?php get_revcanonical_shorturl($post_id); ?&gt;
&nbsp;
# assign the shortened url to a variable
&lt;?php $url = revcanonical_shorturl($post_id); ?&gt;</pre></div></div>

<p>Oh and finally, just a reminder that this plugin plays well with the <a href="http://whomwah.github.com/tweetme/">TweetMe plugin</a> I wrote that tweets to <a href="http://twitter.com/">Twitter.com</a> when you publish a post, and will check to see if you have the <a href="http://whomwah.github.com/revcanonical/"> RevCanonical plugin</a> installed. If you do, it will use your own shortened url instead of the <a href="http://bit.ly/">bit.ly</a> version.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=6FUqkeqsijY:beenej5TqzQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/04/23/revcanonical-updates-customise-your-link-tag-plus-more/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Revcanonical, a rev=canonical Wordpress plugin</title>
		<link>http://whomwah.com/2009/04/14/revcanonical-a-revcanonical-wordpress-plugin/</link>
		<comments>http://whomwah.com/2009/04/14/revcanonical-a-revcanonical-wordpress-plugin/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 11:06:41 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1410</guid>
		<description><![CDATA[UPDATE [15:06 April 14th 2009]
Revcanonical is a Wordpress plugin that creates localised shortened urls, and adds support for the rev=canonical link tag.
Revcanonical came about after seeing a post on Mr Willison&#8217;s website a few days ago. I&#8217;d seen mutterings around the web from Joshua Schachter, Dave Winer and Chris Shiflett about how url shortening services [...]]]></description>
			<content:encoded><![CDATA[<p class="update"><a href="#update-one">UPDATE [15:06 April 14th 2009]</a></p>
<p><a href="http://wordpress.org/extend/plugins/revcanonical/">Revcanonical</a> is a <a href="http://wordpress.org/">Wordpress</a> plugin that creates localised shortened urls, and adds support for the <a href="http://revcanonical.appspot.com/">rev=canonical</a> link tag.</p>
<p><a href="http://wordpress.org/extend/plugins/revcanonical/">Revcanonical</a> came about after seeing <a href="http://swtiny.eu/EZa">a post on Mr Willison&#8217;s website</a> a few days ago. I&#8217;d seen mutterings around the web from <a href="http://joshua.schachter.org/2009/04/on-url-shorteners.html">Joshua Schachter</a>, <a href="http://www.scripting.com/stories/2009/03/07/solvingTheTinyurlCentraliz.html">Dave Winer</a> and <a href="http://shiflett.org/blog/2009/apr/save-the-internet-with-rev-canonical">Chris Shiflett</a> about how url shortening services are not great for the web for amongst many reasons, the persistence of the link becomes questionable, because you are relying on that service actually being around in 20 years.</p>
<p>It seems that <a href="http://laughingmeme.org/2009/04/03/url-shortening-hinting/">clever people have taken the conversation further</a> and have actually started to come up with possible solutions. One such solution is <a href="http://laughingmeme.org/2009/04/03/url-shortening-hinting/">rev= canonical</a>, and is the one I liked and hence wanted to implement into my site. In fact, some of the big players have already added rev=canonical to their sites. <a href="http://flickr.com">Flickr</a>, <a href="http://dopplr.com">Dopplr</a> and <a href="http://php.net">php.net</a> already have pages that use it and there&#8217;s even <a href="http://revcanonical.appspot.com/">a rev= canonical web service</a>. That&#8217;s millions of pages already out there.</p>
<p>By default, once you install the plugin to your Wordpress blog, you will get a tag added to the source of your page that will contain a shortened version of the url for the page it sits in.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rev=&quot;canonical&quot; type=&quot;text/html&quot; href=&quot;http://whomwah.com/p12p&quot; /&gt;</pre></div></div>

<p>That&#8217;s it! You can now, not only use this url in sites like <a href="http://twitter.com">Twitter</a> without having to go via a url shortening service, but services or people that understand the rev=canonical link tag, will be able to use this shortened version over the longer canonical version. For example, <a href="http://simonwillison.net">Simon</a> has build a great <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">bookmarklet</a> that does just this. You can use it when you are on a url you&#8217;d like to share. It will return the shortened version of the url if it&#8217;s available, otherwise it will use a shortening service as a last resort. This means that if I go to this page:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://whomwah.com/2009/04/14/revcanonical-a-revcanonical-wordpress-plugin</pre></div></div>

<p>And I want to share this link on Twitter for example. The <a href="http://simonwillison.net/2009/Apr/11/revcanonical/">bookmarklet</a> would see I have implemented rev=canonical and would fetch the shortened url.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://whomwah.com/p136</pre></div></div>

<p>In fact, you would in reality get this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">http://littl.me/p136</pre></div></div>

<p>as the plugin allows you to add your own shortened domain (and I bought one). It&#8217;s up to you though point this new domain to the right place.</p>
<p>So, this means that I still get a short url to share, that works on my website, but also means that it&#8217;s persistence is down to me, and not to a 3rd party. It also means that if people to <a href="http://littl.me">http://littl.me</a>, it redirects to <a href="http://whomwah.com">my website</a>, so hopefully there&#8217;s a little more trust in the shortened url final destination.</p>
<p>Some final tech bits. It uses a base36 encoded post ID (made sense and was simple to implement) in the shortened url with the letter p to namespace. It also creates a 301 as <a href="http://twitter.com/simonw/status/1496864191">the general consensus agreed</a>.</p>
<p>Oh and if you use the <a href="http://whomwah.github.com/tweetme/">TweetMe</a> plugin I wrote then I&#8217;m just in the process of deploying a new version that will use your localised shortened link if it&#8217;s available.</p>
<p class="note" id="update-one">[UPDATE] I&#8217;m getting lots of people asking why I went for rev=canonical and not rel=shortlink etc. The truth is no particular reason, other than more people I knew and trusted have gone for the former. There appears to be no definitive correct way yet as far as I can see, so until there is I&#8217;ll have to make an executive choice.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=ANvRn_XQWvk:B-2eUESXWOc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/04/14/revcanonical-a-revcanonical-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Using Cocoa to keep an app window always on top</title>
		<link>http://whomwah.com/2009/04/11/using-cocoa-to-keep-an-app-window-always-on-top/</link>
		<comments>http://whomwah.com/2009/04/11/using-cocoa-to-keep-an-app-window-always-on-top/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 16:39:21 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1393</guid>
		<description><![CDATA[Sometimes you want your application to keep one of it&#8217;s windows always-on-top. A chat application like Adium for example, allows you to keep your conversation window always-on-top so you can follow the conversation whilst still using other applications. In the TellyBox application I wrote, this functionality is also very useful, as you can watch tv [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want your application to keep one of it&#8217;s windows always-on-top. A chat application like <a href="http://www.adiumx.com/">Adium</a> for example, allows you to keep your conversation window always-on-top so you can follow the conversation whilst still using other applications. In the <a href="http://whomwah.github.com/tellybox/">TellyBox</a> application I wrote, this functionality is also very useful, as you can watch tv whilst still working in other applications.</p>
<p>So the basic implementation was fairly simple. You just use the <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/uid/20000013-BCIDIEDF">windowDidResignMain notification</a>, and then re-set the window level a more fitting one. Below I have also wrapped around a preference setting:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>windowDidResignMain<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSNotification</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification
<span style="color: #002200;">&#123;</span>
  <span style="color: #11740a; font-style: italic;">// It's always nicer if the user has a choice</span>
  <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSUserDefaults</span> standardUserDefaults<span style="color: #002200;">&#93;</span> boolForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;DefaultAlwaysOnTop&quot;</span><span style="color: #002200;">&#93;</span> <span style="color: #002200;">==</span> <span style="color: #a61390;">YES</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self window<span style="color: #002200;">&#93;</span> setLevel<span style="color: #002200;">:</span>NSFloatingWindowLevel<span style="color: #002200;">&#93;</span>;
  <span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self window<span style="color: #002200;">&#93;</span> setLevel<span style="color: #002200;">:</span>NSNormalWindowLevel<span style="color: #002200;">&#93;</span>;
  <span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>My <a href="http://whomwah.github.com/tellybox/">TellyBox</a> application allows you to go fullscreen via the existing Flash application embedded in a webkit view. Using just the basic implementation meant that when going into fullscreen mode the frame of the original window remained in view. To fix this I added this extra bit of code, which gets used via the firing of another useful notification <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.html#//apple_ref/doc/uid/20000013-BCIEBCEI">windowDidBecomeMain</a> :</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>windowDidBecomeMain<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSNotification</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification
<span style="color: #002200;">&#123;</span>
  <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self window<span style="color: #002200;">&#93;</span> setLevel<span style="color: #002200;">:</span>NSNormalWindowLevel<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>which sets the window level back to it&#8217;s default value of 0 when it becomes the main window i.e when you select it.</p>
<p>I hope this little snippet helps people trying to achieve the same effect in their apps.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=yGCl_4iaX-A:eOKwWivTv1Y:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/04/11/using-cocoa-to-keep-an-app-window-always-on-top/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lookup – A simple Mac utility that wraps ldapsearch</title>
		<link>http://whomwah.com/2009/04/07/lookup/</link>
		<comments>http://whomwah.com/2009/04/07/lookup/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 11:53:14 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[lookup]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1361</guid>
		<description><![CDATA[I work on a Mac at work, and it has always been a bit slow searching for other staff members in our global address book. Like other big organisations we have some directory services which we can use LDAP to interrogate. The seemingly standard way for apps to poll these services is asynchronously every second [...]]]></description>
			<content:encoded><![CDATA[<p>I work on a <a href="http://www.apple.com/mac/">Mac</a> at <a href="http://www.bbc.co.uk/">work</a>, and it has always been a bit slow searching for other staff members in our global address book. Like other big organisations we have some <a href="http://en.wikipedia.org/wiki/Directory_service">directory services</a> which we can use <a href="http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol">LDAP</a> to interrogate. The seemingly standard way for apps to poll these services is <a href="http://en.wikipedia.org/wiki/Asynchronous_I/O">asynchronously</a> every second or so, so that you&#8217;re getting results back quickly in the background. In reality this can be clunky if your network is slow, or the directory is very big.</p>
<p>I wanted something simpler, and a gui that gave me was suited to my work requirements. Lookup displays glance-able contact details straight away, letting you copy, paste and drag this data around. It also has simple shortcuts like double clicking the contact to start a new email to that person.</p>
<p>Lookup does not poll asynchronously, it does one request per search and just looks through some key attributes. It seems to work very well, and has been customised for my workplace, but is generic enough for someone to tweak it to suit their companies needs.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/3420133723/"><img src="http://farm4.static.flickr.com/3302/3420133723_714683acc3.jpg?v=0" alt="Lookup" /></a></p>
<p>It wraps <a href="http://linux.die.net/man/1/ldapsearch">ldapsearch</a>, which is a command line app that comes free on your mac. When I say wraps, it&#8217;s not a complete wrapper, but wraps enough to create an app of this kind. Ldapsearch app did everything I wanted in search terms, and gave me a chance to use <a href="http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSTask_Class/index.html">NSTask</a> and <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSPipe_Class/index.html">NSPipe</a> which I know will be useful in the future.</p>
<p>You can get the <a href="http://github.com/whomwah/lookup/tree/master">source over at Github</a>. Why not try and tweak it to work for your company. You never know, just compiling it and updating the settings in the preferences menu may be enough.</p>
<p class="note">Just to be clear, this app does NOT give you access to the BBC address book, just incase you thought I&#8217;d gone mad.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=jIWVU_QXFXg:Fb4m5RaSnWw:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/04/07/lookup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>expires_in Rails FileStore fragment caching in about 6 lines</title>
		<link>http://whomwah.com/2009/04/03/expires_in-filestore-fragment-caching/</link>
		<comments>http://whomwah.com/2009/04/03/expires_in-filestore-fragment-caching/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 14:32:08 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1329</guid>
		<description><![CDATA[I have been building a Rails app that creates RSS feeds based on a lot of screen scraping behind the scenes. I really needed a way to cache the data object that feeds those specific pages. In rails you can do page, action and fragment caching, using many different methods, and storing that cache data [...]]]></description>
			<content:encoded><![CDATA[<p>I have been building a <a href="http://rubyonrails.org/">Rails</a> app that creates <a href="http://en.wikipedia.org/wiki/RSS_(file_format)">RSS</a> feeds based on a lot of <a href="http://en.wikipedia.org/wiki/Screen_scraping">screen scraping</a> behind the scenes. I really needed a way to cache the data object that feeds those specific pages. In rails you can do <a href="http://guides.rubyonrails.org/caching_with_rails.html">page, action and fragment caching</a>, using many different methods, and storing that cache data in many different locations.</p>
<p>After deciding I needed <a href="http://guides.rubyonrails.org/caching_with_rails.html#fragment-caching">Fragment caching</a>, it turns out that if you need your cache data to magically expire over time, you need to be using <a href="http://www.danga.com/memcached/">memcached</a> (I couldn&#8217;t), other wise you have to roll you own solution, based on cache sweeping, or in-code testing of whether your content has expired.</p>
<p>I&#8217;m using <a href="http://api.rubyonrails.org/classes/ActiveSupport/Cache/FileStore.html">FileStore</a> for caching (cached files live on the file system) and I have no database, and all the feed data comes from external feeds that change over time, so unless I fetch it all again, I don&#8217;t know.</p>
<p>What I needed was the ability to have a expires_in parameter whilst using FileStore. So this is what the code below does in surprisingly few lines. The code is an amalgamation of many posts I found doing almost the same thing, but this is what works for me.</p>
<p>First we extend FileStore:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># stick this in a file somewhere in your path e.g lib/fs_extend.rb</span>
<span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#6666ff; font-weight:bold;">ActiveSupport::Cache::FileStore</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> read<span style="color:#006600; font-weight:bold;">&#40;</span>name, options = <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span> 
    ttl = 0
    ttl = options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:expires_in</span><span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#9966CC; font-weight:bold;">if</span> options.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">Hash</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> 
                                         options.<span style="color:#9900CC;">has_key</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:expires_in</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    fn = real_file_path<span style="color:#006600; font-weight:bold;">&#40;</span>name<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#9966CC; font-weight:bold;">if</span> ttl <span style="color:#006600; font-weight:bold;">&gt;</span> 0 <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">exists</span>?<span style="color:#006600; font-weight:bold;">&#40;</span>fn<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">mtime</span><span style="color:#006600; font-weight:bold;">&#40;</span>fn<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&lt;</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC00FF; font-weight:bold;">Time</span>.<span style="color:#9900CC;">now</span> <span style="color:#006600; font-weight:bold;">-</span> ttl<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>fn, <span style="color:#996600;">'rb'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC00FF; font-weight:bold;">Marshal</span>.<span style="color:#CC0066; font-weight:bold;">load</span><span style="color:#006600; font-weight:bold;">&#40;</span>f<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">rescue</span> <span style="color:#0000FF; font-weight:bold;">nil</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>And then in your controller I have:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> FooController <span style="color:#006600; font-weight:bold;">&lt;</span> ApplicationController 
  <span style="color:#9966CC; font-weight:bold;">def</span> do_stuff
    key = <span style="color:#996600;">'someuniquekey'</span>
    expire_fragment<span style="color:#006600; font-weight:bold;">&#40;</span>key<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> 
        <span style="color:#0066ff; font-weight:bold;">@data</span> = read_fragment<span style="color:#006600; font-weight:bold;">&#40;</span>key, <span style="color:#ff3333; font-weight:bold;">:expires_in</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> 1.<span style="color:#9900CC;">hour</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> 
                                  write_fragment<span style="color:#006600; font-weight:bold;">&#40;</span>key, some_complex_data<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
    respond_to <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>format<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">xml</span>
    <span style="color:#9966CC; font-weight:bold;">end</span> 
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This has reduced many 5 second requests to 32ms requests, so hurrah!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=qW5ujiiBA2o:OqpXyY7i55w:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/04/03/expires_in-filestore-fragment-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TellyBox 1.4, Twitter, Scheduling .. plus the coolest icon</title>
		<link>http://whomwah.com/2009/03/22/tellybox-1_4/</link>
		<comments>http://whomwah.com/2009/03/22/tellybox-1_4/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 15:35:42 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[tellybox]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1283</guid>
		<description><![CDATA[[note] if you are updating and have the current app in your dock, you may need to remove it, and then re-add it again to get the  new icon to appear straight away
I&#8217;ve just released a new version of TellyBox, version 1.4. This version pulls in all the new features from sister app RadioAunty, [...]]]></description>
			<content:encoded><![CDATA[<p class="update">[<strong>note</strong>] if you are updating and have the current app in your dock, you may need to remove it, and then re-add it again to get the  new icon to appear straight away</p>
<p>I&#8217;ve just released a new version of <a href="http://whomwah.github.com/tellybox/">TellyBox</a>, version 1.4. This version pulls in all the<a href="http://whomwah.com/2009/03/14/radioaunty-feature-update-twitter-scheduling-and-much-more/"> new features from sister app RadioAunty</a>, plus a few news ones specific to TellyBox.</p>
<p>If you didn&#8217;t know, <a href="http://whomwah.github.com/tellybox">TellyBox</a> is a Mac app that allows you to watch live and catchup <a href="http://www.bbc.co.uk/tv/">BBC Television</a> (Uk users only I&#8217;m afraid). It uses the <a href="http://bbc.co.uk/iplayer/">BBC iPlayer</a> to actually display the telly, but wraps it all up into a native Mac application. </p>
<p><a href="http://www.flickr.com/photos/duncanponting/sets/72157614336016460/"><img src="http://farm4.static.flickr.com/3596/3372908443_537eb57e45.jpg?v=0" alt="TellyApp screenshot" /></a></p>
<p>Like I mentioned above, new features include <a href="http://twitter.com/">Twitter</a> support and scheduling as per <a href="http://whomwah.github.com/radioaunty/">RadioAunty</a>. I recommend <a href="http://whomwah.com/2009/03/14/radioaunty-feature-update-twitter-scheduling-and-much-more/">reading this post</a> to get more information on these. As well as them, the new features specific to TellyBox are:</p>
<ol>
<li>I have removed the default channel entry from the preferences. The app now just remembers what channel you last watched.</li>
<li>The close button, and zoom buttons (red and green) now work.</li>
<li>A brand new app icon (designed by <a href="http://boxblu.com/">David Wilson</a>)</li>
</ol>
<p>I&#8217;m really pleased with the icon. I know <a href="http://boxblu.com/?p=42">David spent a lot of time designing it</a>, and for a first application icon, I think it&#8217;s awesome. I also knew the effect I wanted. I really liked the idea of the icon being a mini telly showing you exactly what you are watching in the main screen. It seems <a href="http://normalkid.com/2008/05/09/application-icons-and-domain-names/">Mac icons can make or break an app</a>, so I&#8217;m hoping this one can only help.</p>
<p>It&#8217;s actually quite a simple effect to achieve. It&#8217;s just about building layers. I use <a href="http://www.cocoadev.com/index.pl?ScreenShotCode">CGWindowListCreateImage</a> to take a screen grab of what&#8217;s playing over time. When I have a new grab, I then construct the dock icon, using the grab at the bottom, then a version of the app icon with a transparent screen to give the glass effect, and finally the channel logo. If you minimize the app, or change windows using spaces, then the icon will change to the <a href="http://images.google.com/images?client=safari&#038;rls=en-us&#038;q=bbc+test+card&#038;oe=UTF-8&#038;um=1&#038;ie=UTF-8&#038;ei=f1TGSfjDPMaHtgfNyZHUCg&#038;sa=X&#038;oi=image_result_group&#038;resnum=1&#038;ct=title">BBC test card</a>.</p>
<p><a href="http://whomwah.github.com/tellybox/">Download TellyBox from the project page on Github</a>, or if you already have the app installed, then you should get a request to update automagically.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=RC6znMwTm_I:LGwGbCQCk5k:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/03/22/tellybox-1_4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>RadioAunty feature update – twitter, scheduling and much more</title>
		<link>http://whomwah.com/2009/03/14/radioaunty-feature-update-twitter-scheduling-and-much-more/</link>
		<comments>http://whomwah.com/2009/03/14/radioaunty-feature-update-twitter-scheduling-and-much-more/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 19:50:40 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[BBC]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1239</guid>
		<description><![CDATA[In my on going Cocoa learning I have been working hard on updates for RadioAunty. ( If you didn&#8217;t know, RadioAunty is Mac app that allows you to listen to live and catchup BBC Radio ). This means the feature list is now quite compelling, so I decided to give and overview of the features [...]]]></description>
			<content:encoded><![CDATA[<p>In my on going <a href="http://developer.apple.com/cocoa/">Cocoa</a> learning I have been working hard on updates for <a href="http://whomwah.github.com/radioaunty/">RadioAunty</a>. ( If you didn&#8217;t know, RadioAunty is Mac app that allows you to listen to live and catchup BBC Radio ). This means the feature list is now quite compelling, so I decided to give and overview of the features to date.</p>
<p><strong>1. Select your Favourite Station</strong> &#8211; Choose from all the <a href="http://www.bbc.co.uk/radio/">BBC National radio stations</a>. You can listen to them in Normal RealPlayer or the much higher quality ACC streams. Make your decision via the preferences screen.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/sets/72157615137746093/"><img src="http://farm4.static.flickr.com/3452/3351927033_7d2d56fcea.jpg?v=0" alt="RadioAunty select a Station" /></a></p>
<p><strong>2. Minimise the radio</strong> &#8211; I didn&#8217;t think people generally stare at the player whilst they are listening, so you can now minimise it like you can with <a href="http://www.apple.com/itunes">iTunes</a>, using ^ cmd Z or the window menu. You can also tweak the width whilst minimised. You will also see that the window title shows the current show playing. This updates along with the schedule as time goes on. More on this next.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/sets/72157615137746093/"><img src="http://farm4.static.flickr.com/3454/3351927271_bd0ec71ca9.jpg?v=0" alt="RadioAunty minimized" /></a></p>
<p><strong>3. View the schedule</strong> &#8211; In the Schedule menu, you will see the day schedule for the station you are listening to (using data from <a href="http://bbc.co.uk/programmes">BBC programmes</a>). You will see a tick next to the show you are currently listening. You will also see that some shows are clickable. This is stuff you can listen to, that is available to catchup in <a href="http://www.bbc.co.uk/iplayer/">iPlayer</a>, it also displays how long left that show is available in iPlayer for. This schedule updates as you listen throughout the day. </p>
<p><img src="http://farm4.static.flickr.com/3434/3354268798_02081fdbf1.jpg?v=0" alt="RadioAunty schedule menu" /></p>
<p><strong>4. Twitter support and other preferences</strong> &#8211; The preferences window gives you the chance to change some of RadioAunty&#8217;s settings and turn on others. From the top, we have updates. Turning this on allows you to receive updates to the application when they become available. Next is default station. This allows you to choose a default station to open with (I think this may be removed next release, and the app will just remember what you last listened to. Next is audio quality. It&#8217;s best to stick to high quality, but those streams are only available in the UK, so if you are listening abroad you will have to choose normal quality. Finally <a href="http://twitter.com">Twitter</a> support. Opting in means that as you listen, details about what you are listening to will be sent to the <a href="http://twitter.com/radioandtvbot">@radioandtvbot</a> account on Twitter. If you supply your twitter username, this will be added to the tweet instead of the default, which is your computer login FullName. The screenshot below next shows you what gets sent.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/sets/72157615137746093/"><img src="http://farm4.static.flickr.com/3651/3352752518_23810447a0.jpg?v=0" alt="RadioAunty twitter support" /></a><br />
<img src="http://farm4.static.flickr.com/3209/3353735857_4367bff3b6.jpg" alt="radioandtvbot" /></p>
<p><strong>5. A nice dynamic app icon</strong> &#8211; The wonderful Tim Broom made the current icon. The icon changes, showing the network you are currently listening to.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/sets/72157615137746093/"><img src="http://farm4.static.flickr.com/3601/3351926135_fba2d2cf0d.jpg?v=0" alt="Nice Icon" /></a></p>
<p><strong>6. Growl support</strong> &#8211; If you use Growl, then RadioAunty will notify you when a show starts playing. If you choose the twitter support it will also notify you when this information is sent to twitter.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/sets/72157615137746093/"><img src="http://farm4.static.flickr.com/3638/3351926335_acd4880bd6.jpg?v=0" alt="Growl Support" /></a></p>
<p>Next then. I&#8217;m going to be transferring the twitter and scheduling stuff over to <a href="http://whomwah.github.com/tellybox/">TellyBox</a> (A Mac app that allows you to watch live and catchup BBC Television). So watch out for the updates. Then I think <a href="http://www.last.fm/">lastfm</a> integration is on the cards. It&#8217;s be nice to scrobble what tracks you are listening to.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=A6WQ2JNbNBw:2-a6_ojViUE:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/03/14/radioaunty-feature-update-twitter-scheduling-and-much-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replicating Apples embossed text in a Cocoa App</title>
		<link>http://whomwah.com/2009/03/11/replicating-apples-embossed-text-in-a-cocoa-app/</link>
		<comments>http://whomwah.com/2009/03/11/replicating-apples-embossed-text-in-a-cocoa-app/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 11:22:04 +0000</pubDate>
		<dc:creator>Duncan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[OSX]]></category>

		<guid isPermaLink="false">http://whomwah.com/?p=1203</guid>
		<description><![CDATA[[update] Thanks to the chaps below in the comments, my in-experience with cocoa is shown. This whole post could be replaced with this code:

 &#91;&#91;myTextField cell&#93; setBackgroundStyle:NSBackgroundStyleRaised&#93;;

If you look at the text in the task or status bar on of a Mac app, you will see that the text has the appearance of being embossed [...]]]></description>
			<content:encoded><![CDATA[<p class="update"><strong>[update]</strong> Thanks to the chaps below in the comments, my in-experience with cocoa is shown. This whole post could be replaced with this code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>myTextField cell<span style="color: #002200;">&#93;</span> setBackgroundStyle<span style="color: #002200;">:</span>NSBackgroundStyleRaised<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>If you look at the text in the task or status bar on of a Mac app, you will see that the text has the appearance of being embossed slightly. It is essentially a textField with some neat attributes associated with it.</p>
<p><a href="http://www.flickr.com/photos/duncanponting/3346662608/"><img src="http://farm4.static.flickr.com/3657/3346662608_9da98cf85b.jpg" alt="Apple embossed text" /></a></p>
<p>This effect does not come for free when you want to use your own <a href="http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextField_Class/Reference/Reference.html">NSTextField</a> somewhere else in your Apps window (actually, I think it does on the iPhone?). To recreate this effect is quite simple. You just need to create a <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSAttributedString_Class/Reference/Reference.html">NSAttibutedString</a> and associate the attributes below to it.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">// Create the white shadow that sits behind the text</span>
<span style="color: #400080;">NSShadow</span> <span style="color: #002200;">*</span>shadow <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSShadow</span> alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>shadow setShadowColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSColor</span> colorWithDeviceWhite<span style="color: #002200;">:</span>1.0 alpha<span style="color: #002200;">:</span>0.5<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>shadow setShadowOffset<span style="color: #002200;">:</span>NSMakeSize<span style="color: #002200;">&#40;</span>1.0, <span style="color: #002200;">-</span>1.1<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">// Create the attributes dictionary, you can change the font size</span>
<span style="color: #11740a; font-style: italic;">// to whatever is useful to you</span>
<span style="color: #400080;">NSMutableDictionary</span> <span style="color: #002200;">*</span>sAttribs <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSMutableDictionary</span> alloc<span style="color: #002200;">&#93;</span> initWithObjectsAndKeys<span style="color: #002200;">:</span>
    <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSFont</span> systemFontOfSize<span style="color: #002200;">:</span>11.0<span style="color: #002200;">&#93;</span>,NSFontAttributeName,
    shadow, NSShadowAttributeName,
    <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">// The shadow object has been assigned to the dictionary, so release</span>
<span style="color: #002200;">&#91;</span>shadow release<span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">// Create a new attributed string with your attributes dictionary attached</span>
<span style="color: #400080;">NSAttributedString</span> <span style="color: #002200;">*</span>s <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSAttributedString</span> alloc<span style="color: #002200;">&#93;</span> initWithString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;82 results found&quot;</span>
    attributes<span style="color: #002200;">:</span>sAttribs<span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">// Set your text value</span>
<span style="color: #002200;">&#91;</span>myTextField setAttributedStringValue<span style="color: #002200;">:</span>s<span style="color: #002200;">&#93;</span>;
<span style="color: #11740a; font-style: italic;">// Clean up</span>
<span style="color: #002200;">&#91;</span>s release<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>I&#8217;m sure there are many other ways to achieve this effect, and I&#8217;d be interested in any easier versions, but this works for me.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/whomwah?a=BH-cJWPiVCA:QRz8XKNnbWo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/whomwah?d=7Q72WNTAKBA" border="0"></img></a>
</div>]]></content:encoded>
			<wfw:commentRss>http://whomwah.com/2009/03/11/replicating-apples-embossed-text-in-a-cocoa-app/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss><!-- Dynamic page generated in 1.208 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-07-03 11:49:25 -->
