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

<channel>
	<title>revetkn.com</title>
	<atom:link href="http://revetkn.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://revetkn.com</link>
	<description>software from the trenches</description>
	<lastBuildDate>Fri, 05 Feb 2010 21:33:22 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Introducing RestFB, a Java Facebook REST API Client</title>
		<link>http://revetkn.com/?p=95</link>
		<comments>http://revetkn.com/?p=95#comments</comments>
		<pubDate>Fri, 05 Feb 2010 21:27:48 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=95</guid>
		<description><![CDATA[Just wanted to mention that I&#8217;ve written a Facebook REST API client called RestFB, which is available under the terms of the MIT license.
If you need to do a Facebook Connect implementation in Java, please give it a try and let me know what you think!
]]></description>
			<content:encoded><![CDATA[<p>Just wanted to mention that I&#8217;ve written a <a href="http://wiki.developers.facebook.com/index.php/API">Facebook REST API</a> client called <a href="http://restfb.com">RestFB</a>, which is available under the terms of the MIT license.</p>
<p>If you need to do a Facebook Connect implementation in Java, please give it a try and let me know what you think!</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When Callable&lt;V&gt; is not enough</title>
		<link>http://revetkn.com/?p=87</link>
		<comments>http://revetkn.com/?p=87#comments</comments>
		<pubDate>Wed, 20 May 2009 20:22:26 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=87</guid>
		<description><![CDATA[At work today I ended up having to write this because Callable&#60;V&#62; wasn&#8217;t flexible enough for what I needed:

public interface Operation&#60;V, E extends Throwable&#62; {
  V execute() throws E;
}
&#8230;would love to see this (as well as a Pair&#60;A,B&#62; class) in a future cut of Java.
]]></description>
			<content:encoded><![CDATA[<p>At work today I ended up having to write this because <tt><a href="http://java.sun.com/javase/6/docs/api/java/util/concurrent/Callable.html">Callable&lt;V&gt;</a></tt> wasn&#8217;t flexible enough for what I needed:</p>
<pre class="prettyprint">
public interface Operation&lt;V, E extends Throwable&gt; {
  V execute() throws E;
}</pre>
<p>&#8230;would love to see this (as well as a <tt>Pair&lt;A,B&gt;</tt> class) in a future cut of Java.</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=87</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CNN Sob Stories</title>
		<link>http://revetkn.com/?p=83</link>
		<comments>http://revetkn.com/?p=83#comments</comments>
		<pubDate>Thu, 16 Apr 2009 18:50:51 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=83</guid>
		<description><![CDATA[I liked this morning&#8217;s front-page CNN story:

If you bought a house you can&#8217;t afford and are unable to keep paying the mortgage, maybe you shouldn&#8217;t have a $90/month (minimum) iPhone&#8230;just sayin&#8217;.
]]></description>
			<content:encoded><![CDATA[<p>I liked this morning&#8217;s front-page CNN story:<br />
<img src="http://revetkn.com/wp-content/uploads/2009/04/picture-1.png" alt="picture-1" title="picture-1" width="340" height="630" class="alignnone size-full wp-image-84" /><br />
If you bought a house you can&#8217;t afford and are unable to keep paying the mortgage, maybe you shouldn&#8217;t have a $90/month (minimum) iPhone&#8230;just sayin&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=83</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Three20 JSON Example Project</title>
		<link>http://revetkn.com/?p=72</link>
		<comments>http://revetkn.com/?p=72#comments</comments>
		<pubDate>Sat, 11 Apr 2009 14:17:09 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=72</guid>
		<description><![CDATA[I&#8217;ve uploaded an example Three20 project that demonstrates a very simple JSON datasource.  You can grab the code here.  It&#8217;s assumed that Three20 lives at ../three20 relative to the project root and that you&#8217;ve got Stig Brautaset&#8217;s JSON framework installed in your ~/Library directory as explained on the Google Code wiki.
There isn&#8217;t much [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded an example <a href="http://github.com/joehewitt/three20/tree/master">Three20</a> project that demonstrates a very simple JSON datasource.  You can <a href="http://revetkn.com/three20/Three20JsonExample.zip">grab the code here</a>.  It&#8217;s assumed that Three20 lives at ../three20 relative to the project root and that you&#8217;ve got Stig Brautaset&#8217;s JSON framework installed in your ~/Library directory as explained <a href="http://code.google.com/p/json-framework/wiki/InstallationInstructions">on the Google Code wiki</a>.</p>
<p>There isn&#8217;t much to the example &#8211; just a single controller and datasource.  It&#8217;s pretty straightforward to bolt on additional functionality like a &#8220;load more&#8221; button (just read the TTCatalog and Three20 source) and hook into the other nice table features Three20 offers out of the box.  Until better docs are available, hopefully this example can serve as a starting point for your own experimentation.  Feedback is welcome!</p>
<p>Some screenshots so you know what you&#8217;re getting&#8230;first, the controller (registered as a datasource delegate) gets a notification that the datasource is in a loading state &#8211;  this view is then automatically shown by the framework:<br />
<img class="alignnone size-full wp-image-74" title="loading" src="http://revetkn.com/wp-content/uploads/2009/04/loading.png" alt="loading" width="414" height="770" /><br />
Second, the data has been loaded and the datasource has notified the controller that it&#8217;s ready.  The controller then retrieves data from the datasource and displays it:<br />
<img class="alignnone size-full wp-image-79" title="json-images" src="http://revetkn.com/wp-content/uploads/2009/04/json-images.png" alt="json-images" width="414" height="770" /><br />
(I&#8217;m using a feed provided by the Yahoo Image Search Service API: <a href="http://search.yahooapis.com/ImageSearchService/V1/imageSearch?appid=YahooDemo&amp;query=lolcats&amp;output=json">here&#8217;s the raw JSON</a>.)</p>
<p><strong>Update, October 3 9:30 AM EDT</strong><br />
It&#8217;s come to my attention that some people are still using this code &#8211; please don&#8217;t!  It was based on three20 as it existed back in March/April 2009 and is now very much out-of-date.  If you&#8217;re looking for current and correct three20 sample code, <a href="http://github.com/klazuka/TTRemoteExamples/tree/master">Keith Lazuka’s github</a> has what you need.  Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=72</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Three20 JSON datasource implementation</title>
		<link>http://revetkn.com/?p=62</link>
		<comments>http://revetkn.com/?p=62#comments</comments>
		<pubDate>Thu, 02 Apr 2009 16:33:32 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=62</guid>
		<description><![CDATA[Three20 is a nice iPhone library, but the documentation is pretty much limited to the TTCatalog example app code&#8230;one thing that&#8217;s left as an exercise for the reader is the implementation of a datasource that fetches its data over the network and how it interacts with its associated TTTableViewController.
One approach to this problem is to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/joehewitt/three20/tree/master">Three20</a> is a nice iPhone library, but the documentation is pretty much limited to the TTCatalog example app code&#8230;one thing that&#8217;s left as an exercise for the reader is the implementation of a datasource that fetches its data over the network and how it interacts with its associated TTTableViewController.</p>
<p>One approach to this problem is to subclass a canned datasource, which gets us a bunch of stuff for free right off the bat:</p>
<pre class="prettyprint">@interface MyDataSource : TTListDataSource&lt;TTURLRequestDelegate&gt; {
 @private
  BOOL _loading;
  BOOL _loaded;
}</pre>
<p>You&#8217;ll want to provide meaningful implementations of accessors like loadedTime:, isLoading:, isLoadingMore:, isLoaded:, etc.  Your controller will query the datasource using those selectors to know what state to show (e.g. loading, error, data, no data).</p>
<p>Write a load:nextPage: implementation that hits the network:</p>
<pre class="prettyprint">- (void)load:(TTURLRequestCachePolicy)cachePolicy nextPage:(BOOL)nextPage {
  TTURLRequest *request =
   [TTURLRequest requestWithURL:@"http://test.com/test.json" delegate:self];

  request.cachePolicy = cachePolicy;
  request.response = [[[TTURLDataResponse alloc] init] autorelease];
  request.httpMethod = @"GET";
  [request send];
}</pre>
<p>Write a requestDidFinishLoad: implementation that pulls JSON out of the response (maybe using <a href="http://code.google.com/p/json-framework/">Stig Brautaset&#8217;s very nice JSON framework</a>) and let your controller know that data&#8217;s available via dataSourceDidFinishLoad:.</p>
<pre class="prettyprint">- (void)requestDidFinishLoad:(TTURLRequest*)request {
  TTURLDataResponse *response = request.response;
  NSString *json = [[NSString alloc] initWithData:response.data encoding:NSUTF8StringEncoding];

  // Load up self.items with json data however you'd like

  [json release];

  _loading = NO;
  _loaded = YES;  

  [self dataSourceDidFinishLoad];
}</pre>
<p>Don&#8217;t forget to implement requestDidStartLoad:, request:didFailLoadWithError:, and requestDidCancelLoad: and have them notify any interested delegates of the request&#8217;s status.  Here&#8217;s an example:</p>
<pre class="prettyprint">- (void)request:(TTURLRequest*)request didFailLoadWithError:(NSError*)error {
  _loading = NO;
  _loaded = YES;
  [self dataSourceDidFailLoadWithError:error];
}</pre>
<p>In your controller, createDataSource: might look like this:</p>
<pre class="prettyprint">- (id&lt;TTTableViewDataSource&gt;)createDataSource {
  MyDataSource *dataSource = [[[MyDataSource alloc] init] autorelease];
  [dataSource.delegates addObject:self];
  [dataSource load:TTURLRequestCachePolicyDefault nextPage:NO];
  return dataSource;
}</pre>
<p>Have fun out there.</p>
<p><strong>Update, April 11 10:30 AM EDT</strong><br />
I&#8217;ve added a <a href="http://revetkn.com/?p=72">new post with a downloadable example project</a> and (finally) cleaned up the above code.  I apologize for previous typos; I really should make sure the code I post actually compiles instead of writing/tweaking it in a wordpress edit window.</p>
<p><strong>Update, October 3 9:30 AM EDT</strong><br />
It&#8217;s come to my attention that some people are still using this code &#8211; please don&#8217;t!  It was based on three20 as it existed back in March/April 2009 and is now very much out-of-date.  If you&#8217;re looking for current and correct three20 sample code, <a href="http://github.com/klazuka/TTRemoteExamples/tree/master">Keith Lazuka’s github</a> has what you need.  Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=62</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Fedex Webdevs Have Small Monitors</title>
		<link>http://revetkn.com/?p=42</link>
		<comments>http://revetkn.com/?p=42#comments</comments>
		<pubDate>Sat, 13 Dec 2008 20:43:46 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=42</guid>
		<description><![CDATA[
Needs more&#160;background-repeat: no-repeat;
]]></description>
			<content:encoded><![CDATA[<p><a href="http://revetkn.com/wp-content/uploads/2008/12/picture-1.png"><img class="size-medium wp-image-43" title="Fedex CSS fail" src="http://revetkn.com/wp-content/uploads/2008/12/picture-1-300x234.png" alt="Fedex CSS fail" width="300" height="234" /></a></p>
<p>Needs more&nbsp;<tt style="color:#333;">background-repeat: no-repeat;</tt></p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UnknownHostException: Java &amp; IPV6 on Linux</title>
		<link>http://revetkn.com/?p=41</link>
		<comments>http://revetkn.com/?p=41#comments</comments>
		<pubDate>Thu, 09 Oct 2008 18:09:37 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=41</guid>
		<description><![CDATA[In case this helps someone else, I spent a few hours trying to pin down why my GWT app was seeing UnknownHostExceptions for things like google.com when using HttpClient in hosted mode.
Luckily, I found this guy (girl?) in the same boat, who figured out that you just need to flip a system property to get [...]]]></description>
			<content:encoded><![CDATA[<p>In case this helps someone else, I spent a few hours trying to pin down why my GWT app was seeing UnknownHostExceptions for things like google.com when using HttpClient in hosted mode.</p>
<p>Luckily, I found <a href=”http://www.digizenstudio.com/blog/2008/06/09/the-unknownhostexception-and-a-not-so-obvious-cause/#more-160″>this guy (girl?) in the same boat</a>, who figured out that you just need to flip a system property to get correct behavior &#8211; in my case, passing in the VM argument <code>-Djava.net.preferIPv4Stack=true</code> on Tomcat startup.</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lots of Data</title>
		<link>http://revetkn.com/?p=40</link>
		<comments>http://revetkn.com/?p=40#comments</comments>
		<pubDate>Fri, 22 Aug 2008 03:49:09 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=40</guid>
		<description><![CDATA[At xmog we&#8217;re working on a project for Advanta that requires fast searching over millions of records.  Luckily for us, Lucene is disgustingly good and makes the whole process relatively simple.
The reason I mention this is because Amazon&#8217;s Elastic Block Storage was released today &#8211; finally, persistent non-S3 storage inside the compute cloud.  [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://xmog.com">xmog</a> we&#8217;re working on a project for <a href="http://advanta.com">Advanta</a> that requires fast searching over millions of records.  Luckily for us, Lucene is disgustingly good and makes the whole process relatively simple.</p>
<p>The reason I mention this is because <a href="http://www.amazon.com/b/?node=689343011">Amazon&#8217;s Elastic Block Storage</a> was released today &#8211; finally, persistent non-S3 storage inside the compute cloud.  We could slap Hadoop and a database and webserver on that bitch and be ready to roll.  Great stuff, really excited to see old-fashioned webhosting die.</p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=40</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Billing Manager on the iPhone</title>
		<link>http://revetkn.com/?p=39</link>
		<comments>http://revetkn.com/?p=39#comments</comments>
		<pubDate>Wed, 07 May 2008 04:02:05 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=39</guid>
		<description><![CDATA[I was pleasantly surprised to see Billing Manager land at the top of the heap of Apple&#8217;s list of  iPhone Productivity Apps (and we&#8217;re 7th most popular across _all_ apps) only a few days after we added support for Mobile Safari.  We&#8217;re also a &#8220;Staff Pick&#8221;.  Good stuff!

]]></description>
			<content:encoded><![CDATA[<p>I was pleasantly surprised to see <a href="http://billingmanager.com">Billing Manager</a> land at the top of the heap of Apple&#8217;s list of  <a href="http://www.apple.com/webapps/productivity/">iPhone Productivity Apps</a> (and we&#8217;re 7th most popular across _all_ apps) only a few days after we added support for Mobile Safari.  We&#8217;re also a &#8220;Staff Pick&#8221;.  Good stuff!</p>
<p><img src="http://revetkn.com/uploads/bm-iphone.png" /></p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>POOL ON THE ROOF MUST HAVE A LEAK</title>
		<link>http://revetkn.com/?p=38</link>
		<comments>http://revetkn.com/?p=38#comments</comments>
		<pubDate>Wed, 09 Apr 2008 00:53:05 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://revetkn.com/?p=38</guid>
		<description><![CDATA[Don&#8217;t remember where this was originally from (found it years ago).  You have to admit it&#8217;s awesome.

]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t remember where this was originally from (found it years ago).  You have to admit it&#8217;s awesome.</p>
<p><img src="http://revetkn.com/uploads/gibson.jpg"/></p>
]]></content:encoded>
			<wfw:commentRss>http://revetkn.com/?feed=rss2&amp;p=38</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
