Congratulations!

[Valid Atom 1.0] This is a valid Atom 1.0 feed.

Recommendations

This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

Source: http://venombytes.com/blog/posts.atom

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
  3.  <id>tag:www.venombytes.com,2008:/blog/posts</id>
  4.  <link rel="alternate" type="text/html" href="http://www.venombytes.com/blog"/>
  5.  <link rel="self" type="application/atom+xml" href="http://www.venombytes.com/blog/posts.atom"/>
  6.  <title>Venombytes</title>
  7.  <updated>2013-03-12T11:00:28+11:00</updated>
  8.  <generator uri="http://enkiblog.com">Enki</generator>
  9.  <author>
  10.    <name>Tom Meier</name>
  11.    <email>[email protected]</email>
  12.  </author>
  13.  <entry>
  14.    <id>tag:www.venombytes.com,2008:Post/4</id>
  15.    <published>2013-03-11T11:10:00+11:00</published>
  16.    <updated>2013-03-12T11:00:28+11:00</updated>
  17.    <link rel="alternate" type="text/html" href="http://venombytes.com/2013/03/11/faster-browser-specs"/>
  18.    <title>Two steps for faster browser specs</title>
  19.    <content type="html">&lt;p&gt;Keeping specs fast is a never ending battle for the average Rails developer. There are 2 quick lines of javascript that can make excellent and stable improvements to spec speed performance.&lt;/p&gt;
  20. &lt;p style="text-align:center;"&gt;&lt;img src="/assets/posts/4_spec_speed/no_speed_limit.jpg" style="width:100%;" alt="" /&gt;&lt;/p&gt;
  21. &lt;p&gt;Most people are aware of JQuery giving the option to disable animations (see &amp;#8211; &lt;a href="http://api.jquery.com/jQuery.fx.off/"&gt;fx.off&lt;/a&gt;), we can disable this in test mode making all browser based specs faster by skipping JS animation. This is acceptable, as we know it works, it&amp;#8217;s still being triggered but skips the time-consuming part for our specs.&lt;/p&gt;
  22. &lt;p&gt;The same can be said for &lt;span class="caps"&gt;CSS&lt;/span&gt; transformations; sliding a menu down and hiding a div for example. We know they work, but don&amp;#8217;t want our specs held up by the animation.&lt;/p&gt;
  23. &lt;p&gt;To acheive this, simply apply the following code to your Rails app :&lt;/p&gt;
  24. &lt;pre&gt;&lt;code&gt;app/views/layouts/_spec_performance.html.erb&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  25.  &lt;td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;
  26. &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;
  27. &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;
  28. &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;
  29. &lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;
  30. &lt;a href="#n6" name="n6"&gt;6&lt;/a&gt;
  31. &lt;a href="#n7" name="n7"&gt;7&lt;/a&gt;
  32. &lt;a href="#n8" name="n8"&gt;8&lt;/a&gt;
  33. &lt;a href="#n9" name="n9"&gt;9&lt;/a&gt;
  34. &lt;strong&gt;&lt;a href="#n10" name="n10"&gt;10&lt;/a&gt;&lt;/strong&gt;
  35. &lt;a href="#n11" name="n11"&gt;11&lt;/a&gt;
  36. &lt;a href="#n12" name="n12"&gt;12&lt;/a&gt;
  37. &lt;a href="#n13" name="n13"&gt;13&lt;/a&gt;
  38. &lt;a href="#n14" name="n14"&gt;14&lt;/a&gt;
  39. &lt;a href="#n15" name="n15"&gt;15&lt;/a&gt;
  40. &lt;a href="#n16" name="n16"&gt;16&lt;/a&gt;
  41. &lt;a href="#n17" name="n17"&gt;17&lt;/a&gt;
  42. &lt;a href="#n18" name="n18"&gt;18&lt;/a&gt;
  43. &lt;a href="#n19" name="n19"&gt;19&lt;/a&gt;
  44. &lt;strong&gt;&lt;a href="#n20" name="n20"&gt;20&lt;/a&gt;&lt;/strong&gt;
  45. &lt;a href="#n21" name="n21"&gt;21&lt;/a&gt;
  46. &lt;a href="#n22" name="n22"&gt;22&lt;/a&gt;
  47. &lt;a href="#n23" name="n23"&gt;23&lt;/a&gt;
  48. &lt;a href="#n24" name="n24"&gt;24&lt;/a&gt;
  49. &lt;a href="#n25" name="n25"&gt;25&lt;/a&gt;
  50. &lt;a href="#n26" name="n26"&gt;26&lt;/a&gt;
  51. &lt;a href="#n27" name="n27"&gt;27&lt;/a&gt;
  52. &lt;a href="#n28" name="n28"&gt;28&lt;/a&gt;
  53. &lt;a href="#n29" name="n29"&gt;29&lt;/a&gt;
  54. &lt;strong&gt;&lt;a href="#n30" name="n30"&gt;30&lt;/a&gt;&lt;/strong&gt;
  55. &lt;a href="#n31" name="n31"&gt;31&lt;/a&gt;
  56. &lt;a href="#n32" name="n32"&gt;32&lt;/a&gt;
  57. &lt;a href="#n33" name="n33"&gt;33&lt;/a&gt;
  58. &lt;a href="#n34" name="n34"&gt;34&lt;/a&gt;
  59. &lt;a href="#n35" name="n35"&gt;35&lt;/a&gt;
  60. &lt;a href="#n36" name="n36"&gt;36&lt;/a&gt;
  61. &lt;a href="#n37" name="n37"&gt;37&lt;/a&gt;
  62. &lt;/pre&gt;&lt;/td&gt;
  63.  &lt;td class="code"&gt;&lt;pre&gt;&lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;if&lt;/span&gt; &lt;span style="color:#036;font-weight:bold"&gt;Rails&lt;/span&gt;.env.test? &lt;span style="font-weight:bold;color:#666"&gt;-%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  64.  &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%=&lt;/span&gt; content_for &lt;span style="color:#A60"&gt;:head&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;do&lt;/span&gt; &lt;span style="font-weight:bold;color:#666"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  65.    &lt;span style="color:#070"&gt;&amp;lt;style&lt;/span&gt; &lt;span style="color:#b48"&gt;type&lt;/span&gt;=&lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;text/css&lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#070"&gt;&amp;gt;&lt;/span&gt;
  66.      .notransition * {
  67.        /*CSS transitions*/
  68.        -webkit-transition: none !important;
  69.        -moz-transition: none !important;
  70.        -o-transition: none !important;
  71.        -ms-transition: none !important;
  72.        transition: none !important;
  73.        /*CSS transition properties*/
  74.        -webkit-transition-property: none !important;
  75.        -moz-transition-property: none !important;
  76.        -o-transition-property: none !important;
  77.        -ms-transition-property: none !important;
  78.        transition-property: none !important;
  79.        /*CSS transforms*/
  80.        -webkit-transform: none !important;
  81.        -moz-transform: none !important;
  82.        -o-transform: none !important;
  83.        -ms-transform: none !important;
  84.        transform: none !important;
  85.        /*CSS animations*/
  86.        -webkit-animation: none !important;
  87.        -moz-animation: none !important;
  88.        -o-animation: none !important;
  89.        -ms-animation: none !important;
  90.        animation: none !important;
  91.    }
  92.    &lt;span style="color:#070"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
  93.  &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;end&lt;/span&gt; &lt;span style="font-weight:bold;color:#666"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  94.  
  95.  &lt;span style="color:#070"&gt;&amp;lt;script&lt;/span&gt; &lt;span style="color:#b48"&gt;type&lt;/span&gt;=&lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;text/javascript&lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#070"&gt;&amp;gt;&lt;/span&gt;
  96. &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;    &lt;span style="color:#369;font-weight:bold"&gt;$&lt;/span&gt;.fx.off = &lt;span style="color:#069"&gt;true&lt;/span&gt;;
  97.    &lt;span style="color:#369;font-weight:bold"&gt;$&lt;/span&gt;(&lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;span style="color:#D20"&gt;body&lt;/span&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;/span&gt;).addClass(&lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;span style="color:#D20"&gt;notransition&lt;/span&gt;&lt;span style="color:#710"&gt;'&lt;/span&gt;&lt;/span&gt;);&lt;/span&gt;
  98.  &lt;span style="color:#070"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  99. &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;end&lt;/span&gt; &lt;span style="font-weight:bold;color:#666"&gt;-%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  100. &lt;/pre&gt;&lt;/td&gt;
  101. &lt;/tr&gt;&lt;/table&gt;
  102.  
  103. &lt;pre&gt;&lt;code&gt;app/views/layouts/any_layout.html.erb&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  104.  &lt;td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;
  105. &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;
  106. &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;
  107. &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;
  108. &lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;
  109. &lt;a href="#n6" name="n6"&gt;6&lt;/a&gt;
  110. &lt;a href="#n7" name="n7"&gt;7&lt;/a&gt;
  111. &lt;a href="#n8" name="n8"&gt;8&lt;/a&gt;
  112. &lt;a href="#n9" name="n9"&gt;9&lt;/a&gt;
  113. &lt;strong&gt;&lt;a href="#n10" name="n10"&gt;10&lt;/a&gt;&lt;/strong&gt;
  114. &lt;a href="#n11" name="n11"&gt;11&lt;/a&gt;
  115. &lt;a href="#n12" name="n12"&gt;12&lt;/a&gt;
  116. &lt;/pre&gt;&lt;/td&gt;
  117.  &lt;td class="code"&gt;&lt;pre&gt;&lt;span style="color:#070"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  118.  &lt;span style="color:#070"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
  119.  &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%=&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;yield&lt;/span&gt; &lt;span style="color:#A60"&gt;:head&lt;/span&gt; &lt;span style="font-weight:bold;color:#666"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  120.  &lt;span style="color:#070"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  121.  &lt;span style="color:#070"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
  122.  ...
  123.  &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%=&lt;/span&gt; &lt;span style="color:#080;font-weight:bold"&gt;yield&lt;/span&gt; &lt;span style="font-weight:bold;color:#666"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  124.  ...
  125.  &lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;&amp;lt;%=&lt;/span&gt; render &lt;span style="color:#606"&gt;partial&lt;/span&gt;: &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;layouts/spec_performance&lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span style="font-weight:bold;color:#666"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
  126.  &lt;span style="color:#070"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
  127. &lt;span style="color:#070"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
  128.  
  129. &lt;/pre&gt;&lt;/td&gt;
  130. &lt;/tr&gt;&lt;/table&gt;
  131. &lt;p&gt;Thats it. I&amp;#8217;m seeing ~31% speed improvements on our mobile specs, and ~18% speed improvements on our normal Capybara features.&lt;/p&gt;</content>
  132.  </entry>
  133.  <entry>
  134.    <id>tag:www.venombytes.com,2008:Post/3</id>
  135.    <published>2011-04-11T18:13:00+10:00</published>
  136.    <updated>2011-04-11T18:13:05+10:00</updated>
  137.    <link rel="alternate" type="text/html" href="http://venombytes.com/2011/04/11/32-bits-of-ruby-in-time"/>
  138.    <title>32 bits of Ruby</title>
  139.    <content type="html">&lt;p&gt;A recent rabbit hole that I fell in, related to a rather obscure Ruby 32bit &amp;#8594; 64 bit Time parsing issue. I&amp;#8217;ll lay it all out here in the hope that no-one else falls into it.&lt;/p&gt;
  140. &lt;p style="text-align:center;"&gt;&lt;img src="/assets/posts/3_ruby32_bit/alice_in_wonderland.jpg" style="width:100%;" alt="" /&gt;&lt;/p&gt;
  141. &lt;p&gt;As per usual, all the code was working swimmingly on my own machine (macbook pro &amp;#8211; 64 bit with the trimmings, hold the fat), but the minute it was deploying onto multiple servers and the testing environment (see &amp;#8211; &lt;a href="http://jenkins-ci.org/"&gt;Jenkins&lt;/a&gt; or whatever continuos integration philosophy you employ), a few inserts into the database were chucking nasty &amp;#8220;ArgumentError: time out of range&amp;#8221; errors.&lt;/p&gt;
  142. &lt;p&gt;First picked up when attempting to load fixtures for the test suite. With a bit of hunting this narrowed down to simply one of the date values being set at &amp;#8216;3000-01-01&amp;#8217; (legacy systems &lt;strong&gt;groan&lt;/strong&gt;), as you can see here:&lt;/p&gt;
  143. &lt;pre&gt;&lt;code&gt;my 64 bit machine:&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  144.  &lt;td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;
  145. &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;
  146. &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;
  147. &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;
  148. &lt;/pre&gt;&lt;/td&gt;
  149.  &lt;td class="code"&gt;&lt;pre&gt;&amp;gt;&amp;gt; Time.parse('3000-01-01')
  150. =&amp;gt; Wed Jan 01 00:00:00 +1100 3000
  151. &amp;gt;&amp;gt; DateTime.parse('3000-01-01')
  152. =&amp;gt; Wed, 01 Jan 3000 00:00:00 +0000
  153. &lt;/pre&gt;&lt;/td&gt;
  154. &lt;/tr&gt;&lt;/table&gt;
  155.  
  156. &lt;pre&gt;&lt;code&gt;on 32 bit testing server:&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  157.  &lt;td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;
  158. &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;
  159. &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;
  160. &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;
  161. &lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;
  162. &lt;a href="#n6" name="n6"&gt;6&lt;/a&gt;
  163. &lt;a href="#n7" name="n7"&gt;7&lt;/a&gt;
  164. &lt;a href="#n8" name="n8"&gt;8&lt;/a&gt;
  165. &lt;/pre&gt;&lt;/td&gt;
  166.  &lt;td class="code"&gt;&lt;pre&gt;ree-1.8.7-2011.03 :001 &amp;gt; Time.parse('3000-01-01')
  167. ArgumentError: time out of range
  168.        from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/time.rb:184:in `local'
  169.        from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/time.rb:184:in `make_time'
  170.        from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/time.rb:243:in `parse'
  171.        from (irb):1
  172. ree-1.8.7-2011.03 :002 &amp;gt; DateTime.parse('3000-01-01')
  173. =&amp;gt; Wed, 01 Jan 3000 00:00:00 +0000
  174. &lt;/pre&gt;&lt;/td&gt;
  175. &lt;/tr&gt;&lt;/table&gt;
  176. &lt;p&gt;So the long and short of it is that Ruby in a 32 bit environment, when running Time.parse tends to have a &amp;#8216;bit&amp;#8217; of a hissy fit with &lt;strong&gt;any&lt;/strong&gt; years greater than 2038. Time has a limited range of 1901 &amp;#8211; 2038, anything, and I mean anything, even a &lt;strong&gt;second&lt;/strong&gt; outside this range, requires DateTime to be used instead.&lt;/p&gt;
  177. &lt;p&gt;With my particular issue, I had to track down where it was calling Time.parse, and why the festicky was it not using a superior DateTime.parse call on the input data. Long live the testing suite! A quick change added to the spec_helper.rb:&lt;/p&gt;
  178. &lt;pre&gt;&lt;code&gt;spec/spec_helper.rb&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  179.  &lt;td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;&lt;a href="#n1" name="n1"&gt;1&lt;/a&gt;
  180. &lt;a href="#n2" name="n2"&gt;2&lt;/a&gt;
  181. &lt;a href="#n3" name="n3"&gt;3&lt;/a&gt;
  182. &lt;a href="#n4" name="n4"&gt;4&lt;/a&gt;
  183. &lt;a href="#n5" name="n5"&gt;5&lt;/a&gt;
  184. &lt;a href="#n6" name="n6"&gt;6&lt;/a&gt;
  185. &lt;/pre&gt;&lt;/td&gt;
  186.  &lt;td class="code"&gt;&lt;pre&gt;  &lt;span style="color:#777"&gt;#Raise on the method call - REMOVEME&lt;/span&gt;
  187.  &lt;span style="color:#080;font-weight:bold"&gt;class&lt;/span&gt; &lt;span style="color:#B06;font-weight:bold"&gt;Time&lt;/span&gt;
  188.    &lt;span style="color:#080;font-weight:bold"&gt;def&lt;/span&gt; &lt;span style="color:#069"&gt;self&lt;/span&gt;.&lt;span style="color:#06B;font-weight:bold"&gt;parse&lt;/span&gt;(date, now=&lt;span style="color:#069"&gt;self&lt;/span&gt;.now)
  189.      raise &lt;span style="background-color:hsla(0,100%,50%,0.05)"&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#D20"&gt;THIS LITTLE BUGGER CALLED ME : &lt;/span&gt;&lt;span style="background-color:hsla(0,0%,0%,0.07);color:black"&gt;&lt;span style="font-weight:bold;color:#666"&gt;#{&lt;/span&gt;caller.inspect&lt;span style="font-weight:bold;color:#666"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#710"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
  190.    &lt;span style="color:#080;font-weight:bold"&gt;end&lt;/span&gt;
  191.  &lt;span style="color:#080;font-weight:bold"&gt;end&lt;/span&gt;
  192. &lt;/pre&gt;&lt;/td&gt;
  193. &lt;/tr&gt;&lt;/table&gt;
  194. &lt;p&gt;On the next run of the relevant spec, which loaded the problematic date times, I could then see the cause of my current despair was none other than &lt;a href="http://sequel.rubyforge.org"&gt;Sequel&lt;/a&gt; . Sequel has been a fantastic utility, and I&amp;#8217;m preferring it over Arel and ActiveRecord for the extra control it gives me. However, this was the root cause.&lt;/p&gt;
  195. &lt;p&gt;Turns out Sequel is well aware of the issue and had an immediate fix to hand already, boomshanka!&lt;/p&gt;
  196. &lt;p&gt;&lt;a href="http://sequel.rubyforge.org/rdoc/classes/Sequel.html"&gt;http://sequel.rubyforge.org/rdoc/classes/Sequel.html&lt;/a&gt;&lt;/p&gt;
  197. &lt;blockquote&gt;
  198. &lt;p&gt;&lt;em&gt;datetime_class&lt;/em&gt; [RW] Sequel can use either Time or DateTime for times returned from the database. It defaults to Time. To change it to DateTime:&lt;/p&gt;
  199. &lt;p&gt;&lt;b&gt;Sequel.datetime_class = DateTime&lt;/b&gt;&lt;/p&gt;
  200. &lt;p&gt;For ruby versions less than 1.9.2, Time has a limited range (1901 to 2038), so if you use datetimes out of that range, you need to switch to DateTime. Also, before 1.9.2, Time can only handle local and &lt;span class="caps"&gt;UTC&lt;/span&gt; times, not other timezones. Note that Time and DateTime objects have a different &lt;span class="caps"&gt;API&lt;/span&gt;, and in cases where they implement the same methods, they often implement them differently (e.g. + using seconds on Time and days on DateTime).&lt;/p&gt;
  201. &lt;/blockquote&gt;
  202. &lt;p&gt;Job done. Setting the Sequel default to use DateTime instead of time resolves this issue for both 32 bit and 64 bit machines, and will work on any modern ruby version.&lt;/p&gt;</content>
  203.  </entry>
  204.  <entry>
  205.    <id>tag:www.venombytes.com,2008:Post/2</id>
  206.    <published>2011-01-30T14:05:00+11:00</published>
  207.    <updated>2011-01-30T14:00:21+11:00</updated>
  208.    <link rel="alternate" type="text/html" href="http://venombytes.com/2011/01/30/static-content-in-rails-3"/>
  209.    <title>Static content in Rails 3</title>
  210.    <content type="html">&lt;p&gt;To auto-generate static pages in Rails 3, other than by simply adding html files to the &amp;#8216;public&amp;#8217; directory, is very easy.&lt;/p&gt;
  211. &lt;p&gt;The most simple way is to just; add a controller such as &amp;#8216;PagesController&amp;#8217;, redirect all unmatched routes there, create a view and it will be displayed if the html/haml view exists &amp;#8211; with any others raising a template not found error (display 500 to the production user).&lt;/p&gt;
  212. &lt;p&gt;However, I usually want to capture whats going on behind the scenes, or share variables across a group of pages.&lt;/p&gt;
  213. &lt;p&gt;Disclaimer &amp;#8211; this isn&amp;#8217;t the &lt;em&gt;ideal&lt;/em&gt; or the &lt;em&gt;best&lt;/em&gt; way, but it is &lt;em&gt;my&lt;/em&gt; convenient way, let me know if you have any tips &amp;#8217;n tricks to improve it further!&lt;/p&gt;
  214. &lt;p style="text-align:center;"&gt;&lt;a href="http://www.flickr.com/photos/st-stev/2289841439/" title="Static Schoolgirls by St Stev, on Flickr"&gt;&lt;img src="http://farm3.static.flickr.com/2177/2289841439_fc49c2dc80_m.jpg" width="240" height="171" alt="Static Schoolgirls" /&gt;&lt;/a&gt;&lt;/p&gt;
  215. &lt;p&gt;My usual setup can be handy, if you want custom static pages for both scoped areas of those logged in and those not, or even subdomains, anything is possible really with the Rails 3 routing setup. Simply add the following:&lt;/p&gt;
  216. &lt;p&gt;Create a pages controller class, under any submodule or folder structure you like.&lt;br /&gt;
  217. This will simply check if the view template exists (even haml) and render that, otherwise render out your custom 404 page, the only params being sent are &amp;#8216;base_page&amp;#8217; which will be set by the routes.&lt;/p&gt;
  218. &lt;pre&gt;&lt;code&gt;app/controllers/pages_controller.rb&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  219.  &lt;td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;1&lt;tt&gt;
  220. &lt;/tt&gt;2&lt;tt&gt;
  221. &lt;/tt&gt;3&lt;tt&gt;
  222. &lt;/tt&gt;4&lt;tt&gt;
  223. &lt;/tt&gt;5&lt;tt&gt;
  224. &lt;/tt&gt;6&lt;tt&gt;
  225. &lt;/tt&gt;7&lt;tt&gt;
  226. &lt;/tt&gt;8&lt;tt&gt;
  227. &lt;/tt&gt;9&lt;tt&gt;
  228. &lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
  229. &lt;/tt&gt;11&lt;tt&gt;
  230. &lt;/tt&gt;12&lt;tt&gt;
  231. &lt;/tt&gt;13&lt;tt&gt;
  232. &lt;/tt&gt;14&lt;tt&gt;
  233. &lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  234.  &lt;td class="code"&gt;&lt;pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"&gt;&lt;span class="r"&gt;class&lt;/span&gt; &lt;span class="cl"&gt;PagesController&lt;/span&gt; &amp;lt; &lt;span class="co"&gt;ApplicationController&lt;/span&gt;&lt;tt&gt;
  235. &lt;/tt&gt;&lt;tt&gt;
  236. &lt;/tt&gt;  &lt;span class="r"&gt;def&lt;/span&gt; &lt;span class="fu"&gt;base_page_processor&lt;/span&gt;&lt;tt&gt;
  237. &lt;/tt&gt;    view_prefix = &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;pages&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
  238. &lt;/tt&gt;&lt;tt&gt;
  239. &lt;/tt&gt;    &lt;span class="r"&gt;if&lt;/span&gt; params[&lt;span class="sy"&gt;:base_page&lt;/span&gt;].present? &amp;amp;&amp;amp; template_exists?(params[&lt;span class="sy"&gt;:base_page&lt;/span&gt;], view_prefix)&lt;tt&gt;
  240. &lt;/tt&gt;      render &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;view_prefix&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="k"&gt;/&lt;/span&gt;&lt;span class="il"&gt;&lt;span class="idl"&gt;#{&lt;/span&gt;params[&lt;span class="sy"&gt;:base_page&lt;/span&gt;]&lt;span class="idl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
  241. &lt;/tt&gt;    &lt;span class="r"&gt;else&lt;/span&gt;&lt;tt&gt;
  242. &lt;/tt&gt;      &lt;span class="c"&gt;#TODO : Notify missing url via email error or error notification service&lt;/span&gt;&lt;tt&gt;
  243. &lt;/tt&gt;      render &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;/public/404.html&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:status&lt;/span&gt; =&amp;gt; &lt;span class="i"&gt;404&lt;/span&gt;&lt;tt&gt;
  244. &lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  245. &lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  246. &lt;/tt&gt;&lt;tt&gt;
  247. &lt;/tt&gt;&lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  248. &lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  249. &lt;/tr&gt;&lt;/table&gt;
  250. &lt;p&gt;To ensure all routes are matched, that aren&amp;#8217;t specifically set in the config/routes.rb file, add this line right at the very end of the file (or at the end of a specific scope, such as a logged in section) :&lt;/p&gt;
  251. &lt;pre&gt;&lt;code&gt;config/routes.rb&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  252.  &lt;td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;1&lt;tt&gt;
  253. &lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  254.  &lt;td class="code"&gt;&lt;pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"&gt;match  &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;:base_page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:controller&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;pages&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:action&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;base_page_processor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:as&lt;/span&gt; =&amp;gt; &lt;span class="sy"&gt;:page_processor&lt;/span&gt;&lt;tt&gt;
  255. &lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  256. &lt;/tr&gt;&lt;/table&gt;
  257. &lt;p&gt;Some specs to help you along the way (using RSpec), and ensure you don&amp;#8217;t break the setup as time goes on:&lt;/p&gt;
  258. &lt;pre&gt;&lt;code&gt;spec/controllers/pages_controller_spec.rb&lt;/code&gt;&lt;/pre&gt;&lt;table class="CodeRay"&gt;&lt;tr&gt;
  259.  &lt;td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"&gt;&lt;pre&gt;1&lt;tt&gt;
  260. &lt;/tt&gt;2&lt;tt&gt;
  261. &lt;/tt&gt;3&lt;tt&gt;
  262. &lt;/tt&gt;4&lt;tt&gt;
  263. &lt;/tt&gt;5&lt;tt&gt;
  264. &lt;/tt&gt;6&lt;tt&gt;
  265. &lt;/tt&gt;7&lt;tt&gt;
  266. &lt;/tt&gt;8&lt;tt&gt;
  267. &lt;/tt&gt;9&lt;tt&gt;
  268. &lt;/tt&gt;&lt;strong&gt;10&lt;/strong&gt;&lt;tt&gt;
  269. &lt;/tt&gt;11&lt;tt&gt;
  270. &lt;/tt&gt;12&lt;tt&gt;
  271. &lt;/tt&gt;13&lt;tt&gt;
  272. &lt;/tt&gt;14&lt;tt&gt;
  273. &lt;/tt&gt;15&lt;tt&gt;
  274. &lt;/tt&gt;16&lt;tt&gt;
  275. &lt;/tt&gt;17&lt;tt&gt;
  276. &lt;/tt&gt;18&lt;tt&gt;
  277. &lt;/tt&gt;19&lt;tt&gt;
  278. &lt;/tt&gt;&lt;strong&gt;20&lt;/strong&gt;&lt;tt&gt;
  279. &lt;/tt&gt;21&lt;tt&gt;
  280. &lt;/tt&gt;22&lt;tt&gt;
  281. &lt;/tt&gt;23&lt;tt&gt;
  282. &lt;/tt&gt;24&lt;tt&gt;
  283. &lt;/tt&gt;25&lt;tt&gt;
  284. &lt;/tt&gt;26&lt;tt&gt;
  285. &lt;/tt&gt;27&lt;tt&gt;
  286. &lt;/tt&gt;28&lt;tt&gt;
  287. &lt;/tt&gt;29&lt;tt&gt;
  288. &lt;/tt&gt;&lt;strong&gt;30&lt;/strong&gt;&lt;tt&gt;
  289. &lt;/tt&gt;31&lt;tt&gt;
  290. &lt;/tt&gt;32&lt;tt&gt;
  291. &lt;/tt&gt;33&lt;tt&gt;
  292. &lt;/tt&gt;34&lt;tt&gt;
  293. &lt;/tt&gt;35&lt;tt&gt;
  294. &lt;/tt&gt;36&lt;tt&gt;
  295. &lt;/tt&gt;37&lt;tt&gt;
  296. &lt;/tt&gt;38&lt;tt&gt;
  297. &lt;/tt&gt;39&lt;tt&gt;
  298. &lt;/tt&gt;&lt;strong&gt;40&lt;/strong&gt;&lt;tt&gt;
  299. &lt;/tt&gt;41&lt;tt&gt;
  300. &lt;/tt&gt;42&lt;tt&gt;
  301. &lt;/tt&gt;43&lt;tt&gt;
  302. &lt;/tt&gt;44&lt;tt&gt;
  303. &lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  304.  &lt;td class="code"&gt;&lt;pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"&gt;require &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;spec_helper&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
  305. &lt;/tt&gt;&lt;tt&gt;
  306. &lt;/tt&gt;describe &lt;span class="co"&gt;PagesController&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;automatic paths&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  307. &lt;/tt&gt;  before(&lt;span class="sy"&gt;:all&lt;/span&gt;) &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  308. &lt;/tt&gt;    &lt;span class="iv"&gt;@routes&lt;/span&gt; = &lt;span class="co"&gt;Rails&lt;/span&gt;.application.routes&lt;tt&gt;
  309. &lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  310. &lt;/tt&gt;&lt;tt&gt;
  311. &lt;/tt&gt;  it &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;should route all traffic and render if template exists&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  312. &lt;/tt&gt;    [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/some_random_path&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/something_else&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/doesnt_exist&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;].each &lt;span class="r"&gt;do&lt;/span&gt; |dynamic_path|&lt;tt&gt;
  313. &lt;/tt&gt;      &lt;span class="iv"&gt;@routes&lt;/span&gt;.recognize_path(dynamic_path).should == {&lt;span class="sy"&gt;:controller&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;pages&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:action&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;base_page_processor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:base_page&lt;/span&gt; =&amp;gt; dynamic_path.gsub(&lt;span class="rx"&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;span class="k"&gt;^&lt;/span&gt;&lt;span class="ch"&gt;\/&lt;/span&gt;&lt;span class="dl"&gt;/&lt;/span&gt;&lt;/span&gt;,&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)}&lt;tt&gt;
  314. &lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  315. &lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  316. &lt;/tt&gt;&lt;tt&gt;
  317. &lt;/tt&gt;  it &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;should not route any traffic with sub paths&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  318. &lt;/tt&gt;    [&lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/some_random_path/with_sub/lines&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/something_else/123/something.csv&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="s"&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;/doesnt_exist/nope&lt;/span&gt;&lt;span class="dl"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;].each &lt;span class="r"&gt;do&lt;/span&gt; |dynamic_path|&lt;tt&gt;
  319. &lt;/tt&gt;      lambda { &lt;span class="iv"&gt;@routes&lt;/span&gt;.recognize_path(dynamic_path) }.should raise_error(&lt;span class="co"&gt;ActionController&lt;/span&gt;::&lt;span class="co"&gt;RoutingError&lt;/span&gt;)&lt;tt&gt;
  320. &lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  321. &lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  322. &lt;/tt&gt;&lt;tt&gt;
  323. &lt;/tt&gt;  describe &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;with templates existing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  324. &lt;/tt&gt;&lt;tt&gt;
  325. &lt;/tt&gt;    it &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;should render the template&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  326. &lt;/tt&gt;      controller.stub!(&lt;span class="sy"&gt;:template_exists?&lt;/span&gt;).and_return(&lt;span class="pc"&gt;true&lt;/span&gt;)&lt;tt&gt;
  327. &lt;/tt&gt;      controller.stub!(&lt;span class="sy"&gt;:render&lt;/span&gt;)&lt;tt&gt;
  328. &lt;/tt&gt;&lt;tt&gt;
  329. &lt;/tt&gt;      controller.should_receive(&lt;span class="sy"&gt;:render&lt;/span&gt;).with( &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;pages/something_that_exists&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; )&lt;tt&gt;
  330. &lt;/tt&gt;&lt;tt&gt;
  331. &lt;/tt&gt;      get &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;base_page_processor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:base_page&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;something_that_exists&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
  332. &lt;/tt&gt;&lt;tt&gt;
  333. &lt;/tt&gt;      response.status.should == &lt;span class="i"&gt;200&lt;/span&gt;&lt;tt&gt;
  334. &lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  335. &lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  336. &lt;/tt&gt;&lt;tt&gt;
  337. &lt;/tt&gt;  describe &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;when template doesnt exist&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  338. &lt;/tt&gt;&lt;tt&gt;
  339. &lt;/tt&gt;    it &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;should render the 404 page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt; &lt;span class="r"&gt;do&lt;/span&gt;&lt;tt&gt;
  340. &lt;/tt&gt;      get &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;base_page_processor&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="sy"&gt;:base_page&lt;/span&gt; =&amp;gt; &lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;something_that_doesnt_exist&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;tt&gt;
  341. &lt;/tt&gt;&lt;tt&gt;
  342. &lt;/tt&gt;      response.status.should == &lt;span class="i"&gt;404&lt;/span&gt;&lt;tt&gt;
  343. &lt;/tt&gt;      response.should render_template(&lt;span class="s"&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="k"&gt;public/404&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;/span&gt;)&lt;tt&gt;
  344. &lt;/tt&gt;    &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  345. &lt;/tt&gt;  &lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  346. &lt;/tt&gt;&lt;tt&gt;
  347. &lt;/tt&gt;&lt;span class="r"&gt;end&lt;/span&gt;&lt;tt&gt;
  348. &lt;/tt&gt;&lt;/pre&gt;&lt;/td&gt;
  349. &lt;/tr&gt;&lt;/table&gt;
  350. &lt;p&gt;Now simply add any view template in your set page prefix, in the above example this would be &amp;#8216;/app/views/pages/any_template_file&amp;#8217;, this will now immediately load in your app. Easy.&lt;/p&gt;</content>
  351.  </entry>
  352.  <entry>
  353.    <id>tag:www.venombytes.com,2008:Post/1</id>
  354.    <published>2011-01-11T22:28:00+11:00</published>
  355.    <updated>2011-01-11T21:35:55+11:00</updated>
  356.    <link rel="alternate" type="text/html" href="http://venombytes.com/2011/01/11/programming-through-a-music-festival"/>
  357.    <title>Programming my way through a music festival</title>
  358.    <content type="html">&lt;p&gt;Like many things, I have to agree with an often overlooked corner stone of the Google empire, that started right at the inception of this life/behavior changing company. It seems the little known players Sergey Brin &amp;amp; Larry Page had been experimenting (with different social scenes, of course) during University and attended a now world famous event: &lt;a href="http://www.burningman.com/"&gt;The Burning Man&lt;/a&gt; (&lt;a href="http://en.wikipedia.org/wiki/Burning_Man"&gt;wiki&lt;/a&gt;).&lt;/p&gt;
  359. &lt;p&gt;In fact, the key reason why they hired &lt;a href="http://en.wikipedia.org/wiki/Eric_Schmidt"&gt;Eric Schmidt&lt;/a&gt; was because he was the &lt;a href="http://en.wikipedia.org/wiki/Eric_Schmidt#cite_note-15"&gt;&amp;#8216;only candidate who had been to Burning man&amp;#8217;&lt;/a&gt;, pretty obvious indicator of the sentiment by our Google overlords. If this isn&amp;#8217;t enough, the very first &amp;#8216;doodle&amp;#8217; was actually a scribble of the burning man (the effigy burned at the close of the festival, which became its namesake).&lt;/p&gt;
  360. &lt;p style="text-align:center;"&gt;&lt;a href="http://www.google.com/doodle4google/history.html"&gt;&lt;img src="http://www.google.com/logos/googleburn.jpg" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
  361. &lt;p&gt;But why discuss Google? I mean, you wouldn&amp;#8217;t jump off a metaphorical bridge and follow them to Bing if they sold out right? The point is I have your attention to some of the most successful characters in the industry (right now), and with their philosophy on this subject, I have to completely agree with them!&lt;/p&gt;
  362. &lt;p&gt;What better way to get to know your work mates? Your peers? Your fellow man? (your fellow alien?) Other than to get so completely, absolutely and absurdly out of your perceived comfort zone. If only for a few days. Every self-help book cluttering up the interesting sections of your local bookstore are filled with methods and techniques to change and alter the way you perceive your surrounds, looking at the world at a slight tilt different to your day to day.&lt;/p&gt;
  363. &lt;p&gt;Seriously, its a pretty far jump from a programmers day to day, frolicking around the fields, in sunshine (yes &amp;#8211; it exists), taking in the smells, the jaw dropping sights, the amazing sounds, the good, the bad and the ugly. So when you&amp;#8217;re considering your new year resolutions, or better yet, that &amp;#8216;thing you should try once&amp;#8217; this year/month/week. Try a festival, something really detached from anything that you would normally do. Rope in some friends, share the experience. Make the most of it, you just might like it. You have nothing to lose, and everything to gain. The unfortunate truth of many of these festivals are a steeper slope of acceptance the older we get, so why not try it now. I know I&amp;#8217;d rather look back when I&amp;#8217;m 97, sitting on my Atari 2600 wondering why the toilet paper isn&amp;#8217;t coming out, reflecting back on my life and thinking about the event, and not &amp;#8216;I wish I tried that&amp;#8217;.&lt;/p&gt;
  364. &lt;p style="text-align:center;"&gt;&lt;img src="/assets/posts/1_rainbow/Atari2600.jpg" alt="" /&gt;&lt;/p&gt;
  365. &lt;p&gt;You don&amp;#8217;t need rhythm, dancing ability, or even confidence. That just seems to come. Just by stepping out your comfort zone and trying something new. It might not happen even while you&amp;#8217;re there, you might not even notice, but you&amp;#8217;ll have changed. Pick a festival that isn&amp;#8217;t the run of the mill, that isn&amp;#8217;t &amp;#8216;where you go after schoolies&amp;#8217;. Try them all.&lt;/p&gt;
  366. &lt;p&gt;If you manage to get to Burning Man, please, please keep an eye out for the giant hippies with dreadlocks that don&amp;#8217;t have peace and happiness in their eyes, more &amp;#8220;I&amp;#8217;m going to break your neck and turn you into a fart bucket&amp;#8221; stare. I&amp;#8217;m guessing a certain pair of Google founders may be nearby.&lt;/p&gt;
  367. &lt;p&gt;The closest you&amp;#8217;ll get to Burning Man in Australia would be &lt;a href="http://rainbowserpent.net/"&gt;Rainbow Serpent&lt;/a&gt;. With subtle twists, that make it truly Australian such as a blessing ceremony by the same beautiful indigenous lady that has done it every year! By far, one of the most absurd and enjoyable experiences of my life. Learn a few things about sustainable living, accidentally eat a meal from a different nationality every day, gyrate nervously to the music until that sudden epiphany: no-one cares, no-one sees me as fool, no-one is watching you to see you fail, &lt;em&gt;everyone&lt;/em&gt; wanting to see a smile and reckless abandon from letting go in some unbelievable surrounds.&lt;/p&gt;
  368. &lt;p&gt;Decide how you want to look back on your life when you&amp;#8217;re on your death bed. Push those boundaries. Try something new. Look me up if you&amp;#8217;re coming. I&amp;#8217;ll be at the front, leaving my work and stress and inhibitions at the gate.&lt;/p&gt;
  369. &lt;p style="text-align:center;"&gt;&lt;a href="http://www.flickr.com/photos/bigdoofa/4509225713/" title="RSF2010-25155222 by Big Doofa, on Flickr"&gt;&lt;img src="http://farm5.static.flickr.com/4066/4509225713_3162871eb1.jpg" width="342" height="500" alt="RSF2010-25155222" /&gt;&lt;/a&gt;&lt;/p&gt;</content>
  370.  </entry>
  371. </feed>
  372.  

If you would like to create a banner that links to this page (i.e. this validation result), do the following:

  1. Download the "valid Atom 1.0" banner.

  2. Upload the image to your own server. (This step is important. Please do not link directly to the image on this server.)

  3. Add this HTML to your page (change the image src attribute if necessary):

If you would like to create a text link instead, here is the URL you can use:

http://www.feedvalidator.org/check.cgi?url=http%3A//venombytes.com/blog/posts.atom

Copyright © 2002-9 Sam Ruby, Mark Pilgrim, Joseph Walton, and Phil Ringnalda