<?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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>David Janes' Code Weblog</title>
	
	<link>http://code.davidjanes.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 08 Nov 2009 10:58:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</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/DavidJanesCode" type="application/rss+xml" /><feedburner:browserFriendly></feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>How to install Android SDK on your Mac</title>
		<link>http://code.davidjanes.com/blog/2009/11/08/how-to-install-android-sdk-on-your-mac/</link>
		<comments>http://code.davidjanes.com/blog/2009/11/08/how-to-install-android-sdk-on-your-mac/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 10:56:54 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=597</guid>
		<description><![CDATA[I was interested in trying the Android emulators yesterday on my Mac, so here&#8217;s what I did. It&#8217;s much simpler than the documentation makes it out to be:

download and unpack the SDK zip file from http://developer.android.com/sdk/index.html
add the SDK tools directory to your path (in ~/.bashrc):
export PATH=${PATH}:${HOME}/…/android-sdk-mac/tools
start Terminal
run the &#8220;Android SDK and AVD Manager&#8221;:
android &#38;

select Settings [...]]]></description>
			<content:encoded><![CDATA[<p>I was interested in trying the Android emulators yesterday on my Mac, so here&#8217;s what I did. It&#8217;s much simpler than the documentation makes it out to be:</p>
<ul>
<li>download and unpack the SDK zip file from <a href="http://developer.android.com/sdk/index.html">http://developer.android.com/sdk/index.html</a></li>
<li>add the SDK tools directory to your path (in <code>~/.bashrc</code>):<br />
<code>export PATH=${PATH}:${HOME}/…/android-sdk-mac/tools</code></li>
<li>start <strong>Terminal</strong></li>
<li>run the &#8220;Android SDK and AVD Manager&#8221;:<br />
<code>android &amp;</code></p>
<ul>
<li>select <strong>Settings</strong> on the left
<ul>
<li> select <strong>Force https://… sources to be fetched using http://…</strong></li>
</ul>
</li>
<li>select Available Packages on the left
<ul>
<li>select the checkboxes for the various <strong>SDK Platforms</strong></li>
<li>press <strong>Install Selected</strong></li>
</ul>
</li>
</ul>
</li>
<li>make an &#8220;Android Virtual Device&#8221;:<br />
<code>android create avd --target 1 --name david</code></li>
<li>run the emulator (note: it can take minutes to boot):<br />
<code>emulator -avd david</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/11/08/how-to-install-android-sdk-on-your-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Next Generation iPhone to include RFID reader?</title>
		<link>http://code.davidjanes.com/blog/2009/11/08/next-generation-iphone-to-include-rfid-reader/</link>
		<comments>http://code.davidjanes.com/blog/2009/11/08/next-generation-iphone-to-include-rfid-reader/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 10:38:17 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=594</guid>
		<description><![CDATA[This was something I was hoping would be in the 3GS. Rumor: Next generation iPhone to be RFID enabled:
A highly reliable source has informed me that Apple has built some prototypes of the next gen iPhone with an RFID reader built in and they have seen it in action. So its not full NFC but [...]]]></description>
			<content:encoded><![CDATA[<p>This was something I was hoping would be in the 3GS. <a href="http://www.intomobile.com/2009/11/06/rumour-iphone-rfid.html">Rumor: Next generation iPhone to be RFID enabled</a>:</p>
<blockquote><p>A highly reliable source has informed me that Apple has built some prototypes of the next gen iPhone with an RFID reader built in and they have seen it in action. So its not full NFC but its a start for real service discovery and I’m told that the reaction was very positive that we can expect this in the next gen iPhone.</p>
<p>If Apple does it, expect every phone manufacturer and their sister to begin pumping out NFC enabled phones, at least for service discovery and sync.</p>
<p>This just reinforces what we knew based on the two separate patents Apple submitted that had the iPhone enabled to read RFID tags. I’m told that the touch project video and the BT SIG’s specs were all driving forces to push this forward as well as other factors.</p>
<p>Guess I’ll be touching my iPhone to my Mac to link them together to sync iTunes by next year.</p></blockquote>
<p>My thoughts:</p>
<ul>
<li>this will be a game changer for RFID, bringing applications down to the small business and hobbyist layer</li>
<li>RFID + applications is a wicked combination, making the mobile phone an Anything Device; Microsoft, Motorola and RIM should all try to get the jump on this</li>
<li>RFID + in app purchase is a wicked combination; put your thinking cap on for this one</li>
<li>RFID + Augmented Reality makes context sensitive layers start popping up</li>
<li>I&#8217;m not a game person, but you <em>know</em> there&#8217;s got to be gaming implications for this</li>
<li>what are the implications for big chains &#8212; groceries, consumer electronics &#8212; when anyone can walk in the door and get a better price buy waving their phone at a shelf</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/11/08/next-generation-iphone-to-include-rfid-reader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fizz Buzz in one line of Python</title>
		<link>http://code.davidjanes.com/blog/2009/10/24/fizz-buzz-in-one-line-of-python/</link>
		<comments>http://code.davidjanes.com/blog/2009/10/24/fizz-buzz-in-one-line-of-python/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 10:58:30 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[code fragments]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=589</guid>
		<description><![CDATA[Since Libin points to &#8220;Fizz Buzz&#8221; in one line of Ruby, I feel it&#8217;s only fair to do it in one line of Python:
print [ not i % 15 and "Fizz Buzz" or not i % 5 and "Buzz" or not i % 3 and "Fizz" or i for i in xrange(1, 101) ]
My preference [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.libinpan.com/2008/02/fizz-buzz-fizzbuzz/">Since Libin points to &#8220;Fizz Buzz&#8221; in one line of Ruby</a>, I feel it&#8217;s only fair to do it in one line of Python:</p>
<pre>print [ not i % 15 and "Fizz Buzz" or not i % 5 and "Buzz" or not i % 3 and "Fizz" or i for i in xrange(1, 101) ]</pre>
<p>My preference is to really have a few more brackets in there, for clarity but apparently terseness is considered a virtue in and off itself sometimes. There&#8217;s other implementations of this in one line of Python:</p>
<ul>
<li><a href="http://www.sogeti-phoenix.com/Blogs/category/FizzBuzz.aspx">Sogeti Phoenix</a></li>
<li><a href="http://codepad.org/xHBbgcnO">Scaevolus on Codepad</a> &#8211; have a drink before you look at this one</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/10/24/fizz-buzz-in-one-line-of-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>hAtom hits the big time</title>
		<link>http://code.davidjanes.com/blog/2009/10/22/hatom-hits-the-big-time/</link>
		<comments>http://code.davidjanes.com/blog/2009/10/22/hatom-hits-the-big-time/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 19:14:39 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[microformats]]></category>
		<category><![CDATA[semantic web]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=585</guid>
		<description><![CDATA[From the Read/Write Web:
Earlier this year, the Associated Press, together with the Media Standards Trust, introduced hNews, a new microformat for describing news content. HNews allows publishers to easily attach machine-readable news semantics to content on the web. Today, the AP announced the completion of the first draft of hNews. In addition, TownNews, announced that [...]]]></description>
			<content:encoded><![CDATA[<p>From the <a href="http://www.readwriteweb.com/archives/ap_hnews_first_draft_adopted_by_townnews.php">Read/Write Web</a>:</p>
<blockquote><p>Earlier this year, the <a href="http://www.ap.org/">Associated Press</a>, together with the <a href="http://www.mediastandardstrust.org/home.aspx">Media Standards Trust</a>, introduced <a href="http://microformats.org/wiki/hNews">hNews</a>, a new microformat for describing news content. HNews allows publishers to easily attach machine-readable news semantics to content on the web. Today, the AP announced the completion of the first draft of hNews. In addition, <a href="http://townnews.com/">TownNews</a>, <a href="http://townnews.com/articles/2009/10/20/press_release/doc4adc780ca9a49642888412.txt">announced</a> that is will support hNews in its <a href="http://townnews.com/solutions/blox_cms/">BLOX content management system</a>, which is being used by over 1,500 newspapers in the US.</p>
<p>HNews, which is an extension of the hAtom format, only requires content users to specify information about the source organization. In addition, publishers can specify <a href="http://microformats.org/wiki/geo">geo-information</a>, a dateline element, <a href="http://microformats.org/wiki/licensing-brainstorming#item_as_container">license information</a> and <a href="http://microformats.org/wiki/principles-brainstorming#rel-principles_specification">information</a> about the code of ethics that governed the behavior of the author of a given site. At its most basic level, hNews, just like other microformats like hCard or hCalendar, allows search engines spiders to identify and read semantic information that would otherwise be buried within a text and would be hard to identify for search engines.</p></blockquote>
<p>The RRW article then goes on to posit some ideas about this being related to AP&#8217;s efforts to track use of their web content across the web. This strikes me as rather farfetched, as stripping out the microformat tags is beyond trivial. What makes this exciting for me is that it makes it more likely that search engines will start recognizing <a href="http://microformats.org/wiki/hatom">hAtom</a> tags and thus will start properly indexing blogs and other microcontent properly into search engines.</p>
<p>In other exciting hAtom-related news, WordPress 2.7 has the <code><a href="http://codex.wordpress.org/Migrating_Plugins_and_Themes_to_2.7#Post_Classes">post_class</a></code> function to allow (new) templates to automatically include the <code>hentry</code> tag on blog posts! Also see the <a href="http://www.smashingmagazine.com/2009/10/20/10-useful-wordpress-hacks-for-advanced-themes/">Smashing Magazine article on this</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/10/22/hatom-hits-the-big-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UIPageControl + UIScrollView</title>
		<link>http://code.davidjanes.com/blog/2009/09/26/uipagecontrol-uiscrollview/</link>
		<comments>http://code.davidjanes.com/blog/2009/09/26/uipagecontrol-uiscrollview/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 12:58:22 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[code fragments]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=578</guid>
		<description><![CDATA[This is an example of how to combine a UIPageControl and a UIScrollView together to create a &#8220;snap to page&#8221;-like effect that is seen on the iPhone&#8217;s home screen. This sample is partially based on Apple&#8217;s UIPageControl example.

XCode Sample Project
]]></description>
			<content:encoded><![CDATA[<p>This is an example of how to combine a <a href="http://code.davidjanes.com/examples/2009-09-26/Scrolling.zip">UIPageControl</a> and a <a href="http://developer.apple.com/IPhone/library/documentation/UIKit/Reference/UIScrollView_Class/Reference/UIScrollView.html">UIScrollView</a> together to create a &#8220;snap to page&#8221;-like effect that is seen on the iPhone&#8217;s home screen. This sample is partially based on <a href="https://developer.apple.com/iphone/library/samplecode/PageControl/index.html">Apple&#8217;s UIPageControl example</a>.
</p>
<p><strong><a href="http://code.davidjanes.com/examples/2009-09-26/Scrolling.zip">XCode Sample Project</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/09/26/uipagecontrol-uiscrollview/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Travel Websites &amp; Web 3.0</title>
		<link>http://code.davidjanes.com/blog/2009/08/10/travel-websites-web-3-0/</link>
		<comments>http://code.davidjanes.com/blog/2009/08/10/travel-websites-web-3-0/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 19:53:24 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[Discover Anywhere Mobile]]></category>
		<category><![CDATA[ideas]]></category>
		<category><![CDATA[semantic web]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=574</guid>
		<description><![CDATA[On my Discover Anywhere Mobile blog, I&#8217;ve posted a list of recommendations about how travel websites can use information to extend their reach.
]]></description>
			<content:encoded><![CDATA[<p>On my Discover Anywhere Mobile blog, <a href="http://www.discoveranywheremobile.com/blog/travel-websites-and-web-3-0/">I&#8217;ve posted a list of recommendations</a> about how travel websites can use information to extend their reach.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/08/10/travel-websites-web-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RIM Application Development</title>
		<link>http://code.davidjanes.com/blog/2009/07/01/rim-application-development/</link>
		<comments>http://code.davidjanes.com/blog/2009/07/01/rim-application-development/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 15:07:26 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[Discover Anywhere Mobile]]></category>
		<category><![CDATA[rim]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=566</guid>
		<description><![CDATA[The Boy Genius wrote a blog post on the state of RIM BlackBerry application development this morning that&#8217;s getting more than a little traction:
One word is where RIM fails so miserably it isn’t even imaginable: software.
You have to look at the big picture here… for what RIM is working with (an incredibly miserable Java OS [...]]]></description>
			<content:encoded><![CDATA[<p>The Boy Genius <a href="http://www.boygeniusreport.com/2009/06/30/what-happened-to-research-in-motion-and-where-are-they-going/">wrote a blog post on the state of RIM BlackBerry application development</a> this morning that&#8217;s getting more than a little traction:</p>
<blockquote><p>One word is where RIM fails so miserably it isn’t even imaginable: software.</p>
<p>You have to look at the big picture here… for what RIM is working with (an incredibly miserable Java OS with so much security and encryption and smoke-blowing APIs) they’ve hit the jackpot. Their OS architecture is fantastic, their use of security is what makes them so trustworthy. But, as each handset release comes closer and closer, people start to see the bigger picture. And that’s the fact that RIM’s OS is more than antiquated, it’s borderline laughable. But it works, you’re thinking, so what’s wrong? I’ve been saying this for years, but it wasn’t designed to do anything the BlackBerry does now. Imagine scotch taping car parts to a 200hp engine and see how far that gets you. Obviously, it’s just a viciously rough metaphor, but we believe a correct one.</p>
<p>There’s so many limitations to RIM’s OS, and even RIM’s data network that it offsets all the wonderful things they’ve managed to accomplish. Remember when people were so excited over leaked shots of OS 4.6 and I said somewhere it was just a theme? Well, was I wrong? Oh, look! OS 5.0! What changed? 99% nothing. Some functionality is added here and there, but the mobile phone landscape has changed so drastically in the last two years, that RIM, admittedly known to planning “three years out” looks to be unable to see the proper direction to head.</p>
<p>You can throw $1,000,000,000 at developers but you won’t get any if your OS, tools, and documentation are so bad, and that’s really in the end a lot of what I’m getting at. I was laying in bed at around 3AM early one morning recently, looking through the iPhone App Store and I came across EA’s Tiger Woods Golf. $4.99, why not? Wait, it’s 150MB? Wow, it must be good. I clicked purchase and literally 4 minutes later, Tiger Woods was installed and up on my screen. Granted I was on a high-speed Wi-Fi connection, but it made me realize more than ever that RIM has the most uphill battle of their lifetimes. When a BlackBerry application over 500k is considered “large”, something’s wrong. When TweetGenius is one of the first BlackBerry applications to do fun, unique things like transparent overlays, consistent shortcuts, and a straight forward UI, something is wrong.</p>
<p>The reason why this is so frustrating to me and I’m guessing many is because RIM literally almost has it all. They’ve got it! They are 90% there but that last 10% has become the most important. If you take Apple for example, and see their shortcomings, and then what they’ve done to fix them, it’s remarkable. It’s a completely different DNA than RIM’s but it’s working. In two years Apple has practically matched Research In Motion in almost every consumer area while having the most advanced mobile operating system with the most advanced mobile SDK on the planet. If Apple can do this in just two years and RIM has stood still, no one thinks that’s a problem?</p></blockquote>
<p><a href="http://blogs.zdnet.com/BTL/?p=20548">Larry Dignan of ZDNet chimes in</a> (I suspect he was going to the iPhone anyway):</p>
<blockquote><p>The BlackBerry operating system issue struck home for me while on vacation. My Storm was my only ramp to the Web. Under stress and heavy usage the BlackBerry OS was clearly struggling. You could almost feel it choke when switching between apps, browsing and handling basic tasks. The interface was fine, but under the hood something is off.</p>
<p>Will these OS limitations affect my next phone choice when my Verizon Wireless contract is up? Possibly. The device is only 25 percent of the smartphone game these days. The operating system is everything. Apple gets it. Palm gets it. Google gets it. I’m not sure that Microsoft gets it. For RIM, it remains to be seen if the company gets OS religion.</p>
<p>For my next phone, I’ll be buying and OS instead of a device. If the iPhone comes to Verizon Wireless it’s most likely a no-brainer for me. I have more than a year to see if Palm’s Pre and WebOS is the real deal. Even the Motorola Android devices may hold promise for me. My last phone choice was basically an escape from Windows Mobile. If RIM doesn’t get its OS strategy together I may ditch the BlackBerry too. All I really need is to browse and tether to my laptop as a wireless card on a good network.</p></blockquote>
<p>The real power behind the RIM brand is all the relationships they&#8217;ve built with communication providers and lock-in to the IT departments in business and government around the world. That said, there is a medium term danger that RIM is going to be undermined from the bottom by consumer-friendly devices such as the iPhone, in the same way that the PC undermined big iron&#8217;s lock on the enterprise market in the 80&#8217;s and 90&#8217;s.</p>
<p><a href="http://www.discoveranywheremobile.com/">I&#8217;m actively developing for the BlackBerry right now</a> and I have to say it&#8217;s a struggle:</p>
<ul>
<li>setup of the development environment is non-obvious and fragmented</li>
<li>it requires Windows; the cool kids are using Linux &amp; Mac</li>
<li>documentation is wildly incomplete and basically incorrect, since there&#8217;s so many references to obsolete technology</li>
<li>how to transfer &#8220;normal&#8221; programming skills into the RIM environment is entirely non-obvious; <a href="http://groups.google.ca/group/toronto-iphone-developers/browse_thread/thread/f2533ad9ddecaeae?hl=en">it&#8217;s difficult even to figure out whether one can talk about there being a filesystem on the device</a></li>
<li>Java ME is garbage. Yes, I went there.</li>
</ul>
<p>My current application approach is to create an entirely self contained browser application and bypass almost all RIM UI features. We should know soon whether this is a sane approach (I may open source this code if there&#8217;s interest).</p>
<p>Update: <a href="http://saunderslog.com/2009/07/01/rim-and-nokia-need-a-manhattan-project-that-is/">Alec Saunders of Calliflower adds comments about Nokia</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/07/01/rim-application-development/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How iPhone OS 3.0 delivers location services</title>
		<link>http://code.davidjanes.com/blog/2009/06/27/how-iphone-os-30-delivers-location-services/</link>
		<comments>http://code.davidjanes.com/blog/2009/06/27/how-iphone-os-30-delivers-location-services/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 11:38:40 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[iphone]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=563</guid>
		<description><![CDATA[Alec Saunders has a seriously cool article on his blog about how your iPhone knows where it is. I got to experience how well this works yesterday when we used TimmyMe in the McCowan Road/Ellesmere Avenue neighborhood to grab a coffee pre-meeting:

Many folks assume that iPhone’s location services are GPS based.  In fact, they’re [...]]]></description>
			<content:encoded><![CDATA[<p>Alec Saunders has a <a href="http://saunderslog.com/2009/06/26/skyhook-how-iphone-os-3-0-delivers-location-services/">seriously cool article on his blog</a> about how your iPhone knows where it is. I got to experience how well this works yesterday when we used <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=285921640&#038;mt=8">TimmyMe</a> in the <a href="http://maps.google.ca/maps?hl=en&#038;safe=off&#038;ie=UTF8&#038;cd=1&#038;geocode=FSRNnAIdH-JG-w&#038;split=0&#038;sll=49.891235,-97.15369&#038;sspn=16.71875,56.536561&#038;ll=43.772783,-79.251809&#038;spn=0.01427,0.033023&#038;z=16">McCowan Road/Ellesmere Avenue neighborhood</a> to grab a coffee pre-meeting:</p>
<blockquote><p>
Many folks assume that iPhone’s location services are GPS based.  In fact, they’re not.  [...]</p>
<p>Skyhook’s innovation is to augment that with WiFi hotspot locations.  Why WiFi? It can be wonderfully accurate, to within 30 to 60 feet, or 10 to 20m which is roughly the same as GPS.  WiFi can establish a fix within less than a second.  And, WiFi is not vulnerable to overhead obstructions, so it can be used indoors. </p>
<p>Skyhook’s technology relies on a database of WiFi access points in over 2,000 cities (and growing).  Much like Google, they use vehicles to drive cities, and using a laptop in the vehicle, they chart the location of WiFi access points.  <strong>In addition, on iPhone as users use the mapping application, new locations and newly discovered WiFi access points are automatically added to the database.  It’s a kind of automated crowdsourcing, based on usage</strong>.
</p></blockquote>
<p>My emphasis on that last sentence. Very cool.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/06/27/how-iphone-os-30-delivers-location-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discover Anywhere Mobile</title>
		<link>http://code.davidjanes.com/blog/2009/06/24/discover-anywhere-mobile/</link>
		<comments>http://code.davidjanes.com/blog/2009/06/24/discover-anywhere-mobile/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 12:45:47 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[Discover Anywhere Mobile]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=561</guid>
		<description><![CDATA[OK, it&#8217;s time to officially unveil my new company: Discover Anywhere Mobile. We&#8217;re creating mobile guides for the tourism and hospitality sector, and similar products for advanced store locators, conference guides, etc.. Platform-wise, we&#8217;re creating iPhone &#38; BlackBerry applications, and then a mobile web browser version to catch other devices. Our belief is that over [...]]]></description>
			<content:encoded><![CDATA[<p>OK, it&#8217;s time to officially unveil my new company: <strong><a href="http://www.discoveranywheremobile.com/">Discover Anywhere Mobile</a></strong>. We&#8217;re creating mobile guides for the tourism and hospitality sector, and similar products for advanced store locators, conference guides, etc.. Platform-wise, we&#8217;re creating iPhone &amp; BlackBerry applications, and then a mobile web browser version to catch other devices. Our belief is that over the next three years this is going to be <em>the way</em> tourists and travelers consume information &#8211; they want everything in the palm of their hands. Why would you want to carry a tour guide book with you anymore?</p>
<p>Note, and this is important, that <strong>we are not a content company</strong>. Our target clients are <a href="http://en.wikipedia.org/wiki/Destination_Marketing_Organisation">Destination Marketing Organizations</a> (DMOs), festival &amp; event organizers, large corporations, and so forth. We will write apps on their behalf using their data and the app will be released under their names. Discover Anywhere Mobile will handle all the bolts and nuts of making this happen: importing &amp; managing data, creating &amp; customizing apps, updating user&#8217;s apps, look &amp; feel, etc.. DMOs provide the marketing and data, we provide the infrastucture and services to make it all happen.</p>
<p>Here&#8217;s the start of our official blurb:</p>
<blockquote><p>
Discovery Anywhere Mobile creates customizable mobile travel guide applications for Destination Management Organizations. Discover Anywhere Mobile can quickly and cost effectively compile your DMO’s event and listing information into mobile applications for the iPhone, BlackBerry and mobile web browsers. Applications created with Discover Anywhere Mobile’s services will meet traveler’s need for concise, relevant, timely destination information at the exact time and place they need it most – at your destination.
</p></blockquote>
<p><a href="http://www.discoveranywheremobile.com/">Go to our website and read more</a>, and if you have your own site, please provide a link!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/06/24/discover-anywhere-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lack of posting</title>
		<link>http://code.davidjanes.com/blog/2009/06/06/lack-of-posting/</link>
		<comments>http://code.davidjanes.com/blog/2009/06/06/lack-of-posting/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 10:52:54 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[administrivia]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=559</guid>
		<description><![CDATA[Sorry for the lack of posting &#8211; I&#8217;m busy applying my ideas rather than coming up with new ones ;-)
]]></description>
			<content:encoded><![CDATA[<p>Sorry for the lack of posting &#8211; I&#8217;m busy <em>applying</em> my ideas rather than coming up with new ones ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/06/06/lack-of-posting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Coffee &amp; iPhone IV</title>
		<link>http://code.davidjanes.com/blog/2009/04/22/coffee-iphone-iv/</link>
		<comments>http://code.davidjanes.com/blog/2009/04/22/coffee-iphone-iv/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 21:12:24 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=553</guid>
		<description><![CDATA[We&#8217;ll be holding the next Coffee &#38; iPhone tomorrow between 4 and 6p again at the Dark Horse Cafe, 215 Spadina Avenue for Coffee and iPhone.

What: Coffee &#38; iPhone
When: Thursday, April 23 from 4 &#8211; 6p
Where: Dark Horse Cafe, 215 Spadina Avenue (at Sullivan Street)


]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ll be holding the next Coffee &amp; iPhone tomorrow between <strong>4 and 6p </strong>again at the Dark Horse Cafe, 215 Spadina Avenue for Coffee and iPhone.</p>
<ul>
<li>What: Coffee &amp; iPhone</li>
<li>When: Thursday, April 23 from <strong>4 &#8211; 6p</strong></li>
<li>Where: Dark Horse Cafe, <a href="http://maps.live.com/#JndoZXJlMT0yMTUrU3BhZGluYStBdmVudWUlMmMrVG9yb250bytPTiZiYj01NS4xMjg2NDkwNjg0ODg4JTdlLTQwLjg2OTE0MDYyNSU3ZTI5LjUzNTIyOTU2Mjk0ODUlN2UtMTE3Ljg2MTMyODEyNQ==">215 Spadina Avenue</a> (at Sullivan Street)</li>
</ul>
<p><a href="http://maps.live.com/default.aspx?v=2&amp;cp=43.65071~-79.39703&amp;lvl=15&amp;style=r&amp;sp=aN.43.65073_-79.39656_Dark%2520Horse%2520Cafe_&amp;mkt=en-us&amp;FORM=LLWR"><img class="alignnone" title="Dark Horse Cafe" src="http://www.joeydevilla.com/wordpress/wp-content/uploads/2009/04/map687f6e2ed2f3.jpg" alt="" width="390" height="292" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/04/22/coffee-iphone-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coffee and iPhone tomorrow!</title>
		<link>http://code.davidjanes.com/blog/2009/04/15/coffee-and-iphone-tomorrow/</link>
		<comments>http://code.davidjanes.com/blog/2009/04/15/coffee-and-iphone-tomorrow/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 18:11:22 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=546</guid>
		<description><![CDATA[Join myself, Blake, Wayne (and more!) tomorrow between 4 and 6p at the Dark Horse Cafe, 215 Spadina Avenue (just north of Queen) for Coffee and iPhone. Bring your MacBook, your iPod, your iPod Touch or just yourself and we&#8217;ll talk all things iPhone and mobile.

What: Coffee &#38; iPhone
When: Thursday, April 16 from 4 &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Join myself, <a href="http://twitter.com/bwinton">Blake</a>, <a href="http://twitter.com/bunnyhero">Wayne</a> (and more!) tomorrow between <strong>4 and 6p </strong>at the Dark Horse Cafe, 215 Spadina Avenue (just north of Queen) for Coffee and iPhone. Bring your MacBook, your iPod, your iPod Touch or just yourself and we&#8217;ll talk all things iPhone and mobile.</p>
<ul>
<li>What: Coffee &amp; iPhone</li>
<li>When: Thursday, April 16 from <strong>4 &#8211; 6p</strong></li>
<li>Where: Dark Horse Cafe, <a href="http://maps.live.com/#JndoZXJlMT0yMTUrU3BhZGluYStBdmVudWUlMmMrVG9yb250bytPTiZiYj01NS4xMjg2NDkwNjg0ODg4JTdlLTQwLjg2OTE0MDYyNSU3ZTI5LjUzNTIyOTU2Mjk0ODUlN2UtMTE3Ljg2MTMyODEyNQ==">215 Spadina Avenue</a> (at Sullivan Street)</li>
</ul>
<p><a href="http://maps.live.com/default.aspx?v=2&amp;cp=43.65071~-79.39703&amp;lvl=15&amp;style=r&amp;sp=aN.43.65073_-79.39656_Dark%2520Horse%2520Cafe_&amp;mkt=en-us&amp;FORM=LLWR"><img class="alignnone" title="Dark Horse Cafe" src="http://www.joeydevilla.com/wordpress/wp-content/uploads/2009/04/map687f6e2ed2f3.jpg" alt="" width="390" height="292" /></a></p>
<p>At the last <a href="http://code.davidjanes.com/blog/2009/04/01/coffee-and-iphone/">Coffee &amp; iPhone</a> we had the following attendees:</p>
<ul>
<li><a href="http://code.davidjanes.com/blog/">David Janes</a> @<a href="http://twitter.com/dpjanes">dpjanes</a></li>
<li><a href="http://www.xinsight.ca/bignames/">Jason Moore</a> @<a href="http://twitter.com/xinsight">xinsight</a></li>
<li><a href="http://bunnyhero.org/">wayne a. lee (bunnyhero)</a> @<a href="http://twitter.com/bunnyhero">bunnyhero</a></li>
<li>Lin Zhou @<a href="http://twitter.com/remixnine">remixnine</a></li>
<li>Darren Baptiste @<a href="http://twitter.com/darrenbaptiste">darrenbaptiste</a></li>
<li><a href="http://bwinton.latte.ca/">Blake Winton</a> @<a href="http://twitter.com/bwinton">bwinton</a></li>
</ul>
<p>Note that this is the <strong>day before</strong> <a href="http://www.joeydevilla.com/2009/04/15/dark-horse-cafe-on-spadina-now-open-coffee-and-code-at-the-spadina-dark-horse-this-friday/">Joey&#8217;s Coffee &amp; Code, at the same location</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/04/15/coffee-and-iphone-tomorrow/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Coffee and iPhone</title>
		<link>http://code.davidjanes.com/blog/2009/04/01/coffee-and-iphone/</link>
		<comments>http://code.davidjanes.com/blog/2009/04/01/coffee-and-iphone/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 14:58:57 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=539</guid>
		<description><![CDATA[Join myself, Blake, Wayne and more tomorrow between 1 and 3pm at the Lettieri Cafe at 581 Bloor West (at the corner with Bathurst) for &#8220;Coffee and iPhone&#8221;. Bring your MacBook and we&#8217;ll talk all things iPhone development.
View Larger Map
]]></description>
			<content:encoded><![CDATA[<p>Join myself, <a href="http://twitter.com/bwinton">Blake</a>, <a href="http://twitter.com/bunnyhero">Wayne</a> and more tomorrow between 1 and 3pm at the Lettieri Cafe at 581 Bloor West (at the corner with Bathurst) for &#8220;Coffee and iPhone&#8221;. Bring your MacBook and we&#8217;ll talk all things iPhone development.</p>
<p><iframe width="800px" height="400" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=103834554841583072791.0004667f6ef4c663e94fe&amp;ll=43.664866,-79.412336&amp;spn=0.013846,0.033045&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps/ms?hl=en&amp;ie=UTF8&amp;msa=0&amp;msid=103834554841583072791.0004667f6ef4c663e94fe&amp;ll=43.664866,-79.412336&amp;spn=0.013846,0.033045&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/04/01/coffee-and-iphone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Three20 Project: Photo viewer and more for the iPhone</title>
		<link>http://code.davidjanes.com/blog/2009/03/27/the-three20-project-photo-viewer-and-more-for-the-iphone/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/27/the-three20-project-photo-viewer-and-more-for-the-iphone/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 09:59:38 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[ideas]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=537</guid>
		<description><![CDATA[This code could be very useful for iPhone developers:
The name of the new project is Three20, after the 320-pixel-wide screen of the iPhone.  The code is all hosted on github for your cloning pleasure. There is an excellent sample app called TTCatalog which lets you play with all of the various UI components. Documentation? [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://joehewitt.com/post/the-three20-project/">This code could be very useful for iPhone developers</a>:</p>
<p style="padding-left: 30px;">The name of the new project is <a href="http://github.com/joehewitt/three20/">Three20</a>, after the 320-pixel-wide screen of the iPhone.  The code is all <a href="http://github.com/joehewitt/three20/">hosted on github</a> for your cloning pleasure. There is an excellent sample app called TTCatalog which lets you play with all of the various UI components. Documentation? Well&#8230; there are instructions for how to add Three20 to your project, but I am still working on comprehensive documentation for each of the classes. For now, the sample app and the code itself are your documentation.</p>
<p>The projects are:</p>
<ul>
<li>Photo viewer</li>
<li>Message composer</li>
<li>Web image views</li>
<li>Internet-aware table view</li>
<li>Better text fields (including type-ahead)</li>
<li>HTTP disk cache</li>
<li>URL-based navigation (this could be interesting)</li>
</ul>
<p>The <a href="http://github.com/joehewitt/three20/tree/master">source base</a> is under the <a href="http://github.com/joehewitt/three20/blob/439391ea117605ccfe83f29794372d63bfd78a63/LICENSE">Apache license</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/27/the-three20-project-photo-viewer-and-more-for-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to: create a MySQL database and user</title>
		<link>http://code.davidjanes.com/blog/2009/03/26/how-to-create-a-mysql-database-and-user/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/26/how-to-create-a-mysql-database-and-user/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 11:02:47 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[db]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=534</guid>
		<description><![CDATA[I always seem to forget this:
$ mysql -u root -p
Enter password: enter mysql-root-user passwd
mysql&#62; CREATE DATABASE DATABASENAME
mysql&#62; GRANT ALL PRIVILEGES ON DBNAME.* to "DBUSER"@"localhost" IDENTIFIED BY "DBPASSWORD";
mysql&#62; FLUSH PRIVILEGES;
mysql&#62; EXIT
$
]]></description>
			<content:encoded><![CDATA[<p>I always seem to forget this:</p>
<pre>$ <strong>mysql -u root -p</strong>
Enter password: <em>enter mysql-root-user passwd</em>
mysql&gt; <strong>CREATE DATABASE <em>DATABASENAME</em></strong>
mysql&gt; <strong>GRANT ALL PRIVILEGES ON <em>DBNAME</em>.* to "<em>DBUSER</em>"@"localhost" IDENTIFIED BY "<em>DBPASSWORD</em>";</strong>
mysql&gt; <strong>FLUSH PRIVILEGES;</strong>
mysql&gt; <strong>EXIT</strong>
$</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/26/how-to-create-a-mysql-database-and-user/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone How To: create a Simple Table</title>
		<link>http://code.davidjanes.com/blog/2009/03/23/iphone-how-to-create-a-simple-table/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/23/iphone-how-to-create-a-simple-table/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 13:08:59 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[code fragments]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=530</guid>
		<description><![CDATA[If you have not created a XIB, do the following:

select Resources in the Interface Building
press ⌘N
select User Interfaces in iPhone OS
select View XIB &#8230; and create in the normal way

To create the Simple Table in the Interface Builder

open the XIB in Resources
drag the Table View from the Library to the View &#8230; it should resize [...]]]></description>
			<content:encoded><![CDATA[<p>If you have not created a XIB, do the following:</p>
<ul>
<li>select <strong>Resources</strong> in the Interface Building</li>
<li>press <strong>⌘N</strong></li>
<li>select <strong>User Interfaces</strong> in <strong>iPhone OS</strong></li>
<li>select <strong>View XIB</strong> &#8230; and create in the normal way</li>
</ul>
<p>To create the Simple Table in the Interface Builder</p>
<ul>
<li>open the XIB in Resources</li>
<li>drag the <strong>Table View</strong> from the <strong>Library</strong> to the View &#8230; it should resize to the full extent of the View</li>
<li>select the <strong>Table View</strong> object and press <strong>⌘2</strong></li>
<li>from the <strong>Outlets</strong> section, drag
<ul>
<li><strong>dataSource</strong> to <strong>File&#8217;s Owner</strong></li>
<li><strong>delegate</strong> to <strong>File&#8217;s Owner</strong></li>
</ul>
</li>
<li>save</li>
</ul>
<p>Make your <code><em>Controller</em>.h</code> a data source and delegate for the table:</p>
<pre>@interface ThemesController : UIViewController
<strong>&lt;UITableViewDelegate, UITableViewDataSource&gt;</strong>
{
}</pre>
<p>Add the following basic code to the <code><em>Controller</em>.m</code> file:</p>
<pre>#pragma mark -
#pragma mark Table View Data Source Methods

- (NSInteger) tableView:(UITableView*) tableView numberOfRowsInSection:(NSInteger) section
{
  return  <strong>... the number of rows ...</strong>;
}

- (UITableViewCell*) tableView:(UITableView*) tableView
  cellForRowAtIndexPath:(NSIndexPath*) indexPath
{
  static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";

  UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];
  if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero
      reuseIdentifier: SimpleTableIdentifier] autorelease];
  } 

  NSUInteger row = [indexPath row];
  cell.text = <strong>... an NSString containing what to display for row row ...</strong>;
  // cell.image = [UIImage imageNamed:@"star.png"];

  return  cell;
}

#pragma mark -
#pragma mark Table Delegate Methods

- (void) tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
}</pre>
<p>Compile and run.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/23/iphone-how-to-create-a-simple-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone How To: load a plist</title>
		<link>http://code.davidjanes.com/blog/2009/03/23/how-to-load-a-plist-in-an-iphone-application/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/23/how-to-load-a-plist-in-an-iphone-application/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 11:46:18 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[code fragments]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=525</guid>
		<description><![CDATA[Property Lists &#8211; plists &#8211; are a standard way of storing data in iPhone and MacOS programs. Here&#8217;s how you use them on the iPhone.
Add this code to Controller.m to populate member listData with the data from plist dwarves.plist:
- (void) viewDidLoad
{
	NSBundle* bundle = [NSBundle mainBundle];
	NSString* plistPath = [bundle pathForResource:@"dwarves" ofType:@"plist"];

	NSArray* dwarves = [[NSArray alloc] initWithContentsOfFile:plistPath];
	self.listData [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Property_list">Property Lists</a> &#8211; plists &#8211; are a standard way of storing data in iPhone and MacOS programs. Here&#8217;s how you use them on the iPhone.</p>
<p>Add this code to <code>Controller.m</code> to populate member <code>listData</code> with the data from plist <code>dwarves.plist</code>:</p>
<pre>- (void) viewDidLoad
{
	NSBundle* bundle = [NSBundle mainBundle];
	NSString* plistPath = [bundle pathForResource:@"<strong>dwarves</strong>" ofType:@"plist"];

	<strong>NSArray</strong>* dwarves = [[<strong>NSArray</strong> alloc] initWithContentsOfFile:plistPath];
	self.listData = dwarves;
	[dwarves release];	

	[super viewDidLoad];
}</pre>
<p>To create the plist:</p>
<ul>
<li>open and select the <strong>Resources</strong> folder in Interface Builder</li>
<li>right-click and select <strong>Add &gt; New File&#8230;</strong></li>
<li>select <strong>Other</strong> in the popup (at the bottom)</li>
<li>select the <strong>Property List</strong> icon and then press the <strong>Next</strong> button</li>
<li>choose your name and <strong>Finish</strong></li>
</ul>
<p>To edit the plist:</p>
<ul>
<li>select it in the <strong>Resources</strong> Folder</li>
<li>right-click and select <strong>Open with Finder</strong></li>
</ul>
<p>Make sure:</p>
<ul>
<li>the name of the plist in the code (<code>dwarves</code>) is the same as the plist you created</li>
<li>the type of the plist in the code (<code>NSArray</code>) is the same as the plist you created &#8211; by default it is actually <code>NSDictionary</code>, which is the other common option</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/23/how-to-load-a-plist-in-an-iphone-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AUAPI: how to encode geographic location</title>
		<link>http://code.davidjanes.com/blog/2009/03/13/auapi-how-to-encode-geographic-location/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/13/auapi-how-to-encode-geographic-location/#comments</comments>
		<pubDate>Fri, 13 Mar 2009 12:55:43 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[auapi]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=520</guid>
		<description><![CDATA[Geographic location is a little more problematic to encode than other data types we&#8217;ve looked at for the Almost Universal API. The issue is that standards for adding geographic information are either overly complicated or they encode information in a hard-to-use-from-JSON manner.
Using GeoRSS
GeoRSS provides two ways (well, way more I&#8217;m sure) of adding geographic point [...]]]></description>
			<content:encoded><![CDATA[<p>Geographic location is a little more problematic to encode than other data types we&#8217;ve looked at for the <a href="http://code.davidjanes.com/blog/2009/02/27/introducing-the-almost-universal-api/">Almost Universal API</a>. The issue is that standards for adding geographic information are either overly complicated or they encode information in a hard-to-use-from-JSON manner.</p>
<h4>Using GeoRSS</h4>
<p><a href="http://georss.org/">GeoRSS</a> provides two ways (well, way more I&#8217;m sure) of adding geographic point information to a blog post (which is essentially the same as AUAPI item). From the webpage:</p>
<pre>&lt;georss:point&gt;45.256 -71.92&lt;/georss:point&gt;</pre>
<p>which would be encoded as:</p>
<pre class="result">{
 "georss:point" : "45.256 -71.92"
}</pre>
<p>and</p>
<pre>&lt;georss:where&gt;
   &lt;gml:Point&gt;
      &lt;gml:pos&gt;45.256 -71.92&lt;/gml:pos&gt;
   &lt;/gml:Point&gt;
&lt;/georss:where&gt;</pre>
<p>which would be encoded as:</p>
<pre class="result">{
 "georss:where" : {
  "gml:Point" : {
   "gml:pos" : "45.256 -71.92",
  }
 }
}</pre>
<p>Neither of these look particularly satisfying because the lat/lon is encoded as a string. We could encode as an array of numbers, but then we have to write a custom transcriber for converting to XML.</p>
<h4>Using hCard</h4>
<p>Another option would be to use the geo.latitude, geo.longitude attributes in hCard. Unfortunately, hCard requires elements such as FN and in general imply that we are talking about a person or organization, so this isn&#8217;t really satisfying either.</p>
<h4>How AUAPI recommends geographic information should be encoded</h4>
<pre>
'geo': {
   'latitude': 34.743763,
   'longitude': -86.572568
}
</pre>
<p>This in fact, is exactly the microformat&#8217;s <a href="http://microformats.org/wiki/geo">geo</a> standard.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/13/auapi-how-to-encode-geographic-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PortableContacts and the Atom syndication standard</title>
		<link>http://code.davidjanes.com/blog/2009/03/03/portablecontacts-and-the-atom-syndication-standard/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/03/portablecontacts-and-the-atom-syndication-standard/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 11:56:57 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[auapi]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=515</guid>
		<description><![CDATA[Thanks to Kevin Marks, I&#8217;ve just stumble onto the Portable Contacts effort. They seem to have thought quite a bit about the hCard/vCard serialization issue. I&#8217;ve added my two bits, in particular making the claim that they should consider making there proposal more compatible with existing consumers and infrastructure by piggybacking on top of the [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to <a href="http://epeus.blogspot.com/">Kevin Marks</a>, I&#8217;ve just stumble onto the <a href="http://portablecontacts.net/">Portable Contacts</a> effort. They seem to have thought quite a bit about the <a href="http://code.davidjanes.com/blog/2009/03/02/auapi-encoding-hcards-in-json/">hCard/vCard serialization issue</a>. I&#8217;ve added my two bits, in particular making the claim that they should consider making there proposal more compatible with existing consumers and infrastructure by piggybacking on top of the <a href="http://atomenabled.org/developers/syndication/">Atom syndication format</a>, rather than requiring PC consumers to redevelop all this infrastructure around their format. This, in essence, is what the Almost Universal API idea is about.</p>
<hr />I&#8217;ve been <a href="http://code.davidjanes.com/blog/category/auapi/">thinking and writing</a> recently about how APIs can be made compatible with each other &#8211; that is, the same consumers can be used with the results from different APIs &#8211; and Kevin Marks pointed me this way, as I had written about hCard serialization.</p>
<p>However, it occurs to me that PC could be made to overlay the <a href="http://atomenabled.org/developers/syndication/">Atom syndication standard</a> with very few changes (by the looks of it, you&#8217;re fairly late into the design cycle though). For example, this:</p>
<pre>{
  "id": "703887",
  "displayName": "Mork Hashimoto",
  "name": {
    "familyName": "Hashimoto",
    "givenName": "Mork"
  },
  "birthday": "0000-01-16",
  "gender": "male",
  "drinker": "heavily",
  "tags": [
    "plaxo guy",
    "favorite"
  ],
}</pre>
<p>Could be encoded like:</p>
<pre>{
  "id": "703887",
  "title": "Mork Hashimoto",
  "updated" : "2008-...",
  "published" : "2007-...",
  "category" : [
   { "term" : "plaxo guy", },
   { "term" : "favorite", },
  ],
  "contact" : {
    "name": {
      "familyName": "Hashimoto",
      "givenName": "Mork"
    },
    "birthday": "0000-01-16",
    "gender": "male",
    "drinker": "heavily",
  }
}</pre>
<p>Which is almost the same, except now that your XML serialization can be Atom (noting of course there will be changes for the paging elements, etc. that you&#8217;ve defined). The immediate implication of this is that you&#8217;re working within a large existing infrastructure that knows about update notification, has tools for display, and so forth.</p>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/03/portablecontacts-and-the-atom-syndication-standard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AUAPI: encode images using media:rss</title>
		<link>http://code.davidjanes.com/blog/2009/03/02/auapi-encode-images-using-mediarss/</link>
		<comments>http://code.davidjanes.com/blog/2009/03/02/auapi-encode-images-using-mediarss/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 21:34:21 +0000</pubDate>
		<dc:creator>David Janes</dc:creator>
				<category><![CDATA[auapi]]></category>

		<guid isPermaLink="false">http://code.davidjanes.com/blog/?p=513</guid>
		<description><![CDATA[MediaRSS is the way to encode images in the Almost Universal API (AUAPI). Because MediaRSS encodes its values in attributes, we use the @ symbol to prefix keys.
Example 1 &#8211; a single image
'media:content': {
    '@medium': 'image',
    '@type': 'image/jpeg',
    '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_m.jpg'
}
Example 2 &#8211; thumbnail
'media:thumbnail': {
   [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://search.yahoo.com/mrss/">MediaRSS</a> is the way to encode images in the <a href="http://code.davidjanes.com/blog/2009/02/27/introducing-the-almost-universal-api/">Almost Universal API</a> (AUAPI). Because MediaRSS encodes its values in attributes, we use the <code>@</code> symbol to prefix keys.</p>
<h4>Example 1 &#8211; a single image</h4>
<pre>'media:content': {
    '@medium': 'image',
    '@type': 'image/jpeg',
    '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_m.jpg'
}</pre>
<h4>Example 2 &#8211; thumbnail</h4>
<pre>'media:thumbnail': {
    '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_t.jpg'
}</pre>
<h4>Example 3 &#8211; multiple images in different sizes</h4>
<pre>'media:group': {
    'media:content': [
        {'@medium': 'image',
        '@type': 'image/jpeg',
        '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_m.jpg'},
        {'@medium': 'image',
        '@type': 'image/jpeg',
        '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_s.jpg'},
        {'@medium': 'image',
        '@type': 'image/jpeg',
        '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_b.jpg'}
    ],
    'media:thumbnail': {
        '@url': u'http://farm3.static.flickr.com/2165/2271778128_b59c01a695_t.jpg'
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://code.davidjanes.com/blog/2009/03/02/auapi-encode-images-using-mediarss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
