<?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&#039;s Weblog</description>
	<lastBuildDate>Fri, 19 Aug 2011 19:46:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Experimenting with the Photojojo 0.48x Wide-angle Converter</title>
		<link>http://involution.com/2011/08/13/experimenting-with-the-photojojo-0-48x-wide-angle-converter/</link>
		<comments>http://involution.com/2011/08/13/experimenting-with-the-photojojo-0-48x-wide-angle-converter/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 21:05:10 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Photos]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1450</guid>
		<description><![CDATA[The Photojojo 0.48x wide-angle converter is a decent lens accessory. While it&#8217;s a bit more suited to lens diameters in the 52mm to 58mm range, the tilt-shiftesque fringing that it added to shots taken with my Canon 15-85mm IS USM, 72mm diameter lens produced an interesting aesthetic. With that lens, a focal length exceeding 25mm [...]]]></description>
			<content:encoded><![CDATA[<p>The Photojojo 0.48x wide-angle converter is a decent lens accessory.  While it&#8217;s a bit more suited to lens diameters in the 52mm to 58mm range, the tilt-shiftesque fringing that it added to shots taken with my Canon 15-85mm IS USM, 72mm diameter lens produced an interesting aesthetic.  With that lens, a focal length exceeding 25mm was necessary to capture a full APS-C frame that wasn&#8217;t partially occluded by the ring adapter.</p>
<p><a href="http://www.flickr.com/photos/hoyhoy/6037261721"><img src="http://farm7.static.flickr.com/6063/6037261721_ec909a29e9.jpg" /></a></p>
<p>This shot was taken at a 73mm focal length and shows the edge fringing clearly.  At these higher zoom-levels, manual focus was absolutely necessary because the fringing wreaked absolute havoc with the autofocus. </p>
<p><a href="http://www.flickr.com/photos/hoyhoy/6039450714"><img src="http://farm7.static.flickr.com/6201/6039450714_8cf7ea8b78.jpg" /></a></p>
<p>The shot above was taken at 35mm and doesn&#8217;t exhibit as much distortion from the wide-angle converter.  I applied a Filter Forge 3 frame to make the fringing at the edges less noticeable.  It was taken from the roof of 1535 Mission Street which is right at the intersection of Van Ness Avenue in San Francisco. </p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2011/08/13/experimenting-with-the-photojojo-0-48x-wide-angle-converter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Upgrading to Rails 3.0.8</title>
		<link>http://involution.com/2011/06/08/upgrading-to-rails-3-0-9-rc1/</link>
		<comments>http://involution.com/2011/06/08/upgrading-to-rails-3-0-9-rc1/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 00:16:24 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1436</guid>
		<description><![CDATA[This was fixed in 3.0.9. If you&#8217;re using js views and partial html replacements, Rails 3.0.8 was totally broken. Right after the 3.0.8 release, 3.0.9rc1 was released which partially addresses the problem. But, after upgrading, you have to wrap every escape_javascript call with raw() if you want your javascript to replace HTML. This was absolutely [...]]]></description>
			<content:encoded><![CDATA[<p><b>This was fixed in 3.0.9</b>. </p>
<p>If you&#8217;re using js views and partial html replacements, Rails 3.0.8 was totally broken.  Right after the 3.0.8 release, 3.0.9rc1 was released which partially addresses the problem.  But, after upgrading, you have to wrap every escape_javascript call with raw() if you want your javascript to replace HTML.  This was absolutely _not_ the case with 3.0.7.  </p>
<p>So, <code>escape_javascript('&lt;img src="lolcat.jpg" /&gt;')</code> becomes <code>raw(escape_javascript('&lt;img src="lolcat.jpg" /&gt;'))</code>.</p>
<p>This can also be accomplished by monkeypatching escape_javascript like this in application.rb. </p>
<pre><code>def escape_javascript_with_workaround(javascript)
  raw(escape_javascript_without_workaround(javascript))
end

alias_method_chain :escape_javascript, :workaround
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2011/06/08/upgrading-to-rails-3-0-9-rc1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ingleside Racetrack and the Entrada Court Sundial</title>
		<link>http://involution.com/2011/02/13/ingleside-racetrack-and-the-entrada-court-sundial/</link>
		<comments>http://involution.com/2011/02/13/ingleside-racetrack-and-the-entrada-court-sundial/#comments</comments>
		<pubDate>Mon, 14 Feb 2011 02:36:22 +0000</pubDate>
		<dc:creator>Tony Perrie</dc:creator>
				<category><![CDATA[Adobe Photoshop CS5]]></category>
		<category><![CDATA[Entrada Court Sundial]]></category>
		<category><![CDATA[Entrada Sundial]]></category>
		<category><![CDATA[Ingleside Race Track]]></category>
		<category><![CDATA[Ingleside Racetrack]]></category>
		<category><![CDATA[Ingleside Sundial]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iPhone4]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[San Francisco]]></category>
		<category><![CDATA[Urbano Sundial]]></category>
		<category><![CDATA[Ingleside]]></category>
		<category><![CDATA[Ingleside Auto Racetrack]]></category>
		<category><![CDATA[Ingleside Horse Race Track]]></category>
		<category><![CDATA[Ingleside Terrace]]></category>
		<category><![CDATA[Locomobiles]]></category>
		<category><![CDATA[Sundial]]></category>

		<guid isPermaLink="false">http://involution.com/?p=1405</guid>
		<description><![CDATA[After our epic 7 mile hike around Blithedale Summit Open Space Preserve in Mill Valley yesterday, Rachel and I managed to muster up enough energy to organize a one mile walk around Urbano Street today in the little Ingleside Terrace neighborhood in San Francisco. Where we live in SF is only about two miles from [...]]]></description>
			<content:encoded><![CDATA[<p>After our epic 7 mile hike around Blithedale Summit Open Space Preserve in Mill Valley yesterday, Rachel and I managed to muster up enough energy to organize a one mile walk around Urbano Street today in the little Ingleside Terrace neighborhood in San Francisco.  Where we live in SF is only about two miles from Entrada Court.  So, it&#8217;s rather sad that in the four years that we&#8217;ve lived in the city we hadn&#8217;t gotten over there to explore the neighborhood built around a racetrack.  You can see the outline of the track in the GPS tracks we followed along the walk. </p>
<p><a href="http://www.flickr.com/photos/hoyhoy/5443038147/"><img src="http://farm6.static.flickr.com/5139/5443038147_ba74656138.jpg" /></a></p>
<p>That circle in the middle of the track is Entrada Court.  There&#8217;s a massive concrete sundial constructed right in the center of an elaborate garden.  I took six pictures there with my iPhone 4 and merged them into a panorama with Photoshop (and filling in missing parts of the sky with Content Aware Fill (don&#8217;t ask)).  What&#8217;s amusing is that the girl on the bike just kept riding in circles around Entrada Court over and over again.  So, she appears in the panorama four times.  Rachel is also standing there in the far right of the picture being annoyed that I was getting in the way of her taking a picture with her Panasonic TZ10.</p>
<pre>
<a href="http://www.flickr.com/photos/hoyhoy/5443642706"><img src="http://farm6.static.flickr.com/5180/5443642706_60b2019ed9_b.jpg" width="1024" height="244" /></a>
</pre>
<p>The base of the sundial is now filled in.  But, originally, it appeared to have a circular reflecting pool beneath it with two bronze seals and colored lights with grass growing around the perimeter.  Now, the entire perimeter is concrete and the roman numerals are colored. </p>
<p><a href="http://foundsf.org/index.php?title=The_Mysterious_Urbano_Sundial"><img src="/images/urbano_sundial_1922.jpg" /></a></p>
<p>You can see the current state of the hour markers here.  We also noticed that the shadow appeared to be a bit early on the dial.  Perhaps this is due to the solar noon of San Francisco being slightly off during the winter months. </p>
<p><a href="http://www.flickr.com/photos/hoyhoy/5443040103"><img src="http://farm5.static.flickr.com/4145/5443040103_52a18622ee_z.jpg" /></a></p>
<p>The Bay Citizen recently published an article (picked up by the New York Times <a href="http://www.nytimes.com/2011/02/13/us/13bcintel.html">here</a>) elaborating on how the sundial was constructed to lure people into buying homes in Ingleside Terrace.  In it, they describe the christening of the dial. </p>
<blockquote><p>
The sundial was dedicated on the evening of Oct. 10, 1913, at a lavish event with 1,500 people in attendance. After children dressed as nymphs unveiled the sundial and four surrounding columns, a midnight supper was served, and couples danced until dawn.
</p></blockquote>
<p>Unbeknownst to the revelers in 1913, the sundial itself would not be scaled by human feet until November 2009 when intrepid Flickr user <a href="http://flickr.com/photos/yelserpluapnaes">yelserpluapnaes</a> literally rose to the occasion by running full speed straight up the face of dial.</p>
<p><a href="http://www.flickr.com/photos/yelserpluapnaes/4102322088"><img src="http://farm3.static.flickr.com/2513/4102322088_b085eb9c68.jpg"></a></p>
<p>FoundSF has an article and a picture from the early &#8217;20&#8242;s showing the dial surrounded by a cavalcade of cars, a large truck filled with people, a large estate, and five largish houses.  </p>
<p><a href="http://foundsf.org/index.php?title=The_Mysterious_Urbano_Sundial"><img src="/images/urbano_sundial_early_20s.jpg"></a></p>
<p>The article on FoundSF with the photos from the 1920&#8242;s appears to be incorrect though.  Horse racing ended at the track in 1898 because it became illegal to gamble horses and then automobile (i.e. &#8220;loco-mobile&#8221;) racing stopped in 1905 for business reasons.  Starting in 1910, Ingleside Terrace was built around Urbano Street which was the old race track.  Outside Lands has a picture of horse racing at the track in the late 1890&#8242;s courtesy of Greg Gaar.  </p>
<p><a href="http://www.outsidelands.org/ingleside-racetrack.php"><img src="/images/ingleside_horse_racetrack_1890.jpg"></a></p>
<p>Outside Lands has another article about the auto racing with a great shot of the &#8220;loco-mobiles&#8221; from 1900 here.</p>
<p><a href="http://www.outsidelands.org/ingleside-race-track.php"><img src="/images/ingleside_auto_race_1900.jpg"></a></p>
<p>San Francisco has quite a number of incongruous sites like the Ingleside Sundial.  However, I&#8217;m slightly dismayed that it took a New York Times article to alert me to something that&#8217;s a mere 10-minute-bicycle-ride away from my house.</p>
]]></content:encoded>
			<wfw:commentRss>http://involution.com/2011/02/13/ingleside-racetrack-and-the-entrada-court-sundial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>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_069ff8f13d_z.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>2</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>1</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>
	</channel>
</rss>

