<?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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>ayn blog</title>
	
	<link>http://blog.andrewng.com</link>
	<description>Andrew Ng's personal blog</description>
	<lastBuildDate>Thu, 15 Jul 2010 16:47:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/aynblog" /><feedburner:info uri="aynblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>37.801878</geo:lat><geo:long>-122.410181</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><image><link>http://blog.andrewng.com</link><url>http://farm4.static.flickr.com/3564/3782671049_91cf9cb275.jpg</url><title>aynblog</title></image><feedburner:emailServiceId>aynblog</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item>
		<title>random skiing and snowboarding vids</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/ADeyGrLz6eA/</link>
		<comments>http://blog.andrewng.com/2010/07/15/random-skiing-and-snowboarding-vids/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 16:44:01 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Snowboarding]]></category>
		<category><![CDATA[snowboard]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=2036</guid>
		<description>Switch triple rodeo at windells: Gnarcade: Gnarcade from Mike Benson on Vimeo. A videogame invasion has hit Mt Hood and High Cascade! Check out Scott Stevens, Micah Hollinger, Chris Beresford, Tim Eddy, Ben Bogart, and Casey Wrightsman as they live life like it&amp;#8217;s one big game.</description>
			<content:encoded><![CDATA[<p>Switch triple rodeo at windells:</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/nKynrjhbtPI&amp;hl=en_US&amp;fs=1?color1=0x3a3a3a&amp;color2=0x999999&amp;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/nKynrjhbtPI&amp;hl=en_US&amp;fs=1?color1=0x3a3a3a&amp;color2=0x999999&amp;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>Gnarcade:</p>
<p><object width="560" height="315"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=13240711&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=13240711&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="560" height="315"></embed></object>
<p><a href="http://vimeo.com/13240711">Gnarcade</a> from <a href="http://vimeo.com/mikebenson">Mike Benson</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>A videogame invasion has hit Mt Hood and High Cascade!  Check out Scott Stevens, Micah Hollinger, Chris Beresford, Tim Eddy, Ben Bogart, and Casey Wrightsman as they live life like it&#8217;s one big game.  </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=ADeyGrLz6eA:gjD-ic75iK8:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=ADeyGrLz6eA:gjD-ic75iK8:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=ADeyGrLz6eA:gjD-ic75iK8:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=ADeyGrLz6eA:gjD-ic75iK8:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=ADeyGrLz6eA:gjD-ic75iK8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=ADeyGrLz6eA:gjD-ic75iK8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=ADeyGrLz6eA:gjD-ic75iK8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/ADeyGrLz6eA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/07/15/random-skiing-and-snowboarding-vids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/07/15/random-skiing-and-snowboarding-vids/</feedburner:origLink></item>
		<item>
		<title>Migrating a “degraded” Amazon EC2 Instance</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/gvaB_mOUk78/</link>
		<comments>http://blog.andrewng.com/2010/06/22/migrating-a-degraded-amazon-ec2-instance/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 22:13:24 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[degraded]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[instance]]></category>
		<category><![CDATA[migration]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=2021</guid>
		<description>I&amp;#8217;ve been using AWS for a few years now, and it has been rock solid. Last Sunday one of my sites became unreachable, when I got home a couple of hours later, I was able to ssh into the instance and everything seemed to be working perfectly. I checked utmp logs and the instance was [...]</description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using AWS for a few years now, and it has been rock solid. Last Sunday one of my sites became unreachable, when I got home a couple of hours later, I was able to ssh into the instance and everything seemed to be working perfectly. I checked utmp logs and the instance was rebooted. A while later I got this email from Amazon:</p>
<blockquote><p>From: 	Amazon EC2 Notification<br />
Subject: 	Notice: Degraded Amazon EC2 Instance</p>
<p>Hello,</p>
<p>We have noticed that one or more of your instances are running on a host degraded due to hardware failure.</p>
<p>i-xxxxxx</p>
<p>The host needs to undergo maintenance and will be taken down at 12:00 GMT on 2010-06-23. Your instances will be terminated at this point.</p>
<p>The risk of your instances failing is increased at this point. We cannot determine the health of any applications running on the instances. We recommend that you launch replacement instances and start migrating to them.</p>
<p>Feel free to terminate the instances with the ec2-terminate-instance API when you are done with them.</p>
<p>Sincerely,</p>
<p>The Amazon EC2 Team</p></blockquote>
<p>Sounded like they would terminate the instance because of hardware failure, and that would be very bad &#8211; this is a high volume eCommerce site. I looked around to see what was the best way to &#8220;clone&#8221; the instance and relaunch it, and it turned out to be really simple.</p>
<p>When I setup EC2 stuff I always use an EBS volume for the important data like the /home, the MySQL storage, most of the configurations in /etc like Apache vhost configs. I also use an Elastic IP address so I can switch it to another instance easily, and it won&#8217;t require modifying DNS records at all. So all I had to do was:</p>
<ul>
<li>get all your AWS access keys, certs, and user id, onto the instance</li>
<li>create a folder for the AMI bundling work</li>
<li>bundle the root volume on the dying instance</li>
</ul>
<pre class="brush: bash; light: true;">
$ sudo mkdir /mnt/ami &amp;&amp; sudo ec2-bundle-vol -d /mnt/ami -k pk-CKXXXXXXXXXXXX.pem -u 12345678 -c cert-CKXXXXXXXXXXXXXXX.pem
</pre>
<ul>
<li>upload the bundle to S3 and register the AMI</li>
</ul>
<pre class="brush: bash; light: true;">
$ ec2-upload-bundle -b somesite-post-degraded -m /mnt/ami/image.manifest.xml -a XXXXXXXXXX -s XXXXXXXXXXXXX/00XX
$ ec2-register somesite-post-degraded/image.manifest.xml
</pre>
<ul>
<li>launch a new instance with the AMI</li>
<li>unattach the EBS volume from the old instance</li>
<li>attach the EBS volume to new instance</li>
<li>re-assign elastic IP to new instance</li>
</ul>
<p>You can do a lot of these tasks from the <a href="https://console.aws.amazon.com/ec2/home">AWS Management Console</a>. All of that took about 2 hours, most of the time was spent waiting for the AMI to bundle and upload as it was pretty large.</p>
<p>Everything worked perfectly after the migration, when I set up the EC2 infrastructure I had planned for things like these and in theory migration should go without any glitch, but I never actually had a need to migrate an instance. It&#8217;s good to know that everything actually worked as designed.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=gvaB_mOUk78:cbJYTw8El6I:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=gvaB_mOUk78:cbJYTw8El6I:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=gvaB_mOUk78:cbJYTw8El6I:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=gvaB_mOUk78:cbJYTw8El6I:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=gvaB_mOUk78:cbJYTw8El6I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=gvaB_mOUk78:cbJYTw8El6I:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=gvaB_mOUk78:cbJYTw8El6I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/gvaB_mOUk78" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/06/22/migrating-a-degraded-amazon-ec2-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/06/22/migrating-a-degraded-amazon-ec2-instance/</feedburner:origLink></item>
		<item>
		<title>Extra space/row in UIPopoverController content?</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/Bf4O0Qw_2eY/</link>
		<comments>http://blog.andrewng.com/2010/05/24/extra-spacerow-in-uipopovercontroller-content/#comments</comments>
		<pubDate>Tue, 25 May 2010 00:59:00 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[3.2]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[extra space]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[objc]]></category>
		<category><![CDATA[objectivec]]></category>
		<category><![CDATA[popover]]></category>
		<category><![CDATA[UIPopoverController]]></category>
		<category><![CDATA[UISplitViewController]]></category>
		<category><![CDATA[UISplitViewControllerDelegate]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=2007</guid>
		<description>If you&amp;#8217;re using UISplitViewController in your iPad/Universal apps, you probably implemented the UISplitViewControllerDelegate to add a UIBarButtonItem to the detail view controller&amp;#8217;s toolbar to display a popover. The popover might have some extra space before the first row after you rotate the simulator or the iPad from landscape to portrait, took me a few hours [...]</description>
			<content:encoded><![CDATA[<p>If you&#8217;re using <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UISplitViewController_class/Reference/Reference.html"><em>UISplitViewController</em></a> in your iPad/Universal apps, you probably implemented the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UISplitViewControllerDelegate_protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40009454"><em>UISplitViewControllerDelegate</em></a> to add a <em>UIBarButtonItem</em> to the detail view controller&#8217;s toolbar to display a popover. The popover might have some extra space before the first row after you rotate the simulator or the iPad from landscape to portrait, took me a few hours to figure this out, it is because the navigation bar&#8217;s <em>translucent</em> property is set to <em>YES</em>, set it to <em>NO</em> before you add the button and you won&#8217;t see the extra space. Also, if you instantiate the nav bar in your NIB, leave its style as<em>default</em> in Interface Builder, otherwise the popover will be messed up on load when you launch the app in portrait orientation. Set them in code instead.</p>
<pre class="brush: objc; highlight: [12];">
- (void)viewWillAppear:(BOOL)animated {
	[super viewWillAppear:animated];

	self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
	self.navigationController.navigationBar.translucent = YES;
}

#pragma mark -
#pragma mark UISplitViewControllerDelegate methods

- (void)splitViewController:(UISplitViewController *)svc willHideViewController:(UIViewController *)aViewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)pc {
	self.navigationController.navigationBar.translucent = NO; //if I don't do this we get extra space in popover
	barButtonItem.title = @&quot;Some Title&quot;;

	// Keep references to the popover controller and the popover button, and tell the detail view controller to show the button.
	self.popoverController = pc;
	self.rootPopoverButtonItem = barButtonItem;
	UIViewController &lt;SubstitutableDetailViewController&gt; *detailViewController = [splitViewController.viewControllers objectAtIndex:1];
	[detailViewController showRootPopoverButtonItem:rootPopoverButtonItem];
}

- (void)splitViewController:(UISplitViewController *)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {
	//setting it back to black translucent
	self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
	self.navigationController.navigationBar.translucent = YES;

	// Nil out references to the popover controller and the popover button, and tell the detail view controller to hide the button.
	UIViewController &lt;SubstitutableDetailViewController&gt; *detailViewController = [splitViewController.viewControllers objectAtIndex:1];
	[detailViewController invalidateRootPopoverButtonItem:rootPopoverButtonItem];
	self.popoverController = nil;
	self.rootPopoverButtonItem = nil;
}
</pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=Bf4O0Qw_2eY:WfP9nvypPQA:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=Bf4O0Qw_2eY:WfP9nvypPQA:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=Bf4O0Qw_2eY:WfP9nvypPQA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=Bf4O0Qw_2eY:WfP9nvypPQA:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=Bf4O0Qw_2eY:WfP9nvypPQA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=Bf4O0Qw_2eY:WfP9nvypPQA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=Bf4O0Qw_2eY:WfP9nvypPQA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/Bf4O0Qw_2eY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/05/24/extra-spacerow-in-uipopovercontroller-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/05/24/extra-spacerow-in-uipopovercontroller-content/</feedburner:origLink></item>
		<item>
		<title>Speeding up Core Data-based UITableViewController</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/r2kwaVH0K3I/</link>
		<comments>http://blog.andrewng.com/2010/05/11/speeding-up-core-data-based-uitableviewcontroller/#comments</comments>
		<pubDate>Wed, 12 May 2010 06:17:32 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[coredata]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[objectivec]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[threads]]></category>
		<category><![CDATA[uitableviewcontroller]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1995</guid>
		<description>It is pretty common for an iPhone/iPad app to make an API call to a server, get the JSON response data back, parse that data, and display it in a table view. The usual way to do this looks like this: - (void)apiCall { NSString *urlString = [[NSString alloc] initWithFormat:@&amp;#34;%@/some_models/some_action.json&amp;#34;, apiEndpoint]; NSURL *url = [[NSURL [...]</description>
			<content:encoded><![CDATA[<p>It is pretty common for an iPhone/iPad app to make an API call to a server, get the JSON response data back, parse that data, and display it in a table view. The usual way to do this looks like this:</p>
<pre class="brush: objc;">
- (void)apiCall {
	NSString *urlString = [[NSString alloc] initWithFormat:@&quot;%@/some_models/some_action.json&quot;, apiEndpoint];
	NSURL *url = [[NSURL alloc] initWithString:urlString];
	NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
	[request setHTTPMethod:@&quot;GET&quot;];
	[NSURLConnection connectionWithRequest:request delegate:self];
	[url release];
	[urlString release];
}
</pre>
<p>This fires off the API call asynchronously, and then you implement some delegate methods like this:</p>
<pre class="brush: objc;">
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
	responseData = [[NSMutableData alloc] initWithCapacity:[response expectedContentLength]+100];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
	[responseData appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
	NSString *jsonString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
	[self dictionaryToCoreData:[jsonString JSONValue]]; //this parses the JSON data and persists into Core Data
	[jsonString release];
	[responseData release];
}
</pre>
<p>This approach works fine, but when you run it on the real devices, you might notice that the table view locks up when you go between the navigation flow. Basically the table view ignores user inputs until everything above is finished. This is because everything is performed on the main thread and it locks up the UI. The asynchronous <i>NSURLConnection</i> method used above doesn&#8217;t like to be used in a background thread, and there is really no reason to do things asynchronously if you&#8217;re working in the background, conveniently, there is a <i>+sendSynchronousRequest</i> method that waits until we get the response and data in <i>NSURLConnection</i>. To perform the above API call in a background thread, the code is actually much simpler:</p>
<pre class="brush: objc;">
- (void)apiCall {
	[self performSelectorInBackground:@selector(backgroundApiCall) withObject:nil];
}

- (void)backgorundApiCall {
	@synchronized(self) {
		NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Top-level pool

		NSString *urlString = [[NSString alloc] initWithFormat:@&quot;%@/some_models/some_action.json&quot;, apiEndpoint];
		NSURL *url = [[NSURL alloc] initWithString:urlString];
		NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
		[request setHTTPMethod:@&quot;GET&quot;];

		NSURLResponse *resp;
		NSError *error;
		NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&amp;resp error:&amp;error];
		// you should probably do some error handling here
		NSString *jsonString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
		[self dictionaryToCoreData:[jsonString JSONValue]];
		[jsonString release];
		[url release];
		[urlString release];
		[pool release];
	}
}
</pre>
<p>Now, when the table view is first loaded, it displays the stale data in Core Data, the API call is fired off in the background, and when we get data back from the call the table view is updated with the new data. Stale data is better than locked up UI.</p>
<p>Notice the very first time you run the app the table view will be empty until the background thread finishes, if this bothers you, you can preload the database with sample data. In our app we can&#8217;t really do this as the data is unique to the user, but it might make sense for you to ship your apps with pre-loaded data.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=r2kwaVH0K3I:SUcWfCxqscY:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=r2kwaVH0K3I:SUcWfCxqscY:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=r2kwaVH0K3I:SUcWfCxqscY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=r2kwaVH0K3I:SUcWfCxqscY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=r2kwaVH0K3I:SUcWfCxqscY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=r2kwaVH0K3I:SUcWfCxqscY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=r2kwaVH0K3I:SUcWfCxqscY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/r2kwaVH0K3I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/05/11/speeding-up-core-data-based-uitableviewcontroller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/05/11/speeding-up-core-data-based-uitableviewcontroller/</feedburner:origLink></item>
		<item>
		<title>[Reachability reachabilityForLocalWiFi] crash with OS4 SDK</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/jIKOYBLxJx4/</link>
		<comments>http://blog.andrewng.com/2010/05/06/reachability-reachabilityforlocalwifi-crash-with-os4-sdk/#comments</comments>
		<pubDate>Thu, 06 May 2010 21:51:07 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[os4]]></category>
		<category><![CDATA[reachability]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1979</guid>
		<description>If you&amp;#8217;re using Apple&amp;#8217;s reachability framework and compiling with OS4 beta SDK, you might get a crash like this: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[Reachability&amp;#60;0xf37d0&amp;#62; init]: cannot init a class object.' You can fix it by commenting out the [super init] line in + (Reachability*) reachabilityForLocalWiFi in Reachability.m: + (Reachability*) [...]</description>
			<content:encoded><![CDATA[<p>If you&#8217;re using Apple&#8217;s reachability framework and compiling with OS4 beta SDK, you might get a crash like this:</p>
<pre class="brush: objc; light: true;">*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[Reachability&lt;0xf37d0&gt; init]: cannot init a class object.'</pre>
<p>You can fix it by commenting out the [super init] line in + (Reachability*) reachabilityForLocalWiFi in Reachability.m:</p>
<pre class="brush: objc; highlight: [3];">
+ (Reachability*) reachabilityForLocalWiFi;
{
	//[super init];
	struct sockaddr_in localWifiAddress;
	bzero(&amp;localWifiAddress, sizeof(localWifiAddress));
	localWifiAddress.sin_len = sizeof(localWifiAddress);
	localWifiAddress.sin_family = AF_INET;
	// IN_LINKLOCALNETNUM is defined in &lt;netinet/in.h&gt; as 169.254.0.0
	localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
	Reachability* retVal = [self reachabilityWithAddress: &amp;localWifiAddress];
	if(retVal!= NULL)
	{
		retVal-&gt;localWiFiRef = YES;
	}
	return retVal;
}
</pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=jIKOYBLxJx4:MX7_pCjScwQ:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=jIKOYBLxJx4:MX7_pCjScwQ:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=jIKOYBLxJx4:MX7_pCjScwQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=jIKOYBLxJx4:MX7_pCjScwQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=jIKOYBLxJx4:MX7_pCjScwQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=jIKOYBLxJx4:MX7_pCjScwQ:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=jIKOYBLxJx4:MX7_pCjScwQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/jIKOYBLxJx4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/05/06/reachability-reachabilityforlocalwifi-crash-with-os4-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/05/06/reachability-reachabilityforlocalwifi-crash-with-os4-sdk/</feedburner:origLink></item>
		<item>
		<title>this blog at geocities</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/UzmG1j0lTQE/</link>
		<comments>http://blog.andrewng.com/2010/04/27/this-blog-at-geocities/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 05:10:36 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Random stuff]]></category>
		<category><![CDATA[geocities]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1977</guid>
		<description>This is cool, now that GeoCities is gone I kindda miss these ridiculous sites. Well I guess now they moved to My/Face. If this blog were hosted at geocities it would look like this or like this (I like the animated gif of Gates).</description>
			<content:encoded><![CDATA[<p><a href="http://wonder-tonic.com/geocitiesizer/index.php">This</a> is cool, now that <a href="http://geocities.yahoo.com/index.php">GeoCities</a> is gone I kindda miss these ridiculous sites. Well I guess now they moved to My/Face.</p>
<p>If this blog were hosted at geocities it would look like <a href="http://wonder-tonic.com/geocitiesizer/content.php?theme=1&amp;music=2&amp;url=blog.andrewng.com">this</a> or <a href="http://wonder-tonic.com/geocitiesizer/content.php?theme=2&amp;music=5&amp;url=blog.andrewng.com">like this</a> (I like the animated gif of Gates).</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=UzmG1j0lTQE:lIDg-_DTnTY:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=UzmG1j0lTQE:lIDg-_DTnTY:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=UzmG1j0lTQE:lIDg-_DTnTY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=UzmG1j0lTQE:lIDg-_DTnTY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=UzmG1j0lTQE:lIDg-_DTnTY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=UzmG1j0lTQE:lIDg-_DTnTY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=UzmG1j0lTQE:lIDg-_DTnTY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/UzmG1j0lTQE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/04/27/this-blog-at-geocities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/04/27/this-blog-at-geocities/</feedburner:origLink></item>
		<item>
		<title>Kyle Conroy’s Blog – Should I have bought that Apple Product?</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/wL1nuI2nTtQ/</link>
		<comments>http://blog.andrewng.com/2010/04/26/kyle-conroys-blog-should-i-have-bought-that-apple-product/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 17:31:23 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[aapl]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1974</guid>
		<description>Currently, Apple&amp;#8217;s stock is at an all time high. A share today is worth over 40 times its value seven years ago. So, how much would you have today if you purchased stock instead of an Apple product? See for yourself in the table below. via Kyle Conroy&amp;#8217;s Personal Blog and Portfolio &amp;#8211; Should I [...]</description>
			<content:encoded><![CDATA[<blockquote><p>Currently, Apple&#8217;s stock is at an all time high. A share today is worth over 40 times its value seven years ago. So, how much would you have today if you purchased stock instead of an Apple product? See for yourself in the table below.</p></blockquote>
<p>via <a href="http://www.kyleconroy.com/apple-stock.php">Kyle Conroy&#8217;s Personal Blog and Portfolio &#8211; Should I have bought that Apple Product?</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=wL1nuI2nTtQ:NULNJ85HNqU:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=wL1nuI2nTtQ:NULNJ85HNqU:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=wL1nuI2nTtQ:NULNJ85HNqU:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=wL1nuI2nTtQ:NULNJ85HNqU:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=wL1nuI2nTtQ:NULNJ85HNqU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=wL1nuI2nTtQ:NULNJ85HNqU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=wL1nuI2nTtQ:NULNJ85HNqU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/wL1nuI2nTtQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/04/26/kyle-conroys-blog-should-i-have-bought-that-apple-product/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/04/26/kyle-conroys-blog-should-i-have-bought-that-apple-product/</feedburner:origLink></item>
		<item>
		<title>Facebook Like Button WordPress plugin</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/PXhOejqxsyE/</link>
		<comments>http://blog.andrewng.com/2010/04/21/facebook-like-button-wordpress-plugin/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 06:44:07 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[like]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1962</guid>
		<description>Now you can add a Facebook &amp;#8220;Like&amp;#8221; button to any webpage, so I quickly created a plugin to add that to WordPress, it will take a day or 2 to publish to the official plugins site, but in the meantime you can grab it at GitHub. If you don&amp;#8217;t have Git, then you can download [...]</description>
			<content:encoded><![CDATA[<p>Now you can add a <a href="http://developers.facebook.com/docs/reference/plugins/like">Facebook &#8220;Like&#8221; button</a> to any webpage, so I quickly created a plugin to add that to WordPress, it will take a day or 2 to publish to the <a href="http://wordpress.org/extend/plugins/facebook-like-button-wp-plugin/">official plugins site</a>, but in the meantime you can grab it at <a href="http://github.com/ayn/wp-facebook-like-button">GitHub</a>. If you don&#8217;t have Git, then you can <a href="http://github.com/ayn/wp-facebook-like-button/zipball/master">download a zipfile</a> of it.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=PXhOejqxsyE:Wi6jGLnDRbI:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=PXhOejqxsyE:Wi6jGLnDRbI:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=PXhOejqxsyE:Wi6jGLnDRbI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=PXhOejqxsyE:Wi6jGLnDRbI:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=PXhOejqxsyE:Wi6jGLnDRbI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=PXhOejqxsyE:Wi6jGLnDRbI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=PXhOejqxsyE:Wi6jGLnDRbI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/PXhOejqxsyE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/04/21/facebook-like-button-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/04/21/facebook-like-button-wordpress-plugin/</feedburner:origLink></item>
		<item>
		<title>Dear Amazon, please don’t show me IE8 ads.</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/A-g1H1-kGbM/</link>
		<comments>http://blog.andrewng.com/2010/04/20/dear-amazon-please-dont-show-me-ie8-ads/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 08:15:23 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[ie8]]></category>
		<category><![CDATA[stupidity]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1954</guid>
		<description>When I go to Amazon I see huge IE8 ads everywhere, very annoying. I submitted ad feedback, not sure if that would help. Uploaded with plasq&amp;#8216;s Skitch!</description>
			<content:encoded><![CDATA[<div class="thumbnail">When I go to Amazon I see huge IE8 ads everywhere, very annoying. I submitted ad feedback, not sure if that would help.</div>
<div class="thumbnail"></div>
<div class="thumbnail"></div>
<div class="thumbnail"><a href="http://skitch.com/andrewng/n9i6d/amazon.com-online-shopping-for-electronics-apparel-computers-books-dvds-more"><img src="http://img.skitch.com/20100420-ejhx18yarfcp3wc62qmsteuc35.preview.jpg" alt="Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs &amp; more" /></a><br />
<span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080;">Uploaded with <a href="http://plasq.com/">plasq</a>&#8216;s <a href="http://skitch.com">Skitch</a>!</span></div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=A-g1H1-kGbM:xGoVgQz8VRY:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=A-g1H1-kGbM:xGoVgQz8VRY:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=A-g1H1-kGbM:xGoVgQz8VRY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=A-g1H1-kGbM:xGoVgQz8VRY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=A-g1H1-kGbM:xGoVgQz8VRY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=A-g1H1-kGbM:xGoVgQz8VRY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=A-g1H1-kGbM:xGoVgQz8VRY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/A-g1H1-kGbM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/04/20/dear-amazon-please-dont-show-me-ie8-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/04/20/dear-amazon-please-dont-show-me-ie8-ads/</feedburner:origLink></item>
		<item>
		<title>If you switched to Three20′s iPad branch and got a linking error…</title>
		<link>http://feedproxy.google.com/~r/aynblog/~3/EfGlvSEUf3U/</link>
		<comments>http://blog.andrewng.com/2010/04/14/if-you-switched-to-three20s-ipad-branch-and-got-a-linking-error/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 19:55:18 +0000</pubDate>
		<dc:creator>ayn</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[objectivec]]></category>
		<category><![CDATA[three20]]></category>

		<guid isPermaLink="false">http://blog.andrewng.com/?p=1947</guid>
		<description>If you switched to Three20&amp;#8242;s iPad branch and see a linking error about MFMailComposeViewController in TTEmailComposer.o, make sure you add MessageUI.framework to your build target.</description>
			<content:encoded><![CDATA[<p>If you switched to <a href="http://github.com/facebook/three20/tree/ipad">Three20&#8242;s iPad branch</a> and see a linking error about <em>MFMailComposeViewController</em> in <em>TTEmailComposer.o</em>, make sure you add <em>MessageUI.framework</em> to your build target.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/aynblog?a=EfGlvSEUf3U:AOVOecOB5rM:WtzYBjuvWu0"><img src="http://feeds.feedburner.com/~ff/aynblog?d=WtzYBjuvWu0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=EfGlvSEUf3U:AOVOecOB5rM:I9og5sOYxJI"><img src="http://feeds.feedburner.com/~ff/aynblog?d=I9og5sOYxJI" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=EfGlvSEUf3U:AOVOecOB5rM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/aynblog?i=EfGlvSEUf3U:AOVOecOB5rM:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=EfGlvSEUf3U:AOVOecOB5rM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/aynblog?i=EfGlvSEUf3U:AOVOecOB5rM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/aynblog?a=EfGlvSEUf3U:AOVOecOB5rM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/aynblog?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/aynblog/~4/EfGlvSEUf3U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.andrewng.com/2010/04/14/if-you-switched-to-three20s-ipad-branch-and-got-a-linking-error/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.andrewng.com/2010/04/14/if-you-switched-to-three20s-ipad-branch-and-got-a-linking-error/</feedburner:origLink></item>
	</channel>
</rss>
