<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>David Janes&#039; Code Weblog</title>
	<atom:link href="http://code.davidjanes.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://code.davidjanes.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 10 Nov 2013 19:23:27 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0.9</generator>
	<item>
		<title>Pretty Printing JSON in Objective-C</title>
		<link>http://code.davidjanes.com/blog/2013/11/10/pretty-printing-json-in-objective-c/</link>
		<comments>http://code.davidjanes.com/blog/2013/11/10/pretty-printing-json-in-objective-c/#comments</comments>
		<pubDate>Sun, 10 Nov 2013 19:23:27 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[code fragments]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=856</guid>
		<description><![CDATA[Apple&#8217;s JSON serializer NSJSONSerialization &#8211; despite having years to get it right &#8211; makes a horrible hash of pretty printing JSON. It does not sort the keys and it puts backslashes in front of all slashes. SBJson does a much &#8230; <a href="http://code.davidjanes.com/blog/2013/11/10/pretty-printing-json-in-objective-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Apple&#8217;s JSON serializer <code>NSJSONSerialization</code> &#8211; despite having years to get it right &#8211; makes a horrible hash of pretty printing JSON. It does not sort the keys and it puts backslashes in front of all slashes.</p>
<p><a href="https://github.com/stig/json-framework">SBJson</a> does a much nicer job of this. Here&#8217;s a code fragment that will use SBJson if you&#8217;ve linked to it, otherwise it will fall back to Apple&#8217;s code.</p>
<pre>+ (NSString*) formatJSONPretty:(id)_obj
{
    /*
     *  If we are linked with SBJsonWriter, we use those libraries as
     *  it has a much nicer formatter
     */
    id writer = [[NSClassFromString(@"SBJsonWriter") alloc] init];
    if (writer) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
        [writer performSelector:NSSelectorFromString(@"setHumanReadable:") withObject:@YES];
        [writer performSelector:NSSelectorFromString(@"setSortKeys:") withObject:@YES];
        return [writer performSelector:NSSelectorFromString(@"stringWithObject:") withObject:_obj];
#pragma clang diagnostic pop
    }

    NSData* d = [NSJSONSerialization dataWithJSONObject:_obj options:NSJSONWritingPrettyPrinted error:nil];
    return [[NSString alloc] initWithData:d encoding:NSUTF8StringEncoding];
}</pre>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2013/11/10/pretty-printing-json-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Made It</title>
		<link>http://code.davidjanes.com/blog/2013/01/07/i-made-it/</link>
		<comments>http://code.davidjanes.com/blog/2013/01/07/i-made-it/#comments</comments>
		<pubDate>Mon, 07 Jan 2013 12:20:10 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[administrivia]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=847</guid>
		<description><![CDATA[For the foreseeable future, I&#8217;ll be writing at my latest blog &#8220;I Made It&#8220;, where I&#8217;ll be covering DIY, the Internet of Things and my 2013 projects. Please subscribe, follow, etc.!]]></description>
				<content:encoded><![CDATA[<p>For the foreseeable future, I&#8217;ll be writing at my latest blog &#8220;<a href="http://imadeit.davidjanes.com/">I Made It</a>&#8220;, where I&#8217;ll be covering DIY, the Internet of Things and my 2013 projects.</p>
<p>Please subscribe, follow, etc.!</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2013/01/07/i-made-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;MMObility: Why the closing of Glitch matters&#8221;</title>
		<link>http://code.davidjanes.com/blog/2012/11/25/mmobility-why-the-closing-of-glitch-matters/</link>
		<comments>http://code.davidjanes.com/blog/2012/11/25/mmobility-why-the-closing-of-glitch-matters/#comments</comments>
		<pubDate>Sun, 25 Nov 2012 13:29:14 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=839</guid>
		<description><![CDATA[Beau Hindman: On top of all of the wonderful art, music, and hipper-than-hip nods and winks that went on during Glitch&#8217;s run, Tiny Speck released a very robust sandbox that was not all about &#8220;hardcore&#8221; PvP, looting, and griefing other &#8230; <a href="http://code.davidjanes.com/blog/2012/11/25/mmobility-why-the-closing-of-glitch-matters/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img style="float: right; margin: 0 0 10px 10px"  title="glitchgoodbye4" src="http://code.davidjanes.com/blog/wp-content/uploads/2012/11/glitchgoodbye4.jpg" alt="" width="125" height="125" /></a><a href="http://massively.joystiq.com/2012/11/23/mmobility-why-the-closing-of-glitch-matters/">Beau Hindman</a>:</p>
<blockquote><p>On top of all of the wonderful art, music, and hipper-than-hip nods and winks that went on during Glitch&#8217;s run, Tiny Speck released a very robust sandbox that was not all about &#8220;hardcore&#8221; PvP, looting, and griefing other players. It was a sandbox that was first and foremost a journey into a very unique world with elements, characters, and systems we had never seen before. More innovations, please? Glitch delivered innovation in the tired and often angry sandbox gaming genre.</p>
<p>Glitch encouraged players to work together, made combat an occasional and shocking thing (as it should be), brought some of us almost to tears with lore that spoke of alien yet parental love, and gave us choices to do almost anything we wanted with our characters. Even our character&#8217;s sex was unknown. It was up to us to do what we wanted, which is the true reason a sandbox should exist, not just for hardcore PvP that is actually quite unrealistic and silly.</p></blockquote>
<p>I.e. Glitch closed because it provided a game mechanic that the designers wanted but (potential) players didn&#8217;t.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2012/11/25/mmobility-why-the-closing-of-glitch-matters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simperium &#8211; cross platform object synchronization</title>
		<link>http://code.davidjanes.com/blog/2012/08/25/simperium-cross-platform-object-synchronization/</link>
		<comments>http://code.davidjanes.com/blog/2012/08/25/simperium-cross-platform-object-synchronization/#comments</comments>
		<pubDate>Sat, 25 Aug 2012 12:03:14 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[links]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=835</guid>
		<description><![CDATA[Simperium. Cross-platform (including iOS) fine-grained data object sharing. Kinda like iCloud but better? There&#8217;s a video at the link. I don&#8217;t see Android in the list, this seems like something of an oversite. Cost is around 2-4¢/user/month.]]></description>
				<content:encoded><![CDATA[<p><a href="https://simperium.com/">Simperium</a>.</p>
<p>Cross-platform (including iOS) fine-grained data object sharing. Kinda like iCloud but better? There&#8217;s a video at the link.</p>
<p>I don&#8217;t see Android in the list, this seems like something of an oversite.</p>
<p>Cost is around 2-4¢/user/month.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2012/08/25/simperium-cross-platform-object-synchronization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editorial &#8211; How to Save RIM</title>
		<link>http://code.davidjanes.com/blog/2012/06/04/editorial-how-to-save-rim/</link>
		<comments>http://code.davidjanes.com/blog/2012/06/04/editorial-how-to-save-rim/#comments</comments>
		<pubDate>Mon, 04 Jun 2012 10:57:55 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[rim]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=829</guid>
		<description><![CDATA[Apple and IBM are two companies that made successful turnarounds from seemingly fairly desperate situations. Generally the turn arounds were done by a powerful outsider[1] brought to the company, who cut through a Gordian Knot type situation. RIM has two &#8230; <a href="http://code.davidjanes.com/blog/2012/06/04/editorial-how-to-save-rim/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Apple and IBM are two companies that made successful turnarounds from seemingly fairly desperate situations. Generally the turn arounds were done by a powerful outsider[1] brought to the company, who cut through a Gordian Knot type situation.</p>
<p>RIM has two major issues: their hardware and their apps.</p>
<h4>Hardware</h4>
<p>Their hardware lineup is confusing, frequently breaks and uninspired of design and engineering.</p>
<p>When Steve Jobs returned to Apple, he simplified the product line from a jumble of numbered products with overlapping feature sets into 4 four products, based on a 2×2 matrix: inexpensive / expensive × desktop / laptop.</p>
<p>RIM should do something similar, simplifying its hardware line into three or four models easily grasped in purpose:</p>
<ul>
<li><strong>BlackBerry Student / Third World</strong> &#8212; Nokia competitor inexpensive  starter model</li>
<li><strong>BlackBerry Business</strong> &#8212; Keyboard model</li>
<li><strong>BlackBerry Touch</strong> &#8212; Touch Screen model, iPhone / Android competitor</li>
</ul>
<p>And that&#8217;s that. I don&#8217;t know what to do with the PlayBook but unless it supports some critical business function that people buy BlackBerry mobiles for, it should be dropped.</p>
<h4>Apps</h4>
<p>Apps used to be almost impossible to develop cost effectively for BlackBerries due to a plethora of semi-compatible devices and a backwards Java ME development environment. RIM&#8217;s solution &#8212; for the future &#8212; is to allow you to develop in HTML5, C++, Java ME, Android, and Adobe AIR.</p>
<div>Where does this leave us? There is no reason to develop anything for RIM now, as things that run on the old OS are certainly approaching end-of-life; things that run on the new OS BB10 don&#8217;t have a device to deploy to! And what a confusing mess of choices.</div>
<p>What to do?</p>
<p>IMHO Simple: RIM should become (and announce that it is becoming) <strong>the best device to run HTML5 on</strong> it the world. It should hire the best the team of developers to make this happen and make sure that when anyone views a webpage on a BB device, it&#8217;s the best possible experience possible. RIM should provide an environment for security and e-commerce infrastructure that works HTML5 websites &#8212; that can be run on non-BB devices. Add massive and/or intelligent caching in the device to speed things up. Built in jQuery. And so forth.</p>
<p>And it should run on all the BB models above.</p>
<p>And it should drop support for C++, Java ME, Android and Adobe AIR.</p>
<p>[1] it&#8217;s safe to say Steve Jobs had any major favours left  owed to senior Apple management</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2012/06/04/editorial-how-to-save-rim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSURLConnection, ETag and caching</title>
		<link>http://code.davidjanes.com/blog/2012/04/08/nsurlconnection-etag-and-caching/</link>
		<comments>http://code.davidjanes.com/blog/2012/04/08/nsurlconnection-etag-and-caching/#comments</comments>
		<pubDate>Sun, 08 Apr 2012 12:40:19 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[code fragments]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=826</guid>
		<description><![CDATA[If you&#8217;re using NSURLConnection and using If-None-Match/ETag and you&#8217;re depending on getting a 304 status to determine that &#8220;nothing changed&#8221;, make sure you do this: [request setCachePolicy:NSURLRequestReloadIgnoringCacheData]; If you don&#8217;t, after your first request/response cycle, NSURLConnection will start returning status &#8230; <a href="http://code.davidjanes.com/blog/2012/04/08/nsurlconnection-etag-and-caching/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re using <code>NSURLConnection</code> and using <code>If-None-Match</code>/<code>ETag</code> and you&#8217;re depending on getting a <code>304</code> status to determine that &#8220;nothing changed&#8221;, make sure you do this:</p>
<pre>[request setCachePolicy:NSURLRequestReloadIgnoringCacheData];</pre>
<p>If you don&#8217;t, after your first request/response cycle, <code>NSURLConnection</code> will start returning status <code>200</code> instead as it&#8217;s pulling the result from its local cache.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2012/04/08/nsurlconnection-etag-and-caching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes &amp; Missing Files</title>
		<link>http://code.davidjanes.com/blog/2012/02/26/itunes-missing-files/</link>
		<comments>http://code.davidjanes.com/blog/2012/02/26/itunes-missing-files/#comments</comments>
		<pubDate>Sun, 26 Feb 2012 19:45:21 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[macintosh]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=824</guid>
		<description><![CDATA[If you&#8217;re like me and keep your iTunes files on external disks, you&#8217;ll occasionally end up in a situation where the external disk is not available and iTunes ends up marking all your files with an &#8220;exclamation mark&#8221;, indicating they&#8217;re &#8230; <a href="http://code.davidjanes.com/blog/2012/02/26/itunes-missing-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re like me and keep your iTunes files on external disks, you&#8217;ll occasionally end up in a situation where the external disk is not available and iTunes ends up marking all your files with an &#8220;exclamation mark&#8221;, indicating they&#8217;re not available.</p>
<p>To have to do to fix this is hold CTRL+ALT when starting iTunes and it&#8217;ll re-figure everything out.</p>
<p><a href="http://mybiggestcomplaint.com/itunes-aka-the-exclamation-point/439/#comment-5447">Hat tip</a>. </p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2012/02/26/itunes-missing-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>times</title>
		<link>http://code.davidjanes.com/blog/2012/02/02/times/</link>
		<comments>http://code.davidjanes.com/blog/2012/02/02/times/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 00:49:55 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=821</guid>
		<description><![CDATA[Interesting Times is a small, minimalistic, Python library for dealing with time conversions to and from timezones, for once and for all. &#8230; times tries to make working with times and timezones a little less of a clusterfuck and hopefully &#8230; <a href="http://code.davidjanes.com/blog/2012/02/02/times/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="https://github.com/nvie/times#readme">Interesting</a></p>
<blockquote><p>
Times is a small, minimalistic, Python library for dealing with time conversions to and from timezones, for once and for all.<br />
&#8230;<br />
times tries to make working with times and timezones a little less of a clusterfuck and hopefully set a standard of some sort.
</p></blockquote>
<p>See my previous posts on working with <a href="http://code.davidjanes.com/blog/2008/12/22/working-with-dates-times-and-timezones-in-python/">pytz and dateutil</a> (and <a href="http://code.davidjanes.com/blog/2008/12/22/pytz-utcoffset/">also</a>). I&#8217;m looking forward to trying out times.</p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2012/02/02/times/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on Python 3</title>
		<link>http://code.davidjanes.com/blog/2011/12/07/thoughts-on-python-3/</link>
		<comments>http://code.davidjanes.com/blog/2011/12/07/thoughts-on-python-3/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 12:36:03 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=817</guid>
		<description><![CDATA[I&#8217;m learning a new language next year (suggestions welcome). I&#8217;ve totally ignored Python 3 and plan to continue doing so. Read Armin Ronacher on &#8220;Thoughts on Python 3&#8220;. Because as it stands, Python 3 is the XHTML of the programming &#8230; <a href="http://code.davidjanes.com/blog/2011/12/07/thoughts-on-python-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m learning a new language next year (suggestions welcome). I&#8217;ve totally ignored Python 3 and plan to continue doing so. </p>
<p>Read Armin Ronacher on &#8220;<a href="http://lucumr.pocoo.org/2011/12/7/thoughts-on-python3/">Thoughts on Python 3</a>&#8220;.</p>
<blockquote><p>Because as it stands, Python 3 is the XHTML of the programming language world. It&#8217;s incompatible to what it tries to replace but does not offer much besides being more “correct”.</p></blockquote>
<p>Python 3 kills <a href="http://xkcd.com/353/">what makes Python great</a>.  </p>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2011/12/07/thoughts-on-python-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python, Sqlite3, FTS3 &amp; MacOSX</title>
		<link>http://code.davidjanes.com/blog/2011/11/15/python-sqlite3-fts3-macosx/</link>
		<comments>http://code.davidjanes.com/blog/2011/11/15/python-sqlite3-fts3-macosx/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 13:49:24 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[db]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=815</guid>
		<description><![CDATA[If you can&#8217;t load FTS3 on a Mac, this post on StackOverflow tells you how to solve the problem. The final bit of magic is in: from pysqlite2 import dbapi2 as sqlite3]]></description>
				<content:encoded><![CDATA[<p>If you can&#8217;t load FTS3 on a Mac, <a href="http://stackoverflow.com/questions/1545479/force-python-to-forego-native-sqlite3-and-use-the-installed-latest-sqlite3-ver">this post on StackOverflow tells you how to solve the problem</a>.</p>
<p>The final bit of magic is in:</p>
<pre>
from pysqlite2 import dbapi2 as sqlite3
</pre>
<p></p>]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2011/11/15/python-sqlite3-fts3-macosx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
