<?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>John Attebury</title>
	
	<link>http://johnattebury.com</link>
	<description>Web design, programming and administration</description>
	<lastBuildDate>Fri, 11 May 2012 21:00:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/johnattebury" /><feedburner:info uri="johnattebury" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Beginning Phonegap by Thomas Myer; O’Reilly Media</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/NMCYKRMk08M/</link>
		<comments>http://johnattebury.com/blog/2012/05/beginning-phonegap/#comments</comments>
		<pubDate>Fri, 11 May 2012 21:00:28 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[oreilly]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=207</guid>
		<description><![CDATA[TL;DR Highly recommended. Thomas Myer&#8217;s Beginning Phonegap provides a useful balance between a traditional cookbook and a reference work. Review Myers covers the basics: an introduction, (very) brief showcase, installation and basic walkthrough of using PhoneGap win your chosen environment. &#8230; <a href="http://johnattebury.com/blog/2012/05/beginning-phonegap/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://akamaicovers.oreilly.com/images/9781457108150/thumb.gif" /></p>
<h2>TL;DR</h2>
<p>Highly recommended. Thomas Myer&#8217;s Beginning Phonegap provides a useful balance between a traditional cookbook and a reference work. </p>
<h2>Review</h2>
<p>Myers covers the basics: an introduction, (very) brief showcase, installation and basic walkthrough of using PhoneGap win your chosen environment. While this information is helpful, I&#8217;d researched those steps before choosing to learn more about PhoneGap and was most interested in the heart of the book, the API components.</p>
<p>Myers writes:</p>
<p>
<blockquote>&#8220;If you&#8217;re good with HTML, CSS, and JavaScript, you&#8217;ll experience few problems while working with PhoneGap &#8211; all you need is a good introduction to the specifics of the API components, which this book will give you.&#8221;</p></blockquote>
<p>And the book delivers. Using an efficient but accessible tone, Myer introduces PhoneGap API components in separate chapters, putting all (or most) of the pieces together in basic application near the end of the book.</p>
<h3>API Components (and chapter topics)</h3>
<ul>
<li>Accelerometer</li>
<li>Camera</li>
<li>Capture</li>
<li>Compass</li>
<li>Connection</li>
<li>Contacts</li>
<li>Device</li>
<li>Events</li>
<li>File</li>
<li>GeoLocation</li>
<li>Media</li>
<li>Network</li>
<li>Notification</li>
<li>Storage</li>
</ul>
<p>Like a cookbook, each section helpfully highlights differences you might encounter between platforms. For example, Android and Blackberry devices can capture multiple audio clips while iOS devices can record once per invocation. Understanding these differences is particularly helpful during application planning stages. You can adjust your app knowing that one feature will work on the iPhone but not on an Android. Myer does an excellent job of reminding you that you&#8217;re working in a cross-platform environment. (Or at least will be if you publish an app to more than one mobile OS.)</p>
<p>The end of each chapter also provides a section of text-book like questions for review. (Answers appear in Appendix A.) I did not use these review questions, but an instructor might find them useful.</p>
<p>I found the book exceptionally useful and enjoyed the author&#8217;s no-nonsense style. The book works as either (or both) a cookbook or a reference. Having previously researched and used PhoneGap, I now feel very well prepared to use it to create a production app.</p>
<h2>Note</h2>
<p style="float:right;"><a href="http://oreilly.com/bloggers/"><img alt="I review for the O'Reilly Blogger Review Program" src="http://cdn.oreilly.com/bloggers/blogger-review-badge-125.png" border="0" width="125" height="125"></a></p>
<p>I read an ePub version of the book on an iPad and am reviewing this book as part of O&#8217;Reilly&#8217;s Blogger Review Program.</p>
<p><a href="http://johnattebury.com/wp-content/uploads/2012/05/phonegap.gif"><img src="http://johnattebury.com/wp-content/uploads/2012/05/phonegap.gif" alt="" title="phonegap" width="100" height="120" class="alignleft size-full wp-image-237" /></a></p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/NMCYKRMk08M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2012/05/beginning-phonegap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2012/05/beginning-phonegap/</feedburner:origLink></item>
		<item>
		<title>Cutting the cable cord.</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/J97tmjxU1KU/</link>
		<comments>http://johnattebury.com/blog/2012/04/cutting-the-cable-cord/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 04:26:03 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Media]]></category>
		<category><![CDATA[tv]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=199</guid>
		<description><![CDATA[I cancelled cable television today. My wife and I rarely watch television anymore and when we do, it&#8217;s 1 or 2 programs in a sea of channels we never watch. Between the Apple TV, Redbox, and various iPad apps, we &#8230; <a href="http://johnattebury.com/blog/2012/04/cutting-the-cable-cord/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I cancelled cable television today. My wife and I rarely watch television anymore and when we do, it&#8217;s 1 or 2 programs in a sea of channels we <strong>never</strong> watch.</p>
<p>Between the Apple TV, Redbox, and various iPad apps, we can watch just about anything we&#8217;d like. For example, we can purchase an iTunes season pass for Mad Men for half of what we&#8217;ll save <strong>each month</strong>. (The exception being live sporting events. I&#8217;ll visit my brother-in-law more often this Fall.)</p>
<p>Besides saving a lot of money, getting rid of the cable box will address my primary frustration with the Apple TV. I hate having to switch inputs when I want to watch a movie or use AirPlay. With no cable box, the Apple TV becomes my primary input. (I hope that Steve Jobs really cracked the TV interface. I&#8217;d buy an actual TV or iPanel or whatever it&#8217;s going to be called, just to ditch 4 remotes.)</p>
<p>I feel like I just got clean.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Image courtesy of <a href="http://www.flickr.com/photos/biscuitsmlp/6792303139/">smlp.co.uk</a> via <a href="http://creativecommons.org/licenses/by-sa/2.0/deed.en">Creative Commons license</a>.</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/J97tmjxU1KU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2012/04/cutting-the-cable-cord/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2012/04/cutting-the-cable-cord/</feedburner:origLink></item>
		<item>
		<title>Changing Cognition</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/20tXYOOha7U/</link>
		<comments>http://johnattebury.com/blog/2012/03/changing-cognition/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 07:57:37 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Media]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[mcluhan]]></category>
		<category><![CDATA[montessori]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=193</guid>
		<description><![CDATA[Interesting video in light of Kids&#8217; Cognition Is Changing—Education Will Have to Change With It. In his YouTube video, Michael Sokil presents a thesis and an &#8216;argument&#8217;. That argument&#8217;s not written, but he obviously researched his topic and &#8216;concentrated&#8217; on &#8230; <a href="http://johnattebury.com/blog/2012/03/changing-cognition/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Interesting video in light of <a href="http://www.theatlantic.com/technology/archive/2012/02/kids-cognition-is-changing-education-will-have-to-change-along-with-it/253782/">Kids&#8217; Cognition Is Changing—Education Will Have to Change With It</a>. </p>
<p><iframe width="560" height="315" src="http://www.youtube.com/embed/D3QGkt_EZP0" frameborder="0" allowfullscreen></iframe></p>
<p>In his YouTube video, <a href="http://www.youtube.com/user/mjsokes">Michael Sokil</a> presents a thesis and an &#8216;argument&#8217;. That argument&#8217;s not written, but he obviously researched his topic and &#8216;concentrated&#8217; on it, life-skills noted in the article.</p>
<blockquote><p>Among the skills they highlighted: public problem-solving through cooperative work &#8212; crowdsourcing and the like; the ability to search effectively for information online; the ability to distinguish the quality and veracity of online discoveries; the ability to synthesize, or combine facts and details from different sources into coherent narratives; the ability to concentrate; and the ability to distinguish between the signal and the noise as the information we&#8217;re exposed to gets bigger, and broader, and more plentiful.</p></blockquote>
<p>Eventually, we&#8217;ll see many more videos, presentations and later interactive animations than term papers. </p>
<p>And that&#8217;s ok.</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/20tXYOOha7U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2012/03/changing-cognition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2012/03/changing-cognition/</feedburner:origLink></item>
		<item>
		<title>O’Reilly Blogger Review Program</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/q7KMXiemrM0/</link>
		<comments>http://johnattebury.com/blog/2012/02/oreilly-blogger-review-program/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 06:41:24 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[oreilly]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=170</guid>
		<description><![CDATA[This afternoon I applied and was accepted to the O&#8217;Reilly Blogger Review Program. It&#8217;s a good idea. Bloggers get a free e-book or video to review. O&#8217;Reilly gets reviews and SEO magic-making links to their books and videos. (Of course, &#8230; <a href="http://johnattebury.com/blog/2012/02/oreilly-blogger-review-program/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This afternoon I applied and was accepted to the <a href="http://oreilly.com/bloggers/">O&#8217;Reilly Blogger Review Program</a>.</p>
<p>It&#8217;s a good idea. Bloggers get a free e-book or video to review. O&#8217;Reilly gets reviews and SEO magic-making links to their books and videos. (Of course, bloggers get a little of that SEO magic too.)</p>
<p>Request a book. Read it. Review it. Show the links to your review and request another.</p>
<p>My goals in the program:</p>
<ul>
<li>Learn a lot</li>
<li>Review objectively</li>
</ul>
<p>I&#8217;ve requested <em>Beginning Phonegap</em> as my first book.</p>
<p>This should be fun.</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/q7KMXiemrM0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2012/02/oreilly-blogger-review-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2012/02/oreilly-blogger-review-program/</feedburner:origLink></item>
		<item>
		<title>Xcode from Snow Leopard to Lion</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/jy4hg65Y19A/</link>
		<comments>http://johnattebury.com/blog/2011/07/xcode-from-snow-leopard-to-lion/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 06:58:37 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=160</guid>
		<description><![CDATA[Update: The App Store doesn&#8217;t install Xcode. It installs an app called &#8220;Install Xcode&#8221;. I had to search for this app and found multiple copies as I&#8217;d previously downloaded Xcode from the App Store. Right click to check the version. &#8230; <a href="http://johnattebury.com/blog/2011/07/xcode-from-snow-leopard-to-lion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Update: The App Store doesn&#8217;t install Xcode. It installs an app called &#8220;Install Xcode&#8221;. I had to search for this app and found multiple copies as I&#8217;d previously downloaded Xcode from the App Store. Right click to check the version. It should be 4.1. The install went smoothly after that.</p>
<p>****</p>
<p>I had the misfortune of paying $4.99 for Xcode just 2 weeks before Apple made reduced the price to &#8220;Free&#8221; in the App Store.</p>
<p>After upgrading to Lion, I received message that I needed to install the Xcode tools version for OS X Lion. So I fired up the App Store. Clicked install. And waited. (Actually, I did alot of other stuff while Xcode downloaded.) This process differed from typical App Store updates in that no progress bar was displayed beneath the app icon.</p>
<p>Eventually the App Store told me that I had successfully downloaded Xcode, but I received the same error. I still had the wrong version of Xcode for OS X Lion.</p>
<p>A search suggested uninstalling Xcode and then reinstalling using the &#8220;Install Xcode&#8221; app (which appears to function similarly to the &#8220;Install OS X Lion&#8221; app.</p>
<p>Alas, no luck. Not even after a reboot.</p>
<p>Here&#8217;s the error:</p>
<p>****</p>
<blockquote><p>
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Couldn&#8217;t load plug-in &#8216;com.apple.dt.IDE.IDEiPhoneSupport&#8217; while firing fault for extension &#8216;Xcode.Device.iPhonePlaceholder&#8217;<br />
UserInfo: {<br />
    NSUnderlyingError = &#8220;Error Domain=DVTPlugInErrorDomain Code=2 \&#8221;Loading a plug-in failed.\&#8221; UserInfo=0x400db8a80 {DVTPlugInIdentifierErrorKey=com.apple.dt.IDE.IDEiPhoneSupport, DVTPlugInExecutablePathErrorKey=/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEiPhoneSupport.ideplugin/Contents/MacOS/IDEiPhoneSupport, NSLocalizedRecoverySuggestion=The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled., NSLocalizedDescription=Loading a plug-in failed., NSFilePath=/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEiPhoneSupport.ideplugin, NSLocalizedFailureReason=The plug-in \U201ccom.apple.dt.IDE.IDEiPhoneSupport\U201d at path \U201c/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/IDEiPhoneSupport.ideplugin\U201d could not be loaded.  The plug-in or one of its prerequisite plug-ins may be missing or damaged., NSUnderlyingError=0x4003a0b80 \&#8221;The bundle \U201cIDEiPhoneSupport\U201d couldn\U2019t be loaded because it is damaged or missing necessary resources.\&#8221;}&#8221;;<br />
}<br />
Hints: None<br />
Backtrace:<br />
  0  0x00007fff8f10596a __exceptionPreprocess (in CoreFoundation)<br />
  1  0x00007fff8de52d5e objc_exception_throw (in libobjc.A.dylib)<br />
  2  0x000000010a6edc98 -[DVTExtension _fireExtensionFault] (in DVTFoundation)<br />
  3  0x000000010a6d87f9 __38-[DVTDispatchLock performLockedBlock:]_block_invoke_0 (in DVTFoundation)<br />
  4  0x00007fff92f58afd _dispatch_barrier_sync_f_invoke (in libdispatch.dylib)<br />
  5  0x000000010a6d87a9 -[DVTDispatchLock performLockedBlock:] (in DVTFoundation)<br />
  6  0x000000010a6eda45 -[DVTExtension _valueForKey:inParameterData:usingSchema:] (in DVTFoundation)<br />
  7  0x000000010a6ed9ab -[DVTExtension valueForKey:] (in DVTFoundation)<br />
  8  0x000000010a6ed167 +[DVTDevice _knownDeviceLocators] (in DVTFoundation)<br />
  9  0x000000010a6eccea -[DVTDeviceManager startLocating] (in DVTFoundation)<br />
 10  0x000000010ac1d07a IDEInitialize (in IDEFoundation)<br />
 11  0x000000010af8fc0b -[IDEApplicationController applicationWillFinishLaunching:] (in IDEKit)<br />
 12  0x00007fff8b405716 __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 (in Foundation)<br />
 13  0x00007fff8f0ae51a _CFXNotificationPost (in CoreFoundation)<br />
 14  0x00007fff8b3f19cb -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation)<br />
 15  0x00007fff932c46c8 -[NSApplication finishLaunching] (in AppKit)<br />
 16  0x00007fff932c427d -[NSApplication run] (in AppKit)<br />
 17  0x00007fff9354252a NSApplicationMain (in AppKit)<br />
 18  0x000000010a6cfeec (in Xcode)</p>
</blockquote>
<p>I&#8217;m not alone in this issue <a href="https://discussions.apple.com/message/15662283#15662283">https://discussions.apple.com/message/15662283#15662283</a>.</p>
<p>It&#8217;s always something. (Of course, I upgraded asap knowing some problem would turn up. Sue me.)</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/jy4hg65Y19A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2011/07/xcode-from-snow-leopard-to-lion/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2011/07/xcode-from-snow-leopard-to-lion/</feedburner:origLink></item>
		<item>
		<title>Prep addresses for geocoding</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/zYp4YozJbmw/</link>
		<comments>http://johnattebury.com/blog/2011/06/prep-addresses-for-geocoding/#comments</comments>
		<pubDate>Mon, 27 Jun 2011 05:12:43 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[geocode]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=115</guid>
		<description><![CDATA[I needed to geocode several thousand addresses from an old database. The addresses were exported into a pipe-delimited CSV file which contained extra info I didn&#8217;t need. After extracting and prepping the addresses into a separate text file I geocoded &#8230; <a href="http://johnattebury.com/blog/2011/06/prep-addresses-for-geocoding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I needed to geocode several thousand addresses from an old database. The addresses were exported into a pipe-delimited CSV file which contained extra info I didn&#8217;t need. After extracting and prepping the addresses into a separate text file I geocoded the addresses via a simple bash script. </p>
<p><strong>Using Sed &#038; Awk to extract and prep the addresses</strong> </p>
<p># the exported CSV file using pipe | as delimiter</p>
<pre style="font-size:10px;">
"SomeID"|"BusinessName"|"StreetAddress1"|"StreetAddress2"|"City"|"State"|"Zip"|"Phone"|"Fax"
"34"|"Super Store"|"12345 Main St"|""|"Amarillo"|"TX"|"79109"|"123-456-7890"|"234-567-8901"
"85"|"OK Store"|"234 Wescott"|"Suite 100"|"Oklahoma City"|"OK"|"73104"|"345-678-9012"|"456-789-0123"
</pre>
<p># piped commands</p>
<pre>$ sed '1,1 d' exported.csv | sed s/\"//g | sed s/\ /\+/g \
| awk -f addresses.awk | sed '/^ *$/d' > prepped.txt</pre>
<p><strong>Let&#8217;s take a look at each piped command</strong></p>
<p># remove 1st line (header info we don&#8217;t need)</p>
<pre>$ sed '1,1 d' exported.csv</pre>
<p># results are piped to remove double quotes</p>
<pre>| sed s/\"//g</pre>
<p># and those results are piped to replace spaces with +<br />
# (Google&#8217;s geocoding service recommends separating words with pluses + rather than spaces)</p>
<pre>| sed s/\ /\+/g</pre>
<p># results are piped to an awk script (see below) to get only the address fields we want to use<br />
# awk -f <filename> specifies the script to use</p>
<pre>\ | awk -f addresses.awk</pre>
<p># those results are piped to remove blank lines<br />
# and save results to the text file the bash script will use</p>
<pre>| sed '/^ *$/d' > prepped.txt</pre>
<p><strong>A closer look at the straightforward awk script</strong></p>
<pre>
# addresses.awk - - print addresses

# set the pipe as delimiter
# (our CSV file used pipe delimiter rather than commas)
BEGIN { FS = "|" }

{
 # the business name is in field 2
 # business = $2

 # concatenate typical address fields
 # street in 4, city in 6, state in 7, zip in 8
 # we earlier replaced spaces with pluses within address fields
 # hence "Oklahoma City" became "Oklahoma+City"
 # now we insert pluses between fields
 address = $4"+"$6"+"$7"+"$8

 # the data we're looking for
 # will later be processed by the bash script
 print address
}

# print the number of lines that were processed
# use this as a quick validation of the number of addresses
END { print NR }
</pre>
<p># and the prepped.txt file</p>
<pre>
12345+Main+St+Amarillo+TX+79109
234+Wescott+Oklahoma+City+OK+73104
</pre>
<p>With a text file of addresses to geocode, the bash script is up next.</p>
<p>Until this project, I&#8217;d never worked much with Sed &#038; Awk, but using these powerful tools has really crystalized for me the <a href="http://en.wikipedia.org/wiki/Unix_philosophy">Unix Philosophy</a>.</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/zYp4YozJbmw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2011/06/prep-addresses-for-geocoding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2011/06/prep-addresses-for-geocoding/</feedburner:origLink></item>
		<item>
		<title>SpiderMonkey, jsawk &amp; resty on Snow Leopard</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/oTadbBdCOY4/</link>
		<comments>http://johnattebury.com/blog/2011/06/spidermonkey-jsawk-resty-on-snow-leopard/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 07:51:09 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jsawk]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[resty]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=83</guid>
		<description><![CDATA[I recently needed to parse JSON from the command line. A GIS yielded a StackOverflow answer: jsawk. There were other possibilities V8, Python, Perl and PHP, but a Javascript and Awk solution looked promising (and as a Javascript guy, the &#8230; <a href="http://johnattebury.com/blog/2011/06/spidermonkey-jsawk-resty-on-snow-leopard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently needed to parse JSON from the command line. A GIS yielded a <a href="http://stackoverflow.com/questions/1955505/parsing-json-with-sed-and-awk/1955555#1955555">StackOverflow answer</a>: jsawk.</p>
<p>There were other possibilities V8, Python, Perl and PHP, but a Javascript and Awk solution looked promising (and as a Javascript guy, the easiest to pickup). So after a bit of trial and error, here&#8217;s what worked for me.</p>
<p>[Edit- In the comments Bob Kuo suggested using <a href="https://github.com/mxcl/homebrew">Homebrew</a> instead of MacPorts.]</p>
<p>Install <a href="http://www.macports.org/install.php">MacPorts</a> if you haven&#8217;t already.</p>
<p># If you already had MacPorts installed, update and sync if necessary.</p>
<pre>$ sudo port selfupdate
$ sudo port sync</pre>
<p># Install SpiderMonkey (nspr is installed for you)</p>
<pre>$ sudo port install spidermonkey</pre>
<p># Test your install</p>
<pre>$ js</pre>
<p>#You&#8217;ve been dropped into an interactive javascript shell, counts to 99</p>
<pre>js&gt; for(var a = 0; a &lt; 100; a++){ print(a) }</pre>
<p># Quit.</p>
<pre>js&gt;quit()</pre>
<p># Install jsawk &#8211; you can put this wherever you like, I used ~/Code<br />
# For more info, see https://github.com/micha/jsawk</p>
<pre>$ mkdir ~/Code
$ cd !$
$ curl -L http://github.com/micha/jsawk/raw/master/jsawk &gt; jsawk
$ sudo ln -s jsawk /usr/bin/jsawk</pre>
<p># Install resty<br />
# For more info, see https://github.com/micha/resty</p>
<pre>$ curl -L http://github.com/micha/resty/raw/master/resty &gt; resty
$ source resty</pre>
<p># View the current host (you can change this at anytime), outputs URL</p>
<pre>$ resty</pre>
<p># For this demo, set the host to Twitter</p>
<pre>$ resty http://api.twitter.com</pre>
<p># View host again to verify the change, outputs http://api.twitter.com/*</p>
<pre>$ resty</pre>
<p># Get an array of dates from recent tweets on Twitter&#8217;s public timeline</p>
<pre>$ resty GET /statuses/public_timeline.json | \
jsawk  'return this.created_at'</pre>
<p># Get my recent tweets</p>
<pre>$ resty GET /statuses/user_timeline/johnattebury.json | \
jsawk  'return this.text'</pre>
<p>Integrate jsawk into your shell scripts and you&#8217;ve got an excellent JSON parser ready for interesting problems. Combine jsawk with resty and a world of JSON api&#8217;s is just a prompt away.</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/oTadbBdCOY4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2011/06/spidermonkey-jsawk-resty-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2011/06/spidermonkey-jsawk-resty-on-snow-leopard/</feedburner:origLink></item>
		<item>
		<title>Cmd line pipe to list documents of a type</title>
		<link>http://feedproxy.google.com/~r/johnattebury/~3/txp6iprWWDU/</link>
		<comments>http://johnattebury.com/blog/2011/06/cmd-line-pipe/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 04:52:13 +0000</pubDate>
		<dc:creator>John Attebury</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[egrep]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://johnattebury.com/?p=68</guid>
		<description><![CDATA[Lists and links all word docs and pdfs in a new html file. Useful for letting other people check old content to see if it can be deleted. View the code on Gist. &#160;]]></description>
			<content:encoded><![CDATA[<p>Lists and links all word docs and pdfs in a new html file. Useful for letting other people check old content to see if it can be deleted.</p>
<script src="https://gist.github.com/1030425.js"></script><noscript><p>View the code on <a href="https://gist.github.com/1030425">Gist</a>.</p></noscript>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/johnattebury/~4/txp6iprWWDU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://johnattebury.com/blog/2011/06/cmd-line-pipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://johnattebury.com/blog/2011/06/cmd-line-pipe/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.631 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-05-11 16:00:48 -->

