<?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>Involution</title>
	<atom:link href="http://involution.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://involution.com</link>
	<description>Tony Perrie's Weblog</description>
	<lastBuildDate>Sat, 24 Jul 2010 06:54:04 +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>Chuck Lorre Vanity Cards</title>
		<link>http://involution.com/2010/07/23/chuck-lorre-vanity-cards/</link>
		<comments>http://involution.com/2010/07/23/chuck-lorre-vanity-cards/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 03:48:52 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Chuck Lorre]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1366</guid>
		<description><![CDATA[Chuck Lorre maker of &#8220;Dharma and Greg&#8221; and &#8220;The Big Bang Theory&#8221; managed to sneak a series of subliminal vanity cards into his sitcoms. After reading a number of these, I&#8217;m convinced that Lorre is an artist of the highest order forced to slum in the sitcom ghetto for his day job. His hidden vanity [...]]]></description>
			<content:encoded><![CDATA[<p>Chuck Lorre maker of &#8220;Dharma and Greg&#8221; and &#8220;The Big Bang Theory&#8221; managed to sneak a <a href="http://www.chucklorre.com/index.php?p=1">series of subliminal vanity cards</a> into his sitcoms.  </p>
<p>After reading a number of these, I&#8217;m convinced that Lorre is an artist of the highest order forced to slum in the sitcom ghetto for his day job.  His hidden vanity cards reveal the few scant frames of flickering truth shone through the Devil&#8217;s dream box each week.  </p>
<p>My favorite so far is this&#8230;</p>
<blockquote><p>I believe that the very act of believing in something causes us to distance ourselves from that thing, thus a duality is created: oneself and the thing in which one believes. Now since we all know that in order to fully understand a thing one must be that thing &#8212; walk a mile in its shoes so to speak &#8212; it seems obvious that the state of believing in something inevitably causes us to not truly understand that thing in which we believe. This noncomprehension leads to all sorts of difficulties. &#8220;I believe in love&#8221; has a better than even chance of leading to divorce, while &#8220;I believe in God&#8221; seems to end in variations on the Spanish Inquisition. But &#8212; and it&#8217;s a big but &#8212; if one were love, one couldn&#8217;t help but be affectionate and caring towards oneself and others. If one were God, one would act toward all beings and all things as if they were one&#8217;s own creations. And that, my friends, is the secret of life in a two-second vanity card. Of course, the secret could also be &#8220;Sit, Ubu, sit.&#8221; We have to keep an open mind. </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/07/23/chuck-lorre-vanity-cards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Photoshop CS5 Write Perimissions Error on Snow Leopard</title>
		<link>http://involution.com/2010/06/13/adobe-photoshop-cs5-write-perimissions-error-on-snow-leopard/</link>
		<comments>http://involution.com/2010/06/13/adobe-photoshop-cs5-write-perimissions-error-on-snow-leopard/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 19:33:09 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Adobe Photoshop]]></category>
		<category><![CDATA[Adobe Photoshop CS5]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1352</guid>
		<description><![CDATA[My upgrade to Adobe Photoshop CS5 on OS X 10.6 (Snow Leopard, 10.6.3) has been a complete shambles. Any operation involving writing to the temporary disk like &#8220;Save for Web &#038; Devices&#8221; would only result in an error dialog reading &#8220;The operation could not be completed: A write permissions error has occurred&#8221;. Also, on exit, [...]]]></description>
			<content:encoded><![CDATA[<p>My upgrade to Adobe Photoshop CS5 on OS X 10.6 (Snow Leopard, 10.6.3) has been a complete shambles.  Any operation involving writing to the temporary disk like &#8220;Save for Web &#038; Devices&#8221; would only result in an error dialog reading &#8220;<b>The operation could not be completed</b>: A write permissions error has occurred&#8221;.</p>
<p><img src="/images/cs5problem.gif" border=2 /></p>
<p>Also, on exit, CS5 would reliably crash with the error: &#8220;Could not save Preferences because the file is locked or you do not have the necessary access privileges&#8221;. </p>
<p>Fortunately, I&#8217;m not the only early adopter suffering from this <a href="http://forums.adobe.com/message/2885481#2885481">problem</a>.  The issue appears to be that Adobe&#8217;s DMG installer incorrectly sets some permissions under <code>~/Library/Preferences</code>.</p>
<p>What cleared up this issue was executing the following command ( in Applications -> Utilities -> Terminal ).</p>
<pre><code>sudo chmod -R u+w ~/Library/Preferences</code></pre>
<p>These are the specific directories that were errantly set to read-only after my CS5 install.</p>
<pre><code>~/Library/Preferences/Adobe/Extension Manager\ CS5
~/Library/Preferences/Adobe Photoshop\ CS5\ Settings
~/Library/Preferences/ExtendScript\ Toolkit
</code></pre>
<p>CNet has an <a href="http://reviews.cnet.com/8301-13727_7-20005310-263.html">article</a> mentioning other directories that can sometimes be affected.  So, if setting only Preferences didn&#8217;t work, you can try the following. </p>
<pre><code>sudo chmod -R u+rw ~/Library/Application\ Support
sudo chmod -R u+rw ~/Library/Adobe
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/06/13/adobe-photoshop-cs5-write-perimissions-error-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextMate is an application downloaded from the Internet.</title>
		<link>http://involution.com/2010/06/07/textmate-is-an-application-downloaded-from-the-internet/</link>
		<comments>http://involution.com/2010/06/07/textmate-is-an-application-downloaded-from-the-internet/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 05:11:57 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[TextMate]]></category>
		<category><![CDATA[10.6]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[Xattr]]></category>

		<guid isPermaLink="false">http://involution.com/2010/06/07/textmate-is-an-application-downloaded-from-the-internet/</guid>
		<description><![CDATA[I got the dreaded &#8220;TextMate is an application downloaded from the Internet&#8221; error again after manually upgrading to the latest version on Snow Leopard. The fix is quite simple, but rather hard to find in the first page or so of Google results. All that&#8217;s required is a single xattr. sudo xattr -d com.apple.quarantine /Applications/TextMate.app]]></description>
			<content:encoded><![CDATA[<p>I got the dreaded &#8220;TextMate is an application downloaded from the Internet&#8221; error again after manually upgrading to the latest version on Snow Leopard.  </p>
<p>The fix is quite simple, but rather hard to find in the first page or so of Google results.  All that&#8217;s required is a single xattr.</p>
<pre><code>sudo xattr -d com.apple.quarantine /Applications/TextMate.app
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/06/07/textmate-is-an-application-downloaded-from-the-internet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook, Virtual Goods, and the Post-Economic Economy</title>
		<link>http://involution.com/2010/06/02/facebook-and-the-post-economic-economy/</link>
		<comments>http://involution.com/2010/06/02/facebook-and-the-post-economic-economy/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 01:43:17 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Virtual Currency]]></category>
		<category><![CDATA[Virtual Goods]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1290</guid>
		<description><![CDATA[Last week, my favorite financial anarchist, Max Keiser ripped apart the business model of Zynga&#8217;s Facebook virtual currency comparing it to that of his archnemesis, Goldman Sachs. Zynga is giving away Farmville dollars as a promotion for people shopping for vegetables at supermarkets. So, if you buy a zuchini at the supermarket, you get Farmville [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, my favorite financial anarchist, <a href="http://youtu.be/VSwWy4E6I04">Max Keiser</a> ripped apart the business model of Zynga&#8217;s Facebook virtual currency comparing it to that of his archnemesis, Goldman Sachs.  </p>
<blockquote><p>
Zynga is giving away Farmville dollars as a promotion for people shopping for vegetables at supermarkets.  So, if you buy a zuchini at the supermarket, you get Farmville dollars which is a virtual currency which you can then use in Farmville on Facebook to grow virtual vegetables.  Those vegetables trade on the Zynga virtual cash exchange for hard US Dollars.  That&#8217;s a naked long.</p>
<p>So, the spread between naked short sales and naked long sales is enormous.  A naked short sale of a credit derivative makes Goldman Sachs billions where a naked long sale of a virtual vegetable on Farmville makes somebody two dollars.  The naked credit default swap is worth about the two dollars it takes to print nonsense on a piece of paper.  The naked long virtual Farmville currency is worth two dollars in hard money after you spent 20 hours viewing ads on Facebook.  So, why are the naked long people making $2 for twenty hours viewing ads, and the people at Goldman get two billion dollars for manufacturing credit default nonsense because they&#8217;re hooked into the US Government.</p>
</blockquote>
<p>Keiser has the uncanny ability to zoom out to a macro view of the economy which reveals nothing more than a bunch of unevolved apes playing petty power games amongst ourselves.  However, he makes a good point in that we are tending to stray away from our meritocratic roots in favor of a system based on cronyism, nepotism and outright fraud through naked short selling.</p>
<p>On the other side of the blogosphere, <a href="http://youtu.be/ww9STw-o0cc">David Harvey</a> has spent years promoting the idea that the capitalist system has mainly become concerned with creating money out of money.  Keiser&#8217;s views on the Facebook/Zynga virtual economy fits in with Harvey&#8217;s theory.  Essentially, these fictional markets are really just imaginary stopgaps so we can all pretend that we&#8217;re achieving the 3% growth per year to keep the wheels from falling off the status quo.</p>
<p>Keiser calls these fictional markets a zombie economy.  Whether you&#8217;re an individual trading virtual goods over the Internet or an investment bank selling derivatives of derivatives of insurance on derivatives, you are participating in a fictional market where what&#8217;s being bought and sold has no actual value.  The virtual goods are just as worthless as the mortgages written and sold to finance now empty houses built in Detroit during the housing boom.  While online virtual markets are more benign ecologically than zombie housing, both are socially and economically useless and attempts at feigning wealth. </p>
<p>In the 1500&#8242;s, the Spanish learned this lesson the hard way.  They conquered parts of the New World and imported tons of gold from their adventures.  The biggest tangible result of this effort was that people in Spain owned more physical gold which caused 300% inflation.  The general thinking is, if economic advancement isn&#8217;t backed by real innovation and improvements to the society at large, all you&#8217;re really doing is pretending to be wealthy.</p>
<p>Ultimately, creating virtual currencies and goods, fictional markets and zombie economies are equivalent to expropriating gold from tribal nations, printing dollars, or betting against credit default swaps.  These are all misguided attempts by poorly evolved mammals at being acquisitive and maintaining power.  If things proceed as they are, we will continue moving away from production, thrift, and savings towards a post-economic economy where all goods and money are virtual and nothing real is really worth owning.</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/06/02/facebook-and-the-post-economic-economy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pulga Bridge HDR</title>
		<link>http://involution.com/2010/05/24/pulga-bridge-hdr/</link>
		<comments>http://involution.com/2010/05/24/pulga-bridge-hdr/#comments</comments>
		<pubDate>Mon, 24 May 2010 08:07:07 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1288</guid>
		<description><![CDATA[CA-70, Pulga, CA]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/hoyhoy/4625640131" ><img src="http://farm4.static.flickr.com/3341/4625640131_7c4c375334.jpg" alt="" style="display: block; border: solid 2px #000000;" /></a><br />
CA-70, Pulga, CA</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/05/24/pulga-bridge-hdr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deer Creek Falls HDR</title>
		<link>http://involution.com/2010/05/18/deer-creek-falls-hdr/</link>
		<comments>http://involution.com/2010/05/18/deer-creek-falls-hdr/#comments</comments>
		<pubDate>Tue, 18 May 2010 15:13:40 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1285</guid>
		<description><![CDATA[Near Chester, California]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/hoyhoy/4613985136" ><img src="http://farm4.static.flickr.com/3338/4613985136_a75f72b0b8.jpg" alt="" style="display: block; border: solid 2px #000000;" /></a><br />
Near Chester, California</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/05/18/deer-creek-falls-hdr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using FORCE INDEX with Rails</title>
		<link>http://involution.com/2010/04/04/using-force-index-with-rails/</link>
		<comments>http://involution.com/2010/04/04/using-force-index-with-rails/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 02:16:19 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1277</guid>
		<description><![CDATA[Avoiding a full table scan when performing a MySQL query with both an ORDER and a WHERE clause is more difficult than you would think. This is especially true if you&#8217;re only selecting a subset of the table from a foreign key. First off, you must add a compound index with the order column first. [...]]]></description>
			<content:encoded><![CDATA[<p>Avoiding a full table scan when performing a MySQL query with both an <code>ORDER</code> and a <code>WHERE</code> clause is more difficult than you would think.  This is especially true if you&#8217;re only selecting a subset of the table from a foreign key.</p>
<p>First off, you must add a compound index with the order column first.  If the index is constructed with the column used to order the table last, the index will not work as expected. </p>
<pre>add_index :posts [:created_at, :blog_id]</pre>
<p>Next, you have to specify the index in the ActiveRecord call with <code>USE INDEX</code> or <code>FORCE INDEX</code> or else MySQL will not use it by default.</p>
<pre>named_scope :ordered, {
            :from => 'events FORCE INDEX (index_posts_on_created_at_and_blog_id)',
            :order => 'created_at DESC' }</pre>
<p>The Rails <code>add_index</code> method names the MySQL index as <code>index_table_name_on_column_1_at_and_column_2</code> by default.  If you want to list the indexes available for your database, you can perform the query: <code>SHOW INDEXES</code> to investigate.  </p>
<p>It&#8217;s possible to test the index by copying the MySQL queries from your Rails log and prefixing them with <code>EXPLAIN</code> or <code>EXPLAIN EXTENDED</code>.  Using either of these will display the number of rows searched for each query.  If your query is scanning more rows than you&#8217;ve selected, that is a clear sign that the index your using is either not being used or incorrect.</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/04/04/using-force-index-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails Join Query For Empty Right Tables</title>
		<link>http://involution.com/2010/02/04/rails-join-query-for-empty-right-tables/</link>
		<comments>http://involution.com/2010/02/04/rails-join-query-for-empty-right-tables/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 00:38:17 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[ActiveRecord]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rails2]]></category>
		<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1266</guid>
		<description><![CDATA[Say you wanted to select all the accounts from your applications with no associated users. You&#8217;d think this would be obvious, however I racked my brain for a few minutes thinking of a Rails-way of sorting this out. The good news is with Rails 2.2 or later, it can be accomplished like this thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>Say you wanted to select all the accounts from your applications with no associated users.  You&#8217;d think this would be obvious, however I racked my brain for a few minutes thinking of a Rails-way of sorting this out.  </p>
<p>The good news is with Rails 2.2 or later, it can be accomplished like this thanks to join hashes.</p>
<pre><code>Company.find(:all, :include => :users,
             :conditions => { :users => { :id => nil } })
</code></pre>
<p>Before Rails 2.2, you would have had to resort to the following.</p>
<pre><code>Company.find(:all, :include => :users,
             :conditions => "users.id IS NULL")
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2010/02/04/rails-join-query-for-empty-right-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transamerica Building Panorama</title>
		<link>http://involution.com/2009/11/20/transamerica-building-panorama/</link>
		<comments>http://involution.com/2009/11/20/transamerica-building-panorama/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 04:35:32 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[San Francisco]]></category>

		<guid isPermaLink="false">http://involution.com/2009/11/20/transamerica-building-panorama/</guid>
		<description><![CDATA[First attempt using a Canon EOS 7D.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/hoyhoy/4115707911/" ><img src="http://farm3.static.flickr.com/2520/4115707911_ee7b9bb6cf.jpg" alt="" style="display: block; border: solid 2px #000000;" /></a><br />
First attempt using a Canon EOS 7D.</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2009/11/20/transamerica-building-panorama/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interactive Memcached Debugging with Rails</title>
		<link>http://involution.com/2009/06/20/interactive-memcached-debugging-with-rails/</link>
		<comments>http://involution.com/2009/06/20/interactive-memcached-debugging-with-rails/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 23:17:37 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Memcached]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1238</guid>
		<description><![CDATA[The memcached support in Rails is great, but it&#8217;s a bit difficult to see what the heck is going on in a production environment. The first problem is, by default Rails doesn&#8217;t keep a list of all memcached keys that are available on the system. So, you have to use a plugin like memcache_store_with_delete_matched to [...]]]></description>
			<content:encoded><![CDATA[<p>The memcached support in Rails is great, but it&#8217;s a bit difficult to see what the heck is going on in a production environment.  The first problem is, by default Rails doesn&#8217;t keep a list of all memcached keys that are available on the system.  So, you have to use a plugin like <a href="http://github.com/lacomartincik/memcache_store_with_delete_matched/tree/master">memcache_store_with_delete_matched</a> to have memcache itself store a list of all available keys.  </p>
<p>You can install this plugin with the typical <code>script/plugin</code> command. </p>
<pre><code>script/plugin install git://github.com/lacomartincik/memcache-store-with-delete_matched.git
</code></pre>
<p>Then, you configure memcached in your <code>environment.rb</code> like this. </p>
<pre><code>mem_cache_options = {
    :c_threshold => 10000,
    :compression => true,
    :debug => false,
    :timeout => false,
    :namespace => 'app',
    :readonly => false,
    :urlencode => false
  }
  config.action_controller.cache_store = <b>:mem_cache_store_with_delete_matched</b>, ['127.0.0.1:11211'], mem_cache_options
</code></pre>
<p>The other benefit to using memcache_store_with_delete_matched is that regular expressions within <code>expire_fragment</code> works. </p>
<pre><code>expire_fragment(%r!/index_user_.*!)
</code></pre>
<p>So, down to debugging.  If you want to see all keys in a <code>script/console</code>, you can do the following. </p>
<pre><code>YAML.load(ActionController::Base.cache_store.fetch("memcached_store_key_list"))
</code></pre>
<p>You can select certain keys from the memcached_store_keylist. </p>
<pre><code>YAML.load(ActionController::Base.cache_store.fetch("memcached_store_key_list")) .detect{ |k| k.match(/index/) }
</code></pre>
<p>Once you have the list of keys, you can plug them into a fetch command. </p>
<pre><code>ActionController::Base.cache_store.fetch("app/blog/index")
</code></pre>
<p>You can also manually expire keys from a console. </p>
<pre><code>c = ApplicationController.new
c.expire_fragment(/index/)
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2009/06/20/interactive-memcached-debugging-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using YUICompressor with Capistrano and Rails 2.3+ on Combined Javascript and CSS</title>
		<link>http://involution.com/2009/06/18/using-yuicompressor-with-capistrano-and-rails-2-3-on-combined-javascript-and-css/</link>
		<comments>http://involution.com/2009/06/18/using-yuicompressor-with-capistrano-and-rails-2-3-on-combined-javascript-and-css/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 15:20:49 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Capistrano]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[YUICompressor]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1225</guid>
		<description><![CDATA[YUICompressor is a standalone Javascript and CSS minifier from the YUI folks. It&#8217;s fairly awesome in that it does deep analysis of Javascript using Rhino (a standalone Javascript interpreter). Most minifiers take the low road and merely remove spaces and newlines, and, if you&#8217;re lucky maybe shorten the variable names. YUICompressor one-ups them all because [...]]]></description>
			<content:encoded><![CDATA[<p>YUICompressor is a standalone Javascript and CSS minifier from the YUI folks.  It&#8217;s fairly awesome in that it does deep analysis of Javascript using Rhino (a standalone Javascript interpreter).  Most minifiers take the low road and merely remove spaces and newlines, and, if you&#8217;re lucky maybe shorten the variable names.  YUICompressor one-ups them all because it actually parses all your JS and aggressively optimizes it for download speed.  </p>
<h3>CSS and Javascript Conflation</h3>
<p>The problem is most of the guides out there for integrating YUICompressor with Capistrano and Rails are woefully out-of-date.  The main issue is that Rails now has built-in support for combining all JS files into a single file.  So, there&#8217;s no need to manually do this in Capistrano these days.  </p>
<p>You can make Rails combine automatically combine your Javascript by adding a <code>:cache => "cache/all"</code> to your <code>javascript_include_tag</code> and <code>stylesheet_link_tag</code> in your layout. </p>
<pre><code><%= stylesheet_link_tag 'one', 'two', :cache => "cache/all" %>
<%= javascript_include_tag 'jquery', 'ninja',  :cache => "cache/all" %>
</code></pre>
<h3>Priming the JS and CSS Caches</h3>
<p>The Capistrano stuff is a bit tricky because Rails doesn&#8217;t generate the Javascript and CSS until after the app has been visited for the first time.  So, you have to visit each of your web servers after restart during your deploy.</p>
<pre><code>task :after_restart, :roles => :web do
  desc "Visiting each web server"
  sleep(5)  # Wait for passenger to fully spin-up
  run "/usr/bin/wget -O- http://127.0.0.1 >/dev/null 2>&#038;1"
end
</code></pre>
<h3>Invoking YUICompressor</h3>
<p>Now, we can invoke YUICompressor after <code>after_restart</code>.  The previous <code>after_restart</code> task automatically gets invoked after the web servers are restarted, however, the compression needs to happen after that.  So, you have to manually chain a <code>minify</code> just after <code>after_restart</code>.</p>
<pre><code>after "deploy:after_restart", "deploy:minify"</code></pre>
<p>The actual task is quite simple for running the compressor itself.  It&#8217;s just a normal Capistrano task. </p>
<pre><code>task :minify, :roles => :web do
  desc "Minify JS and CSS Using YUICompressor"
  javascript = "#{current_path}/public/javascripts/cache/all.js"
  stylesheet = "#{current_path}/public/stylesheets/cache/all.css"
  compressor = "java -jar /usr/lib/java/yuicompressor-2.4.2.jar"
  run "#{compressor} --type js #{javascript} -o #{javascript}"
  run "#{compressor} --type css #{stylesheet} -o #{stylesheet}"
end
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2009/06/18/using-yuicompressor-with-capistrano-and-rails-2-3-on-combined-javascript-and-css/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Panasonic TZ5 HDRs</title>
		<link>http://involution.com/2009/06/15/panasonic-tz5-hdrs/</link>
		<comments>http://involution.com/2009/06/15/panasonic-tz5-hdrs/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 06:06:40 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Digital Cameras]]></category>
		<category><![CDATA[HDR]]></category>
		<category><![CDATA[Panasonic TZ5]]></category>
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1204</guid>
		<description><![CDATA[For being such a small camera, the Panasonic TZ5 does a pretty decent of job shooting bracketed images. Bracketing is where you shoot three differently exposed shots and then use software like Photoshop CS4 or Photomatix Pro to blend them together to produce a high-dynamic range (HDR) photograph. Over the past year, I&#8217;ve been experimenting [...]]]></description>
			<content:encoded><![CDATA[<p>For being such a small camera, the Panasonic TZ5 does a pretty decent of job shooting bracketed images.  Bracketing is where you shoot three differently exposed shots and then use software like Photoshop CS4 or Photomatix Pro to blend them together to produce a high-dynamic range (HDR) photograph.  Over the past year, I&#8217;ve been experimenting with bracketing, HDR, and various software to produce some fairly stunning results.  Out of all those, these are my greatest hits. </p>
<h3>Austin Creek Fire Road</h3>
<p>This shot was taken near Guerneville, CA at the Austin Creek State Recreational Area which is adjacent to Armstrong Redwoods State Natural Reserve.  Taking pictures under a forest canopy is tricky.  And, to be honest, most of the shots I&#8217;ve attempted in these conditions normally don&#8217;t amount to anything.  Doing HDR and applying some &#8220;highlight&#8221; adjustments create a stunning result about 10% of the time.  I was lucky here because this turned out the best out of anything I&#8217;ve shot in the ubiquitous redwood parks surrounding the Bay Area. </p>
<p><a href="http://www.flickr.com/photos/hoyhoy/3627241711/"><img src="http://farm4.static.flickr.com/3304/3627241711_4af596ae5e.jpg?v=0" style="border: 2px solid #000000 !important;" /></a></p>
<h3>San Francisco Park Presidio</h3>
<p>The Presidio is another area where it&#8217;s difficult to take decent photographs due to the sun shining down through gaps in the canopy.  It&#8217;s similar to the redwood parks in that images tend to be overexposed in parts and underexposed in others due to beams of sunshine sparsely illuminating the groves of trees.  This image turned out quite well, but there&#8217;s some rippling at the bottom you can see at high-resolutions due to the fact I was sans tripod on this walk.  </p>
<p><a href="http://www.flickr.com/photos/hoyhoy/3246073927/"><img src="http://farm4.static.flickr.com/3394/3246073927_eafb022d79.jpg?v=0" style="border: 2px solid #000000 !important;" /></a></p>
<h3>Foggy Golden Gate Bridge</h3>
<p>The following HDR I took from the Marin Headlands.  It was a bit of a chore finding a place to sit the camera on the mini-tripod.  My normal procedure is to set a two second timer and leave the camera resting on a fence post before shooting an HDR up there.  Small movements in the exposure can wreak havoc with Photomatix Pro.  On this one, I feel like I turned the saturation up a bit too high, but people seem to like it.  </p>
<p><a href="http://www.flickr.com/photos/hoyhoy/3588395466/"><img src="http://farm4.static.flickr.com/3636/3588395466_03b7ec1638.jpg?v=0" style="border: 2px solid #000000 !important;" /></a></p>
<p>Here is a link to all of my other <a href="http://flickr.com/photos/hoyhoy/tags/hdr">HDR images</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2009/06/15/panasonic-tz5-hdrs/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
