<?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>Perceive Designs &#187; Programming</title>
	<atom:link href="http://www.perceive.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.perceive.net</link>
	<description>My Perception is My Reality</description>
	<lastBuildDate>Wed, 30 Nov 2011 19:06:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Finally Found the Error I&#8217;ve Been Looking for (or &#8220;OSX Error Code Lookup Tool&#8221;)</title>
		<link>http://www.perceive.net/2009/12/22/finally-found-the-error-ive-been-looking-for-or-osx-error-code-lookup-tool/</link>
		<comments>http://www.perceive.net/2009/12/22/finally-found-the-error-ive-been-looking-for-or-osx-error-code-lookup-tool/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 19:29:25 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1071</guid>
		<description><![CDATA[In a recent project, I kept receiving a -10000 error in the console when running my app.  Quite frustrating to say the least since the error description was useless, and Google wasn&#8217;t any help at all either.
So I was completely thrilled to come across the OSX Error Code Lookup Tool.  Download, compile, and plug in [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent project, I kept receiving a -10000 error in the console when running my app.  Quite frustrating to say the least since the error description was useless, and Google wasn&#8217;t any help at all either.</p>
<p>So I was completely thrilled to come across the <a href="http://bitbucket.org/boredzo/error-lookup-tool/downloads/" onclick="javascript:pageTracker._trackPageview('/outbound/article/bitbucket.org');">OSX Error Code Lookup Tool</a>.  Download, compile, and plug in your error code &#8212; it&#8217;ll give you something good back!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2009/12/22/finally-found-the-error-ive-been-looking-for-or-osx-error-code-lookup-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color Me Crazy (or &#8220;When a Color Isn&#8217;t Just a Color&#8221;)</title>
		<link>http://www.perceive.net/2009/11/19/color-me-crazy-or-when-a-color-isnt-just-a-color/</link>
		<comments>http://www.perceive.net/2009/11/19/color-me-crazy-or-when-a-color-isnt-just-a-color/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 18:04:47 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[cocoatouch]]></category>
		<category><![CDATA[UIColor]]></category>
		<category><![CDATA[UIImage]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1037</guid>
		<description><![CDATA[Ever need to use an image as a background, but can&#8217;t figure out how?  It&#8217;s quite simple &#8212; colors aren&#8217;t always colors:

UIImage *patternImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"patternImage" ofType:@"png"]];

[myView setBackgroundColor:[UIColor colorWithPatternImage: patternImage]];

]]></description>
			<content:encoded><![CDATA[<p>Ever need to use an image as a background, but can&#8217;t figure out how?  It&#8217;s quite simple &#8212; colors aren&#8217;t always colors:</p>
<pre><code>
UIImage *patternImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"patternImage" ofType:@"png"]];

[myView setBackgroundColor:[UIColor colorWithPatternImage: patternImage]];
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2009/11/19/color-me-crazy-or-when-a-color-isnt-just-a-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We are a Billion Fragments (or &#8220;Removing URL Fragments with NSURL&#8221;)</title>
		<link>http://www.perceive.net/2009/11/19/we-are-a-billion-fragments-or-removing-url-fragments-with-nsurl/</link>
		<comments>http://www.perceive.net/2009/11/19/we-are-a-billion-fragments-or-removing-url-fragments-with-nsurl/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 17:24:35 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[NSURL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1059</guid>
		<description><![CDATA[NSURL is a wonderfully powerful Cocoa object, bet there is at least one thing it leaves out, but I'll show you how to fix that.]]></description>
			<content:encoded><![CDATA[<p>NSURL is a wonderfully powerful Cocoa object, bet there is at least one thing it leaves out, but I&#8217;ll show you how to fix that.  <a href="http://en.wikipedia.org/wiki/Uniform_Resource_Locator"title="Uniform Resource Locator"  onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">URLs</a> are composed of several distinct parts. Given the example URL of http://www.example.com:80/path/to/file/page.htm?key=val#foo this is broken into these parts:</p>
<ul>
<li>scheme (http://)</li>
<li>authority (www.example.com:80)</li>
<li>path (/path/to/file/page.htm)</li>
<li>query (key=val)</li>
<li>fragment (foo)</li>
</ul>
<p>You can read more about all of this in <a href="http://labs.apache.org/webarch/uri/rfc/rfc3986.html" onclick="javascript:pageTracker._trackPageview('/outbound/article/labs.apache.org');">RFC3986</a>.  Today I&#8217;m just focusing on the fragment part.</p>
<p>Frequently, you have an NSURL object and may just want the URL without the fragment, to find distinct pages in a site for example.</p>
<p>This Objective-C category on the NSURL object does just that.</p>
<p>header:</p>
<pre>//
//  PDNSURLExtras.h
//
//  Created by Eric Vitiello on 11/5/09.
//  Copyright 2009 Eric Vitiello. All rights reserved.
//

#import 

@interface NSURL (PDExtras)
- (NSURL *)urlByRemovingFragment;
@end</pre>
<p>implementation:</p>
<pre>//
//  PDNSURLExtras.m
//
//  Created by Eric Vitiello on 11/5/09.
//  Copyright 2009 Eric Vitiello. All rights reserved.
//

#import "PDNSURLExtras.h"

@implementation NSURL (PDExtras)

-(NSURL *)urlByRemovingFragment {
	NSString *urlString = [self absoluteString];
	// Find that last component in the string from the end to make sure to get the last one
	NSRange fragmentRange = [urlString rangeOfString:@"#" options:NSBackwardsSearch];
	if (fragmentRange.location != NSNotFound) {
		// Chop the fragment.
		NSString* newURLString = [urlString substringToIndex:fragmentRange.location];
		return [NSURL URLWithString:newURLString];
	} else {
		return self;
	}
}

@end</pre>
<p>To use:</p>
<pre>NSURL *url = [NSURL URLWithString:@"http://www.example.com:80/path/to/file/page.htm?key=val#foo"];
NSURL *urlWithoutFragment = [url urlByRemovingFragment];</pre>
<p>Nice and simple.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2009/11/19/we-are-a-billion-fragments-or-removing-url-fragments-with-nsurl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magpie and Feed Encoding (or &#8220;Why are there question marks everywhere?&#8221;)</title>
		<link>http://www.perceive.net/2009/04/09/magpie-and-feed-encoding-or-why-are-there-question-marks-everywhere/</link>
		<comments>http://www.perceive.net/2009/04/09/magpie-and-feed-encoding-or-why-are-there-question-marks-everywhere/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 14:45:59 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1040</guid>
		<description><![CDATA[So I&#8217;m working on a website that uses MagpieRSS for parsing a feed.  The feed had those pretty quotation and apostrophes in it, but when Magpie parses the feed, they all get turned into question marks.
So, for future reference, you can force Magpie to parse the feed according to the encoding you need by [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;m working on a website that uses <a href="http://magpierss.sourceforge.net/" onclick="javascript:pageTracker._trackPageview('/outbound/article/magpierss.sourceforge.net');">MagpieRSS</a> for parsing a feed.  The feed had those pretty quotation and apostrophes in it, but when Magpie parses the feed, they all get turned into question marks.</p>
<p>So, for future reference, you can force Magpie to parse the feed according to the encoding you need by setting a constant before calling magpie:<br />
<code><br />
define('MAGPIE_OUTPUT_ENCODING', 'UTF-8');<br />
</code></p>
<p>That&#8217;s all.  Your feed will look good.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2009/04/09/magpie-and-feed-encoding-or-why-are-there-question-marks-everywhere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If I Had a Photograph of You (or &#8220;How to Cache Images in CocoaTouch&#8221;)</title>
		<link>http://www.perceive.net/2009/01/13/if-i-had-a-photograph-of-you-or-how-to-cache-images-in-cocoatouch/</link>
		<comments>http://www.perceive.net/2009/01/13/if-i-had-a-photograph-of-you-or-how-to-cache-images-in-cocoatouch/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 02:44:44 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1035</guid>
		<description><![CDATA[A quick note.  Wanting to cache images in an iPhone app?  Load the image using:
[UIImage imageNamed:]
if you use:
[UIImage imageWithContentsOfFile:]
the image will not be cached.
]]></description>
			<content:encoded><![CDATA[<p>A quick note.  Wanting to cache images in an iPhone app?  Load the image using:</p>
<pre>[UIImage imageNamed:]</pre>
<p>if you use:</p>
<pre>[UIImage imageWithContentsOfFile:]</pre>
<p>the image will not be cached.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2009/01/13/if-i-had-a-photograph-of-you-or-how-to-cache-images-in-cocoatouch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone / iPod Touch Backup Extractor</title>
		<link>http://www.perceive.net/2008/11/11/iphone-ipod-touch-backup-extractor/</link>
		<comments>http://www.perceive.net/2008/11/11/iphone-ipod-touch-backup-extractor/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 12:36:04 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1027</guid>
		<description><![CDATA[This may come as a surprise to some of you, but debugging applications on the iPhone is no picnic. I know, crazy, isn&#8217;t it!  It&#8217;s next to impossible to get the information you need from a customer&#8217;s device without building in some method to send the user&#8217;s preferences, data, etc. right into your application, which [...]]]></description>
			<content:encoded><![CDATA[<p>This may come as a surprise to some of you, but debugging applications on the iPhone is no picnic. I know, crazy, isn&#8217;t it!  It&#8217;s next to impossible to get the information you need from a customer&#8217;s device without building in some method to send the user&#8217;s preferences, data, etc. right into your application, which just seems messy.</p>
<p>Luckily another developer has created the <a href="http://supercrazyawesome.com/" target="_blank" onclick="javascript:pageTracker._trackPageview('/outbound/article/supercrazyawesome.com');">iPhone / iPod Touch Backup Extractor</a>, which extracts all of the data for an application from the backups made by iTunes when you sync your device.</p>
<p>What a wonderful thing.  Thank you, Pádraig.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2008/11/11/iphone-ipod-touch-backup-extractor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyGarden (or &#8220;Is There an App for My iPhone to Track the Things I&#8217;ve Planted?&#8221;)</title>
		<link>http://www.perceive.net/2008/08/09/mygarden-or-is-there-an-app-for-my-iphone-to-track-the-things-ive-planted/</link>
		<comments>http://www.perceive.net/2008/08/09/mygarden-or-is-there-an-app-for-my-iphone-to-track-the-things-ive-planted/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 03:41:45 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[programing]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1018</guid>
		<description><![CDATA[My first app for the Apple AppStore is finally in the queue waiting approval to appear in the AppStore.  It&#8217;s called MyGarden, and keeps track of the things that you plant in your garden.
]]></description>
			<content:encoded><![CDATA[<p>My first app for the Apple AppStore is finally in the queue waiting approval to appear in the AppStore.  It&#8217;s called <a title="MyGarden" href="/mygarden">MyGarden</a>, and keeps track of the things that you plant in your garden.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2008/08/09/mygarden-or-is-there-an-app-for-my-iphone-to-track-the-things-ive-planted/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple OS X WebDAV doesn&#8217;t work right (or &#8220;How To Redirect Carefully&#8221;)</title>
		<link>http://www.perceive.net/2008/07/08/apple-os-x-webdav-doesnt-work-right-or-how-to-redirect-carefully/</link>
		<comments>http://www.perceive.net/2008/07/08/apple-os-x-webdav-doesnt-work-right-or-how-to-redirect-carefully/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 16:43:06 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[webdav]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=1007</guid>
		<description><![CDATA[I have a WebDAV server that I store all of my personal documents on, and after upgrading to Tiger awhile back I had problems with folders disappearing in the directory listing, and things just not working quite right.
It turns out that the Apple WebDAVFS (and some other WebDAV client implementations) have problems with the Apache [...]]]></description>
			<content:encoded><![CDATA[<p>I have a WebDAV server that I store all of my personal documents on, and after upgrading to Tiger awhile back I had problems with folders disappearing in the directory listing, and things just not working quite right.</p>
<p>It turns out that the Apple WebDAVFS (and some other WebDAV client implementations) have problems with the Apache WebDAV.  Just a minor incompatibility, but annoying nonetheless.  There is a configuration change that needs to be made in the httpd.conf to fix this problem:</p>
<pre>BrowserMatch "^WebDAVFS/1.+" redirect-carefully</pre>
<p>This should work for all future 1.x versions of WebDAVFS on OS X.  I limited it to 1.x assuming that maybe, just maybe, they might fix this &#8220;problem&#8221; in version 2.0.</p>
<p>It&#8217;s a simple change, and will make Apache &#8220;redirect carefully&#8221;.  For those interested, Apache says:</p>
<blockquote><p>This forces the server to be more careful when sending a redirect to the client. This is typically used when a client has a known problem handling redirects. This was originally implemented as a result of a problem with Microsoft&#8217;s WebFolders software which has a problem handling redirects on directory resources via DAV methods.</p></blockquote>
<p>If course, I would think it should always be &#8220;careful&#8221; about redirecting, but that&#8217;s just me.  Maybe redirecting carelessly is the best default.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2008/07/08/apple-os-x-webdav-doesnt-work-right-or-how-to-redirect-carefully/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hebrew in PHP (or &#8220;Unexpected What?&#8221;)</title>
		<link>http://www.perceive.net/2008/05/28/hebrew-in-php-or-unexpected-what/</link>
		<comments>http://www.perceive.net/2008/05/28/hebrew-in-php-or-unexpected-what/#comments</comments>
		<pubDate>Wed, 28 May 2008 18:55:56 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.perceive.net/?p=999</guid>
		<description><![CDATA[One of the guys here just got an interesting PHP error:
Parse error:  syntax error, unexpected &#8216;)&#8217;, expecting T_PAAMAYIM_NEKUDOTAYIM in C:\wamp\index.php on line 201
Apparently it&#8217;s hebrew for &#8220;double colon&#8221;.
You learn something new every day.
]]></description>
			<content:encoded><![CDATA[<p>One of the guys here just got an interesting PHP error:</p>
<blockquote><p>Parse error:  syntax error, unexpected &#8216;)&#8217;, expecting T_PAAMAYIM_NEKUDOTAYIM in C:\wamp\index.php on line 201</p></blockquote>
<p><a href="http://en.wikipedia.org/wiki/Paamayim_nekudotayim"title="Double Colon.  Really."  onclick="javascript:pageTracker._trackPageview('/outbound/article/en.wikipedia.org');">Apparently it&#8217;s hebrew</a> for &#8220;double colon&#8221;.</p>
<p>You learn something new every day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2008/05/28/hebrew-in-php-or-unexpected-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 3 Smart Bookmarks (or &#8220;Find Your Place&#8221;)</title>
		<link>http://www.perceive.net/2008/04/08/firefox-3-smart-bookmarks-or-find-your-place/</link>
		<comments>http://www.perceive.net/2008/04/08/firefox-3-smart-bookmarks-or-find-your-place/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 15:32:58 +0000</pubDate>
		<dc:creator>eric</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Firefox]]></category>

		<guid isPermaLink="false">http://www.perceive.net/2008/04/08/firefox-3-smart-bookmarks-or-find-your-place/</guid>
		<description><![CDATA[Firefox 3 includes an interesting concept called places.  The idea is that all history and bookmarks are stored in a SQLite database, and the browser exposes an API to interact with the data.  You&#8217;ll see it in action in the &#8220;Smart Bookmarks&#8221; button in the Bookmarks Toolbar &#8212; these are dynamic queries against the database [...]]]></description>
			<content:encoded><![CDATA[<p>Firefox 3 includes an interesting concept called <a href="http://developer.mozilla.org/en/docs/Places" onclick="javascript:pageTracker._trackPageview('/outbound/article/developer.mozilla.org');">places</a>.  The idea is that all history and bookmarks are stored in a SQLite database, and the browser exposes an API to interact with the data.  You&#8217;ll see it in action in the &#8220;Smart Bookmarks&#8221; button in the Bookmarks Toolbar &#8212; these are dynamic queries against the database to find places you have visited the most, visited recently, etc.</p>
<p>I became interested in this because I started to write an extension for Firefox 2 to display all of the websites I work on that are in development &#8212; the overhead was far too much for the return, so I stopped working on it.</p>
<p>Luckily, with Firefox 3, the places infrastructure allows me to do this very easily.  For instance <a href="place:type=0&amp;sort=4&amp;maxResults=50&amp;terms=staging">this bookmark</a> will list out all of the items in your history, sorted recently visited first, that contain the text &#8217;staging&#8217;.  Quite handy.</p>
<p>I&#8217;m sure there is a better way to do this.  I tried the <a href="http://forums.mozillazine.org/viewtopic.php?t=629560" onclick="javascript:pageTracker._trackPageview('/outbound/article/forums.mozillazine.org');">uri parameter</a>, but it kept crashing Firefox.  In any case, it&#8217;s a nice addition, and another testament to SQLite&#8217;s applicability to many areas of web and application development.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.perceive.net/2008/04/08/firefox-3-smart-bookmarks-or-find-your-place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

