<?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</title>
	<atom:link href="http://lightyearsoftware.com/blog/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>Fri, 13 Aug 2010 19:02:34 +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>Debian Cron Not Running Daily, Weekly, Monthly Jobs?</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fdebian-cron-not-running-daily-weekly-monthly-jobs%2F&amp;seed_title=Debian+Cron+Not+Running+Daily%2C+Weekly%2C+Monthly+Jobs%3F</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F08%2Fdebian-cron-not-running-daily-weekly-monthly-jobs%2F&amp;seed_title=Debian+Cron+Not+Running+Daily%2C+Weekly%2C+Monthly+Jobs%3F#comments</comments>
		<pubDate>Fri, 13 Aug 2010 19:02:34 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=291</guid>
		<description><![CDATA[Some VPS vendors, when they provision your server, will install a very bare-bones OS. Debian&#8217;s default /etc/crontab includes lines to run the scripts in /etc/cron.{daily,weekly,monthly}, and it&#8217;s encouraged to place additional scripts in those directories to run jobs on a simple schedule. I recently noticed that a backup script on a customer&#8217;s server wasn&#8217;t running, [...]]]></description>
			<content:encoded><![CDATA[<p>Some VPS vendors, when they provision your server, will install a very bare-bones OS. Debian&#8217;s default <tt>/etc/crontab</tt> includes lines to run the scripts in <tt>/etc/cron.{daily,weekly,monthly}</tt>, and it&#8217;s encouraged to place additional scripts in those directories to run jobs on a simple schedule.</p>
<p>I recently noticed that a backup script on a customer&#8217;s server wasn&#8217;t running, and it took me several minutes of digging to discover the reason. These special script directories are ignored unless you install anacron:</p>
<p><tt>25 6	* * *	root	<strong>test -x /usr/sbin/anacron</strong> || ( cd / &#038;&#038; run-parts --report /etc/cron.daily )<br />
47 6	* * 7	root	<strong>test -x /usr/sbin/anacron</strong> || ( cd / &#038;&#038; run-parts --report /etc/cron.weekly )<br />
52 6	1 * *	root	<strong>test -x /usr/sbin/anacron</strong> || ( cd / &#038;&#038; run-parts --report /etc/cron.monthly )</tt></p>
<p>To fix it: <tt>sudo aptitude install anacron</tt></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%2Fdebian-cron-not-running-daily-weekly-monthly-jobs%2F&amp;seed_title=Debian+Cron+Not+Running+Daily%2C+Weekly%2C+Monthly+Jobs%3F/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>Ruby, Threads and RubyCocoa</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fruby-threads-and-rubycocoa%2F&amp;seed_title=Ruby%2C+Threads+and+RubyCocoa</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fruby-threads-and-rubycocoa%2F&amp;seed_title=Ruby%2C+Threads+and+RubyCocoa#comments</comments>
		<pubDate>Mon, 24 May 2010 19:43:50 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby & Rails]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=255</guid>
		<description><![CDATA[If you&#8217;re a Rails developer working on Mac OS X 10.6, you may have seen this message: Ruby threads cannot be used in RubyCocoa without patches to the Ruby interpreter It is caused by a plug-in or gem requiring osx/cocoa, frequently attachment_fu. AttachmentFu can use CoreImage as an image processor instead of calling out to [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a Rails developer working on Mac OS X 10.6, you may have seen this message:</p>
<pre>
Ruby threads cannot be used in RubyCocoa without patches to the Ruby interpreter
</pre>
<p>It is caused by a plug-in or gem requiring <tt>osx/cocoa</tt>, frequently <a href="http://github.com/technoweenie/attachment_fu">attachment_fu</a>. AttachmentFu can use CoreImage as an image processor instead of calling out to an image manipulation library such as ImageMagick or GD2.</p>
<p>The warning is harmless, but it can be very noisy. To disable it, you can simply remove CoreImage from AttachmentFu&#8217;s list of image processors by creating a new file in <tt>config/initializers</tt>. Its contents should be this one line:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#6666ff; font-weight:bold;">Technoweenie::AttachmentFu</span>.<span style="color:#9900CC;">default_processors</span>.<span style="color:#5A0A0A; font-weight:bold;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'CoreImage'</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>Image resize operations will now use one of the other image processors, which you can install from <a href="http://www.macports.org/">MacPorts</a>. I never deploy to a Mac OS X server for production, and I prefer to run as much of the same code as possible in development, so this isn&#8217;t a problem for me.</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%2Fruby-threads-and-rubycocoa%2F&amp;seed_title=Ruby%2C+Threads+and+RubyCocoa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tim O&#8217;Reilly on Raising VC</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Ftim-oreilly-on-raising-vc%2F&amp;seed_title=Tim+O%26%238217%3BReilly+on+Raising+VC</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Ftim-oreilly-on-raising-vc%2F&amp;seed_title=Tim+O%26%238217%3BReilly+on+Raising+VC#comments</comments>
		<pubDate>Wed, 05 May 2010 14:31:08 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Entrepreneurship]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=253</guid>
		<description><![CDATA[Tim O&#8217;Reilly, interviewed by Inc. in The Oracle of Silicon Valley, on raising venture capital and the potential of his company getting really big: &#8220;Money is like gasoline during a road trip,&#8221; he says. &#8220;You don&#8217;t want to run out of gas on your trip, but you&#8217;re not doing a tour of gas stations. You [...]]]></description>
			<content:encoded><![CDATA[<p>Tim O&#8217;Reilly, interviewed by Inc. in <a href="http://www.inc.com/magazine/20100501/the-oracle-of-silicon-valley_Printer_Friendly.html">The Oracle of Silicon Valley</a>, on raising venture capital and the potential of his company getting really big:</p>
<blockquote><p>
&#8220;Money is like gasoline during a road trip,&#8221; he says. &#8220;You don&#8217;t want to run out of gas on your trip, but you&#8217;re not doing a tour of gas stations. You have to pay attention to money, but it shouldn&#8217;t be about the money.&#8221;
</p></blockquote>
]]></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%2Ftim-oreilly-on-raising-vc%2F&amp;seed_title=Tim+O%26%238217%3BReilly+on+Raising+VC/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>Use content_for to Put Markup In Its Place</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fuse-content_for-to-put-markup%2F&amp;seed_title=Use+content_for+to+Put+Markup+In+Its+Place</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F05%2Fuse-content_for-to-put-markup%2F&amp;seed_title=Use+content_for+to+Put+Markup+In+Its+Place#comments</comments>
		<pubDate>Mon, 03 May 2010 13:00:56 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby & Rails]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=244</guid>
		<description><![CDATA[Here is a useful trick for ensuring that you keep your partial templates well organized without sacrificing page-load times or duplicating your layouts unnecessarily. You can use content_for to capture some markup, but have it emitted into the page from somewhere else. Two places this is immediately useful: adding additional tags inside &#60;head&#62; and placing [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a useful trick for ensuring that you keep your partial templates well organized without sacrificing page-load times or duplicating your layouts unnecessarily.</p>
<p>You can use <tt>content_for</tt> to capture some markup, but have it emitted into the page from somewhere else.</p>
<p>Two places this is immediately useful: adding additional tags inside <tt>&lt;head&gt;</tt> and placing in-line Javascript near <tt>&lt;/body&gt;</tt>, while keeping the code itself right next to the DOM elements it works upon.</p>
<p><tt>content_for</tt> works by capturing whatever appears inside the block and storing it for later use. You emit whatever is stored using <tt>yield</tt>. What&#8217;s more, <tt>content_for</tt> doesn&#8217;t clobber the previous captured text if you use it more than once with the same key. </p>
<p>Say you have a fancy Javascript control that replaces a standard <tt>&lt;select&gt;</tt> element in forms. You can do this in your partials:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">&lt;select ...&gt;
  &lt;option&gt;...&lt;/option&gt;
  &lt;option&gt;...&lt;/option&gt;
  ...
&lt;/select&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#5A0A0A; font-weight:bold;">content_for</span> <span style="color:#ff3333; font-weight:bold;">:body_close</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  &lt;script type=&quot;text/javascript&quot;&gt;
    // code that does something with that &lt;select&gt;
  &lt;/script&gt;
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">&gt;</span></pre></div></div>

<p>And then in your layout, just before the <tt>&lt;/body&gt;</tt>:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#9966CC; font-weight:bold;">yield</span> <span style="color:#ff3333; font-weight:bold;">:body_close</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>Because most browsers will run in-line Javascript upon encountering it, this would delay the execution of the code until all of the page content was loaded, making your page appear to load faster.</p>
<p>What&#8217;s more, if that fancy Javascript control also requires a CSS file, but you don&#8217;t want to require the browser to fetch it on all of the other pages that don&#8217;t need it, you can conditionally add it to <tt>&lt;head&gt;</tt> by defining another <tt>content_for</tt> key that accumulates additional markup to go there:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#5A0A0A; font-weight:bold;">content_for</span> <span style="color:#ff3333; font-weight:bold;">:head</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
  <span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#5A0A0A; font-weight:bold;">stylesheet_link_tag</span> <span style="color:#996600;">'fancy_control'</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
<span style="color:#006600; font-weight:bold;">&lt;%</span> <span style="color:#9966CC; font-weight:bold;">end</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>And in your layout:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;">&lt;head&gt;
  ...
  <span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#9966CC; font-weight:bold;">yield</span> <span style="color:#ff3333; font-weight:bold;">:head</span> <span style="color:#006600; font-weight:bold;">%&gt;</span>
&lt;/head&gt;</pre></div></div>

<p>This is also useful for keeping per-page markup like <tt>&lt;title&gt;</tt> and <tt>meta</tt> tags in the template and out of your controller.</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%2Fuse-content_for-to-put-markup%2F&amp;seed_title=Use+content_for+to+Put+Markup+In+Its+Place/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE + Rails Javascript Caching Gotcha</title>
		<link>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F04%2Fie-rails-javascript-caching-gotcha%2F&amp;seed_title=IE+%2B+Rails+Javascript+Caching+Gotcha</link>
		<comments>http://lightyearsoftware.com/feeder/?FeederAction=clicked&amp;feed=Articles+%28RSS2%29&amp;seed=http%3A%2F%2Flightyearsoftware.com%2Fblog%2F2010%2F04%2Fie-rails-javascript-caching-gotcha%2F&amp;seed_title=IE+%2B+Rails+Javascript+Caching+Gotcha#comments</comments>
		<pubDate>Fri, 30 Apr 2010 20:02:46 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Ruby & Rails]]></category>

		<guid isPermaLink="false">http://lightyearsoftware.com/blog/?p=240</guid>
		<description><![CDATA[Rails supports a simple method of asset bundling with javascript_include_tag by way of the :cache option: &#60;%= javascript_include_tag 'first', 'second', 'third', :cache =&#62; true %&#62; There&#8217;s a gotcha hiding here that you may not find until you deploy to production and visit your site in IE. Admittedly, this is a bug, but if you happen [...]]]></description>
			<content:encoded><![CDATA[<p>Rails supports a simple method of asset bundling with <tt>javascript_include_tag</tt> by way of the <tt>:cache</tt> option:</p>

<div class="wp_syntax"><div class="code"><pre class="rails" style="font-family:monospace;"><span style="color:#006600; font-weight:bold;">&lt;%</span>= <span style="color:#5A0A0A; font-weight:bold;">javascript_include_tag</span> <span style="color:#996600;">'first'</span>, <span style="color:#996600;">'second'</span>, <span style="color:#996600;">'third'</span>, <span style="color:#ff3333; font-weight:bold;">:cache</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">%&gt;</span></pre></div></div>

<p>There&#8217;s a gotcha hiding here that you may not find until you deploy to production and visit your site in IE.</p>
<p>Admittedly, this is a bug, but if you happen to have a <em>second</em> <tt>javascript_include_tag</tt> with the <tt>:cache</tt> argument in the same page, IE will choke on lots of the script, telling you &#8220;object doesn&#8217;t support this property or method,&#8221; among other things.</p>
<p>The problem is that Rails can&#8217;t resolve multiple tags using the same value for <tt>:cache</tt>, and it emits two <tt>&lt;script&gt;</tt> tags referencing the same Javascript file. IE gets confused by the second one (perhaps loading it twice?). Every other browser I&#8217;ve used handles it fine.</p>
<p>The solution: either don&#8217;t use <tt>:cache</tt> more than once or make sure you use explicit, unique bundle names instead of just <tt>true</tt>.</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%2F04%2Fie-rails-javascript-caching-gotcha%2F&amp;seed_title=IE+%2B+Rails+Javascript+Caching+Gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
