<?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>Sat, 18 Feb 2012 06:41:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</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>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>4</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.605 seconds. --><!-- Cached page generated by WP-Super-Cache on 2012-02-18 01:42:42 -->

