<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Aral Balkan &#187; Articles</title>
	<atom:link href="http://aralbalkan.com/category/articles/feed" rel="self" type="application/rss+xml" />
	<link>http://aralbalkan.com</link>
	<description>Passionate geekisms.</description>
	<lastBuildDate>Wed, 01 Feb 2012 18:53:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
		<item>
		<title>It&#8217;s your data, but what about the URLs? #myData #myURLs</title>
		<link>http://aralbalkan.com/3986</link>
		<comments>http://aralbalkan.com/3986#comments</comments>
		<pubDate>Wed, 04 Jan 2012 19:32:59 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3986</guid>
		<description><![CDATA[Owning your own data is great, owning your own URLs also is even better. Let's start asking web app developers for this feature.]]></description>
			<content:encoded><![CDATA[<p id="top" />Gone is the initial love affair I had with the web. Those early days when I believed that Google actually could do no evil and when the web was an open frontier of boundless potential built by those who naively and bravely toiled to further the plight of humanity are in the past. </p>
<p>Replaced, are they, by the grey (OK, pastel) reality of commercial silos that grant users varying degrees of access to their own data <a href="http://lifehacker.com/5697167/if-youre-not-paying-for-it-youre-the-product">while trying to gleam as much information about them as they can to sell to their advertisers</a> and other interested third parties. And what freedoms remain are under grave threat from legislation like <a href="http://www.netmagazine.com/news/sopa-bill-threatens-web-industry-111571">SOPA</a> and <a href="http://fightforthefuture.org/pipa/">PROTECT IP</a>. </p>
<p><span id="more-3986"></span></p>
<p>How's that for overly-dramatic? </p>
<h2>Yes, that was overly-dramatic!</h2>
<p>Of course, it's not all doom and gloom.</p>
<p>There is <a href="http://webstandards.org">a thriving web standards community</a> actively building, evolving, and furthering the open web, and bodies like the <a href="https://www.eff.org/">EFF</a> who are campaigning to keep the web open. People–at least in the geekier circles–are becoming more aware of the importance of owning their own data. And, in all fairness, many web services now allow users to backup or export their data. </p>
<p>But what about the URLs used for public pieces of user data? </p>
<p>Who owns those?</p>
<h2>Who owns your URLs?</h2>
<p>The norm today is that URLs belong to the web service provider. </p>
<p>Case in point: <a href="http://aralbalkan.com/3975">I'm closing my Flickr account in response to Yahoo! hiring PayPal's president as CEO</a> and that means that the URLs for all my photos and sets will now go dead. Anyone who has linked to a photo will now get a broken link. In short, this will break (a teeny, tiny, probably imperceptible) part of the Internet. Regardless of its impact, however, breaking links breaks the Internet.</p>
<p>So what can we do about it?</p>
<h2>#myData #myURL</h2>
<p>Just like we are beginning to understand the value of owning our own data, we need to understand the value of owning our own URLs. </p>
<p>And by this, I don't mean that we should all host all of our own data. We don't all want to run a mini Flickr, a mini YouTube, etc. We don't all have the technical expertise or the financial means to do so. It's just not practical. </p>
<p>It does mean, however, that I should be able to use my own URLs with third-party services. So, if I have a domain name (e.g., <em>aralbalkan.com</em>), I should be able to tell Flickr to use, say, <em>photos.aralbalkan.com</em> as the root of all URLs to my images and sets. In other words, I should be able to tell web services to use my own URLs as the <a href="http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html">canonical URLs</a> to represent my own data. </p>
<p>If Flickr had allowed this, for example, I could have uploaded the photos I exported from it either to <em>photos.aralbalkan.com</em> under the same URL scheme or to somewhere else completely different (and used redirects, etc.) without breaking the Internet. </p>
<p>Owning your own data is great, owning your own URLs also is even better. </p>
<p>Let's start demanding that web application developers implement this feature.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3986/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Goodbye, Yahoo! (&amp; instructions on how to export/backup your photos from Flickr)</title>
		<link>http://aralbalkan.com/3975</link>
		<comments>http://aralbalkan.com/3975#comments</comments>
		<pubDate>Wed, 04 Jan 2012 18:34:16 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[back-up]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Photos]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3975</guid>
		<description><![CDATA[How to backup your photos from your Flickr account to your own computer.]]></description>
			<content:encoded><![CDATA[<p id="top" />Since reading the news that <a href="http://www.guardian.co.uk/technology/2012/jan/04/yahoo-appoints-paypal-president?newsfeed=true">Yahoo! have hired PayPal's president</a>, I no longer want anything to do with them. </p>
<p>The only things I had left on my 12-year-old Yahoo! account were a few contacts from the days I used Messenger and email and the photos on my Flickr account. I exported the former easily and I'm in the process of backing up the photos and their metadata from Flickr now. </p>
<p><span id="more-3975"></span></p>
<p>Once the backups are complete, I'll be deleting my Yahoo! account.</p>
<h2>Dead URLs break the web</h2>
<p>Unfortunately, this does mean that those URLs are going to die (and it's made me realise how valuable URLs are–they're part of your data and you should own them, not the web apps you use. All web apps should give you the ability to provide your own URLs as canonical URLs for your own data.) </p>
<h2>How to backup your Flickr photos</h2>
<p>Anyway, in case you want to backup your photos from Flickr, here's the way I'm doing it. Follow these instructions to get going:</p>
<ol>
<li><a href="http://code.google.com/p/flickrdownload/downloads/list">Download the latest flickrdownload</a></li>
<li>Unzip the downloaded file somewhere and then navigate to that folder in Terminal (Open up Terminal, type <code>cd</code> and then drag the unzipped folder into terminal to get its path, and press return to change to that folder).</li>
<li>Enter the following line, <strong>substituting your own Flickr username and the path to the folder you want the photos backed up to</strong>, in Terminal:
<pre>java -Xmx2048m -jar FlickrDownload.jar --photosDir /PATH/TO/THE/FOLDER/YOU/WANT/THE/PHOTOS/BACKED/UP/TO/ --downloadExifData --authUsername YOUR_FLICKR_USERNAME</pre>
</li>
</ol>
<p>The first time you run this, it will give you a URL that you need to copy into your web browser to visit Flickr and authorise the script. Once you've done that, press return in the terminal and the script should Just Work&trade; (it didn't for me and I had to run the command again for it to work.)</p>
<p>That's it! Hope it helps.</p>
<h2>Flickr to WP</h2>
<p>I'm also using the <a href="http://wordpress.org/extend/plugins/flickr-to-wp">Flickr to WP</a> plugin to import all my photos into this blog so I can share them here. </p>
<h2>Update #1</h2>
<p>flickrdownload downloaded all my images properly but died when trying to write the <em>archive.html</em> file with the following error: </p>
<p><code>com.sun.org.apache.xerces.internal. impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.</code></p>
<p>It did write the XML metadata files correctly, though, and so I'm going ahead and shutting my account (I can always regenerate the HTML file by fixing the code). </p>
<p>Also, I saw that some of the images were Flickr's "image not available" placeholders but it doesn't seem to have affected the originals (just the derived medium and small versions, which are not crucial).</p>
<h2>Update #2</h2>
<p>I've now backed up the Flickr photos both offline <a href="http://aralbalkan.com/4296">and on this blog</a>, cancelled my Flickr Pro subscription, and shut down both my Flickr account as well as my main 12-year-old Yahoo! account. </p>
<p>Goodbye, Yahoo!</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3975/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Comfort Zones (the obligatory 2011 review and 2012 resolutions post)</title>
		<link>http://aralbalkan.com/3969</link>
		<comments>http://aralbalkan.com/3969#comments</comments>
		<pubDate>Wed, 04 Jan 2012 15:37:11 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3969</guid>
		<description><![CDATA[2011 was a busy year. I had a host of speaking engagements, including presenting opening and closing keynotes on User Experience and the future of web and mobile design and development at conferences like Future of Web Design, NSConference in the UK, Fronteers in the Netherlands, Login in Lithuania. I hosted the Brand Perfect Tour [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />2011 was a busy year. I had a host of speaking engagements, including presenting opening and closing keynotes on User Experience and the future of web and mobile design and development at conferences like <a href="http://lanyrd.com/2011/fowd/sdyrm/" title="Making the New Everyday Things at Future of Web Design 2011 | Lanyrd">Future of Web Design</a>, <a href="http://alblue.bandlem.com/2011/03/nsconference-2011-day-3.html" title="AlBlue&#8217;s Blog: NSConference 2011 Day 3">NSConference</a> in the UK, <a href="http://fronteers.nl/congres/2011/sessions/the-future-is-native-aral-balkan" title="The Future is Native by Aral Balkan · Fronteers">Fronteers</a> in the Netherlands, <a href="http://www.youtube.com/watch?v=y1OjQoDr7Hc" title="Už patogumo ribų: emocinio dizaino menas, Aral Balkan @ Login 2011<br />
      - YouTube">Login</a> in Lithuania. I hosted the <a href="http://www.brandperfect-tour.com/" title="Brand Perfect Tour | Think Tank &amp; Design Master Classes">Brand Perfect Tour</a> for Monotype Imaging in <a href="http://www.brandperfect-tour.com/events/london-november-15/" title="Adventures In Mobile. The iPhone And Beyond. | Brand Perfect Tour">London</a> and <a href="http://www.brandperfect-tour.com/events/berlin-october-27th/" title="Adventures In Mobile. The iPhone And Beyond. | Brand Perfect Tour">Berlin</a>, taught <a href="http://geekninjafactory.com/" title="Geek Ninja Factory | iPhone and iPad Training Courses in Brighton, UK.">my iOS Development and Mobile User Experience workshops</a> multiple times in Brighton, Oslo, and Stockholm, hosted a <a href="http://aralbalkan.com/3781" title="Aral Balkan &middot;  Geek Ninja Battle Night">Geek Ninja Battle</a> and created my own conference, <a href="http://updateconf.com/" title="Update Conference – The human touch: iOS and beyond – September 5-7, 2011 – Brighton">Update 2011</a> (<a href="http://www.youtube.com/playlist?list=PL4850B9F46ADEFBE2&amp;feature=viewall" title="Update 2011 Conference Videos<br />
            - YouTube">watch the videos here</a>), and, as part of the steering committee, I helped realise the inaugural <a href="http://brightondigitalfestival.co.uk/" title="Brighton Digital Festival | Celebrating digital culture – this September">Brighton Digital Festival</a>. As part of the Brighton Digital Festival, <a href="http://maban.co.uk/" title="Anna Debenham">Anna Debenham</a> from <a href="http://hackasaurus.org/" title="Hackasaurus">Mozilla&#8217;s Hackasaurus project</a> and I also <a href="http://brightondigitalfestival.co.uk/2011/06/aral-balkan-speaking-at-longhill-high-school-and-varndean-school/" title="Aral Balkan Speaking at Longhill High School and Varndean School | Brighton Digital Festival">visited two schools in Brighton</a> to teach the kids to code and I also gave a new talk on augmented reality at the <a href="http://www.lighthouse.org.uk/programme/improving-reality" title="Lighthouse">Improving Reality</a> conference. Additionally, I presented sessions at the Norwegian Developers Conference, <a href="http://blogs.bath.ac.uk/webservices/2011/03/22/the-big-m-conference-the-talks/" title="The Big M Conference &#8211; The Talks &laquo;  Web Services">The Big M</a>, and <a href="http://www.learningrocks.co.uk/2011/01/bettr-type-of-conference.html" title="Learning Rocks: A BETTr type of conference?">Be Bettr</a>, mentored designers at <a href="http://aralbalkan.com/3762" title="Aral Balkan &middot;  Design Jam London 2: post-mortem">Design Jam London 2</a>, was interviewed as part of the <a href="http://mrqwest.co.uk/blog/168/insites-brighton" title="MrQwest: Insites: Brighton ~ The Home of a Croydon Web Designer">Insites Tour</a>, wrote a few opinion pieces for <a href="http://www.netmagazine.com/" title=".net magazine | The world's best-selling magazine for web designers and developers since 1994">.net magazine</a>, and helped judge the <a href="http://www.netmagazine.com/features/net-awards-2011-winners" title=".net Awards 2011: the winners! | Feature | .net magazine">.net awards</a>.</p>
<h2 id="nomoreeatinganimals">No more eating animals</h2>
<p><span id="more-3969"></span></p>
<p>Oh, and in the last few weeks of 2011, I decided to give up eating meat (in a nutshell, I couldn&#8217;t reconcile my revulsion at being served whale at a sushi restaurant in Oslo with my willingness to eat–among others-cow, pig, and chicken.) I&#8217;m hugely enjoying being vegetarian. Even in these short few weeks, my diet has become infinitely more varied and I&#8217;ve discovered (and re-discovered) restaurants, ingredients, and dishes that I never would have otherwise because I would have picked the burger or steak on the menu.</p>
<h2 id="comfortzones">Comfort zones</h2>
<p>So I guess I have done quite a bit and things have changed in my life. And yet I feel that I haven&#8217;t achieved as much as I wanted to and that I need to venture outside my comfort zone.  </p>
<p>It&#8217;s somewhat ironic, considering that my focus on User Experience in all things leads me to try and remove all friction from my life; design my life, if you will, for maximum comfort. And there isn&#8217;t anything wrong with that… as long as you are also pushing yourself, playing with stuff you love, growing, and creating. (And how lucky we are, those of us that have the luxury to do those things.)</p>
<p>All this to say, I feel I&#8217;ve gotten a bit too comfortable and I am going to make a concerted effort this year to venture outside my comfort zone. </p>
<h2 id="focusandexperimentation">Focus and experimentation</h2>
<p>I want to start experimenting again, making mistakes, iterating, hopefully working and collaborating with other people, and generally getting my hands dirty.</p>
<p>I&#8217;m also aware that I need to focus (heck, I spend enough time telling everyone around me that focus is key). It&#8217;s too easy with all the conferences and workshops and travel to get pulled into a endless chain of social engagements. I&#8217;m definitely a social creature and I adore the company of others but sometimes you need to cuddle up with a warm blanket, a nice hot cup of tea, and your laptop and actually–y&#8217;know–make stuff!</p>
<h2 id="letsplaytogether">Let&#8217;s play together</h2>
<p>The &#8216;collaborating with other people&#8217; bit is also something I want to really focus on. As an only child, it&#8217;s not something that comes naturally to me and I want to work on that. (I&#8217;m very used to being self-sufficient and handling all aspects of a project… but that–while it has its advantages–can also limit you in the scope of the projects you can work on.) I thought I&#8217;d get the chance to work with a lovely team on a new project this year when the kind folks at Lighthouse backed my interactive film idea and helped submit the proposal to the Arts Council and the BBC for their The Space project. Unfortunately, following an unbelievably short evaluation period in which they were inundated with entries, our proposal was not picked for funding. This was a bummer (yes, that&#8217;s the technical term) but I have a few other ideas up my sleeve–one of which is an app idea that I&#8217;m very excited about.</p>
<h2 id="thewritestuffohboy">The write stuff (oh boy)</h2>
<p>I also have a couple of writing/publishing projects I want to undertake. This started out as a mild desire but has progressed in the last year to become a full-on craving; one of those ideas that just sits there at the back of your mind and won&#8217;t go away until you actually do it. I&#8217;ll be starting on three different projects that I will be announcing shortly. I plan on developing each one publicly, and working on them concurrently.  </p>
<h2 id="focusfocusfocus">Focus, focus, focus!</h2>
<p>Of course, if I&#8217;m to focus on these projects, something has to give. As such I am going to cut down on my speaking engagements for 2012. There are several conferences I&#8217;ve already said yes to (and which I&#8217;m hugely looking forward to), but I am going to be very selective in which ones I say yes to going forward. (That said, if you have an awesome conference planned that you want an inspirational opening or closing keynote for, get in touch!) I am also going to keep teaching my workshops but will limit them to one a month at most.</p>
<h2 id="wanderlust">Wanderlust</h2>
<p>Finally, I feel like I could do with a change of scene. As much as I love Brighton, I&#8217;ve been here for about eight years now (and in the UK for a decade) and that&#8217;s the longest I&#8217;ve stayed in one country. I have to say I&#8217;m tempted by the quality of life in Oslo… or perhaps somewhere warmer? I don&#8217;t know. All I can say is don&#8217;t be too surprised if you hear that I&#8217;m going off to experience somewhere new. (And if you have any ideas–about working together, great places to live, or both, leave me a comment!)</p>
<h2 id="nufftalk">&#8216;nuff talk</h2>
<p>I&#8217;m still planning out my year but this post marks the end of the thinking phase and the beginning of the doing phase. Time to get those hands dirty. Expect to see some half-baked ideas being developed publicly, experiments, mistakes, new beginnings, new friendships, and hopefully some really cool projects. </p>
<p>Don&#8217;t mind the dust, and I hope you enjoy the ride.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3969/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>iPad 2: Fit For Real Work?</title>
		<link>http://aralbalkan.com/3808</link>
		<comments>http://aralbalkan.com/3808#comments</comments>
		<pubDate>Sat, 02 Apr 2011 11:28:44 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3808</guid>
		<description><![CDATA[Following my talks at the LOGIN, The Big M, NSConference, and Tweakers.net Developer Summit last month, .net magazine asked if I'd like to be the subject of their Reader Q&#038;A section in their next issue and answer questions sent in via Twitter on life, UX, mobile, and everything. I informed them that yes, I'd be [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />
<p>Following my talks at the <a href="http://login.lt/">LOGIN</a>, <a href="http://thebigm.mobi/">The Big M</a>, <a href="http://ideveloper.tv/schedule/details?event_id=3">NSConference</a>, and <a href="http://summit.tweakers.net/">Tweakers.net Developer Summit</a> last month, .net magazine asked if I'd like to be the subject of their Reader Q&A section in their next issue and answer questions sent in via Twitter on life, UX, mobile, and everything. I informed them that yes, I'd be delighted to, and this whole adventure eventually resulted in a lovely email from Tanya at .net magazine with the questions that were tweeted in. </p>
<p>(Welcome if you're reading this from the link in the .net article, by the way. I hope you enjoyed it.)</p>
<p><span id="more-3808"></span></p>
<p>Fast forward to this morning when I decided to write my replies using only my new iPad 2 to see how it holds up to some — albeit lightweight — real-world use. As I do, I will be writing this post, also on my iPad, using the free WordPress app.</p>
<h2>The first hurdle (or "even the best web apps still have an uphill struggle when it comes to competing with native user experiences")</h2>
<p>The first thing I had to do was to locate Tanya's email and copy the questions from it to Pages. After this, I would pick the questions I wanted to answer, delete the others, and start entering my answers after each of the questions. An easy enough task. Or so you would think.</p>
<p>The first problem was the Mail app on iPad when used with a GMail account via IMAP: it is horrible at searching for existing messages that it hasn't downloaded (ones on the server). So I had to do what I usually have to do, which is to fire up the GMail site in Mobile Safari. This let me find the message but — get this — I couldn't select the whole thing. There was just no way I could make the message scroll while selecting. A basic usability failure if ever there was one. I finally had to resort to using <a href="http://sendtodropbox.com/">Send To Dropbox</a> to forward the email to Dropbox where, using the Dropbox iPad app, I could select the contents to paste into Pages.</p>
<h2>Pages for iPad</h2>
<p>For the most part, Pages for iPad worked like a charm. My only complaint is that the word count feature is so well hidden that I actually thought it didn't have one (and cooked up a quick app to scratch my own itch before finding it). </p>
<h2>How's that for radical contextualization? WordPress app issues.</h2>
<p>Writing this post in the WordPress app wasn't entirely hassle-free either.</p>
<p>The first gotcha was a usability issue. When I started a new post, after entering the title, I tapped into the post body section and the header information entirely disappeared off the top of the screen. I would not have had a problem with that interaction — and, in fact, would have quite enjoyed the additional writing space it provided — if it had provided me with a cue — a landmark — to denote where the information went and a means by which I could get it back. Without either of those, I was left wondering whether it was a bug and I had lost the information altogether. It made me tap off of the text view to see if something had gone wrong. When the text view lost focus, the header information returned, and I was reassured that I hadn't lost it.</p>
<p>Another usability issue was more concerning: I wasn't sure, as I started typing my post, whether it was being auto-saved. This led me to feeling insecure and I started searching for a way to save. As I stumbled through the interface, I found the options screen where I set the status of the post to Draft and hit the save button. A quick test confirmed that the WordPress app doesn't auto-save as you're typing so I keep hitting the Update button every so often, which removes the editor and  thereby interrupts my writing flow.</p>
<p>I would implement quite a rigorous auto-save since there's nothing worse than losing data (and it's an operating system expectation on iOS). </p>
<h2>Adding images to my blog post</h2>
<p>One other usability issue I had was with adding images to my post. The buttons for adding images are at the bottom of the compose window and are covered by the keyboard when you are typing. For one thing, this led me initially to question if the functionality existed at all since I hadn't noticed them prior to clicking in the text box to edit my post. Then, it meant that I had to once more interrupt my writing flow to add images by first manually making the keyboard lose focus, then adding the image, then tapping in the text box to return to editing the text.</p>
<p>Once I realised where to find and how to use the buttons, I was unimpressed by the functionality. It adds some horrible code either above or below your content (instead of where you are in the document). </p>
<p><img src="http://aralbalkan.com/wp-content/uploads/2011/04/20110406-084819.jpg" id="blogsy-1303259751534.865" class="alignnone size-full" alt="20110406-084819.jpg" width="500" height="366"></p>
<p>I would redesign the interface so that the toolbar buttons were in a keyboard extension and so the writing area filled up the entire remaining space above the keyboard in both orientations. </p>
<p>Also, while taking screenshots on my iPad was simple enough (if a bit unergonomic due to the distance between the two buttons that have to be pressed in tandem), I found the simple task of annotating and cropping them to be a big issue. To cut a long story of several fruitless app purchases short, I ended up using the free <a href="http://www.zagg.com/j/photopad.php">PhotoPad</a> app which was one of the few I could find that actually showed me the exact image dimensions I was cropping to. </p>
<h2>A general UX gripe with the iPad: Undo</h2>
<p>Shake to undo works like a charm on the iPhone. This is a tiny device that fits into the palm of one hand. Shaking it involves almost no effort at all and is an ergonomically-sound gesture. Not so with the iPad. </p>
<p>The iPad is the size of about six iPhone 4 placed side-by-side and thus has very different human factors considerations. Lifting this baby off your lap and shaking it wildly from side to side every time you want to undo a typo will, at best, make you look mentally unstable if carried out in a public space.</p>
<p>Apple must implement a better gesture for this important gesture in future versions of iOS for the iPad. I recommend a three-finger swipe to the left (with a three-finger right swipe as redo). It's currently not mapped to any universal gesture on the OS and is relatively effortless to perform and can be layered in as an alternative gesture while still supporting shake-to-undo to transition iPhone users to the iPad.</p>
<p><em>Since writing this, I've been alerted on Twitter that there is an Undo button on the iPad's symbol/number keyboard but it's not ideal; hidden away like that. I've had an iPad since the beginning and I never noticed it.</em></p>
<h2>Blogsy</h2>
<p>I finally gave up on the WordPress app and I'm typing this in <a href="http://blogsyapp.com/" target="_self" title="">Blogsy</a>. Goodness knows it has its own limitations (for example, the code and "WYSIWYG" views look identical initially, making it impossible to know which mode you're in) but it is still light years ahead of the official WordPress app and has lots of potential (or is at least a step in the right direction).</p>
<h2>A land of opportunity</h2>
<p>So, is the iPad 2 fit for "real work?" Depends. On the app, that is. And what you call work.</p>
<p>On the one hand, you have awesome apps like Garage Band, Pages, Keynote, and Dropbox that you can be really productive with. On the other, there are lots of half-baked apps out there that may have potential but are, quite frankly, rather limited in professional features.</p>
<p>It feels to me like most apps on the iPad have a long way to go before users can be as productive as they are with a Mac. Far from being a negative aspect, this means that there is lots of opportunity here (for app developers who grok UX) to create successful apps.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3808/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>HSBC Prepare CSV bookmarklet for FreeAgent: Download previous statements on HSBC Personal accounts</title>
		<link>http://aralbalkan.com/3744</link>
		<comments>http://aralbalkan.com/3744#comments</comments>
		<pubDate>Tue, 15 Feb 2011 12:00:57 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[account]]></category>
		<category><![CDATA[bank]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[downloadable]]></category>
		<category><![CDATA[freeagent]]></category>
		<category><![CDATA[hsbc]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[previous statements]]></category>
		<category><![CDATA[statements]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3744</guid>
		<description><![CDATA[I have an HSBC Advance account. It's a premium personal current account (ok, you can stop looking at me like I'm a fool – I get travel insurance and stuff. OK, OK, and I'm gullible!) You would think that one feature of a current account in this day and age, whether premium or not, would [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />I have an HSBC Advance account. It's a premium personal current account (ok, you can stop looking at me like I'm a fool – I get travel insurance and stuff. OK, OK, <em>and</em> I'm gullible!) You would think that one feature of a current account in this day and age, whether premium or not, would be the ability download previous statements in a data format or some sort. </p>
<p>In fact, for some inexplicable reason which must make perfect sense to you if you're a fat cat making billions after being bailed out by taxpayer's – i.e., our – money, HSBC allows you to do download statements in a variety of formats but only for recent transactions. As of this writing, my recent transactions only go as far back as the start of January, 2011. I also have access to "previous statements" that date back to the start of last year but – and it's a big but – I can't download them. I can print them but that's about it. WTF indeed.</p>
<p><span id="more-3744"></span></p>
<p>Since I've recently started using the excellent <a href="http://fre.ag/3aixj8xt">FreeAgent</a> and I really want to get a grip on my finances and accounting, I need to import my personal bank transactions into FreeAgent alongside my business accounts. This braindead artificial limitation imposed by HSBC was stopping me from doing that. So I fixed it. And with that, I give you the HSBC Prepare CSV bookmarket.</p>
<h2>Installation</h2>
<p>&rarr; <a href="javascript:function loadScript(scriptURL) { var scriptElem = document.createElement('script'); scriptElem.setAttribute('language', 'JavaScript'); scriptElem.setAttribute('src', scriptURL); document.body.appendChild(scriptElem);} loadScript('http://dl.dropbox.com/u/5269427/savestatement.js');" title="HSBC Prepare CSV">HSBC Prepare CSV</a> &larr;</p>
<p>You see the link above? (Yes, the one pointed to by the arrows!) <strong>Drag it</strong> to your browser's bookmark toolbar to create a bookmarklet.</p>
<p><img src="http://dl.dropbox.com/u/5269427/HSBC%20blog%20post/hsbc-bookmarklet.png" alt="Install the bookmarklet by dragging it to your browser's toolbar"></p>
<p>That's it, you're done!</p>
<h2>Usage</h2>
<p><img src="http://dl.dropbox.com/u/5269427/HSBC%20blog%20post/hsbc-copy-to-clipboard2.png" alt="The copy to clipboard icon"></p>
<ol>
<li>Sign in to your HSBC Personal account and navigate to a previous statement.</li>
<li>Click the "HSBC Prepare CSV" bookmarklet you created earlier.</li>
<li>A little copy-to-clipboard icon will be inserted into your statement. Click it to copy the generated CSV to your system clipboard.</li>
<li>In your text editor of choice, create a new file and paste the generated CSV into it.</li>
<li>Save the file with a meaningful name like <em>2011-02-07-HSBC-Personal.csv</em> (as opposed to a generic <em>statement.csv</em> or <em>transactions.csv</em> as HSBC's system insists on naming files when it does allow you to download them<code>&lt;/rantOff&gt;</code>).</li>
</ol>
<p>Once you've downloaded your statements using the above process, you can upload them to <a href="http://fre.ag/3aixj8xt">FreeAgent</a>.</p>
<p>I hope you enjoy using the bookmarklet and that it helps you with your bookkeeping/accounting.</p>
<p>(It is my sincerest hope that HSBC will fix this huge oversight and that this bookmarklet will not be needed for much longer. If this blog post helps to shame them into doing it, all the better.)</p>
<h2>Freeagent</h2>
<p>If you like the bookmarklet and haven't heard of <a href="http://fre.ag/3aixj8xt">FreeAgent</a> yet, why not sign up with my referral code – 3aixj8xt – (or via one of the links in this article), and we'll both get 10% off.</p>
<h2>Details</h2>
<p>The generated CSV is in <a href="http://www.freeagentcentral.com/support/kb/banking/file-format-for-bank-upload-csv">the AMEX CSV format</a> published by <a href="http://fre.ag/3aixj8xt">FreeAgent</a>. This is the simplest CSV format they accept and the only one that is currently published. </p>
<p>You can see <a href="http://dl.dropbox.com/u/5269427/savestatement.js">the source code for the HSBC Prepare CSV script</a> here to make sure that it's not doing anything nefarious with your bank data. </p>
<p>I am talking to the lovely folks at <a href="http://fre.ag/3aixj8xt">FreeAgent</a> at the moment to see if we can't capture a bit more of the information from HSBC personal accounts in a slightly more involved CSV format in the future.</p>
<h2>Credits</h2>
<p>The HSBC Prepare CSV bookmarklet would not have been possible without the following resources and components:</p>
<ul>
<li><a href="http://twitter.com/roanlavery">Roan Lavery</a> for FreeAgent and for pointing me to the CSV file format and for general friendship, help, and patience with a guy who currently hates accounting but is trying to hate it less.</li>
<li><a href="http://jquery.com/">jQuery</a>, the awesome JavaScript library that makes DOM traversal (as well as other things) a CSS-selector-esque piece of cake.</li>
<li><a href="https://github.com/mojombo/clippy">Clippy</a>, the little Flash-based copy-to-clipboard component.</li>
<li><a href="http://flowplayer.org/tools/toolbox/flashembed.html">jQuery FlashEmbed</a>, which I'm using to embed Clippy into the statement.</li>
<li>The Squidoo article by echo85 for showing me <a href="http://www.squidoo.com/load-jQuery-dynamically">how to lazy load jQuery</a> and, similarly, the Coding in Paradise article on <a href="http://codinginparadise.org/weblog/2005/08/ajax-creating-huge-bookmarklets.html">Creating Huge Bookmarklets</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3744/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>PhoneGap iOS installer bug (and workaround)</title>
		<link>http://aralbalkan.com/3652</link>
		<comments>http://aralbalkan.com/3652#comments</comments>
		<pubDate>Mon, 08 Nov 2010 17:41:22 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[BUG]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[installer]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[XCode]]></category>
		<category><![CDATA[xcode not installed]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3652</guid>
		<description><![CDATA[I was trying to install PhoneGap iOS on my new MacBook Air but got an error when I ran the PhoneGapLibInstaller.pkg installer. It was telling me that I didn't have Xcode installed when, in fact, I did. I just didn't have it installed in the default location (/Developer). (Since I usually have several versions of [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />I was trying to install PhoneGap iOS on my new MacBook Air but got an error when I ran the PhoneGapLibInstaller.pkg installer. It was telling me that I didn't have Xcode installed when, in fact, I did. I just didn't have it installed in the default location (/Developer). </p>
<p>(Since I usually have several versions of Xcode on my machine at the same time, I've taken to installing them off the root in descriptive folders – e.g., Xcode3.2.4iOS4.1, etc.) </p>
<p><span id="more-3652"></span></p>
<p>A cursory glance through the installer code revealed that the installer doesn't appear to need to do anything with Xcode, it just checks whether it exists (at the default location). Specifically, it checks if Xcode is installed by checking for the existence of /Developer/Applications/Xcode.app and if the iOS SDK is installed by checking for /Developer/Platforms/iPhoneOS.platform. So, as a workaround, I rebuilt the packager <a href="https://github.com/aral/phonegap-iphone">from source</a> and removed the two requirements. Lo and behold, the installer ran beautifully. </p>
<p>It's a niche issue (most people have Xcode installed in the default location), and I know that the PhoneGap team are aware of it, <a href="http://twitter.com/davejohnson/status/1678690370977792">Dave Johnson was looking into it</a>, and <a href="http://twitter.com/shazron">Shazron Abdullah</a> just posted <a href="https://gist.github.com/667981">a gist on the issue</a>, so I'm sure that a fix will be out shortly. </p>
<p>In the meanwhile, if you're affected by the issue, <a href="/downloads/PhoneGapLib.zip">you can grab my installer</a> (.zip; 356KB), which doesn't have the two checks in it, and try using that instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3652/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Error 404</title>
		<link>http://aralbalkan.com/3641</link>
		<comments>http://aralbalkan.com/3641#comments</comments>
		<pubDate>Fri, 05 Nov 2010 14:48:32 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[error 404]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3641</guid>
		<description><![CDATA[An error 404 is just a geeky way of saying that the web site or page that you're looking for does not exist. Read more about Error 404 on Wikipedia. And here is a list of some cool Error 404 pages to keep you entertained. PS. Here's a special welcome if you arrived here via [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />An error 404 is just a geeky way of saying that the web site or page that you're looking for does not exist.</p>
<p>Read more about <a href="http://en.wikipedia.org/wiki/HTTP_404">Error 404 on Wikipedia</a>.</p>
<p><span id="more-3641"></span></p>
<p>And here is a list of <a href="http://www.hongkiat.com/blog/60-really-cool-and-creative-error-404-pages/">some cool Error 404 pages</a> to keep you entertained.</p>
<p>PS. Here's a special welcome if you arrived here via <a href="http://thelink.is/404">http://thelink.is/404</a>. (I never can resist a good recursion.)</p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3641/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Web hosting recommendations</title>
		<link>http://aralbalkan.com/3631</link>
		<comments>http://aralbalkan.com/3631#comments</comments>
		<pubDate>Thu, 04 Nov 2010 15:46:54 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Friends]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[recommendations]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[web host]]></category>
		<category><![CDATA[web hosting]]></category>
		<category><![CDATA[web hosts]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3631</guid>
		<description><![CDATA[I do all my own web development these days with either Python/Django or JavaScript. (Have you seen Joyent's excellent SmartPlatform yet or checked out node.js? It's the future.) That said, I still have legacy sites that run PHP/MySQL and my blog is powered by WordPress. I'm also not too happy with my current web host [...]]]></description>
			<content:encoded><![CDATA[<p id="top" /><img src="/images/crazywebhostingdotcom.jpg" alt="Woman wearing a sports jersey sponsored by crazywebhosting.com. Photo credit: grantlairdjr/Flickr."></p>
<p>I do all my own web development these days with either Python/<a href="http://www.djangoproject.com/">Django</a> or JavaScript. (Have you seen <a href="http://www.joyent.com/technology/smartplatform/">Joyent's excellent SmartPlatform</a> yet or checked out <a href="http://nodejs.org/">node.js</a>? It's the future.) That said, I still have legacy sites that run PHP/MySQL and my blog is powered by WordPress. I'm also not too happy with my current web host (my sites fall over whenever I get linked to from somewhere popular) so I've been on the lookout for a new web host for some time. However, <a href="">as I tweeted yesterday</a>, "I hate looking for hosting on the web – it feels like walking through the red light district in Amsterdam – very seedy."</p>
<p><span id="more-3631"></span></p>
<p>Thankfully, one of the cool things about having geeky followers on Twitter is that you have a wealth of valuable knowledge to tap into if you need help from time to time. In Twitter parlance, this is known as #lazyweb. </p>
<p>So, Yesterday, I asked my Twitterverse if they could recommend a good web host for me for a LAMP stack with PHP/MySQL. Here are some of the recommendations I got, in hopes that it might save you some Google-time:</p>
<ul>
<li><a href="http://vps.net">VPS.net</a>: recommended by <a href="http://twitter.com/#!/aexmo/status/29597568473">Alex Morris</a> and <a href="http://twitter.com/#!/JayGreasley/status/29598514622">Jay Greasley</a> – reportedly handled Andy Clarke's Hardboiled HTML5 book/site launch really well and you can start for just £1/day and scale as you like.</li>
<li><a href="http://servage.net">Servage</a> recommended by a UX hero of mine, <a href="http://twitter.com/#!/osteslag/status/29605613780">Joachim Bondo</a>, who says "I’ve been fireballed a few times without any hiccups."</li>
<li><a href="http://mediatemple.com">MediaTemple</a> recommended by <a href="http://twitter.com/#!/_ds/status/29598553516">Dustin Senos</a>, <a href="http://twitter.com/#!/jmlares/status/29597599421">Jessica Lares</a>, <a href="http://twitter.com/#!/fabianv/status/29597918912">Fabian</a>, <a href="http://twitter.com/#!/TrisRoid/status/29598373454">Tristram Bates</a>, and <a href="http://twitter.com/#!/Matt_Lo/status/29605336909">Matt Lo</a>.</li>
<li><a href="http://rackspace.com">Rackspace</a> / <a href="http://rackspacecloud.com">Rackspace Cloud</a> recommended by <a href="http://twitter.com/#!/acidsmile/status/29597660042">Maria T</a>, <a href="http://twitter.com/#!/jamesdevonport/status/29597857196">James Devonport</a>, and <a href="http://twitter.com/#!/steveworkman/status/29599650746">Steve Workman</a> ("great, but expensive").</li>
<li><a href="http://slicehost.com">Slicehost</a> recommended by <a href="http://twitter.com/khaxby/status/29598465217">Kirstie Haxby</a>.</li>
<li><a href="http://linode.com">Linode</a> recommended by <a href="http://twitter.com/#!/pardel/status/29597793338">Paul Ardeleanu</a>, <a href="http://twitter.com/#!/pilky/status/29598974044">Martin Pilkington</a>, and <a href="http://twitter.com/#!/georgioskap/status/29599741523">Georgios Kaperonis</a>.</li>
<li><a href="http://dreamhost.com">Dreamhost</a> recommended by <a href="http://twitter.com/#!/uliwitness/status/29598389131">Uli Kusterer</a> (Pros: "Their admin panel. Great usability w/o having to know much about hosting. Also: support via chat" Cons: "isn't very fast"/"might fall over under load") and <a href="http://twitter.com/#!/bmf/status/29598532419">Mike Lee</a> ("I love them… I've been with them for 13 years and never had a problem or run out of bandwidth. I can't say that of most companies."), <a href="http://twitter.com/#!/isaiah/status/29610721532">Isaiah</a> ("cheap, easy, reliable"), and <a href="http://twitter.com/#!/bdsexton/status/29602955415">Brian Sexton</a> ("usually pretty good"). <a href="http://twitter.com/#!/steveworkman/status/29599650746">Steve Workman</a>: "cheap but not quick". Martin Pilkington doesn't like them, saying "I was with Dreamhost for a while. Good features for the prices, but their uptime was terrible and support mediocre."</li>
<li><a href="http://www.bluehost.com/">Bluehost</a> recommended by <a href="http://twitter.com/#!/isaiah/status/29610721532">Isaiah</a> ("they’re cheap and easy but fall victim to Utah power grid.") and Mark Groves ("impossibly cheap"). [Then again, not sure that "impossibly cheap" is a positive recommendation.]</li>
<li><a href="http://hetzner.de/en/">Hetzner</a> (German, site has English version) recommended by <a href="http://twitter.com/#!/John_A_Clarke/status/29597612138">John Clarke</a>.</li>
<li><a href="http://idologic.com">Idologic</a> recommended by <a href="http://twitter.com/#!/nickkuh/status/29603164377">Nick Kuh</a> ("I've experienced tonnes of different hosting providers and would highly recommend [them] they really know their shit.")</li>
</ul>
<p>Of the recommendations, <a href="http://vps.net">VPS.net</a> looks very alluring. As does <a href="http://servage.net">Servage</a>, <a href="http://mediatemple.com">MediaTemple</a>, and <a href="http://www.rackspacecloud.com/cloud_hosting_products/sites">Rackspace CloudSites</a>. If I wasn't afraid of sys-admin, I would probably consider <a href="http://linode.com">Linode</a> and <a href="http://slicehost.com">Slicehost</a>. </p>
<p>Also interesting, <a href="http://twitter.com/#!/TrisRoid/status/29604510419">as pointed out by Tristram Bates</a>, is <a href="http://www.macminicolo.net/">MacMiniColo.net</a>. They host using Mac Minis as dedicated servers from the US. (Although you're looking at a much higher initial outlay since you need to buy the Mac Mini.)</p>
<p>I hope you find this helpful in narrowing down the field if you're on the hunt for a new web host. If you have any other recommendations (of hosts that you have personally experienced yourself and are happy with), please feel free to leave a comment and share your experiences with the rest of us.</p>
<p><em>Photo courtesy of <a href="http://www.flickr.com/photos/grantlairdjr/8280807/">grantlairdjr via Flickr</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3631/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>Video: Facebook &amp; Twitter security FAIL (&amp; how you can stay safe)</title>
		<link>http://aralbalkan.com/3607</link>
		<comments>http://aralbalkan.com/3607#comments</comments>
		<pubDate>Mon, 25 Oct 2010 19:45:11 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[firesheep]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[sniffing]]></category>
		<category><![CDATA[spoofing]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[wifi]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3607</guid>
		<description><![CDATA[If you're accessing Facebook or Twitter from a public WiFi network at a cafe or some other public setting, anyone on the same network can easily access your account. In fact, today, Eric Butler released a Firefox extension called Firesheep that makes it child's play. In this short video, I show you Eric's extension in [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />If you're accessing Facebook or Twitter from a public WiFi network at a cafe or some other public setting, anyone on the same network can easily access your account. In fact, today, <a href="http://codebutler.com">Eric Butler</a> released <a href="http://codebutler.com/firesheep">a Firefox extension called Firesheep</a> that makes it child's play. <a href="http://www.youtube.com/watch?v=eUyrMVkRTlI">In this short video</a>, I show you Eric's extension in action and also show you how you can protect yourself from such attacks by using the EFF's <a href="https://www.eff.org/https-everywhere">HTTPS Everywhere Firefox extension</a>.</p>
<p><a href="http://www.youtube.com/watch?v=eUyrMVkRTlI">Watch the video.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3607/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
		<item>
		<title>A switch gotcha</title>
		<link>http://aralbalkan.com/3598</link>
		<comments>http://aralbalkan.com/3598#comments</comments>
		<pubDate>Wed, 13 Oct 2010 21:02:01 +0000</pubDate>
		<dc:creator>Aral</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[declaration]]></category>
		<category><![CDATA[expected expression]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[statement]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[unexpected type name]]></category>

		<guid isPermaLink="false">http://aralbalkan.com/?p=3598</guid>
		<description><![CDATA[So here's another one for the eagle-eyed among you. This is a little issue I first ran into a little while ago and it was surprising when I discovered the reason behind it. What's wrong with this code: switch&#40;controlVariable&#41; &#123; case 0: NSInteger x = kSomeConstant; // some other code... break; case 1: // ... [...]]]></description>
			<content:encoded><![CDATA[<p id="top" />So here's another one for the eagle-eyed among you. This is a little issue I first ran into a little while ago and it was surprising when I discovered the reason behind it. </p>
<p>What's wrong with this code:</p>
<p><span id="more-3598"></span></p>
<pre class="objc"><span style="color: #0000ff;">switch</span><span style="color: #002200;">&#40;</span>controlVariable<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
  <span style="color: #0000ff;">case</span> <span style="color: #0000dd;">0</span>:
    NSInteger x = kSomeConstant;
   <span style="color: #ff0000;">// some other code...</span>
   <span style="color: #0000ff;">break</span>;
  <span style="color: #0000ff;">case</span> <span style="color: #0000dd;">1</span>:
   <span style="color: #ff0000;">// ...</span>
<span style="color: #0000ff;">default</span>:
   <span style="color: #ff0000;">// ...</span>
<span style="color: #002200;">&#125;</span></pre>
<p>At first glance, it looks rather kosher. However, you'd get an error along the lines of:</p>
<p><code>Unexpected type name 'NSInteger': expected expression</code></p>
<p>Here's the gotcha gotcha: you must have a statement follow a label and a declaration is not a statement. So, the workaround is to either surround the first case block in curly brackets. e.g.,</p>
<pre class="objc"><span style="color: #0000ff;">case</span> <span style="color: #0000dd;">0</span>:
<span style="color: #002200;">&#123;</span>
    NSInteger x = kSomeConstant;
   <span style="color: #ff0000;">// some other code...</span>
   <span style="color: #0000ff;">break</span>;
<span style="color: #002200;">&#125;</span></pre>
<p>or to put any statement, even if it's an empty one, after the label:</p>
<pre class="objc"><span style="color: #0000ff;">case</span> <span style="color: #0000dd;">0</span>:
  ;
  NSInteger x = kSomeConstant;
  <span style="color: #ff0000;">// some other code...</span>
  <span style="color: #0000ff;">break</span>;</pre>
<p>You can <a href="http://stackoverflow.com/questions/2036819/compile-error-with-switch-expected-expression-before">read more about the issue on this StackOverflow thread.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://aralbalkan.com/3598/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc/2.0/uk/</creativeCommons:license>
	</item>
	</channel>
</rss>

