<?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>cronspam.org</title>
	
	<link>http://cronspam.org</link>
	<description>overwhelming technology</description>
	<lastBuildDate>Sun, 28 Dec 2008 19:13:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Cronspam" /><feedburner:info uri="cronspam" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>How to drive interest in Computer Science</title>
		<link>http://feedproxy.google.com/~r/Cronspam/~3/VCfUyqe257M/how-to-drive-interest-in-computer-science</link>
		<comments>http://cronspam.org/how-to-drive-interest-in-computer-science#comments</comments>
		<pubDate>Sun, 28 Dec 2008 19:12:48 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://cronspam.org/?p=73</guid>
		<description><![CDATA[Obviously we&#8217;ve been doing it wrong.  Which would you rather read?
&#160;&#160;
Check out the other alternative book covers. [via Dave Thomas's blog]
]]></description>
			<content:encoded><![CDATA[<p>Obviously we&#8217;ve been doing it wrong.  Which would you rather read?</p>
<p><nobr><img alt="" src="http://www.pragprog.com/images/covers/190x228/rails2.jpg?1184184147" title="Agile Web Development book cover" class="alignnone" width="190" height="228" />&nbsp;&nbsp;<img alt="" src="http://pragdave.blogs.pragprog.com/.a/6a00d83451c41c69e20105368a3148970b-320wi" title="Improved Agile Web Development book cover" class="alignnone" width="190" height="228" /></nobr></p>
<p>Check out the other <a href="http://www.globalnerdy.com/2007/09/14/reimagining-programming-book-covers/">alternative book covers</a>. [via <a href="http://pragdave.blogs.pragprog.com/pragdave/2008/12/clearly-ive-missed-an-opportunity-with-our-book-covers.html">Dave Thomas's</a> blog]</p>
]]></content:encoded>
			<wfw:commentRss>http://cronspam.org/how-to-drive-interest-in-computer-science/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cronspam.org/how-to-drive-interest-in-computer-science</feedburner:origLink></item>
		<item>
		<title>Integrating Timeline with Google Spreadsheets</title>
		<link>http://feedproxy.google.com/~r/Cronspam/~3/lpdRYImFJqE/integrating-timeline-with-google-spreadsheets</link>
		<comments>http://cronspam.org/integrating-timeline-with-google-spreadsheets#comments</comments>
		<pubDate>Sun, 21 Dec 2008 06:28:15 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[MIT Simile]]></category>
		<category><![CDATA[google docs]]></category>
		<category><![CDATA[mit]]></category>
		<category><![CDATA[simile]]></category>
		<category><![CDATA[spreadsheets]]></category>
		<category><![CDATA[timeline]]></category>

		<guid isPermaLink="false">http://cronspam.org/?p=23</guid>
		<description><![CDATA[You’ve just finished learning all about Timeline, you have a working example on your own website, and you’re dreading having to manage an XML or JSON eventsource file.  

One good solution is Google Spreadsheets &#8211; you can manage your events in a standard spreadsheet, then export them in JSON format to Timeline.

Even better, Google [...]]]></description>
			<content:encoded><![CDATA[<p>You’ve just finished learning all about <a href="http://simile.mit.edu/timeline">Timeline</a>, you have a working example on your own website, and you’re dreading having to manage an XML or JSON <code>eventsource</code> file.  </p>
<p><a href="http://cronspam.org/wordpress/wp-content/uploads/2008/12/timeline.jpg"><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/timeline.jpg" alt="timeline" title="timeline" width="578" height="234" class="alignnone size-full wp-image-67" /></a></p>
<p>One good solution is <a href="http://docs.google.com/">Google Spreadsheets</a> &#8211; you can manage your events in a standard spreadsheet, then export them in JSON format to Timeline.</p>
<p><a href="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_spreadsheet_values.jpg"><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_spreadsheet_values.jpg" alt="google_docs_spreadsheet_values" title="google_docs_spreadsheet_values" width="696" height="238" class="alignnone size-full wp-image-66" /></a></p>
<p>Even better, Google Spreadsheets allows custom forms to be created to simplify the entry of events (you can even embed this form in your own webpage alongside Timeline).</p>
<h2>Create a Google Spreadsheet</h2>
<p>Go to <a href="http://docs.google.com/">Google Docs</a> and select New -&gt; Spreadsheet</p>
<p><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_new_spreadsheet.jpg" alt="Google Docs: New Spreadsheet" title="Google Docs: New Spreadsheet" width="178" height="154" class="alignnone size-full wp-image-27" /></p>
<p>Add columns for each <code>eventsource</code> field you want to populate.  I recommend the following:</p>
<ul>
<li>start</li>
<li>end</li>
<li>duration</li>
<li>title</li>
<li>description</li>
<li>link</li>
<li>icon</li>
<li>category (not an actual eventsource field, it’ll be used for automatic styling)</li>
</ul>
<p>It should look something like this:</p>
<p><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_spreadsheet_columns.jpg" alt="Google Docs: Spreadsheet Columns" title="Google Docs: Spreadsheet Columns" width="950" height="52" class="alignnone size-full wp-image-28" /></p>
<h2>Publish your spreadsheet</h2>
<p>Now you need to make your spreadsheet accessible to the public by publishing it.  Go to the <em>Share</em> tab and select <em>Share with the world</em>:</p>
<p><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_publish_spreadsheet.jpg" alt="google_docs_publish_spreadsheet" title="google_docs_publish_spreadsheet" width="153" height="129" class="alignnone size-full wp-image-34" /></p>
<p>Make sure <em>Let people view without signing in</em> is selected, copy the provided link &#038; click <em>Save</em>:</p>
<p><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_publish_spreadsheet_dialog.jpg" alt="google_docs_publish_spreadsheet_dialog" title="google_docs_publish_spreadsheet_dialog" width="372" height="229" class="alignnone size-full wp-image-35" /></p>
<p>The link should look something like this:</p>
<p><code><a href="http://spreadsheets.google.com/ccc?key=pu1JqzPKsipKl2H7e9EmmRA">http://spreadsheets.google.com/ccc?key=pu1JqzPKsipKl2H7e9EmmRA</a></code></p>
<h2>Get your spreadsheet data as a feed</h2>
<p>To incorporate your spreadsheet data with Timeline, you&#8217;ll need to retrieve the feed as JSON formatted data.  Thankfully the Google Docs API now supports this, use the key value from the previous step and build the feed URL:</p>
<p><code><a href="http://spreadsheets.google.com/feeds/list/pu1JqzPKsipKl2H7e9EmmRA/od6/public/basic">http://spreadsheets.google.com/feeds/list/<b>pu1JqzPKsipKl2H7e9EmmRA</b>/od6/public/basic</a></code></p>
<p>More information: <a href="http://code.google.com/apis/spreadsheets/docs/2.0/reference.html">Google Spreadsheets Data API</a></p>
<p>It&#8217;s helpful to be able to view the data from the JSON feed, but in a format prettier than the actual raw feed data.  Check out <a href="http://bolinfest.com/json/inspect.html">JSON Inspector</a> (Firefox only) for a nice solution.</p>
<h2>Integrate your spreadsheet data with Timeline</h2>
<p>Ok, this is where it gets dirty.  You&#8217;ll need to write some Javascript to process the JSON data from the spreadsheet feed &#038; create event sources for Timeline to display.  Here&#8217;s what I did: <a href='http://cronspam.org/wordpress/wp-content/uploads/2008/12/timeline.js'>timeline.js</a></p>
<p>Breaking it down, these are the important excerpts from <code>timeline.js</code>:</p>
<p>At the end of <code>tl_init()</code>, after Timeline is configured, the feed is processed using a callback (<code>tl_loadWorksheetJSON</code>):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">  <span style="color: #000000; font-style: italic; ">// JSON feed for google spreadsheet, will load events internally</span>
  <span style="color: #000000; ">var</span> feedUrl <span style="color: #000000; font-weight: bold; ">=</span> <span style="color: #000000; ">&quot;http://spreadsheets.google.com/feeds/list/pu1JqzPKsipKl2H7e9EmmRA/od6/public/values&quot;</span>;
  feedUrl <span style="color: #000000; font-weight: bold; ">+=</span> <span style="color: #000000; ">&quot;?alt=json-in-script&amp;callback=tl_loadWorksheetJSON&quot;</span>;
&nbsp;
  <span style="color: #000000; ">var</span> scriptTag <span style="color: #000000; font-weight: bold; ">=</span> document.createElement<span style="color: #000000; font-weight: bold; ">&#40;</span><span style="color: #000000; ">'script'</span><span style="color: #000000; font-weight: bold; ">&#41;</span>;
  scriptTag.src <span style="color: #000000; font-weight: bold; ">=</span> feedUrl;
  document.body.appendChild<span style="color: #000000; font-weight: bold; ">&#40;</span>scriptTag<span style="color: #000000; font-weight: bold; ">&#41;</span>;</pre></div></div>

<p>Taking a look at <code>tl_loadWorksheetJSON</code>, you&#8217;ll see that it iterates through the rows from the spreadsheet feed, converting each row to an event based on the column name.  The list of events is then added to Timeline:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">  eventSource.addMany<span style="color: #000000; font-weight: bold; ">&#40;</span>timelinerEntries<span style="color: #000000; font-weight: bold; ">&#41;</span>;</pre></div></div>

<p>You&#8217;re welcome to reuse the code, it&#8217;s under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">Creative Commons</a> license.</p>
<h2>Create a webform for your spreadsheet</h2>
<p>Google Spreadsheets supports the creation of forms, this really simplifies your data entry and allows others to help enter data without exposing your spreadsheet.  You can even embed the form into a website, allowing others to update the Timeline interactively.</p>
<p><a href="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_spreadsheet_form.jpg"><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/google_docs_spreadsheet_form.jpg" alt="google_docs_spreadsheet_form" title="google_docs_spreadsheet_form" width="569" height="586" class="alignnone size-full wp-image-63" /></a></p>
<p>Don&#8217;t edit the titles of the questions in the form &#8211; those are the column names, and if you edit the titles they&#8217;ll update the spreadsheet and break your spreadsheet/javascript parsing.</p>
<h2>Credits</h2>
<p>Many thanks to the blog entry here: <a href="http://kiyo.wordpress.com/2007/04/29/google-spreadsheet-json-to-timeline/">http://kiyo.wordpress.com/2007/04/29/google-spreadsheet-json-to-timeline/</a> where I was able to see the original Javascript in action and everything I&#8217;d been reading about the Google Docs API and Timeline references all finally made sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://cronspam.org/integrating-timeline-with-google-spreadsheets/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cronspam.org/integrating-timeline-with-google-spreadsheets</feedburner:origLink></item>
		<item>
		<title>Fix Apache on Mac OS X Leopard (10.5.x)</title>
		<link>http://feedproxy.google.com/~r/Cronspam/~3/pGUUrSJK_BQ/fix-apache-on-mac-os-x-leopard-105x</link>
		<comments>http://cronspam.org/fix-apache-on-mac-os-x-leopard-105x#comments</comments>
		<pubDate>Sat, 20 Dec 2008 23:54:01 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mac OSX]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://cronspam.org/?p=8</guid>
		<description><![CDATA[The Apache installed on Mac OS X Leopard (10.5.x) is initially configured extremely conservatively, at first glance it appears broken when you try to visit your user account directory and you get:

This is supposed to display the contents of /Users/jpeacock/Site  To fix this you need to add a directory configuration for your user account [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://httpd.apache.org/">Apache</a> installed on Mac OS X Leopard (10.5.x) is initially configured extremely conservatively, at first glance it appears broken when you try to visit your user account directory and you get:</p>
<p><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/page1_1.jpg" alt="Apache 403 Forbidden" title="Apache 403 Forbidden" width="539" height="230" class="alignnone size-full wp-image-10" /></p>
<p>This is supposed to display the contents of <code>/Users/jpeacock/Site</code>  To fix this you need to add a directory configuration for your user account directories.</p>
<p>Open a terminal and edit the Apache configuration file <code>/etc/apache2/httpd.conf</code>  as <code>root</code>, adding the new directory configuration as shown below the existing comment block:</p>

<div class="wp_syntax"><div class="code"><pre class="foo" style="font-family:monospace;">  #
  # Note that from this point forward you must specifically allow
  # particular features to be enabled - so if something's not working as
  # you might expect, make sure that you have specifically enabled it
  # below.
  #
&nbsp;
  # open up permissions for user dirs
  &lt;directory &quot;/Users/*/Sites&quot;&gt;
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order allow,deny
      Allow from all
  &lt;/directory&gt;</pre></div></div>

<p>Save your changes, then restart Apache to reload the new configuration:</p>
<p><code>sudo /usr/sbin/apachectl restart</code></p>
<p>Now everything should be working:</p>
<p><img src="http://cronspam.org/wordpress/wp-content/uploads/2008/12/page1_2.jpg" alt="Apache Success" title="Apache Success" width="539" height="230" class="alignnone size-full wp-image-11" /></p>
]]></content:encoded>
			<wfw:commentRss>http://cronspam.org/fix-apache-on-mac-os-x-leopard-105x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cronspam.org/fix-apache-on-mac-os-x-leopard-105x</feedburner:origLink></item>
		<item>
		<title>RoR: acts_as_versioned</title>
		<link>http://feedproxy.google.com/~r/Cronspam/~3/85Yl3An8yHA/ror-acts_as_versioned</link>
		<comments>http://cronspam.org/ror-acts_as_versioned#comments</comments>
		<pubDate>Tue, 16 Dec 2008 05:09:23 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[RubyOnRails]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://cronspam.org/?p=3</guid>
		<description><![CDATA[I&#8217;m jump-starting this new blog by copying over the one tech post I have from my personal site.  Enjoy!
acts_as_versioned is pretty awesome..but it lacks documentation regarding how it interacts with optimistic locking.
If you have a column named lock_version, then ActiveRecord will use optimistic locking. (yay!)  But it also means that acts_as_versioned will not [...]]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;m jump-starting this new blog by copying over the <a href="http://jasonpeacock.com/2006/10/05/ror-acts_as_versioned/">one tech post</a> I have from my personal site.  Enjoy!</em></p>
<p><code>acts_as_versioned</code> is pretty awesome..but it lacks documentation regarding how it interacts with optimistic locking.</p>
<p>If you have a column named <code>lock_version</code>, then ActiveRecord will use optimistic locking. (yay!)  But it also means that <code>acts_as_versioned</code> will not automatically create the <code>version</code> column that it uses, nor will it use it even if you create it yourself.  Instead, you need to tell it to use the <code>lock_version</code> column instead:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby ruby" style="font-family:monospace;"><span style="color: #000000; ">class</span> Message <span style="color: #000000; font-weight: bold; ">&lt;</span> <span style="color:#6666ff; font-weight:bold;">ActiveRecord::Base</span>
    validates_uniqueness_of <span style="color:#ff3333; font-weight:bold;">:register_name</span>
&nbsp;
    acts_as_versioned <span style="color:#ff3333; font-weight:bold;">:version_column</span> <span style="color: #000000; font-weight: bold; ">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:lock_version</span>
<span style="color: #000000; ">end</span></pre></div></div>

<p><strong>Update</strong></p>
<p>Some feedback from <a href="http://eric.harris-braun.com/">Eric Harris-Braun</a>:</p>
<blockquote><p>
Thanks Jason, but be warned there are more issues too. Namely that the version numbers so created will not necessarily be sequential, especially if you have set some <code>:if_changed</code> conditions. This is because the <code>lock_version</code> will be updated even if you don’t make a change, but the version in the your_model_version won’t be saved.
</p></blockquote>
<p>Which is a very good point, only do this if your code can handle non-consecutive version numbers!</p>
]]></content:encoded>
			<wfw:commentRss>http://cronspam.org/ror-acts_as_versioned/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://cronspam.org/ror-acts_as_versioned</feedburner:origLink></item>
	</channel>
</rss>
