<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>iamcam</title>
	<atom:link href="http://iamcam.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iamcam.wordpress.com</link>
	<description>Cameron Perry&#039;s mobile &#38; web development blog</description>
	<lastBuildDate>Wed, 04 Jan 2012 14:17:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iamcam.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>iamcam</title>
		<link>http://iamcam.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iamcam.wordpress.com/osd.xml" title="iamcam" />
	<atom:link rel='hub' href='http://iamcam.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Underwhelming Android Experience</title>
		<link>http://iamcam.wordpress.com/2011/10/17/underwhelming-android-experience/</link>
		<comments>http://iamcam.wordpress.com/2011/10/17/underwhelming-android-experience/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 01:14:26 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[mobile]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=285</guid>
		<description><![CDATA[Ryan Heise summed it up nicely in Four Months With Android. I used an HTC incredible for 11 months. There are some great things about Android, but the negatives far outweigh the benefits for me. Android was just underwhelming. The UI and UX isn&#8217;t as nicely polished as iOS. Android apps, on average, just aren&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=285&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ryan Heise summed it up nicely in <a href="http://dinnerwithandroid.tumblr.com/post/11571096718/four-months-with-android-reflections-grievances-and" target="_blank">Four Months With Android</a>. I used an HTC incredible for 11 months. There are some great things about Android, but the negatives far outweigh the benefits for me. Android was just underwhelming. The UI and UX isn&#8217;t as nicely polished as iOS. Android apps, on average, just aren&#8217;t as well polished. Android reminds me of Windows of years past. Sure, it more or less works, but it&#8217;s just not that great of an experience.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/285/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/285/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/285/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=285&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/10/17/underwhelming-android-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>Will Hybrid Mobile Apps Prevail Over Native?</title>
		<link>http://iamcam.wordpress.com/2011/10/10/will-hybrid-mobile-apps-prevail-over-native/</link>
		<comments>http://iamcam.wordpress.com/2011/10/10/will-hybrid-mobile-apps-prevail-over-native/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 01:29:45 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Reviews and Discussions]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[hybrid]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[PhoneGap]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=273</guid>
		<description><![CDATA[I&#8217;ve been wrestling with this question for some time, and I thought this post may help sort out my thoughts and opinions while giving you some important insight. Are hybrid mobile apps going to become the developer&#8217;s choice anytime soon? The debate can be pretty heated as companies choose one technology over the other. Hybrid, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=273&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been wrestling with this question for some time, and I thought this post may help sort out my thoughts and opinions while giving you some important insight. Are hybrid mobile apps going to become the developer&#8217;s choice anytime soon? The debate can be pretty heated as companies choose one technology over the other.</p>
<h2>Hybrid, the Unlikely Union</h2>
<p>Let&#8217;s get the definitions straight before we begin. A hybrid app is one of those mobile apps that uses a native web view to display HTML, CSS, and JS &#8220;web&#8221; apps. They&#8217;re only sort-of &#8220;web apps&#8221; because they are run locally, though they often pull data from online sources via AJAX requests. So, you have this HTML/CSS/JS app running inside of a natively-compiled stand-alone web browser of sorts on your phone. One such example is <a title="PhoneGap" href="http://www.PhoneGap.com" target="_blank">PhoneGap</a>. Because the logic bits of the app are written using web technologies, you can often develop once and deploy on multiple platforms, so long as you&#8217;re using supported markup. You&#8217;re killing multiple birds with one stone.</p>
<h2>Hybrid is the Bee&#8217;s Knees</h2>
<p>As I mentioned above, hybrid technologies are great for developing cross-platform apps. Seriously &#8211; since iOS, Android, and even some Blackberry devices are both running Webkit most, if not all, your html, css, js is going to work remarkably similarly on both platforms. It&#8217;s pretty enticing. From your and your client&#8217;s perspective it&#8217;s a pretty easy sell. For one round of development you have the potential to hit many more users. It&#8217;s pretty cost-effective. Pretty soon you&#8217;re singing the praises of your decision and you&#8217;ve decided that from now on hybrid apps are the bee&#8217;s knees.<br />
<span id="more-273"></span></p>
<h2>The Gateway Drug</h2>
<p>I&#8217;m not going to lie &#8211; I immediately fell in love with the idea because my background was primarily web development. I can take my existing toolset and apply it just a little bit differently to come up with something like an iPhone app that I&#8217;m sure everyone would want to buy. I&#8217;m getting ahead of myself. If it wasn&#8217;t for tools like <a title="PhoneGap" href="http://www.phonegap.com" target="_blank">PhoneGap</a> and <a title="jQTouch" href="http://jqtouch.com/" target="_blank">jQTouch</a>, it would have been much longer before I got into mobile development. Now there are libraries such as <a href="http://www.sencha.com/products/touch" target="_blank">Sencha Touch</a> and <a href="http://jquerymobile.com/" target="_blank">jQuery Mobile</a> to aid development. It&#8217;s an exciting industry to be working in. It&#8217;s not that the web is old and tired, but mobile development is something new and exciting. I can&#8217;t wait to see where we&#8217;ll be in just a few years from now. It&#8217;s getting <em>that</em> good, that fast.</p>
<h2>Native Apps, the OG Tech</h2>
<p>So far I&#8217;ve been discussing the benefits, and singing the praises of developing hybrid apps. So what about native ones? Since I&#8217;m really only familiar with Cocoa Touch, I&#8217;ll write from the perspective of an iOS developer, though many of these points will apply to Android. There is something to be said about the quality and performance of native apps. Native apps are going to perform better than hybrid apps, no doubt about it. When you read that, you&#8217;ll probably first think about number crunching, but I encourage you to think about it from another perspective: responsiveness. I&#8217;m talking about the speed at which things happen on the screen when you need them to. Does the next view load and transition instantaneously? How about animations or actions attached to button presses? Hybrid frameworks have come a long way, but native still wins this race, hands-down. When your app responds immediately to touch events, that&#8217;s awesome for the users&#8217;s experience because that&#8217;s how apps <em>should</em> work.</p>
<p>I think there&#8217;s also a certain level of sophistication in native apps that can&#8217;t quite be reached by hybrid apps. You can do quite a bit (even impressive) things with html/css/js but it only goes so far. At some point you hit a wall. More on this later.</p>
<h2>Sticking Points</h2>
<p>About a year ago, I chose to switch from jQTouch to Sencha Touch for hybrid app development. Overall, the end results have been very pleasing, especially compared to pre-Sencha Touch days. This framework takes care of most of the heavy lifting, from UI to data management. In many ways Sencha Touch looks and feels very similar to a native app. It mimics many of the same user interface and behaviors as its native cousins on both iOS and Android. It really is the best-of-class frameworks for hybrid apps. Beware, however, that it&#8217;s not an entirely pleasant experience.</p>
<h3>The Mobile Web Darling, Sencha Touch</h3>
<p>I&#8217;ve run into too-many-to-count issues with Sencha Touch relating to tweaking the layout, screen rendering, and general UX problems (I never said it was perfect). I&#8217;ve discussed some of these with fellow developers. Typically I describe it this way &#8211; It&#8217;s not too bad to work with until something that should work out of the box, doesn&#8217;t. I&#8217;ve spent far too many hours trying to debug and fix some very basic problems. Case in point &#8211; rotating the device causes rendering errors. A good number of developers have also experienced some major Android incompatibilities, especially with the HTC Sense UI. Ever seen a text form field duplicate itself elsewhere on the screen when given focus? Work with Sencha on Android long enough and you&#8217;ll see what I mean. There&#8217;s no clear fix for that, nor is that mysterious field controllable by the DOM &#8211; it&#8217;s all at the OS level. How about crashing Android devices when you scroll the screen content too much? Just sayin&#8217;. I will give Sencha some credit, though. Touch works much better on Android than it did a year ago, and many of the most significant problems have been addressed. Also, customizing the UI isn&#8217;t too terrible. Most of the time.</p>
<h3>The &#8220;Others&#8221;</h3>
<p>I&#8217;ve read enough about others&#8217; experiences with jQuery Mobile to know it&#8217;s not up to par like Sencha Touch is. I skipped over it a while ago, and don&#8217;t have immediate plans of working through another framework&#8217;s growing pains just yet. I guess this post isn&#8217;t quite fair enough to Sencha because it&#8217;s really the one I know most about. So let me reiterate &#8211; others have been saying Sencha Touch really is the best one out there. And truth be told &#8211; Sencha Touch can produce some really good apps.</p>
<p>The problem you&#8217;re going to run into with these &#8220;web&#8221; frameworks is going to convince your client and end users that the app is undetectably different than native apps. That means they should be just as fluid and work just as seamlessly as native apps. Most of the time I don&#8217;t see that parity. Animations can be jerky, the UI looks mostly native, but you can tell the difference. When it comes down to it, there are simply things you can&#8217;t do with web technologies that are pretty commonplace with native libraries. It&#8217;s not really JS&#8217;s fault, but DOM manipulations are expensive. The more DOM you&#8217;re manipulating, the more the responsiveness is going to suffer. Remember when this was a real problem on desktops several years ago? Well, it&#8217;s the same on mobile now. It&#8217;s frustrating.</p>
<p>Here&#8217;s one place hybrid apps tend to really fall behind &#8211; interacting with core OS services. HTML5 offers new support for basic features such as address book and some media-related tasks, geo location, etc, but only to a point. As you develop enough hybrid apps, you start to get the feel for things you can and can&#8217;t do. PhoneGap has done a great job of providing a good native API and a set of helpful plugins, but it does not solve every problem. New plugin needs still require a native programming to interface with your JS. It gets a bit sticky</p>
<h2>Native Learning Curves</h2>
<p>The learning curve kept me from iOS development initially. If your only prior experience was most web technologies, it&#8217;s understandable. There is a bit of a steep learning curve if most concepts core to Objective C are new to you, but be assured it&#8217;s not impossible. It just takes work, as it does with any new language and/or framework. My experience shows that once I started picking up the generalities, the specifics started to fall into place. It gets better. Seek the help of programming books and <a href="http://www.stackoverflow.com" target="_blank">Stack Overflow</a>. Study at sample projects (Apple and Google both provide them) and understand them.</p>
<h2>Finally, Stand</h2>
<p>If you&#8217;ve read this far, congratulate yourself. I&#8217;m not normally this long-winded. Or am I? Anyhow, where do I stand? Which is better? Both. Well. Sort of. I mean, I think if you have the chops for native development and the help of a good designer and UX colleague, do it. I believe that at this point of time, you are going to get the best results from developing native apps, especially on iOS. Hybrid apps, in my opinion, are going to be the most obvious choice when clients are wanting cross-platform apps on limited budgets. I don&#8217;t mean this to imply native apps are prohibitively expensive. Rather, hybrid apps do allow you to perform a bit of a shortcut by only having to write one codebase for multiple platforms. The question of whether or not the tradeoff is worth it. Do you feel you can create as quality of an experience with hybrid apps as with native? That&#8217;s for you to answer, and then to explain to your clients. You may be of the opinion that native apps are most ideal (that&#8217;s how I feel), however sometimes the decision isn&#8217;t yours &#8211; directly or indirectly.</p>
<p>I&#8217;ll probably get some flack for this. Remember, use the right tool. Sometimes that&#8217;s determined more by budget than technology. A client looking to develop a low-cost app for iOS, Android, and Blackberry will not get quite the same experience as if the same app were developed separately for each platform. Remember &#8211; you pay for cutting corners. Some people are OK with that.</p>
<p>To answer the post&#8217;s title question? Not yet. I think there&#8217;s still plenty of catching up to do, however I don&#8217;t have many hopes for full OS-level integration for web technologies (remember, the web is platform-agnostic).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/273/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=273&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/10/10/will-hybrid-mobile-apps-prevail-over-native/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>GeoLocation Near You</title>
		<link>http://iamcam.wordpress.com/2011/08/31/geolocation-near-you/</link>
		<comments>http://iamcam.wordpress.com/2011/08/31/geolocation-near-you/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 17:22:02 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=256</guid>
		<description><![CDATA[We at Pivotal Action were recently given a task for a client &#8211; develop a tool for a mobile API where admin can upload a list of retailers so that their mobile app users could find locations near them. It&#8217;s basically a &#8220;Find near me&#8221; utility. This type of project is broken down into 3 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=256&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We at <a href="http://www.PivotalAction.com">Pivotal Action</a> were recently given a task for a client &#8211; develop a tool for a mobile API where admin can upload a list of retailers so that their mobile app users could find locations near them. It&#8217;s basically a &#8220;Find near me&#8221; utility.</p>
<p>This type of project is broken down into 3 parts: Upload &amp; store geolocation data, find addresses near a given point, and display those locations either textually or on a map display. This quick tutorial will cover the first two parts.</p>
<h3>Part 1, Getting Located</h3>
<p>The goal of this part is to obtain and store latitude/longitude pairs for given addresses. I&#8217;m going to assume you can already get a list of addresses, whether for a spreadsheet/csv file, or other source. With a parsed address, you can obtain the lat/lng pairs from the Google Maps API. Just be forewarned that Google limits you to 2,500 requests per 24h period. That could be a problem for some applications, so you may need another provider like <a href="http://www.SimpleGeo.com" target="_blank">SimpleGeo.com</a></p>
<pre>&lt;?php
// Google maps API. rate limit to 2,500 reqs/24h
$url 		= 'http://maps.googleapis.com/maps/api/geocode/json';
$address	= urlencode($row['address']);
$city		= urlencode($row['city']);
$state		= urlencode($row['state']);
$zip 		=  $row['zip'];

$requestUrl = $url."?address=".($address.",".$city.",".$state.",".$zip). "&amp;sensor=false";
// echo $requestUrl;

$crl = curl_init();
curl_setopt($crl, CURLOPT_HEADER, 0);
curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1); 

// Set up the CURL request
curl_setopt($crl, CURLOPT_URL, $requestUrl); 

// Here we get the google result in JSON
$googJson = curl_exec($crl);

curl_close($crl);

$googArr = json_decode($googJson);
$status = $googArr-&gt;status;
$loc = $googArr-&gt;results[0]-&gt;geometry-&gt;location;
if( strtolower($status) == "ok" ){
	$tableData[count($tableData) - 1]['lat'] = $loc-&gt;lat;
	$tableData[count($tableData) - 1]['lng'] = $loc-&gt;lng;
} else {
	$tableData[count($tableData) - 1]['lat'] = 0.0;
	$tableData[count($tableData) - 1]['lng'] = 0.0;
}

//go on to save $tableData to your DB

?&gt;</pre>
<p>There are a couple key parts in there. First, you need to URL encode the address details. Second, the curl stuff is pretty standard &#8211; you can find similar versions all over the net. Third, the response data comes back as a JSON string, so you need to decode it into a PHP array to make it useful. My default value for lat/lng pairs is 0.0/0.0. There may be cases where Google doesn&#8217;t understand the address information or perhaps you&#8217;ve gone over your rate limit, so you have to accept more or less a throw-away response. The important thing is that you have your address coordinates saved (dare I say, cached) in your DB. You need this.</p>
<h3>Part 2, Finding Yourself</h3>
<p>Now how are you supposed to find these stores that are near you, at this moment, without having to use a lame web form or other manual means? You&#8217;re going to use the <a href="http://en.wikipedia.org/wiki/Haversine_formula" target="_blank">Haversine</a>, aka Great Circle  Formula. Don&#8217;t click that link unless you really want to be confused. Here&#8217;s the gist &#8211; the globe is a big sphere, and we know from high school and/or college trigonometry classes that you can figure out lengths and distances on geometric objects. Some guy long ago (whose name was not Haversine) sat down and figured this out for us. What we get as a result of running these maths is the distance between to points on earth, using lat/long pairs. The caveat is these are as the crow flies, not driving directions. What I&#8217;m going to show you below is some SQL you can use to find the <em>N</em> closest points within a given distance. This will work on MySQL, and I&#8217;m assuming other SQL-compliant DBs. YMMV.</p>
<pre>// scale:  MILES - use 3959 ;  KM - use 6371 (mean radius of the earth)
$scale = 3959;
$sql = "SELECT name, address, city, state, zip,  ( "
. (int) $scale ." * acos( cos( radians(".(float) $loc['lat']
. ") ) * cos( radians( lat ) ) * cos( radians( lng ) - radians("
. (float) $loc['lng'].") ) + sin( radians(". (float) $loc['lat']
. ") ) * sin( radians( lat ) ) ) ) AS distance FROM "
. $tablename ." HAVING distance &lt; ". (int) $distance 
. " ORDER BY distance LIMIT 0 , ". (int) $limit . ";";</pre>
<p>(Thank Pavel Chuchuva on Stack Overflow for the SQL [<a href="http://stackoverflow.com/questions/574691/mysql-great-circle-distance-haversine-formula/574736#574736" target="_blank">answer here</a>]). You only need a couple parameters to get this chugging along and giving you a list of distances, closest to farthest from the point you are feeding it. Along with your address information, you&#8217;re also provided a distance in miles (using 3959 for measurement in Km).</p>
<p>Now you can use these results to display distances to your users. Let Google be your guide for implementing Part 3.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/256/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/256/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/256/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=256&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/08/31/geolocation-near-you/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>Quiet NSLog() in Release Builds</title>
		<link>http://iamcam.wordpress.com/2011/07/31/quiet-nslog-in-release-builds/</link>
		<comments>http://iamcam.wordpress.com/2011/07/31/quiet-nslog-in-release-builds/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 17:13:06 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=254</guid>
		<description><![CDATA[On the heels of the previous post, here&#8217;s a little snippit I picked up from Marek Bell to quiet NSLog() output in release builds. Add this to your {MyApp}-prefix.pch file #ifndef __OPTIMIZE__ #    define NSLog(&#8230;) NSLog(__VA_ARGS__) #else #    define NSLog(&#8230;) {} #endif The reasoning behind using __OPTIMIZE__ is that it&#8217;s set only on release builds [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=254&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>On the heels of the previous post, here&#8217;s a little snippit I picked up from <a href="http://www.marekbell.com/Marek_Bell/Blog/Entries/2009/3/25_Removing_NSLogs_on_Release_Builds.html" target="_blank">Marek Bell</a> to quiet NSLog() output in release builds.</p>
<p>Add this to your {MyApp}-prefix.pch file</p>
<p>#ifndef __OPTIMIZE__<br />
#    define NSLog(&#8230;) NSLog(__VA_ARGS__)<br />
#else<br />
#    define NSLog(&#8230;) {}<br />
#endif</p>
<p>The reasoning behind using __OPTIMIZE__ is that it&#8217;s set only on release builds of your app, not in debug versions. It&#8217;s very simple and allows you to use NSLog() instead of having to come up with your own version.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/254/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/254/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/254/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=254&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/07/31/quiet-nslog-in-release-builds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>Quiet the Console &#8211; PhoneGap / iOS</title>
		<link>http://iamcam.wordpress.com/2011/07/26/quiet-the-console-phonegap-ios/</link>
		<comments>http://iamcam.wordpress.com/2011/07/26/quiet-the-console-phonegap-ios/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 23:36:08 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Apps]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=249</guid>
		<description><![CDATA[I have a confession &#8211; I&#8217;m a console logging junkie. I just like to see what&#8217;s going on. While that may be great for development, at some point you&#8217;ll have to quiet the logging down for production. Really &#8211; doing enough logging will slow everything down each time you&#8217;ve inserted a console.log() into your code. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=249&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a confession &#8211; I&#8217;m a console logging junkie. I just like to see what&#8217;s going on. While that may be great for development, at some point you&#8217;ll have to quiet the logging down for production. Really &#8211; doing enough logging will slow everything down each time you&#8217;ve inserted a console.log() into your code.</p>
<p>Silencing the output to XCode&#8217;s debugging console wasn&#8217;t immediately obvious. Overriding console.log() in JS by setting it to an empty function worked in the browser for development, but as soon as I loaded the app onto the actual simulator, we were back to square one. Enter the PhoneGap DebugConsole prototype. Override it.</p>
<p>Insert this anywhere after your phonegap.js file loads. It&#8217;ll keep things quiet as long as DEBUG = true&#8230;</p>
<pre>if(DEBUG == true){
    DebugConsole.prototype.log = function(message, maxDepth) { }
    DebugConsole.prototype.warn = function(message, maxDepth) { }
    window.console = new DebugConsole();
}</pre>
<p>There you have it</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=249&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/07/26/quiet-the-console-phonegap-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>PhoneGap + XCode4</title>
		<link>http://iamcam.wordpress.com/2011/03/17/phonegap-xcode4/</link>
		<comments>http://iamcam.wordpress.com/2011/03/17/phonegap-xcode4/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 01:04:48 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[XCode4]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=233</guid>
		<description><![CDATA[There&#8217;s been a bit of confusion surrounding changes to XCode4 and PhoneGap. Right now the big ones are 1) Where did my PhoneGap user templates go!? and 2) How do I submit my PhoneGap-based app to Apple? Let me help you. 1) You want to create a new PG project, but you&#8217;re not seeing the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=233&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a bit of confusion surrounding changes to XCode4 and PhoneGap. Right now the big ones are 1) Where did my PhoneGap user templates go!? and 2) How do I submit my PhoneGap-based app to Apple? Let me help you.</p>
<p>1) You want to create a new PG project, but you&#8217;re not seeing the XCode templates when you go through the new project menus. Check out <a title="Sazron's XCode4 + PhoneGap template fix" href="http://blogs.nitobi.com/shazron/2011/03/16/creating-a-phonegap-project-from-the-command-line-for-xcode-4/">Shazron&#8217;s blog</a> @ Nitobi for a command-line script to get you a new project up and running. It&#8217;s not as sexy as the XCode template, but it will do.</p>
<p>2) You can&#8217;t compile your app for submission to Apple? That was a little more tricky to track down. See <a href="https://devforums.apple.com/message/375793#375793">this thread</a> on the Apple Dev Forums for a bit of an abstract view of what&#8217;s going on. I&#8217;ll save you the details. Follow these steps to XCode bliss.</p>
<ol>
<li>Select the PhoneGapLib.xcodeproj entry in your files list:<img class="alignnone size-full wp-image-238" title="00000050" src="http://iamcam.files.wordpress.com/2011/03/00000050.png?w=580" alt=""   /></li>
<li>Make sure the &#8220;All&#8221; tab is selected:<br />
<a href="http://iamcam.files.wordpress.com/2011/03/00000051.png"><img class="alignnone size-full wp-image-240" title="00000051" src="http://iamcam.files.wordpress.com/2011/03/00000051.png?w=580" alt=""   /></a></li>
<li>Look for the &#8220;Deployment&#8221; section and scroll down until you see the &#8220;Skip Install&#8221; parameter. Set Skip Install to YES:<br />
<a href="http://iamcam.files.wordpress.com/2011/03/00000052.png"><img class="alignnone size-full wp-image-241" title="00000052" src="http://iamcam.files.wordpress.com/2011/03/00000052.png?w=580" alt=""   /></a></li>
<li><strong>EDIT: Make sure to verify your target device&#8230;</strong><br />
Make sure you have the &#8220;iOS Device&#8221; option selected in the schemes drop-down:<br />
<a href="http://iamcam.files.wordpress.com/2011/03/select-device.png"><img class="alignnone size-full wp-image-243" title="select-device" src="http://iamcam.files.wordpress.com/2011/03/select-device.png?w=580" alt=""   /></a></li>
<li> Go over to the &#8220;Product &gt; Archive&#8221; menu. XCode will do its compile magic. Open the Organizer to see the app and the listed archives when the compile is complete. At this point, make sure you are ready to upload the app to iTunes Connect. Bonus: we get to skip the Application Loader app from now on!</li>
<li>Select the archive and click the &#8220;Submit&#8221; button. XCode will ask for your credentials. Log in and select the appropriate app and distribution profile from the list. Submit. If all goes to plan, you&#8217;ll get a message of approval. Finished.</li>
</ol>
<p>That was easy. Now you can navigate the XCode4 waters with PhoneGap.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=233&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/03/17/phonegap-xcode4/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>

		<media:content url="http://iamcam.files.wordpress.com/2011/03/00000050.png" medium="image">
			<media:title type="html">00000050</media:title>
		</media:content>

		<media:content url="http://iamcam.files.wordpress.com/2011/03/00000051.png" medium="image">
			<media:title type="html">00000051</media:title>
		</media:content>

		<media:content url="http://iamcam.files.wordpress.com/2011/03/00000052.png" medium="image">
			<media:title type="html">00000052</media:title>
		</media:content>

		<media:content url="http://iamcam.files.wordpress.com/2011/03/select-device.png" medium="image">
			<media:title type="html">select-device</media:title>
		</media:content>
	</item>
		<item>
		<title>Catching Android&#8217;s Back Button in PhoneGap</title>
		<link>http://iamcam.wordpress.com/2011/03/03/catching-androids-back-button-in-phonegap/</link>
		<comments>http://iamcam.wordpress.com/2011/03/03/catching-androids-back-button-in-phonegap/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 07:48:04 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[Design and Usability]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[Sencha Touch]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=229</guid>
		<description><![CDATA[This little bit of code is going to be useful to those of you developing a &#8220;singe page&#8221; app inside of PhoneGap. This applies to Sencha Touch (big fan), but doesn&#8217;t as much to jQuery mobile and jQTouch, as it&#8217;s a multi-page/navigation based event framework (it uses the app&#8217;s url string to do things like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=229&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This little bit of code is going to be useful to those of you developing a &#8220;singe page&#8221; app inside of PhoneGap. This applies to <a href="http://www.sencha.com/products/touch">Sencha Touch</a> (big fan), but doesn&#8217;t as much to <a href="http://jquerymobile.com/">jQuery mobile</a> and <a href="http://www.jqtouch.com/">jQTouch</a>, as it&#8217;s a multi-page/navigation based event framework (it uses the app&#8217;s url string to do things like move around to different link anchors). This is really important on these single page apps because the Android hardware back button will send the PhoneGap app to the background. You need some way to intercept it so you can start building your own history management mechanism. Sounds fun, right? It&#8217;s actually not that hard.</p>
<p>On app initialization, add an event listener for Android&#8217;s back button, and the callback to handle it. PhoneGap takes care of the interface between Android and your app.</p>
<pre>document.addEventListener("backbutton", backKeyDown, true); 
function backKeyDown() { 
     // Call my back key code here.
 	alert('go back!');
}</pre>
<p>That&#8217;s enough to get you started, and it should be pretty apparent if it works or not.</p>
<p>How about history management? It will depend on the app and what makes sense, BUT you&#8217;ll probably want to create a history array, and pop off some value that directs the app each time you hit the hardware back button. Here&#8217;s another idea: change the destination of the back button depending on the view. I personally like the idea of the latter because apps built on Sencha Touch are going to have easy tie-ins through predefined listeners JS Objects that define screen elements like buttons.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=229&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/03/03/catching-androids-back-button-in-phonegap/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>Mobile Platform Detection on the web</title>
		<link>http://iamcam.wordpress.com/2011/01/26/mobile-platform-detection-on-the-web/</link>
		<comments>http://iamcam.wordpress.com/2011/01/26/mobile-platform-detection-on-the-web/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 23:36:27 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=225</guid>
		<description><![CDATA[I had a use case recently where I need to determine whether the client browser was a desktop/laptop/etc or a mobile device that supports tap events in JS. This will be useful to people who are dynamically binding different events to elements. var tmpElem = document.createElement('div'); tmpElem.setAttribute('tap', 'return;'); clickEvent = (typeof tmpElem.tap == "undefined") ? [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=225&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a use case recently where I need to determine whether the client browser was a desktop/laptop/etc or a mobile device that supports tap events in JS. This will be useful to people who are dynamically binding different events to elements.</p>
<pre>var tmpElem = document.createElement('div');
tmpElem.setAttribute('tap', 'return;');
clickEvent = (typeof tmpElem.tap == "undefined") ? 'click' : 'tap' ;</pre>
<p>You would use it like this</p>
<pre>$('.showDetails').bind(clickEvent,function(e){
      display(e, $(this).attr('info'));
      console.log( clickEvent + " " + $(this).attr('info'));
      //would look like "Click fooBar"
 });</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/225/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/225/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/225/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=225&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2011/01/26/mobile-platform-detection-on-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>Tell your Mac to say &#8220;Anything&#8221; (and record it)</title>
		<link>http://iamcam.wordpress.com/2010/06/22/tell-your-mac-to-say-anything-and-record-it/</link>
		<comments>http://iamcam.wordpress.com/2010/06/22/tell-your-mac-to-say-anything-and-record-it/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 17:43:43 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[speech synthesis]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=221</guid>
		<description><![CDATA[This tutorial will show you how to record text to an audio file and convert it to an MP3 for use with PhoneBooth, or any other application you might want to use speech synthesis / text-to-speech recordings with.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=221&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t quite have the voice acting skills that people care to listen to on a pre-recorded message, so I was faced with a challenge when I decided I wanted one for our hosted virtual phone system over at <a href="http://www.phonebooth.com" target="_blank">PhoneBooth</a>. I had a vague recollection that Apple provided recordable speech synthesis / text-to-speech (TTS) capabilities in the command line, so I went searching. Bingo. The app is called <em>say</em>.</p>
<p>This tutorial will show you how to use a Mac&#8217;s TTS capabilities to record text to an audio file, and then convert it to an MP3 for use with PhoneBooth, or any other application you might want to use.</p>
<p>Try this out from the command line (open Applications &gt; Utilities &gt; Terminal )</p>
<pre>say "Hello world."</pre>
<p>To save it to a file:</p>
<pre>say "Hello world." -o greetings.aiff</pre>
<p>Or to read the text from a file,</p>
<pre>say -f script.txt -o greetings.aiff</pre>
<p>PhoneBooth requires either wave or mp3 for its auto attendant scripts (e.g., &#8220;Press 1 for sales, 2 for billing,&#8221; etc.). Some voices support exports to wave (see the <em>say</em> documentation: <em>man say</em>), but the default in 10.6 doesn&#8217;t seem to &#8211; it creates an audio file, but produces no sound. The next step involves using <em>lame</em> to convert the file to a mono mp3. You will need to install lame using <a href="http://www.finkproject.org/" target="_blank">Fink</a> or <a href="http://www.macports.org/" target="_blank">Mac Ports </a>first. If you don&#8217;t have lame installed you can also use iTunes to do the conversion for you, but your tutorial more or less stops here without lame.</p>
<pre>lame -m m greetings.aiff greetings.mp3</pre>
<p>Finally, upload greetings.mp3 to PhoneBooth. Finished. For the curious, the -m m option tells lame to encode the mp3 to mono.</p>
<p>For the super-efficient folks out there, put it all into one line (and open when finished):</p>
<pre>say -f script.txt -o greetings.aiff; lame -m m greetings.aiff greeting.mp3; open greetings.mp3</pre>
<p>NB: If you wish to make your spoken text flow more naturally you can add [[slnc 300]] between sentences, increasing or decreasing the number for longer or shorter pauses. Apple has much more <a href="http://developer.apple.com/mac/library/documentation/UserExperience/Conceptual/SpeechSynthesisProgrammingGuide/FineTuning/FineTuning.html#//apple_ref/doc/uid/TP40004365-CH5-SW12" target="_blank">detailed documentation</a> for the brave.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=221&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2010/06/22/tell-your-mac-to-say-anything-and-record-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
		<item>
		<title>If your site goes down, does it make a noise?</title>
		<link>http://iamcam.wordpress.com/2010/05/05/if-your-site-goes-down-does-it-make-a-noise/</link>
		<comments>http://iamcam.wordpress.com/2010/05/05/if-your-site-goes-down-does-it-make-a-noise/#comments</comments>
		<pubDate>Wed, 05 May 2010 19:06:56 +0000</pubDate>
		<dc:creator>Cameron Perry</dc:creator>
				<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://iamcam.wordpress.com/?p=219</guid>
		<description><![CDATA[I don&#8217;t go to my brochure site very often. It&#8217;s there for the curious client who needs the reassurance that I know what I&#8217;m doing. Considering I haven&#8217;t made any significant changes in quite some time, I had no reason to go back, but apparently I should have. At some point my .htaccess file went [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=219&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t go to my brochure site very often. It&#8217;s there for the curious client who needs the reassurance that I know what I&#8217;m doing. Considering I haven&#8217;t made any significant changes in quite some time, I had no reason to go back, but apparently I should have. At some point my .htaccess file went missing, which was pretty good to foil even the best attempts to view pages other than the home page. I have two questions: 1) How long were all these links broken &#8211; that I didn&#8217;t even notice it, and 2) Nobody said anything &#8211; why?</p>
<p>Regardless, everything is fixed now. Typing my name into Google or Bing will fetch either this blog or the brochure site in the top 2-3 positions. If you haven&#8217;t been yet, check out <a href="http://www.mistercameron.com">mistercameron.com</a> .</p>
<p>Cue deriding comments.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iamcam.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iamcam.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iamcam.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iamcam.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iamcam.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iamcam.wordpress.com/219/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iamcam.wordpress.com/219/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iamcam.wordpress.com/219/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iamcam.wordpress.com&amp;blog=40512&amp;post=219&amp;subd=iamcam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iamcam.wordpress.com/2010/05/05/if-your-site-goes-down-does-it-make-a-noise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9f70334a8d2b026223f965453e714da3?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">iamcam</media:title>
		</media:content>
	</item>
	</channel>
</rss>
