<?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>Light Year Blog &#187; Apple</title>
	<atom:link href="http://lightyearsoftware.com/blog/category/apple/feed/" rel="self" type="application/rss+xml" />
	<link>http://lightyearsoftware.com/blog</link>
	<description>Thoughts on Rails, iPhone and software consulting from a Columbus indie developer.</description>
	<lastBuildDate>Thu, 09 Sep 2010 02:46:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>My First Foray into Facebook Ads</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F09%2Fmy-first-foray-into-facebook-ads%2F&amp;seed_title=My+First+Foray+into+Facebook+Ads</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F09%2Fmy-first-foray-into-facebook-ads%2F&amp;seed_title=My+First+Foray+into+Facebook+Ads#comments</comments>
		<pubDate>Fri, 03 Sep 2010 14:17:54 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=295</guid>
		<description><![CDATA[Web Roulette hasn&#8217;t lit the world on fire. Thus far I&#8217;ve been working on free options: Twitter, Facebook and LinkedIn contacts, submissions to app review sites, giving out handfuls of promo codes and asking the younger members of my extended family to give them to their friends. It hasn&#8217;t made a noticeable difference. Thus far, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://lightyearsoftware.com/products/web-roulette.html">Web Roulette</a> hasn&#8217;t lit the world on fire. Thus far I&#8217;ve been working on free options: Twitter, Facebook and LinkedIn contacts, submissions to app review sites, giving out handfuls of promo codes and asking the younger members of my extended family to give them to their friends. It hasn&#8217;t made a noticeable difference. Thus far, sales have followed the usual &#8220;app curve&#8221;: the biggest sales day is day #1, with an almost exponential decline to one or two a day, at best.</p>
<p>I decided to dip my toe into paid advertising, and Facebook seemed the natural place to start. The way I figure it: people who spend time on Facebook, and more to the point, people who look at, and especially click on, Facebook ads are people who are looking to waste time online. That&#8217;s my target audience for Web Roulette: people looking to waste time online. Facebook makes it easy and fairly affordable to experiment with ads, offering both a CPM (impression-based) and CPC (click-based) model. Knowing that the proportion of Facebook users who also have iOS devices is probably well less than half, I opted for the CPC model.</p>
<p>Facebook lets you target your ad in some nice ways and lets you set a bid price for each click and a daily maximum. I won&#8217;t go into all the details, but it is pretty nice for someone getting started with advertising.</p>
<p>This first experience with it was, to say the least, disappointing. I started the campaign on Monday, August 23 and set a daily maximum of $20. The first day, Facebook served 189,795 impressions, garnering 31 clicks, for a click-through rate of 0.016%. The second day, 160,000 impressions, 32 clicks: 0.02%. The third day, 68,478 impressions, 3 clicks: 0.004%. The campaign ran for a week, but Facebook served essentially no ads the last four days, resulting in no clicks. This is hardly surprising, as my ads performed horribly.</p>
<p>I created additional, more focused ads within the campaign. The first ad targeted anyone in the United States, and ended with 204,479 impressions, 31 clicks (0.015% CTR). A second ad created later that day targeted people 18-35 in the United States (219,146 impressions, 35 clicks, 0.015%). A day or so later, I created ads targeting people who had &#8220;liked&#8221; various iPhone keywords, and another targeting people who had &#8220;liked&#8221; StumbleUpon, which is a web site similar to what Web Roulette does. These last two ads were shown so few times (3663 and 1755 impressions, respectively) that I don&#8217;t think I can draw any conclusions regarding their effectiveness.</p>
<p>Maybe my ads weren&#8217;t written very well or I didn&#8217;t bid enough, but given these results, I&#8217;m not eager to run another campaign. Worst of all, I sent the clicks through LinkShare, and I know that of the 66 clicks I received, not one resulted in a sale. For a 99¢ app. This is a brutal market.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F09%2Fmy-first-foray-into-facebook-ads%2F&amp;seed_title=My+First+Foray+into+Facebook+Ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding &#8220;contrib&#8221; Extensions to MacPorts PostgreSQL</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fadding-contrib-extensions-to-macports-postgresql%2F&amp;seed_title=Adding+%26%238220%3Bcontrib%26%238221%3B+Extensions+to+MacPorts+PostgreSQL</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fadding-contrib-extensions-to-macports-postgresql%2F&amp;seed_title=Adding+%26%238220%3Bcontrib%26%238221%3B+Extensions+to+MacPorts+PostgreSQL#comments</comments>
		<pubDate>Fri, 06 Aug 2010 02:41:19 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=286</guid>
		<description><![CDATA[PostgreSQL is my database of choice. The main reason is that a standard distribution comes with just about everything one could ask for in a free RDBMS, and if what you want isn&#8217;t already installed, it&#8217;s often in the &#8220;contrib&#8221; directory. In particular, now that I&#8217;m doing a lot of iOS development, and location awareness [...]]]></description>
			<content:encoded><![CDATA[<p>PostgreSQL is my database of choice. The main reason is that a standard distribution comes with just about everything one could ask for in a free RDBMS, and if what you want isn&#8217;t already installed, it&#8217;s often in the &#8220;contrib&#8221; directory. In particular, now that I&#8217;m doing a lot of iOS development, and location awareness is a big part of mobile apps, it&#8217;s useful to be able to work with coordinates. PostgreSQL does this using the cube data type and earthdistance functions, both in &#8220;contrib&#8221;.</p>
<p>MacPorts, however, doesn&#8217;t include much of the contents of &#8220;contrib&#8221; in a standard install, including both of these extensions. This makes it a lot harder to develop code using them unless I want to set up a development database on my production server, something I am not eager to do.</p>
<p>Thankfully, there is a solution: disable auto-clean, and after installing the <tt>postgresql83</tt> (or <tt>84</tt>, depending on the version you want), you can install the extra &#8220;contrib&#8221; extensions by hand.</p>
<ol>
<li>Edit <tt>/opt/local/etc/macports/macports.conf</tt> and set <tt>portautoclean</tt> to <tt>no</tt>.</li>
<li>Install PostgreSQL (<tt>sudo port install postgresql83</tt>) or, if you&#8217;ve already installed it, re-install it (<tt>sudo port upgrade --force postgresql83</tt>).</li>
<li>Change into MacPorts working directory: <tt>cd `port work postgresql83`/postgresql-8.3.11/contrib</tt>. Your specific version will differ from mine if you&#8217;re reading this more than a few months after I wrote it.</li>
<li>For each extension you want installed, <tt>cd</tt> into the directory, <tt>make all</tt>, then <tt>sudo make install</tt>. This compiles C code, if any, into a shared library, then copies the library and supporting SQL files (to create types, functions, etc., and also to drop them) to <tt>/opt/local/share/postgresql83/contrib</tt>.</li>
<li>Change into <tt>/opt/local/share/postgresql83/contrib</tt> and run the SQL files associated with the extensions you want. This probably needs to be done as the PostgreSQL super-user. For example, <tt>psql -U postgres dbname &lt;cube.sql</tt>.</li>
<li>Enable auto-clean again by editing <tt>/opt/local/etc/macports/macports.conf</tt> and setting <tt>portautoclean</tt> back to <tt>yes</tt>.</li>
<li>Clean the postgresql83 port: <tt>sudo port clean postgresql83</tt>.
</ol>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fadding-contrib-extensions-to-macports-postgresql%2F&amp;seed_title=Adding+%26%238220%3Bcontrib%26%238221%3B+Extensions+to+MacPorts+PostgreSQL/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Roulette 1.0.1 is on the App Store</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fweb-roulette-1-0-1-is-on-the-app-store%2F&amp;seed_title=Web+Roulette+1.0.1+is+on+the+App+Store</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fweb-roulette-1-0-1-is-on-the-app-store%2F&amp;seed_title=Web+Roulette+1.0.1+is+on+the+App+Store#comments</comments>
		<pubDate>Wed, 04 Aug 2010 18:17:52 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=284</guid>
		<description><![CDATA[Apple approved the 1.0.1 update to Web Roulette earlier this week. It fixes a potential crash when submitting links back to us and addresses a UI glitch on the &#8220;about&#8221; screen. One interesting statistic from the first couple weeks of sales is that iPad users are the large majority of daily users. It&#8217;s hard (impossible?) [...]]]></description>
			<content:encoded><![CDATA[<p>Apple approved the 1.0.1 update to Web Roulette earlier this week. It fixes a potential crash when submitting links back to us and addresses a UI glitch on the &#8220;about&#8221; screen.</p>
<p>One interesting statistic from the first couple weeks of sales is that iPad users are the large majority of daily users. It&#8217;s hard (impossible?) to say if this is because there is less competition in the iPad part of the App Store or if people prefer to use a web-centric app like Web Roulette on an iPad.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fweb-roulette-1-0-1-is-on-the-app-store%2F&amp;seed_title=Web+Roulette+1.0.1+is+on+the+App+Store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Set Up Internet Sharing on Mac OS X</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F06%2Fhow-to-set-up-internet-sharing-on-mac-os-x%2F&amp;seed_title=How+to+Set+Up+Internet+Sharing+on+Mac+OS+X</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F06%2Fhow-to-set-up-internet-sharing-on-mac-os-x%2F&amp;seed_title=How+to+Set+Up+Internet+Sharing+on+Mac+OS+X#comments</comments>
		<pubDate>Thu, 10 Jun 2010 04:57:26 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=266</guid>
		<description><![CDATA[These days, it&#8217;s not uncommon to be faced with the situation of having two or more Wi-Fi devices you might wish to use in a hotel room when the hotel does not provide free in-room Wi-Fi. The hotel doesn&#8217;t know that those devices are all yours and in one room, so using them means paying [...]]]></description>
			<content:encoded><![CDATA[<p>These days, it&#8217;s not uncommon to be faced with the situation of having two or more Wi-Fi devices you might wish to use in a hotel room when the hotel does not provide free in-room Wi-Fi. The hotel doesn&#8217;t know that those devices are all yours and in one room, so using them means paying <em>per device</em>, which is crazy.</p>
<p>This explains how to easily set up Internet connection sharing in Mac OS X 10.6 so you can pay once, and piggyback the rest of your devices off that one laptop. These instructions assume that you have a wired Ethernet connection available in the room.</p>
<ol>
<li>Plug in your laptop to the Ethernet, pay and get it working.</li>
<li>Go to System Preferences -> Network. Take note of the <strong>IP address</strong>, <strong>router</strong> and <strong>one DNS server</strong>.</li>
<p><a href="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/Screen-shot-2010-06-09-at-9.32.08-PM.png"><img src="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/Screen-shot-2010-06-09-at-9.32.08-PM-300x144.png" alt="Ethernet connection settings" title="Ethernet Settings" width="300" height="144" class="aligncenter size-medium wp-image-272" /></a></p>
<li>There are three IP address ranges <a href="http://en.wikipedia.org/wiki/Private_network">reserved for private use</a>: 10.x.x.x, 172.{16-31}.x.x and 192.168.x.x. Looking at the IP address, router and DNS address from the previous step, pick one of those ranges that is <em>unused</em>. You&#8217;ll use this for the wireless network you create shortly. For example, the router is in 10.1.x.x and the DNS server is in 172.16.x.x, so I&#8217;ll use 192.168.x.x.</li>
<li>You may find it easiest if you&#8217;re moving between locations to create a new network location for this Internet sharing configuration. You can do that in the Location drop-down at the top of the System Preferences window.</li>
<li>Still in the Network part of System Preferences, choose AirPort, then click Advanced. Go to the TCP/IP tab.</li>
<li>Pick any IP address in your chosen range, with a matching subnet mask. 10.x.x.x should use 255.0.0.0, 172.16.x.x should use 255.255.0.0, and 192.168.x.x should use 255.255.0.0. Enter the same router address you copied down from the Ethernet configuration. For this post, I&#8217;ll use 192.168.1.1.</li>
<p><a href="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/Screen-shot-2010-06-09-at-9.33.12-PM.png"><img src="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/Screen-shot-2010-06-09-at-9.33.12-PM-300x136.png" alt="Wireless connection TCP/IP settings window" title="Wireless TCP/IP settings" width="300" height="136" class="aligncenter size-medium wp-image-273" /></a></p>
<li>Go to the System Preferences -> Sharing. Click the Internet Sharing item, but not the checkbox next to it. This should show &#8220;share your connection from&#8221; is Ethernet, and &#8220;to computers using&#8221; has AirPort checked. Click AirPort Options.</li>
<p><a href="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/Screen-shot-2010-06-09-at-9.34.11-PM.png"><img src="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/Screen-shot-2010-06-09-at-9.34.11-PM-300x143.png" alt="Internet Sharing options dialog" title="Internet Sharing options" width="300" height="143" class="aligncenter size-medium wp-image-274" /></a></p>
<li>Pick a network name. I also recommend turning on 128-bit WEP. It&#8217;s not great, but it&#8217;s better than nothing. You need to pick a password, which unfortunately must be exactly 13 characters.</li>
<li>Click the checkbox next to Internet Sharing and Start in the scary warning dialog that follows.</li>
<li>From one of your other devices, you can now connect to your new wireless network. You will have to configure its IP address manually, since your Mac is not running a DHCP server to supply it.</li>
<li>Use another, different address for your wireless device, but in the same network as the AirPort you just set up. Since it&#8217;s using 192.168.1.1, I&#8217;ll use 192.168.1.2. Use the same subnet mask, but use the AirPort&#8217;s IP (192.168.1.1) as the router. Use the DNS IP you copied down in step #2.</li>
<p><a href="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/IMG_0244.png"><img src="http://lightyearsoftware.com/blog/wp-content/uploads/2010/06/IMG_0244-200x300.png" alt="an example of wireless network settings on an iPhone" title="wireless device settings" width="200" height="300" class="aligncenter size-medium wp-image-271" /></a>
</ol>
<p>That&#8217;s it: you should now be able to use the Internet from your wireless device, via your laptop plugged into the Ethernet.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F06%2Fhow-to-set-up-internet-sharing-on-mac-os-x%2F&amp;seed_title=How+to+Set+Up+Internet+Sharing+on+Mac+OS+X/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic Subversion Revision Stamping for iPhone Projects</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fautomatic-subversion-revision-stamping-for-iphone-projects%2F&amp;seed_title=Automatic+Subversion+Revision+Stamping+for+iPhone+Projects</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fautomatic-subversion-revision-stamping-for-iphone-projects%2F&amp;seed_title=Automatic+Subversion+Revision+Stamping+for+iPhone+Projects#comments</comments>
		<pubDate>Wed, 26 May 2010 14:56:59 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=260</guid>
		<description><![CDATA[Early during development of a new iPhone OS application, I discovered that App Store submissions must use a strict format for the CFBundleVersion key in the Info.plist file. It can only be numbers and dots. This left me a little frustrated with how to version pre-1.0 releases to testers. I didn&#8217;t want to use an [...]]]></description>
			<content:encoded><![CDATA[<p>Early during development of a new iPhone OS application, I discovered that App Store submissions must use a strict format for the <tt>CFBundleVersion</tt> key in the <tt>Info.plist</tt> file. It can only be numbers and dots. This left me a little frustrated with how to version pre-1.0 releases to testers. I didn&#8217;t want to use an open-source style &#8220;0.9&#8243; and yet it wasn&#8217;t 1.0. What I really wanted was &#8220;1.0 b1&#8243; or similar.</p>
<p>I stumbled on Daniel Jalkut&#8217;s post about <a href="http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode">automatically stamping the Subversion revision into <tt>Info.plist</tt></a> and thought that might be a good way to go. I also created a new key in <tt>Info.plist</tt>, <tt>LYSApplicationDisplayVersion</tt>, that I use as a human-friendly version string, which is where I get my preferred &#8220;1.0 b1&#8243; form. <tt>CFBundleVersion</tt> now takes the form of <em>major.minor.revision</em>, where <em>major</em> and <em>minor</em> are the important parts of the human-friendly version (&#8220;1.0&#8243;) and <em>revision</em> is the Subversion revision number that produced the binary.</p>
<p>I like this method because it solves one problem raised by commenters on Daniel&#8217;s post. Because the Subversion revision is the third component, it doesn&#8217;t matter than r3999 is a mature 1.2 point release and r4000 is a risky pre-2.0 alpha for testers. Those versions end up 1.2.3999 and 2.0.4000 and it&#8217;s clear that they are from two different branches of development. For iPhone Ad Hoc distribution, iTunes also parses the version properly and knows that 1.0.100 is newer than 1.0.95.</p>
<p>Here is the script to paste into your custom script build phase:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Xcode auto-versioning script for Subversion</span>
<span style="color: #666666; font-style: italic;"># by Axel Andersson, modified by Daniel Jalkut to add</span>
<span style="color: #666666; font-style: italic;"># &quot;--revision HEAD&quot; to the svn info line, which allows</span>
<span style="color: #666666; font-style: italic;"># the latest revision to always be used.</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$0: Must be run from Xcode&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">&quot;BUILT_PRODUCTS_DIR&quot;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Get the current subversion revision number and use it to set the CFBundleVersion value</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$REV</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">`/usr/bin/svnversion -n ./`</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$INFO</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;$ENV{BUILT_PRODUCTS_DIR}/$ENV{WRAPPER_NAME}/Info.plist&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$version</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$REV</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># (Match the last group of digits and optional letter M/S/P):</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ugly yet functional (barely) regex by Daniel Jalkut:</span>
<span style="color: #666666; font-style: italic;">#$version =~ s/([\d]*:)(\d+[M|S]*).*/$2/;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># better yet still functional regex via Kevin &quot;Regex Nerd&quot; Ballard</span>
<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$version</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">m/(\d+)([MSP]*)$/</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$version</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$0: No Subversion revision found&quot;</span> <span style="color: #b1b100;">unless</span> <span style="color: #0000ff;">$version</span><span style="color: #339933;">;</span>
<span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$0: Modified, switched or partial working copy, you sure about that?&quot;</span> <span style="color: #b1b100;">if</span> <span style="color: #0000ff;">$2</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">&quot;BUILD_STYLE&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;Ad Hoc&quot;</span> <span style="color: #339933;">||</span> <span style="color: #0000ff;">$ENV</span><span style="color: #009900;">&#123;</span><span style="color: #ff0000;">&quot;BUILD_STYLE&quot;</span><span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">eq</span> <span style="color: #ff0000;">&quot;App Store&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FH<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;plutil -convert xml1 <span style="color: #000099; font-weight: bold;">\&quot;</span>$INFO<span style="color: #000099; font-weight: bold;">\&quot;</span> -o - |&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$0: $INFO: $!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$info</span> <span style="color: #339933;">=</span> <span style="color: #000066;">join</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #009999;">&lt;FH&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #0000ff;">$info</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/([\t ]+&lt;key&gt;CFBundleVersion&lt;\/key&gt;\n[\t ]+&lt;string&gt;\d+\.\d+).*?(&lt;\/string&gt;)/$1.$version$2/</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">open</span><span style="color: #009900;">&#40;</span>FH<span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;| plutil -convert binary1 - -o <span style="color: #000099; font-weight: bold;">\&quot;</span>$INFO<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">or</span> <span style="color: #000066;">die</span> <span style="color: #ff0000;">&quot;$0: $INFO: $!&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066;">print</span> FH <span style="color: #0000ff;">$info</span><span style="color: #339933;">;</span>
<span style="color: #000066;">close</span><span style="color: #009900;">&#40;</span>FH<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>There are a couple of other changes to this script for Subversion 1.5 and later, and for iPhone OS targets.</p>
<p>The first is that the regular expression allows for a trailing P in the Subversion revision. This signals a working copy from a sparse checkout, which I never use and therefore may be a problem. I have the script fail if any letter is appended to the revision when the <tt>BUILD_STYLE</tt> is &#8220;Ad Hoc&#8221; or &#8220;App Store&#8221;, which are two new configurations, cloned from Release, that I use for Ad Hoc and App Store distribution, respectively. Especially for modified working copies: I <em>never</em> want to accidentally hand out a build made from a modified working copy. Should the day come that I really do, I can comment this line out, make the build, and uncomment it again.</p>
<p>The second is that iPhone projects convert <tt>Info.plist</tt> to the binary plist format in the application bundle. In order to extract the existing <tt>CFBundleVersion</tt> key, it must be converted back to XML. When writing the plist back out, it is again converted to binary. Both of these steps use <tt>plutil</tt>, which is part of the Developer Tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fautomatic-subversion-revision-stamping-for-iphone-projects%2F&amp;seed_title=Automatic+Subversion+Revision+Stamping+for+iPhone+Projects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remember HTTP Password in Mobile Safari</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fremember-http-password-in-mobile-safari%2F&amp;seed_title=Remember+HTTP+Password+in+Mobile+Safari</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fremember-http-password-in-mobile-safari%2F&amp;seed_title=Remember+HTTP+Password+in+Mobile+Safari#comments</comments>
		<pubDate>Mon, 03 May 2010 15:39:01 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby & Rails]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=250</guid>
		<description><![CDATA[In iPhone OS 3.0, Apple allowed Mobile Safari to save usernames and passwords in web forms. Unfortunately, Safari does not offer to do the same thing for HTTP Basic and Digest authentication. I&#8217;ve become fond of using HTTP authentication because it is very easy to set up, either in your Apache virtual host configuration or [...]]]></description>
			<content:encoded><![CDATA[<p>In iPhone OS 3.0, Apple allowed Mobile Safari to save usernames and passwords in web forms. Unfortunately, Safari does not offer to do the same thing for HTTP Basic and Digest authentication. I&#8217;ve become fond of using HTTP authentication because it is very easy to set up, either in your Apache virtual host configuration or within a Rails application. There are many times that a full-fledged user database is unnecessary for a simple administration back-end.</p>
<p>There is a work-around, though it does mean storing your user and password in plaintext in your device&#8217;s bookmarks. HTTP allows you to supply authentication credentials as part of the URL, in the form <tt>http://username:password@example.com/</tt>.</p>
<p>In the last few days, I&#8217;ve considered building a form-based login for one of my sites, just so I can do basic management from my iPad. I&#8217;m comfortable that since the device rarely leaves the house, and the data on this site is not sensitive, that leaving the password in plaintext in the bookmark is an acceptable trade-off.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fremember-http-password-in-mobile-safari%2F&amp;seed_title=Remember+HTTP+Password+in+Mobile+Safari/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>malloc Debugging</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F01%2Fmalloc-debugging%2F&amp;seed_title=malloc+Debugging</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F01%2Fmalloc-debugging%2F&amp;seed_title=malloc+Debugging#comments</comments>
		<pubDate>Tue, 12 Jan 2010 21:39:04 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=218</guid>
		<description><![CDATA[Bill Bumgarner posted a nice tutorial on using malloc to debug memory misuse in Cocoa. I&#8217;ve run across these before when reading the malloc(1) man page, but it&#8217;s nice to have a tutorial that shows how to use them in practice.]]></description>
			<content:encoded><![CDATA[<p>Bill Bumgarner posted a nice tutorial on <a href="http://www.friday.com/bbum/2010/01/10/using-malloc-to-debug-memory-misuse-in-cocoa/">using malloc to debug memory misuse in Cocoa</a>. I&#8217;ve run across these before when reading the <tt>malloc(1)</tt> man page, but it&#8217;s nice to have a tutorial that shows how to use them in practice.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F01%2Fmalloc-debugging%2F&amp;seed_title=malloc+Debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ssh-agent on Mac OS X 10.5</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2009%2F08%2Fssh-agent-on-mac-os-x-10-5%2F&amp;seed_title=ssh-agent+on+Mac+OS+X+10.5</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2009%2F08%2Fssh-agent-on-mac-os-x-10-5%2F&amp;seed_title=ssh-agent+on+Mac+OS+X+10.5#comments</comments>
		<pubDate>Mon, 17 Aug 2009 14:51:43 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=152</guid>
		<description><![CDATA[For as long as I can remember, I&#8217;ve been using a tool called SSHKeychain on Mac OS X to manage ssh-agent and my identities, to make logging into remote servers secure, yet password-free. Lately, however, something has changed and SSHKeychain isn&#8217;t able to keep track of my keys. The result is that instead of rarely [...]]]></description>
			<content:encoded><![CDATA[<p>For as long as I can remember, I&#8217;ve been using a tool called <a href="http://sshkeychain.org/">SSHKeychain</a> on Mac OS X to manage ssh-agent and my identities, to make logging into remote servers secure, yet password-free.</p>
<p>Lately, however, something has changed and SSHKeychain isn&#8217;t able to keep track of my keys. The result is that instead of rarely typing my passphrases, I&#8217;m doing it constantly. I think it started around the time I updated to 10.5.8.</p>
<p>Turns out that Leopard has much better support for ssh-agent built-in and SSHKeychain isn&#8217;t necessary. Dave Dribin&#8217;s blog lays it all out: <a href="http://www.dribin.org/dave/blog/archives/2007/11/28/ssh_agent_leopard/">ssh-agent on Mac OS X 10.5</a> and, for the security conscious, <a href="http://www.dribin.org/dave/blog/archives/2007/11/28/securing_ssh_agent/">Securing ssh-agent on Mac OS X 10.5</a>.</p>
<p>A couple of things to watch out for:</p>
<ul>
<li>If you are switching from SSHKeychain, remove the environment override for <tt>SSH_AUTH_SOCK</tt> from <tt>~/.MacOSX/environment.plist</tt>.</li>
<li>To get the GUI passphrase dialog and the option to save the passphrase in your keychain, you must use the system <tt>ssh</tt>, not one from Fink or MacPorts.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2009%2F08%2Fssh-agent-on-mac-os-x-10-5%2F&amp;seed_title=ssh-agent+on+Mac+OS+X+10.5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code the Phone</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2009%2F03%2Fcode-the-phone%2F&amp;seed_title=Code+the+Phone</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2009%2F03%2Fcode-the-phone%2F&amp;seed_title=Code+the+Phone#comments</comments>
		<pubDate>Mon, 16 Mar 2009 14:47:05 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=86</guid>
		<description><![CDATA[I&#8217;ve started a new blog, Code the Phone, with a friend of mine. The purpose of it is all things related to application development and the business of selling apps on smartphones. Not surprisingly, we aren&#8217;t talking about anything other than the iPhone at the moment.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started a new blog, <a href="http://www.codethephone.com/">Code the Phone</a>, with a friend of mine. The purpose of it is all things related to application development and the business of selling apps on smartphones. Not surprisingly, we aren&#8217;t talking about anything other than the iPhone at the moment.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2009%2F03%2Fcode-the-phone%2F&amp;seed_title=Code+the+Phone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing In Season 1.0</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2008%2F12%2Fannouncing-in-season-10%2F&amp;seed_title=Announcing+In+Season+1.0</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2008%2F12%2Fannouncing-in-season-10%2F&amp;seed_title=Announcing+In+Season+1.0#comments</comments>
		<pubDate>Thu, 18 Dec 2008 15:54:52 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=58</guid>
		<description><![CDATA[I am pleased to announce the immediate availability of In Season 1.0 for the iPhone and iPod touch. In Season is a produce shopping guide, inspired by a couple of recent books that address the problem of missing flavor in most produce found in American markets. Here in America, we&#8217;ve become rather used to the [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to announce the <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=300208288&#038;mt=8">immediate availability</a> of <a href="http://lightyearsoftware.com/products/in-season.html">In Season 1.0</a> for the iPhone and iPod touch.  In Season is a produce shopping guide, inspired by a couple of recent books that address the problem of missing flavor in most produce found in American markets.</p>
<p>Here in America, we&#8217;ve become rather used to the idea that fresh fruits and vegetables are available whenever we want them.  What we don&#8217;t always realize is that this convenience comes at the cost of flavor and price.  Plants grow according to a schedule, and while we can force things somewhat (hothouse tomatoes, for example), if you want peaches in the dead of winter, they aren&#8217;t coming from the northern hemisphere.</p>
<p>Shipping produce from South America is a long trip to an American market, though, so food has to be bred to survive the journey and someone (the consumer) has to cover the costs of that travel.</p>
<p>There are even disadvantages to strawberries grown and sold in season.  Strawberries are so fragile, growers have had to breed them exclusively for shipment, resulting in a berry that has only a pale shadow of true strawberry flavor left.</p>
<p>I created In Season to help my own family, and hopefully others, with this problem.  Food tastes better when it&#8217;s grown according to its natural schedule, and even more so if you can find a local farmer supplying produce to your market.  It will take less effort to grow it and supply will be higher, so you will pay less.  Locally-grown produce also means less fuel is burned bringing that food to market, further bringing prices down and reducing your carbon footprint at the same time.</p>
<p>The economics of the App Store being what they are, version 1.0 is a toe in the water.  If it is well received and I can justify further development, I have some great ideas to make it an extremely useful and educational app.</p>
<p>If you are interested in those books I mention above, they are terrific reads: <a href="http://www.amazon.com/gp/product/0547053800?ie=UTF8&#038;tag=lightyear-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0547053800">How to Pick a Peach: The Search for Flavor from Farm to Table</a>, by Russ Parsons and <a href="http://www.amazon.com/gp/product/0060852569?ie=UTF8&#038;tag=lightyear-20&#038;linkCode=as2&#038;camp=1789&#038;creative=9325&#038;creativeASIN=0060852569">Animal, Vegetable, Miracle: A Year of Food Life</a>, by Barbara Kingsolver.</p>
]]></content:encoded>
			<wfw:commentRss>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2008%2F12%2Fannouncing-in-season-10%2F&amp;seed_title=Announcing+In+Season+1.0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
