<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Walt Gordon Jones</title>
	
	<link>http://waltgordonjones.com</link>
	<description>Art, conversation, and geekery.</description>
	<lastBuildDate>Wed, 30 Jun 2010 17:59:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/waltgordonjones" /><feedburner:info uri="waltgordonjones" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>The Reach of Your Compassion</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/buTNJQmaFkM/the-reach-of-your-compassion</link>
		<comments>http://waltgordonjones.com/360/the-reach-of-your-compassion#comments</comments>
		<pubDate>Mon, 01 Mar 2010 04:48:48 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Connect]]></category>
		<category><![CDATA[Create]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=360</guid>
		<description><![CDATA[We are all sometimes strange, inconsistent, frail, error-prone beings. That seems to be the nature of the human condition. Weakness comes in many forms: sickness, injury, lapses of judgment or character, mistakes, or bad luck. Your happiness and even survival depends on your ability to accept the limitations of your own abilities. Your ability to help, teach, lead or console others depends on your ability to accept their weaknesses.]]></description>
			<content:encoded><![CDATA[<p><em>Compassion is the acceptance of weakness in yourself and in others.</em></p>
<p>We are all sometimes strange, inconsistent, frail, error-prone beings. That seems to be the nature of the human condition. Weakness comes in many forms: sickness, injury, lapses of judgment or character, mistakes, or bad luck. Your happiness and even survival depends on your ability to accept the limitations of your own abilities. Your ability to help, teach, lead or console others depends on your ability to accept their weaknesses.</p>
<p>I had this realization a few years ago, and it seems I continue to have experiences that lead me back to this truth: You cannot have compassion for others without embracing your own weakness. You can never be truly happy with yourself if you are unable to accept and understand the human weakness of others. The two are directly linked.</p>
<blockquote><p>&#8220;The reach of your compassion is the reach of your art.&#8221; &#8211; Joseph Campbell</p></blockquote>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/buTNJQmaFkM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/360/the-reach-of-your-compassion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/360/the-reach-of-your-compassion</feedburner:origLink></item>
		<item>
		<title>Subreala Explained for Artists and Javascript Developers</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/zIY-FhZkA7s/subreala-explained-for-artists-and-javascript-developers</link>
		<comments>http://waltgordonjones.com/352/subreala-explained-for-artists-and-javascript-developers#comments</comments>
		<pubDate>Wed, 03 Feb 2010 22:56:03 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Connect]]></category>
		<category><![CDATA[Create]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=352</guid>
		<description><![CDATA[Subreala allows you to easily upload words and images and then create interactive pages for them. It's as easy as just selecting which visualization you want to use, preview it, and then publish it. You can also link pages together and create interactive menus that link to your pages. And you can embed any page on another site, like your blog for example.]]></description>
			<content:encoded><![CDATA[<h3>Dear Artist</h3>
<p><a href="http://subreala.com">Subreala</a> allows you to easily upload words and images and then create interactive pages for them. It&#8217;s as easy as just selecting which visualization you want to use, preview it, and then publish it. You can also link pages together and create interactive menus that link to your pages. And you can embed any page on another site, like your blog for example.</p>
<p>Right now, there are dozens of visualizations to select from, mostly based on original code from artist Gerard Ferrandez. It&#8217;s an open platform that lets javascript developers create new visualizations, so as time goes on, there will be more interesting ways to present your art.</p>
<p>You do not need to make a huge time investment. You just upload your stuff, create a page, and share the link anywhere (or embed it.) You create a byline with a link back to your site or blog, and that credit appears on every page created with your art.</p>
<p>Subreala is still in development, so you need an invite code from me or another member to get started.</p>
<h3>Dear Javascript Developer</h3>
<p>Subreala is an experiment I&#8217;ve created in my spare time that gives javascript developers access to the DOM for pages containing artist content, such as words and images. The visualizations already on the site offer a good example of what is possible.</p>
<p>The platform has been designed to not use any javascript libraries for the site frame and navigation, so you can use any frameworks or libraries you want with no namespace collisions. You have access to load javascript, CSS, and HTML on the page, and of course full access to the DOM. All the content is always structured the same way, with classes and ids to make things easy to find.</p>
<p>You do not need to make a huge time investment. This is perfect for demos you&#8217;ve already created and just need an easy place to show it off. You create a byline with a link back to your site or blog, and that credit appears on every page created with your code.</p>
<p>Subreala is still in development, so you need an invite code from me or another member to get started.</p>
<h3>Thanks for reading</h3>
<p>I hope that Subreala will teach me more about how artists and geeks can collaborate better to build more interesting things. I&#8217;m completely open to your feedback and suggestions. I&#8217;ve been working on this in the background for about a year, and I&#8217;ll continue to improve it in small steps.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/zIY-FhZkA7s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/352/subreala-explained-for-artists-and-javascript-developers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/352/subreala-explained-for-artists-and-javascript-developers</feedburner:origLink></item>
		<item>
		<title>Introducing Subreala</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/aWQqE7lKrzk/introducing-subreala</link>
		<comments>http://waltgordonjones.com/301/introducing-subreala#comments</comments>
		<pubDate>Tue, 02 Feb 2010 22:44:35 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Connect]]></category>
		<category><![CDATA[Create]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=301</guid>
		<description><![CDATA[Introducing Subreala. A whole new way to present words and images. What is Subreala? Subreala is an experimental project, still in active development, and might become almost anything.]]></description>
			<content:encoded><![CDATA[<div style="width:590px; height:350px; margin:auto;">
<iframe src ="http://subreala.com/page/embed/25" width="100%" height="100%" scrolling="no" frameborder="0"></p>
<p>Your browser does not support iframes.</p>
<p></iframe>
</div>
<p><br/></p>
<h3>What is Subreala?</h3>
<p><a href="http://subreala.com">Subreala</a> is an experimental project, still in active development, and might become almost anything.</p>
<p>Subreala is an exploration into how artists and developers can collaborate more effectively.</p>
<p>Subreala is a private beta because it&#8217;s not completely finished yet. (Email waltjones at subreala.com for an invite.)</p>
<p>Subreala is a way to create stories that lead anywhere and everywhere.</p>
<p>Subreala is a way to credit both artists and developers, while providing an immersive adventure for the curious explorer.</p>
<h3>Artists</h3>
<p>Upload your visual or textual content and create pages from a library of interactive visualizations.</p>
<p>Link your pages to other pages, creating a path that may be linear or labyrinthine.</p>
<h3>Developers</h3>
<p>Upload javascript targeted to a structured DOM model for content.</p>
<p>Test your code against a library of artist content, and release it to be used by others.</p>
<h3>Many thanks to</h3>
<p>Gerard Ferrandez, who released his Javascript under Creative Commons, and without whom this project would still be just an idea.</p>
<p>The Behance artists who released their images under Creative Commons, and whose work I have used to create the initial demos.</p>
<p>All other Creative Commons artists, whether or not they appear on Subreala.</p>
<p>The Open Source development community.</p>
<h3>Email me</h3>
<p>This project exists in order to help push creativity forward on the web. If you have ideas, comments, feedback, etc. email waltjones at subreala.com.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/aWQqE7lKrzk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/301/introducing-subreala/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/301/introducing-subreala</feedburner:origLink></item>
		<item>
		<title>The Definitive Wordpress Content Directory Solution</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/FwlpztIlCo0/the-definitive-wordpress-content-directory-solution</link>
		<comments>http://waltgordonjones.com/322/the-definitive-wordpress-content-directory-solution#comments</comments>
		<pubDate>Mon, 01 Feb 2010 00:12:24 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=322</guid>
		<description><![CDATA[There are a wide variety of problem reports appearing on support forums related to Wordpress that all have one root cause and solution. Here are some common issue descriptions: problems uploading images; problems installing themes, plugins; problems auto-upgrading Wordpress; anything else where Wordpress needs to write files.]]></description>
			<content:encoded><![CDATA[<p>There are a wide variety of problem reports appearing on support forums related to Wordpress that all have one root cause and solution. Here are some common issue descriptions:</p>
<ul>
<li>Problems uploading images</li>
<li>Problems installing themes, plugins</li>
<li>Problems auto-upgrading Wordpress</li>
<li>Anything else where Wordpress needs to write files</li>
</ul>
<p>And here is a typical error message:</p>
<blockquote><p>&#8220;To perform the requested action, connection information is required.&#8221;</p></blockquote>
<p>Or&#8230;</p>
<blockquote><p>Unable to create directory [...]. Is its parent directory writable by the server?</p></blockquote>
<p>The problem is that Wordpress is executing in the context of your web server process, but the directories have write permissions based on the user context used to originally create the directories.</p>
<p>Many of the suggested solutions on the web simply won&#8217;t work, while other solutions work but create security problems with your Wordpress installation. Here is the full solution that should work on all Linux systems, regardless of the specific environment. What we are going to do is give your web server ownership of the directories and files of your Wordpress install. This requires you to be knowledgeable and comfortable in your bash shell environment, which is probably reasonably true if you installed Wordpress yourself.</p>
<p>First we will give everybody write access so that WP can write the content directories. Some solutions on the web stop at this step, but this leaves your files with no filesystem security. We are only doing this briefly in order to determine what user context is being used by the web server.</p>
<p>Go to your Wordpress root directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd /var/www/html/my_wp_blog</span></pre></div></div>

<p>Give the world write access to the content directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># chmod 777 wp-content</span></pre></div></div>

<p>Now log into Wordpress and upload a photo to a blog post, causing WP to create the new directories required. Then look on the server to see what user created the directories.  This would commonly be apache, but also many people are reporting that this is the user &#8220;nobody&#8221; on their server.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd wp-content</span>
<span style="color: #666666; font-style: italic;"># ls -l</span>
total <span style="color: #000000;">16</span>
<span style="color: #660033;">-rw-r--r--</span> <span style="color: #000000;">1</span> root root   <span style="color: #000000;">30</span> May  <span style="color: #000000;">4</span>  <span style="color: #000000;">2007</span> index.php
drwxr-xr-x <span style="color: #000000;">3</span> root root <span style="color: #000000;">4096</span> Feb <span style="color: #000000;">10</span> <span style="color: #000000;">19</span>:<span style="color: #000000;">31</span> plugins
drwxr-xr-x <span style="color: #000000;">5</span> root root <span style="color: #000000;">4096</span> Mar <span style="color: #000000;">23</span> 03:04 themes
drwxrwxrwx <span style="color: #000000;">3</span> apache apache <span style="color: #000000;">4096</span> Mar <span style="color: #000000;">24</span> 02:08 uploads</pre></div></div>

<p>Notice that the uploads directory was created by user apache:apache. This is the information you needed.  Go back down one dir level and set the permissions back to a secure level.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd ..</span>
<span style="color: #666666; font-style: italic;"># chmod 755 wp-content</span></pre></div></div>

<p>Now for the actual fix.  Recursively set the owner and group for your Wordpress installation to the user that created the uploads directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># cd ..</span>
<span style="color: #666666; font-style: italic;"># chown -R apache:apache my_wp_blog</span></pre></div></div>

<p>You&#8217;re done. Wordpress now has access to the file system for photo and attachment uploads, automatic upgrades, and anything else needed by your plugins.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/FwlpztIlCo0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/322/the-definitive-wordpress-content-directory-solution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/322/the-definitive-wordpress-content-directory-solution</feedburner:origLink></item>
		<item>
		<title>Fix InPlaceCollectionEditor in IE7</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/PYkotxN2rfY/fix-inplacecollectioneditor-in-ie7</link>
		<comments>http://waltgordonjones.com/317/fix-inplacecollectioneditor-in-ie7#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:18:17 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[browser compatibility]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=317</guid>
		<description><![CDATA[If you're using the Prototype javascript framework and Scriptaculous UI libraries to enhance your front end, the Scriptaculous InPlaceCollectionEditor is a great AJAX select control. The one problem for me was getting it to work on IE7. Here's how I did it.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using the Prototype javascript framework and Scriptaculous UI libraries to enhance your front end, the Scriptaculous InPlaceCollectionEditor is a great AJAX select control. The one problem for me was getting it to work on IE7. Looking around the web, the solutions posted <a href="http://www.ruby-forum.com/topic/135627">here</a> and <a href="http://dev.rubyonrails.org/ticket/10096">here</a> didn&#8217;t work for the latest version of Scriptaculous. After some debugging, here&#8217;s what did work.</p>
<p>There are several places in the InPlaceCollectionEditor code (controls.js) where document.createElement() is used to add an element to the DOM. In all other browsers, the new elements is implicitly extended with Prototype goodness. In IE7 you have to explicitly extend it.</p>
<p>(Line numbers from controls.js version 1.8.2)</p>
<p>Line 518:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> btn <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>btn<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Line 527:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> link <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>link<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Line 542:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">fld <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>fld<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Line 547:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">fld <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'textarea'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>fld<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Line 763:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> list <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'select'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>list<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Line 798:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">tempOption <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>tempOption<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Line 841:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">option <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'option'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> Element.<span style="color: #660066;">extend</span><span style="color: #009900;">&#40;</span>option<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After these changes, InPlaceCollectionEditor worked flawlessly for me in all major browsers including IE7+.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/PYkotxN2rfY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/317/fix-inplacecollectioneditor-in-ie7/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/317/fix-inplacecollectioneditor-in-ie7</feedburner:origLink></item>
		<item>
		<title>Roll Your Own Sitemaps in Rails</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/siPRdXODwIg/roll-your-own-sitemaps-in-rails</link>
		<comments>http://waltgordonjones.com/312/roll-your-own-sitemaps-in-rails#comments</comments>
		<pubDate>Sun, 31 Jan 2010 23:04:16 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=312</guid>
		<description><![CDATA[Sitemaps are an important SEO requirement for sites with content on lots of pages.  This is especially true if the pages are frequently updated or hard for a search spider to navigate. Yet a surprising number of sites with dynamic content do not provide a sitemap.xml for search engines.]]></description>
			<content:encoded><![CDATA[<p>Sitemaps are an important SEO requirement for sites with content on lots of pages.  This is especially true if the pages are frequently updated or hard for a search spider to navigate. Yet a surprising number of sites with dynamic content do not provide a sitemap.xml for search engines. (You can test this in a browser by simply adding &#8220;sitemap.xml&#8221; to the root URL.)</p>
<p>There are some really interesting options out there for managing sitemaps in rails. Sitemap (<a href="http://github.com/queso/sitemap/tree/master">http://github.com/queso/sitemap/tree/master</a>) is a full application in itself, with five controllers, three models, and tons of features. There are others that spider your site from the outside, as a third party tool would. And many variations on rake-driven tasks, or other processes outside Rails that must be automated some way or run manually. </p>
<p>Instead of having to run a separate task, here we are going to simply generate the sitemap only when it is requested.  If it hasn&#8217;t changed, it will be served from the page cache.  You may outgrow this technique if you have a very large sitemap, although using a sitemap index (allowing multiple smaller sitemaps) would help quite a bit in this case. </p>
<p>This solution is for people who want to:</p>
<ol>
<li>Customize what gets included and/or updated</li>
<li>Stay up to date with frequently changing content</li>
<li>Keep the code lean</li>
<li>Set it and forget it (no rake tasks)</li>
</ol>
<p>This article is based on how I implemented sitemaps for <a href="http://subreala.com">subreala.com</a>, however in researching it, I (finally) stumbled on <a href="http://www.igvita.com/2006/11/24/google-yahoo-sitemaps-in-rails/">an article by Ilya G</a> in 2006 where he describes essentially the same technique.  I decided to go ahead and publish this as an update, since some things have changed in three years, though not as much as you&#8217;d think.  </p>
<p>The first thing you&#8217;ll do is add a route to handle sitemap.xml:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">map.<span style="color:#9900CC;">connect</span> <span style="color:#996600;">'sitemap.xml'</span>, <span style="color:#ff3333; font-weight:bold;">:controller</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'portal'</span>, <span style="color:#ff3333; font-weight:bold;">:action</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'sitemap'</span></pre></div></div>

<p>Then in your controller:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">caches_page <span style="color:#ff3333; font-weight:bold;">:sitemap</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">def</span> sitemap
  <span style="color:#0066ff; font-weight:bold;">@pages</span> = Page.<span style="color:#9900CC;">find</span> <span style="color:#ff3333; font-weight:bold;">:all</span>
    respond_to <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>format<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">format</span>.<span style="color:#9900CC;">xml</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Then use builder to generate the XML. (views/page/sitemap.xml.builder):</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">xml.<span style="color:#9900CC;">instruct</span>! <span style="color:#ff3333; font-weight:bold;">:xml</span>, <span style="color:#ff3333; font-weight:bold;">:version</span><span style="color:#006600; font-weight:bold;">=&gt;</span><span style="color:#996600;">&quot;1.0&quot;</span> 
&nbsp;
xml.<span style="color:#9900CC;">urlset</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'xmlns:xsi'</span>.<span style="color:#9900CC;">to_sym</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>,
<span style="color:#996600;">'xsi:schemaLocation'</span>.<span style="color:#9900CC;">to_sym</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd&quot;</span>,
         <span style="color:#996600;">'xmlns'</span>.<span style="color:#9900CC;">to_sym</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;</span>
  <span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
&nbsp;
  <span style="color:#0066ff; font-weight:bold;">@pages</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>page<span style="color:#006600; font-weight:bold;">|</span>
    xml.<span style="color:#9900CC;">url</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      xml.<span style="color:#9900CC;">loc</span> page_url<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:only_path</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span>, <span style="color:#ff3333; font-weight:bold;">:name</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> page.<span style="color:#9900CC;">link</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      xml.<span style="color:#9900CC;">lastmod</span> page.<span style="color:#9900CC;">updated_at</span>.<span style="color:#9900CC;">strftime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;%Y-%m-%d&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      xml.<span style="color:#9900CC;">changefreq</span> <span style="color:#996600;">'monthly'</span>
      xml.<span style="color:#9900CC;">priority</span> <span style="color:#996600;">'0.5'</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Check <a href="http://www.sitemaps.org">sitemaps.org</a> for the full spec on the XML elements. The ones used above are reasonable defaults to start with.</p>
<p>The only thing left is to expire the cache when the sitemap should be regenerated.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">expire_page<span style="color:#006600; font-weight:bold;">&#40;</span>@page.<span style="color:#9900CC;">link</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

<p>This is the quickest, easiest way to keep your sitemap current if you&#8217;re serving a moderate amount of content. The cost of generating a new sitemap is only incurred when the sitemap.xml is requested by a spider and the cached version has expired. If your site grows to the point where you want to use a background task, the above method can be converted to be called from a rake task.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/siPRdXODwIg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/312/roll-your-own-sitemaps-in-rails/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/312/roll-your-own-sitemaps-in-rails</feedburner:origLink></item>
		<item>
		<title>The Vertical Color of Sound</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/eixt68FJ_0o/the-vertical-color-of-sound</link>
		<comments>http://waltgordonjones.com/281/the-vertical-color-of-sound#comments</comments>
		<pubDate>Wed, 02 Sep 2009 17:49:33 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Create]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[creativity]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[people]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=281</guid>
		<description><![CDATA[It was through Eno's words that I fully appreciated that enjoying sound for its own sake can be just as must a first class experience as enjoying music. Sound, on its own merits, is just as interesting and beautiful as melody, harmony, or rhythm. And it justified what I had always felt in those moments when the "music" parts of music momentarily disappear. What is left in that unstructured space?]]></description>
			<content:encoded><![CDATA[<p>My first experience with the guitar was at about ten years old.  I was pretty much obsessed with the opening chord of <a href="http://en.wikipedia.org/wiki/A_Hard_Day's_Night_(song)">A Hard Day&#8217;s Night</a>, and believed that with enough effort I&#8217;d figure out how to play that chord.</p>
<p>I never did figure it out.</p>
<p>There were two things in that situation I didn&#8217;t really understand at the time.  The first was that no one else knew how to reproduce that chord either. Fast forward to 1998, when math professor Jason Brown finally <a href="http://www.noiseaddicts.com/2008/11/beatles-hard-days-night-mystery-chord-solved/">unlocked the secret using Fourier transform analysis</a> on the recording. What he found is that in addition to two guitars and bass, Beatles producer George Martin had also overdubbed piano on the track.  I guess the band knew how to keep a secret, or did they even know what Martin had done?</p>
<p>The other thing I didn&#8217;t realize is how compelling sound itself can be, completely apart from what we think of as music.  That chord was a great example.  There is no melody, no rhythm. There is just the sound, by itself, apart from any real composition.  It stands on its own.</p>
<p>The whole thing reminds me of Eric Tamm&#8217;s book on Brian Eno, <a href="http://www.pdfhacks.com/eno/BE.pdf">The Vertical Color of Sound</a>. He quotes Eno naming the grand piano as his favorite instrument:</p>
<blockquote><p>&#8220;I like it because of the complexity of its sound. If you hold the sustain pedal down, strike a note and just <em>listen</em>&#8230; That&#8217;s one of my favorite musical experiences.  I often sit at the piano for an hour or two, and just go &#8220;bung!&#8221; and listen to the note dying. Each piano does it in a different way. You find all these exotic harmonies drifting in and drifting out again, and one that will appear and disappear many times. There&#8217;ll be fast-moving ones and slow-moving ones. That&#8217;s spellbinding, for me.&#8221;</p></blockquote>
<p>It was through Eno&#8217;s words that I fully appreciated that enjoying sound for its own sake can be just as much a first class experience as enjoying music.  Sound, on its own merits, is just as interesting and beautiful as melody, harmony, or rhythm.  And it justified what I had always felt in those moments when the &#8220;music&#8221; parts of music momentarily disappear. What is left in that unstructured space? Just sound.</p>
<p>Thanks to <a href="http://www.erictamm.com/">Eric Tamm</a> and his publisher for making his books available online.</p>
<p>Also thanks to <a href="http://arsdivina.com/">Steve Turnidge</a> for turning me on to Eric Tamm&#8217;s work.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/eixt68FJ_0o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/281/the-vertical-color-of-sound/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/281/the-vertical-color-of-sound</feedburner:origLink></item>
		<item>
		<title>How To Work Better</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/75gFFMVlwe4/how-to-work-better</link>
		<comments>http://waltgordonjones.com/272/how-to-work-better#comments</comments>
		<pubDate>Thu, 27 Aug 2009 17:46:29 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Connect]]></category>
		<category><![CDATA[Headline]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=272</guid>
		<description><![CDATA[I'm in the offices of Design Commission and I just noticed this on the wall above where I'm sitting.

How To Work Better

1. Do one thing at a time.
2. Know the problem.
3. Learn to listen.
4. Learn to ask questions.
5. Distinguish sense from nonsense.
6. Accept change as inevitable.
7. Admit mistakes.
8. Say it simple.
9. Be calm.
10. Smile.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the offices of <a href="http://www.designcommission.com/">Design Commission</a> and I just noticed this on the wall above where I&#8217;m sitting.</p>
<p><strong>How To Work Better</strong></p>
<ol>
<li>Do one thing at a time.</li>
<li>Know the problem.</li>
<li>Learn to listen.</li>
<li>Learn to ask questions.</li>
<li>Distinguish sense from nonsense.</li>
<li>Accept change as inevitable.</li>
<li>Admit mistakes.</li>
<li>Say it simple.</li>
<li>Be calm.</li>
<li>Smile.</li>
</ol>
<p>This made me realize two things.</p>
<p>First, change where you sit.  The more the better.  It will give you new insights, and help you think better.</p>
<p>The other thing? I really miss having <a href="http://peterkappus.com/">Peter Kappus</a> around, although everyone else at DC is similarly awesome.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/75gFFMVlwe4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/272/how-to-work-better/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/272/how-to-work-better</feedburner:origLink></item>
		<item>
		<title>Excessive (ab)use of eval (try send instead)</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/pdGRcIfQZoE/excessive-abuse-of-eval</link>
		<comments>http://waltgordonjones.com/257/excessive-abuse-of-eval#comments</comments>
		<pubDate>Thu, 23 Jul 2009 03:36:12 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[ruby metaprogramming]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=257</guid>
		<description><![CDATA[I was just reminded how much I have learned about Ruby metaprogramming in just the past few months when I looked back at the original code I wrote for the soundex_find plugin.  The code worked great, but relied on excessive eval calls.]]></description>
			<content:encoded><![CDATA[<p>I was just reminded how much I have learned about Ruby metaprogramming in just the past few months when I looked back at the original code I wrote for the soundex_find plugin.  The code worked great, but relied on excessive eval calls:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> update_soundex
  <span style="color:#CC0066; font-weight:bold;">eval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{self.class}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">sdx_columns</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#CC0066; font-weight:bold;">eval</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;self.#{c}_soundex = #{self.class}.soundex(self.#{c})&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Which I rewrote to use zero evals:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> update_soundex
  <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">sdx_columns</span>.<span style="color:#9900CC;">each</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{c}_soundex=&quot;</span>, <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">soundex</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">send</span><span style="color:#006600; font-weight:bold;">&#40;</span>c<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>How did I come up with the first version?</p>
<ul>
<li>I didn&#8217;t realize object.class returns a Constant which can be used to directly call class methods.  (I thought it returned a string.)</li>
<li>I didn&#8217;t understand the power of object.send, which allows methods to be called using strings.</li>
</ul>
<p>I&#8217;m sure if I come back to this in another six months, I&#8217;ll find a way to improve it again.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/pdGRcIfQZoE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/257/excessive-abuse-of-eval/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/257/excessive-abuse-of-eval</feedburner:origLink></item>
		<item>
		<title>“Just Don’t Have Anything Worth Stealing”</title>
		<link>http://feedproxy.google.com/~r/waltgordonjones/~3/0-REJSpBr58/just-dont-have-anything-worth-stealing</link>
		<comments>http://waltgordonjones.com/244/just-dont-have-anything-worth-stealing#comments</comments>
		<pubDate>Sat, 18 Jul 2009 18:19:43 +0000</pubDate>
		<dc:creator>waltgordonjones</dc:creator>
				<category><![CDATA[Connect]]></category>
		<category><![CDATA[Headline]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[Orwell]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://waltgordonjones.com/?p=244</guid>
		<description><![CDATA[It turns out that a feature built into the HTML standard allows any website to test your browser history against a set of "interesting" URLs and send that information back to their server, associated with your IP address and browser cookie, and of course your login if you have one on that site.

Here's the part that baffles me. Most of the smart, technical people talking about this seem to think it's pretty much OK.]]></description>
			<content:encoded><![CDATA[<p>One way to ensure you will not be the victim of theft is to simply not have anything to steal.  Someone get your credit card number? Can&#8217;t happen if you don&#8217;t have one in the first place.  Steal your login, or <a href="http://www.techcrunch.com/2009/07/16/twitters-internal-strategy-laid-bare-to-be-the-pulse-of-the-planet/">hundreds of confidential docs</a>? Not if they never existed.  The solution is to do nothing and have nothing, and then nothing bad can happen.</p>
<p>In real life, we don&#8217;t usually think that way.  We like the advantages of having valuable things, whether they may be bank accounts, passwords, or documents.  The truth is, security achieved by having nothing to steal is not really security at all.</p>
<p><strong>Real security is having all that stuff and then actually protecting it.</strong></p>
<p>Which brings me to a strange technical discussion that&#8217;s been bubbling around lately.  It turns out that a feature built into the HTML standard allows any website to test your browser history against a set of &#8220;interesting&#8221; URLs and send that information back to their server, associated with your IP address and browser cookie, and of course your login if you have one on that site.</p>
<p>For example, Amazon could (hypothetically, and I&#8217;m not suggesting they are doing this) have a list of hundreds of book authors&#8217; web sites and know whether you visit the blog or website of any of them.  Your employer could invisibly test you from your home computer against any set of domains they might care to put in a list.  This can all be done with javascript disabled (although who does that anyway), and with full security filters on, and on every browser on the market.</p>
<p>Here&#8217;s the part that baffles me.  Most of the smart, technical people talking about this seem to think it&#8217;s pretty much OK.  In fact, some <a href="http://www.azarask.in/blog/post/socialhistoryjs/">blog add-ons for social networking links</a> will peek at your history in order to know which social networks you are actively using.</p>
<p>The prevailing opinion is that it&#8217;s a fairly innocent quirk in the HTML standard, that the information gained isn&#8217;t really that private, and that you can always just use &#8220;private browsing&#8221;, clear your history, or turn off history completely.  The widespread description of private browsing mode as &#8220;pr0n mode&#8221; has led to an almost <a href="http://en.wikipedia.org/wiki/Orwellian">Orwellian</a> attitude that if you want your history to be private, you must be doing something wrong.</p>
<p>Meanwhile, modern browsers can do some really cool things with history.  Chrome and Firefox both integrate history into the address bar suggest feature. Some browsers have history search, and Explorer has had a pretty decent tree view for a long time.</p>
<p>All this stuff is valuable, and it all works without sharing my history with the rendered HTML page.  The proposed security solution of disabling history in order to protect it is a lot like protecting your documents or bank accounts by just not having any.</p>
<p>Technically, the fallacy lies here: Existing solutions (like private browsing) are trying to control how history gets into the browser, but no effort has been made to limit how history gets *out* of the browser.  Here is what I said in a comment on <a href="http://sharovatov.wordpress.com/2009/04/21/startpaniccom-and-visited-links-privacy-issue/">Vitaly Sharovatov&#8217;s blog</a> and has been <a href="http://slashdot.org/article.pl?sid=09/06/13/2125211">quoted on Slashdot</a>:</p>
<blockquote><p>The idea that the only way to protect your history data is to give up keeping history at all seems broken to me. Just because the information is in the browser, and I may use it in other ways, doesn&#8217;t mean it has to be used to mark up the rendered HTML on sites I visit. There&#8217;s nothing that inextricably ties history to the browser&#8217;s rendering engine.</p></blockquote>
<p>Chrome and the latest versions of Safari have thumbnail screens for your top recently visited sites. Again, cool stuff. But why have new browser features at all if you&#8217;ve already decided that reasonable people should all just turn them off?</p>
<p>So, please consider this an open letter to browser vendors.  Either you intend for this private information to leak out with no controls, or you intend to fix the situation. Otherwise, your enhancements and features around history information are crippled at best, and pointless at worst.</p>
<img src="http://feeds.feedburner.com/~r/waltgordonjones/~4/0-REJSpBr58" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://waltgordonjones.com/244/just-dont-have-anything-worth-stealing/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://waltgordonjones.com/244/just-dont-have-anything-worth-stealing</feedburner:origLink></item>
	</channel>
</rss>
