Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Site updated at 2012-03-02 22:54:44 UTC

  • Loading branch information...
commit 42bbab5caafb45b47884c052a9db333f087cbbdb 1 parent 739f3a3
John Firebaugh authored
Showing with 8,500 additions and 1 deletion.
  1. BIN  assets/jwplayer/glow/controlbar/background.png
  2. BIN  assets/jwplayer/glow/controlbar/blankButton.png
  3. BIN  assets/jwplayer/glow/controlbar/divider.png
  4. BIN  assets/jwplayer/glow/controlbar/fullscreenButton.png
  5. BIN  assets/jwplayer/glow/controlbar/fullscreenButtonOver.png
  6. BIN  assets/jwplayer/glow/controlbar/muteButton.png
  7. BIN  assets/jwplayer/glow/controlbar/muteButtonOver.png
  8. BIN  assets/jwplayer/glow/controlbar/normalscreenButton.png
  9. BIN  assets/jwplayer/glow/controlbar/normalscreenButtonOver.png
  10. BIN  assets/jwplayer/glow/controlbar/pauseButton.png
  11. BIN  assets/jwplayer/glow/controlbar/pauseButtonOver.png
  12. BIN  assets/jwplayer/glow/controlbar/playButton.png
  13. BIN  assets/jwplayer/glow/controlbar/playButtonOver.png
  14. BIN  assets/jwplayer/glow/controlbar/timeSliderBuffer.png
  15. BIN  assets/jwplayer/glow/controlbar/timeSliderCapLeft.png
  16. BIN  assets/jwplayer/glow/controlbar/timeSliderCapRight.png
  17. BIN  assets/jwplayer/glow/controlbar/timeSliderProgress.png
  18. BIN  assets/jwplayer/glow/controlbar/timeSliderRail.png
  19. BIN  assets/jwplayer/glow/controlbar/unmuteButton.png
  20. BIN  assets/jwplayer/glow/controlbar/unmuteButtonOver.png
  21. BIN  assets/jwplayer/glow/display/background.png
  22. BIN  assets/jwplayer/glow/display/bufferIcon.png
  23. BIN  assets/jwplayer/glow/display/muteIcon.png
  24. BIN  assets/jwplayer/glow/display/playIcon.png
  25. BIN  assets/jwplayer/glow/dock/button.png
  26. +115 −0 assets/jwplayer/glow/glow.xml
  27. BIN  assets/jwplayer/glow/playlist/item.png
  28. BIN  assets/jwplayer/glow/playlist/itemOver.png
  29. BIN  assets/jwplayer/glow/playlist/sliderCapBottom.png
  30. BIN  assets/jwplayer/glow/playlist/sliderCapTop.png
  31. BIN  assets/jwplayer/glow/playlist/sliderRail.png
  32. BIN  assets/jwplayer/glow/playlist/sliderThumb.png
  33. BIN  assets/jwplayer/glow/sharing/embedIcon.png
  34. BIN  assets/jwplayer/glow/sharing/embedScreen.png
  35. BIN  assets/jwplayer/glow/sharing/shareIcon.png
  36. BIN  assets/jwplayer/glow/sharing/shareScreen.png
  37. BIN  assets/jwplayer/player.swf
  38. +344 −0 atom.xml
  39. +321 −0 blog/2010/12/22/selenium-on-ruby/index.html
  40. +462 −0 blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/index.html
  41. +298 −0 blog/2011/04/03/kernel-density-estimation-with-protovis/index.html
  42. +296 −0 blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/index.html
  43. +289 −0 blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/index.html
  44. +288 −0 blog/archives/index.html
  45. +43 −0 blog/categories/d3-js/atom.xml
  46. +225 −0 blog/categories/d3-js/index.html
  47. +38 −0 blog/categories/homebrew/atom.xml
  48. +225 −0 blog/categories/homebrew/index.html
  49. +45 −0 blog/categories/protovis/atom.xml
  50. +225 −0 blog/categories/protovis/index.html
  51. +263 −0 blog/categories/ruby/atom.xml
  52. +242 −0 blog/categories/ruby/index.html
  53. +43 −0 blog/categories/sfpark/atom.xml
  54. +225 −0 blog/categories/sfpark/index.html
  55. +72 −0 blog/categories/statistics/atom.xml
  56. +239 −0 blog/categories/statistics/index.html
  57. +71 −0 blog/categories/tools/atom.xml
  58. +225 −0 blog/categories/tools/index.html
  59. +72 −0 blog/categories/visualization/atom.xml
  60. +239 −0 blog/categories/visualization/index.html
  61. +38 −0 blog/categories/xcode/atom.xml
  62. +225 −0 blog/categories/xcode/index.html
  63. BIN  favicon.png
  64. BIN  images/bird_32_gray.png
  65. BIN  images/bird_32_gray_fail.png
  66. BIN  images/code_bg.png
  67. BIN  images/dotted-border.png
  68. BIN  images/email.png
  69. BIN  images/line-tile.png
  70. BIN  images/noise.png
  71. BIN  images/rss.png
  72. BIN  images/search.png
  73. +663 −1 index.html
  74. +45 −0 javascripts/ender.js
  75. +37 −0 javascripts/github.js
  76. +1,497 −0 javascripts/libs/ender.js
  77. +85 −0 javascripts/libs/jXHR.js
  78. +298 −0 javascripts/libs/swfobject-dynamic.js
  79. +5 −0 javascripts/modernizr-2.0.js
  80. +161 −0 javascripts/octopress.js
  81. +56 −0 javascripts/pinboard.js
  82. +78 −0 javascripts/twitter.js
  83. BIN  sfpark/SFpark.png
  84. +126 −0 sfpark/rates.html
  85. +241 −0 sfpark/rates.js
  86. +39 −0 sitemap.xml
  87. +1 −0  stylesheets/screen.css
BIN  assets/jwplayer/glow/controlbar/background.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/blankButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/divider.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/fullscreenButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/fullscreenButtonOver.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/muteButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/muteButtonOver.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/normalscreenButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/normalscreenButtonOver.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/pauseButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/pauseButtonOver.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/playButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/playButtonOver.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/timeSliderBuffer.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/timeSliderCapLeft.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/timeSliderCapRight.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/timeSliderProgress.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/timeSliderRail.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/unmuteButton.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/controlbar/unmuteButtonOver.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/display/background.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/display/bufferIcon.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/display/muteIcon.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/display/playIcon.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  assets/jwplayer/glow/dock/button.png
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
115 assets/jwplayer/glow/glow.xml
View
@@ -0,0 +1,115 @@
+<?xml version="1.0"?>
+<skin version="1.1" name="Glow" author="LongTail Video">
+
+ <settings>
+ <setting name="backcolor" value="0x000000" />
+ <setting name="frontcolor" value="0xeeeeee" />
+ <setting name="lightcolor" value="0xeeeeee" />
+ <setting name="screencolor" value="0x000000" />
+ </settings>
+
+ <components>
+ <component name="controlbar">
+ <settings>
+ <setting name="margin" value="0" />
+ <setting name="fontsize" value="11" />
+ <setting name="fontcolor" value="0xEEEEEE" />
+ <setting name="buttoncolor" value="0xEEEEEE" />
+ </settings>
+
+ <layout>
+ <group position="left">
+ <button name="play" />
+ <text name="elapsed" />
+ </group>
+ <group position="center">
+ <slider name="time" />
+ </group>
+ <group position="right">
+ <text name="duration" />
+ <button name="blank" />
+ <button name="mute" />
+ <button name="fullscreen" />
+ </group>
+ </layout>
+
+ <elements>
+ <element name="background" src="background.png" />
+ <element name="capLeft" src="divider.png" />
+ <element name="capRight" src="divider.png" />
+ <element name="divider" src="divider.png" />
+ <element name="blankButton" src="blankButton.png" />
+ <element name="fullscreenButton" src="fullscreenButton.png" />
+ <element name="fullscreenButtonOver" src="fullscreenButtonOver.png" />
+ <element name="muteButton" src="muteButton.png" />
+ <element name="muteButtonOver" src="muteButtonOver.png" />
+ <element name="pauseButton" src="pauseButton.png" />
+ <element name="pauseButtonOver" src="pauseButtonOver.png" />
+ <element name="playButton" src="playButton.png" />
+ <element name="playButtonOver" src="playButtonOver.png" />
+ <element name="timeSliderBuffer" src="timeSliderBuffer.png" />
+ <element name="timeSliderCapLeft" src="timeSliderCapLeft.png" />
+ <element name="timeSliderCapRight" src="timeSliderCapRight.png" />
+ <element name="timeSliderProgress" src="timeSliderProgress.png" />
+ <element name="timeSliderRail" src="timeSliderRail.png" />
+ <element name="normalscreenButton" src="normalscreenButton.png" />
+ <element name="normalscreenButtonOver" src="normalscreenButtonOver.png" />
+ <element name="unmuteButton" src="unmuteButton.png" />
+ <element name="unmuteButtonOver" src="unmuteButtonOver.png" />
+ <element name="volumeSliderRail" src="divider.png" />
+ <element name="volumeSliderProgress" src="divider.png" />
+ </elements>
+ </component>
+
+ <component name="display">
+ <settings>
+ <setting name="bufferinterval" value="250" />
+ <setting name="bufferrotation" value="90" />
+ </settings>
+ <elements>
+ <element name="background" src="background.png" />
+ <element name="playIcon" src="playIcon.png" />
+ <element name="muteIcon" src="muteIcon.png" />
+ <element name="errorIcon" src="bufferIcon.png" />
+ <element name="bufferIcon" src="bufferIcon.png" />
+ </elements>
+ </component>
+
+ <component name="dock">
+ <settings>
+ <setting name="fontcolor" value="0xFFFFFF" />
+ </settings>
+ <elements>
+ <element name="button" src="button.png" />
+ </elements>
+ </component>
+
+ <component name="playlist">
+ <settings>
+ <setting name="fontcolor" value="0xEEEEEE" />
+ <setting name="overcolor" value="0xFFFFFF" />
+ <setting name="activecolor" value="0xFFFFFF" />
+ <setting name="backgroundcolor" value="0x333333" />
+ </settings>
+ <elements>
+ <element name="item" src="item.png" />
+ <element name="itemOver" src="itemOver.png" />
+ <element name="sliderCapBottom" src="sliderCapBottom.png" />
+ <element name="sliderCapTop" src="sliderCapTop.png" />
+ <element name="sliderRail" src="sliderRail.png" />
+ <element name="sliderThumb" src="sliderThumb.png" />
+ </elements>
+ </component>
+
+ <component name="sharing">
+ <elements>
+ <element name="embedIcon" src="embedIcon.png" />
+ <element name="embedScreen" src="embedScreen.png" />
+ <element name="shareIcon" src="shareIcon.png" />
+ <element name="shareScreen" src="shareScreen.png" />
+ </elements>
+ </component>
+
+ </components>
+
+</skin>
BIN  assets/jwplayer/glow/playlist/item.png
View
Diff not rendered
BIN  assets/jwplayer/glow/playlist/itemOver.png
View
Diff not rendered
BIN  assets/jwplayer/glow/playlist/sliderCapBottom.png
View
Diff not rendered
BIN  assets/jwplayer/glow/playlist/sliderCapTop.png
View
Diff not rendered
BIN  assets/jwplayer/glow/playlist/sliderRail.png
View
Diff not rendered
BIN  assets/jwplayer/glow/playlist/sliderThumb.png
View
Diff not rendered
BIN  assets/jwplayer/glow/sharing/embedIcon.png
View
Diff not rendered
BIN  assets/jwplayer/glow/sharing/embedScreen.png
View
Diff not rendered
BIN  assets/jwplayer/glow/sharing/shareIcon.png
View
Diff not rendered
BIN  assets/jwplayer/glow/sharing/shareScreen.png
View
Diff not rendered
BIN  assets/jwplayer/player.swf
View
Binary file not shown
344 atom.xml
View
@@ -0,0 +1,344 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title><![CDATA[John Firebaugh]]></title>
+ <link href="http://jfirebaugh.github.com/atom.xml" rel="self"/>
+ <link href="http://jfirebaugh.github.com/"/>
+ <updated>2012-03-02T14:54:39-08:00</updated>
+ <id>http://jfirebaugh.github.com/</id>
+ <author>
+ <name><![CDATA[John Firebaugh]]></name>
+
+ </author>
+ <generator uri="http://octopress.org/">Octopress</generator>
+
+
+ <entry>
+ <title type="html"><![CDATA[Xcode 4.3, homebrew, and autoconf]]></title>
+ <link href="http://jfirebaugh.github.com/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/"/>
+ <updated>2012-02-18T00:00:00-08:00</updated>
+ <id>http://jfirebaugh.github.com/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf</id>
+ <content type="html"><![CDATA[<p>Xcode 4.3 no longer includes autotools. If you have installed Xcode 4.3 and
+uninstalled the previous versions, you will no longer have <code>/usr/bin/autoconf</code>.
+This isn&#8217;t usually a problem for installing homebrew formulae, since the
+downloaded packages should come with <code>configure</code> pregenerated, but if you want
+to use <code>brew install --HEAD</code> or are building a package from a source
+repository, you may need it. Here&#8217;s how to get it:</p>
+
+<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
+<span class='line-number'>2</span>
+</pre></td><td class='code'><pre><code class=''><span class='line'>brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/autoconf.rb
+</span><span class='line'>brew link autoconf</span></code></pre></td></tr></table></div></figure>
+
+
+<p>At some point in the near future, homebrew will probably add an autoconf formula.
+At that point, you&#8217;ll be able to <code>brew install autoconf</code> directly.</p>
+]]></content>
+ </entry>
+
+ <entry>
+ <title type="html"><![CDATA[Visualizing SFpark Demand-Responsive Meter Rate Adjustments]]></title>
+ <link href="http://jfirebaugh.github.com/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/"/>
+ <updated>2011-09-03T00:00:00-07:00</updated>
+ <id>http://jfirebaugh.github.com/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments</id>
+ <content type="html"><![CDATA[<p>On July 11th 2011, <a href="http://sfpark.org/">SF<em>park</em></a> announced the
+first set of <a href="http://sfpark.org/how-it-works/pricing/">meter rate adjustments</a>.
+Meter operational hours were divided into six distinct rate periods, and the hourly
+price of metered parking in the project&#8217;s seven pilot areas was adjusted on a
+block-to-block basis in response to parking demand during each period:</p>
+
+<ul>
+<li>+25¢ in periods of 80% or more occupancy</li>
+<li>No change in periods of 60-80% occupancy</li>
+<li>−25¢ in periods of 30-60% occupancy</li>
+<li>−50¢ in periods of less than 40% occupancy</li>
+</ul>
+
+
+<p>I created this visualization using the <a href="http://mbostock.github.com/d3/">d3.js</a>
+framework and data provided by SF<em>park</em>. Click for full size.</p>
+
+<p><a href="http://jfirebaugh.github.com/sfpark/rates.html"><img src="http://jfirebaugh.github.com/sfpark/SFpark.png" alt="SFpark meter
+rate adjustment visualization" /></a></p>
+]]></content>
+ </entry>
+
+ <entry>
+ <title type="html"><![CDATA[Kernel Density Estimation with Protovis]]></title>
+ <link href="http://jfirebaugh.github.com/blog/2011/04/03/kernel-density-estimation-with-protovis/"/>
+ <updated>2011-04-03T00:00:00-07:00</updated>
+ <id>http://jfirebaugh.github.com/blog/2011/04/03/kernel-density-estimation-with-protovis</id>
+ <content type="html"><![CDATA[<p><a href="http://bl.ocks.org/900762"><img src="http://dl.dropbox.com/u/7078234/KDE.png" alt="" /></a></p>
+
+<p>A <a href="http://en.wikipedia.org/wiki/Kernel_density_estimation">kernel density estimate</a> provides a
+means of estimating and visualizing the probability distribution function of a
+random variable based on a random sample. In contrast to a histogram, a kernel
+density estimate provides a smooth estimate, via the effect of a smoothing
+parameter called the <em>bandwidth</em>, here denoted by <em>h</em>. With the correct choice
+of bandwidth, important features of the distribution can be seen; an incorrect
+choice will result in undersmoothing or oversmoothing and obscure those
+features.</p>
+
+<p>Here we see a histogram and three kernel density estimates for a sample of
+waiting times in minutes between eruptions of
+<a href="http://en.wikipedia.org/wiki/Old_Faithful">Old Faithful Geyser</a> in Yellowstone National
+Park, taken from R&#8217;s
+<a href="http://stat.ethz.ch/R-manual/R-patched/library/datasets/html/faithful.html"><code>faithful</code></a>
+dataset. The data follow a <a href="http://en.wikipedia%0A.org/wiki/Bimodal_distribution">bimodal distribution</a>; short
+eruptions are followed by a wait time averaging about 55 minutes, and long
+eruptions by a wait time averaging about 80 minutes. In recent years, wait
+times have been increasing, possibly due to the effects of earthquakes on the
+geyser&#8217;s geohydrology.</p>
+]]></content>
+ </entry>
+
+ <entry>
+ <title type="html"><![CDATA[Making sense of constant lookup in Ruby]]></title>
+ <link href="http://jfirebaugh.github.com/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/"/>
+ <updated>2011-01-21T00:00:00-08:00</updated>
+ <id>http://jfirebaugh.github.com/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby</id>
+ <content type="html"><![CDATA[<p>In Ruby 1.8, constant lookup is mostly <a
+href="http://en.wikipedia.org/wiki/Scope_(programming)#Lexical_versus_dynamic_scoping">lexically scoped</a>,
+even when using <tt>class_eval</tt> or <tt>instance_eval</tt>.
+That is, constant lookup always searches the chain of <em>lexically
+enclosing</em> classes or modules. The first lexically enclosing class or
+module is not necessarily the same as <tt>self.class</tt>:</p>
+
+<div><script src='https://gist.github.com/790454.js?file=constants.rb'></script>
+<noscript><pre><code>puts &quot;#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}&quot;
+
+X = '::X'
+
+class Foo
+ X = 'Foo::X'
+
+ def foo
+ puts &quot;instance method: #{X}&quot;
+ end
+end
+
+Foo.new.foo
+
+f = Foo.new
+def f.bar
+ puts &quot;singleton method: #{X}&quot;
+end
+f.bar
+
+Foo.class_eval do
+ puts &quot;class_eval: #{X}&quot;
+end
+
+Foo.new.instance_eval do
+ puts &quot;instance_eval: #{X}&quot;
+end
+</code></pre></noscript></div>
+
+
+<p>Here&#8217;s the output on 1.8.7:</p>
+
+<div><script src='https://gist.github.com/790510.js?file='></script>
+<noscript><pre><code>1.8.7-p330
+instance method: Foo::X
+singleton method: ::X
+class_eval: ::X
+instance_eval: ::X</code></pre></noscript></div>
+
+
+<p>Here we can see that within the lexical block defining <tt>Foo#foo</tt>, which
+is enclosed by <tt>class Foo</tt>, <tt>X</tt> refers to <tt>Foo::X</tt>, while
+in the lexical blocks used for the singleton method, <tt>class_eval</tt>, and
+<tt>instance_eval</tt>, which are not in <tt>class Foo</tt>&#8217;s scope,
+<tt>X</tt> refers to <tt>::X</tt>, the global constant.</p>
+
+<p>However, in 1.9, the situation changes, and moreover, the behavior is
+different between 1.9.1 and 1.9.2. Here&#8217;s the result of running <tt><a
+href="http://rvm.beginrescueend.com/set/ruby/">rvm 1.9.1,1.9.2
+constants.rb</a></tt>:</p>
+
+<div><script src='https://gist.github.com/790511.js?file='></script>
+<noscript><pre><code>1.9.1-p378
+instance method: Foo::X
+singleton method: ::X
+class_eval: Foo::X
+instance_eval: Foo::X
+1.9.2-p136
+instance method: Foo::X
+singleton method: Foo::X
+class_eval: ::X
+instance_eval: Foo::X</code></pre></noscript></div>
+
+
+<p>So, in 1.9.1, constant lookup in <tt>class_eval</tt> and
+<tt>instance_eval</tt> proceeds from the receiver, rather than the lexically
+enclosing scope. Particularly for <tt>class_eval</tt>, this turned out to be a
+<a href="http://www.ruby-forum.com/topic/191672">problematic</a> <a
+href="http://www.ruby-forum.com/topic/199317">change</a>, breaking existing
+libraries that depended on the 1.8.7 behavior and making it hard to build DSLs
+that behaved in predictable ways. Eventually, it was decided to <a
+href="http://www.ruby-forum.com/topic/199317#871425">revert to the 1.8
+behavior</a>, and this was supposedly implemented:</p>
+
+<blockquote><pre>
+&gt; [Matz] would like to revert all of instance_eval, instance_exec,
+&gt; class_eval, and class_exec to the behavior of 1.8 (including class
+&gt; variables). [...]
+
+I have just commited it to the SVN trunk.
+</pre></blockquote>
+
+
+<p>I say &#8220;supposedly&#8221; only because as you can see, the 1.9.2 behavior still
+differs from 1.8.7 in the case of <tt>instance_eval</tt>. Was this an
+oversight, or was the revert later unreverted for&nbsp;<span
+style="font-family: monospace;">instance_eval</span>? If so, what was the
+rationale? I searched the mailing list and subsequent commits, but couldn&#8217;t
+find an explanation. If anyone can shed light on the matter, I would
+appreciate it.</p>
+
+<p>As you can see, 1.9.2 also changed the behavior for singleton methods: the
+receiver&#8217;s scope is now searched before the lexically enclosing scope. This
+change makes sense to me, and I haven&#8217;t heard of it causing any problems.</p>
+
+<p>Note that these rules apply to constant <em>definition</em>&nbsp;as well as
+lookup. In 1.8 and 1.9.2, a constant defined in a class_evaluated block will
+be defined in the enclosing lexical scope, rather than the scope of the
+receiver. This is one of the things that makes <tt>Foo = Class.new { &#8230;
+}</tt> not <em>quite</em> the same as <tt>class Foo; &#8230;; end</tt>:</p>
+
+<div><script src='https://gist.github.com/790492.js?file='></script>
+<noscript><pre><code>puts &quot;#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}&quot;
+
+class Foo
+ class Bar
+ end
+end
+
+Baz = Class.new do
+ class Quux
+ end
+end
+
+puts Foo::Bar
+puts Quux
+</code></pre></noscript></div>
+
+
+<p>The block passed to <tt>Class.new</tt> is effectively
+<tt>class_eval</tt>uated, so in this example, the constant <tt>Quux</tt> ends
+up defined at the top level. (And once again 1.9.1 is the exception: it
+defines <tt>Baz::Quux</tt> instead.) This behavior can cause problems if you
+are in the habit of defining test classes in RSpec <tt>describe</tt> blocks:</p>
+
+<div><script src='https://gist.github.com/790496.js?file='></script>
+<noscript><pre><code>require 'rspec'
+
+describe &quot;a TestClass&quot; do
+ class TestClass &lt; String
+ end
+end
+
+describe &quot;other TestClass&quot; do
+ class TestClass &lt; Integer
+ end
+end
+</code></pre></noscript></div>
+
+
+<p>Here <tt>TestClass</tt> winds up in the global scope, not the scope of the
+RSpec example group that <tt>describe</tt> creates. If you have multiple specs
+that define test classes with the same name, you may get collisions unless you
+place each <tt>describe</tt> within a uniquely-named module or diligently
+remove the constants in an <tt>after</tt> block. In the above example, you&#8217;ll
+get the error &#8220;superclass mismatch for class TestClass&#8221;.</p>
+
+<p>If you need to ensure a particular scoping is used (for example, if you need
+to support 1.9.1 as well as 1.8.7/1.9.2), you can always be explicit about it
+by prefixing constants with <tt>::</tt> (for global lookup), <tt>self::</tt>
+(for receiver scope), or the fully qualified desired scope:</p>
+
+<div><script src='https://gist.github.com/790500.js?file='></script>
+<noscript><pre><code>require 'rspec'
+
+describe &quot;a TestClass&quot; do
+ class self::TestClass &lt; String
+ end
+end
+
+describe &quot;other TestClass&quot; do
+ class ::TestClass &lt; Integer
+ end
+end
+
+module A
+ module B
+ end
+end
+
+describe &quot;third TestClass&quot; do
+ class A::B::TestClass &lt; Integer
+ end
+end
+</code></pre></noscript></div>
+
+
+
+]]></content>
+ </entry>
+
+ <entry>
+ <title type="html"><![CDATA[Selenium on Ruby]]></title>
+ <link href="http://jfirebaugh.github.com/blog/2010/12/22/selenium-on-ruby/"/>
+ <updated>2010-12-22T00:00:00-08:00</updated>
+ <id>http://jfirebaugh.github.com/blog/2010/12/22/selenium-on-ruby</id>
+ <content type="html"><![CDATA[<p>The state of Selenium on Ruby is a bit confusing. Among the top google results for
+<a href="http://www.google.com/search?q=selenium+ruby">&#8220;selenium ruby&#8221;</a> are several links that are badly out of date, and it&#8217;s
+not clear which of the many <a href="http://rubygems.org/search?utf8=%E2%9C%93&amp;amp;query=selenium">gems</a> are ones you would want
+to use. This post aims to clear up some of the confusion.</p>
+
+<p>First of all, you should be aware that there are two Selenium APIs: the original 1.0 API, called Selenium-RC, and a
+newer 2.0 API called Selenium WebDriver. Internally, the two have quite different architectures. In a nutshell,
+Selenium-RC is based around a Java &#8220;Remote Control&#8221; server process that launches the browser under test and manages
+communication between the client process (the Ruby interpreter, in our case) and the browser. The browser is controlled
+by injecting the &#8220;Selenium Core&#8221; JavaScript framework into the Browser&#8217;s built-in JavaScript interpreter. In contrast,
+WebDriver requires no external process; the browser is launched directly, and controlled via means that vary from
+browser to browser. For example, WebDriver controls Firefox via a custom Firefox extension.</p>
+
+<p>Ruby has good support for both RC and WebDriver. The <a href="http://rubygems.org/gems/selenium-client">selenium-client</a> gem
+(<a href="http://selenium-client.rubyforge.org/">docs</a>, <a href="https://github.com/ph7/selenium-client">source</a>) provides bindings for
+the RC API, and the <a href="http://rubygems.org/gems/selenium-webdriver">selenium-webdriver</a> gem
+(<a href="http://code.google.com/p/selenium/wiki/RubyBindings">wiki</a>,
+<a href="http://selenium.googlecode.com/svn/trunk/docs/api/rb/index.html">docs</a>,
+<a href="http://code.google.com/p/selenium/source/browse/#svn%2Ftrunk%2Frb">source</a>) provides bindings for the WebDriver API.
+You will likely want to use one of these two gems, but which one? If you are using Selenium via a higher-level Ruby
+library such as Webrat or Capybara, the choice will be made for you: Webrat uses selenium-client, Capybara uses
+selenium-webdriver. If you want to access a Selenium API directly, I would generally recommend selenium-webdriver.
+The WebDriver API provides several advantages, including multi-browser testing, page navigation, drag-and-drop, and
+multi-frame and multi-window support. It recently released its
+<a href="http://groups.google.com/group/selenium-users/browse_thread/thread/28ce2b37123a4e4d">first beta</a> and is where the
+future of Selenium and Selenium on Ruby lies. It is, however, still beta software and sometimes changes its API in
+aggravating ways. If stability is of paramount concern, stick with selenium-client.</p>
+
+<p>You may find references to some other Selenium-related Ruby projects. The <a href="http://rubygems.org/gems/Selenium">Selenium</a>
+gem (with a capital &#8220;S&#8221;) and its associated website <a href="http://selenium.rubyforge.org/">selenium.rubyforge.org</a> paved the
+way for Selenium on Ruby, but today it is obsolete, as is the <a href="http://rubygems.org/gems/selenium-rails">selenium-rails</a>
+gem which depends on it. Unfortunately they are still prominently featured in search results and on the
+<a href="http://seleniumhq.org/projects/ruby/">outdated &#8220;Selenium on Ruby&#8221; page</a>, which doesn&#8217;t even mention selenium-webdriver.</p>
+
+<p>The Selenium RC API relies on an external Java-based server process, and though the selenium-client gem provides rake
+tasks to start and stop an RC server, it does not provide the actual jar file necessary to run the service. You can
+either download and install it yourself, or install the <a href="http://rubygems.org/gems/selenium-rc">selenium-rc</a> gem, which
+bundles it. You&#8217;ll sometimes see a gem that depends on selenium-client also depending on selenium-rc solely for the jar,
+as the <a href="https://github.com/pivotal/jasmine-gem">jasmine</a> gem does. The selenium-rc gem has some Ruby code in it too, but
+it more or less duplicates functionality that&#8217;s already part of selenium-client.</p>
+
+<p>Finally there&#8217;s the <a href="http://rubygems.org/gems/selenium">selenium</a> and
+<a href="http://rubygems.org/gems/selenium_remote_control">selenium_remote_control</a> gems, which provide functionality similar
+to selenium-client and selenium-rc. They don&#8217;t seem widely used and at first glance I don&#8217;t see any reason to prefer
+them to the more popular gems. Recent releases of the selenium-webdriver gem include the selenium-client code as well,
+and personally, I hope that selenium-webdriver can usurp the &#8220;selenium&#8221; gem name and become the One True Selenium gem
+for Ruby.</p>
+]]></content>
+ </entry>
+
+</feed>
321 blog/2010/12/22/selenium-on-ruby/index.html
View
@@ -0,0 +1,321 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Selenium on Ruby - John Firebaugh</title>
+ <meta name="author" content="John Firebaugh">
+
+
+ <meta name="description" content="The state of Selenium on Ruby is a bit confusing. Among the top google results for
+&#8220;selenium ruby&#8221; are several links that are badly out &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://jfirebaugh.github.com/blog/2010/12/22/selenium-on-ruby">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="John Firebaugh" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-29668835-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">John Firebaugh</a></h1>
+
+ <h2>Open Source, Ruby, Rubinius, RubySpec, Rails.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:jfirebaugh.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Selenium on Ruby</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2010-12-22T00:00:00-08:00" pubdate data-updated="true">Dec 22<span>nd</span>, 2010</time>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>The state of Selenium on Ruby is a bit confusing. Among the top google results for
+<a href="http://www.google.com/search?q=selenium+ruby">&#8220;selenium ruby&#8221;</a> are several links that are badly out of date, and it&#8217;s
+not clear which of the many <a href="http://rubygems.org/search?utf8=%E2%9C%93&amp;amp;query=selenium">gems</a> are ones you would want
+to use. This post aims to clear up some of the confusion.</p>
+
+<p>First of all, you should be aware that there are two Selenium APIs: the original 1.0 API, called Selenium-RC, and a
+newer 2.0 API called Selenium WebDriver. Internally, the two have quite different architectures. In a nutshell,
+Selenium-RC is based around a Java &#8220;Remote Control&#8221; server process that launches the browser under test and manages
+communication between the client process (the Ruby interpreter, in our case) and the browser. The browser is controlled
+by injecting the &#8220;Selenium Core&#8221; JavaScript framework into the Browser&#8217;s built-in JavaScript interpreter. In contrast,
+WebDriver requires no external process; the browser is launched directly, and controlled via means that vary from
+browser to browser. For example, WebDriver controls Firefox via a custom Firefox extension.</p>
+
+<p>Ruby has good support for both RC and WebDriver. The <a href="http://rubygems.org/gems/selenium-client">selenium-client</a> gem
+(<a href="http://selenium-client.rubyforge.org/">docs</a>, <a href="https://github.com/ph7/selenium-client">source</a>) provides bindings for
+the RC API, and the <a href="http://rubygems.org/gems/selenium-webdriver">selenium-webdriver</a> gem
+(<a href="http://code.google.com/p/selenium/wiki/RubyBindings">wiki</a>,
+<a href="http://selenium.googlecode.com/svn/trunk/docs/api/rb/index.html">docs</a>,
+<a href="http://code.google.com/p/selenium/source/browse/#svn%2Ftrunk%2Frb">source</a>) provides bindings for the WebDriver API.
+You will likely want to use one of these two gems, but which one? If you are using Selenium via a higher-level Ruby
+library such as Webrat or Capybara, the choice will be made for you: Webrat uses selenium-client, Capybara uses
+selenium-webdriver. If you want to access a Selenium API directly, I would generally recommend selenium-webdriver.
+The WebDriver API provides several advantages, including multi-browser testing, page navigation, drag-and-drop, and
+multi-frame and multi-window support. It recently released its
+<a href="http://groups.google.com/group/selenium-users/browse_thread/thread/28ce2b37123a4e4d">first beta</a> and is where the
+future of Selenium and Selenium on Ruby lies. It is, however, still beta software and sometimes changes its API in
+aggravating ways. If stability is of paramount concern, stick with selenium-client.</p>
+
+<p>You may find references to some other Selenium-related Ruby projects. The <a href="http://rubygems.org/gems/Selenium">Selenium</a>
+gem (with a capital &#8220;S&#8221;) and its associated website <a href="http://selenium.rubyforge.org/">selenium.rubyforge.org</a> paved the
+way for Selenium on Ruby, but today it is obsolete, as is the <a href="http://rubygems.org/gems/selenium-rails">selenium-rails</a>
+gem which depends on it. Unfortunately they are still prominently featured in search results and on the
+<a href="http://seleniumhq.org/projects/ruby/">outdated &#8220;Selenium on Ruby&#8221; page</a>, which doesn&#8217;t even mention selenium-webdriver.</p>
+
+<p>The Selenium RC API relies on an external Java-based server process, and though the selenium-client gem provides rake
+tasks to start and stop an RC server, it does not provide the actual jar file necessary to run the service. You can
+either download and install it yourself, or install the <a href="http://rubygems.org/gems/selenium-rc">selenium-rc</a> gem, which
+bundles it. You&#8217;ll sometimes see a gem that depends on selenium-client also depending on selenium-rc solely for the jar,
+as the <a href="https://github.com/pivotal/jasmine-gem">jasmine</a> gem does. The selenium-rc gem has some Ruby code in it too, but
+it more or less duplicates functionality that&#8217;s already part of selenium-client.</p>
+
+<p>Finally there&#8217;s the <a href="http://rubygems.org/gems/selenium">selenium</a> and
+<a href="http://rubygems.org/gems/selenium_remote_control">selenium_remote_control</a> gems, which provide functionality similar
+to selenium-client and selenium-rc. They don&#8217;t seem widely used and at first glance I don&#8217;t see any reason to prefer
+them to the more popular gems. Recent releases of the selenium-webdriver gem include the selenium-client code as well,
+and personally, I hope that selenium-webdriver can usurp the &#8220;selenium&#8221; gem name and become the One True Selenium gem
+for Ruby.</p>
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">John Firebaugh</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2010-12-22T00:00:00-08:00" pubdate data-updated="true">Dec 22<span>nd</span>, 2010</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/ruby/'>Ruby</a>, <a class='category' href='/blog/categories/tools/'>Tools</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jfirebaugh.github.com/blog/2010/12/22/selenium-on-ruby/" data-via="jfire" data-counturl="http://jfirebaugh.github.com/blog/2010/12/22/selenium-on-ruby/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+
+ <a class="basic-alignment right" href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/" title="Next Post: Making sense of constant lookup in Ruby">Making sense of constant lookup in Ruby &raquo;</a>
+
+ </p>
+ </footer>
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/">Xcode 4.3, homebrew, and autoconf</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/">Visualizing SFpark Demand-Responsive Meter Rate Adjustments</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/04/03/kernel-density-estimation-with-protovis/">Kernel Density Estimation with Protovis</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/">Making sense of constant lookup in Ruby</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2010/12/22/selenium-on-ruby/">Selenium on Ruby</a>
+ </li>
+
+ </ul>
+</section>
+
+<section>
+ <h1>GitHub Repos</h1>
+ <ul id="gh_repos">
+ <li class="loading">Status updating...</li>
+ </ul>
+
+ <a href="https://github.com/jfirebaugh">@jfirebaugh</a> on GitHub
+
+ <script type="text/javascript">
+ $.domReady(function(){
+ if (!window.jXHR){
+ var jxhr = document.createElement('script');
+ jxhr.type = 'text/javascript';
+ jxhr.src = '/javascripts/libs/jXHR.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(jxhr, s);
+ }
+
+ github.showRepos({
+ user: 'jfirebaugh',
+ count: 0,
+ skip_forks: true,
+ target: '#gh_repos'
+ });
+ });
+ </script>
+ <script src="/javascripts/github.js" type="text/javascript"> </script>
+</section>
+
+
+<section>
+ <h1>Latest Tweets</h1>
+ <ul id="tweets">
+ <li class="loading">Status updating...</li>
+ </ul>
+ <script type="text/javascript">
+ $.domReady(function(){
+ getTwitterFeed("jfire", 4, false);
+ });
+ </script>
+ <script src="/javascripts/twitter.js" type="text/javascript"> </script>
+
+ <a href="http://twitter.com/jfire" class="twitter-follow-button" data-show-count="false">Follow @jfire</a>
+
+</section>
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - John Firebaugh -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
462 blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/index.html
View
@@ -0,0 +1,462 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Making sense of constant lookup in Ruby - John Firebaugh</title>
+ <meta name="author" content="John Firebaugh">
+
+
+ <meta name="description" content="In Ruby 1.8, constant lookup is mostly <a
+href="http://en.wikipedia.org/wiki/Scope_(programming)#Lexical_versus_dynamic_scoping">lexically scoped, &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://jfirebaugh.github.com/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="John Firebaugh" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-29668835-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">John Firebaugh</a></h1>
+
+ <h2>Open Source, Ruby, Rubinius, RubySpec, Rails.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:jfirebaugh.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Making Sense of Constant Lookup in Ruby</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2011-01-21T00:00:00-08:00" pubdate data-updated="true">Jan 21<span>st</span>, 2011</time>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>In Ruby 1.8, constant lookup is mostly <a
+href="http://en.wikipedia.org/wiki/Scope_(programming)#Lexical_versus_dynamic_scoping">lexically scoped</a>,
+even when using <tt>class_eval</tt> or <tt>instance_eval</tt>.
+That is, constant lookup always searches the chain of <em>lexically
+enclosing</em> classes or modules. The first lexically enclosing class or
+module is not necessarily the same as <tt>self.class</tt>:</p>
+
+<div><script src='https://gist.github.com/790454.js?file=constants.rb'></script>
+<noscript><pre><code>puts &quot;#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}&quot;
+
+X = '::X'
+
+class Foo
+ X = 'Foo::X'
+
+ def foo
+ puts &quot;instance method: #{X}&quot;
+ end
+end
+
+Foo.new.foo
+
+f = Foo.new
+def f.bar
+ puts &quot;singleton method: #{X}&quot;
+end
+f.bar
+
+Foo.class_eval do
+ puts &quot;class_eval: #{X}&quot;
+end
+
+Foo.new.instance_eval do
+ puts &quot;instance_eval: #{X}&quot;
+end
+</code></pre></noscript></div>
+
+
+<p>Here&#8217;s the output on 1.8.7:</p>
+
+<div><script src='https://gist.github.com/790510.js?file='></script>
+<noscript><pre><code>1.8.7-p330
+instance method: Foo::X
+singleton method: ::X
+class_eval: ::X
+instance_eval: ::X</code></pre></noscript></div>
+
+
+<p>Here we can see that within the lexical block defining <tt>Foo#foo</tt>, which
+is enclosed by <tt>class Foo</tt>, <tt>X</tt> refers to <tt>Foo::X</tt>, while
+in the lexical blocks used for the singleton method, <tt>class_eval</tt>, and
+<tt>instance_eval</tt>, which are not in <tt>class Foo</tt>&#8217;s scope,
+<tt>X</tt> refers to <tt>::X</tt>, the global constant.</p>
+
+<p>However, in 1.9, the situation changes, and moreover, the behavior is
+different between 1.9.1 and 1.9.2. Here&#8217;s the result of running <tt><a
+href="http://rvm.beginrescueend.com/set/ruby/">rvm 1.9.1,1.9.2
+constants.rb</a></tt>:</p>
+
+<div><script src='https://gist.github.com/790511.js?file='></script>
+<noscript><pre><code>1.9.1-p378
+instance method: Foo::X
+singleton method: ::X
+class_eval: Foo::X
+instance_eval: Foo::X
+1.9.2-p136
+instance method: Foo::X
+singleton method: Foo::X
+class_eval: ::X
+instance_eval: Foo::X</code></pre></noscript></div>
+
+
+<p>So, in 1.9.1, constant lookup in <tt>class_eval</tt> and
+<tt>instance_eval</tt> proceeds from the receiver, rather than the lexically
+enclosing scope. Particularly for <tt>class_eval</tt>, this turned out to be a
+<a href="http://www.ruby-forum.com/topic/191672">problematic</a> <a
+href="http://www.ruby-forum.com/topic/199317">change</a>, breaking existing
+libraries that depended on the 1.8.7 behavior and making it hard to build DSLs
+that behaved in predictable ways. Eventually, it was decided to <a
+href="http://www.ruby-forum.com/topic/199317#871425">revert to the 1.8
+behavior</a>, and this was supposedly implemented:</p>
+
+<blockquote><pre>
+&gt; [Matz] would like to revert all of instance_eval, instance_exec,
+&gt; class_eval, and class_exec to the behavior of 1.8 (including class
+&gt; variables). [...]
+
+I have just commited it to the SVN trunk.
+</pre></blockquote>
+
+
+<p>I say &#8220;supposedly&#8221; only because as you can see, the 1.9.2 behavior still
+differs from 1.8.7 in the case of <tt>instance_eval</tt>. Was this an
+oversight, or was the revert later unreverted for&nbsp;<span
+style="font-family: monospace;">instance_eval</span>? If so, what was the
+rationale? I searched the mailing list and subsequent commits, but couldn&#8217;t
+find an explanation. If anyone can shed light on the matter, I would
+appreciate it.</p>
+
+<p>As you can see, 1.9.2 also changed the behavior for singleton methods: the
+receiver&#8217;s scope is now searched before the lexically enclosing scope. This
+change makes sense to me, and I haven&#8217;t heard of it causing any problems.</p>
+
+<p>Note that these rules apply to constant <em>definition</em>&nbsp;as well as
+lookup. In 1.8 and 1.9.2, a constant defined in a class_evaluated block will
+be defined in the enclosing lexical scope, rather than the scope of the
+receiver. This is one of the things that makes <tt>Foo = Class.new { &#8230;
+}</tt> not <em>quite</em> the same as <tt>class Foo; &#8230;; end</tt>:</p>
+
+<div><script src='https://gist.github.com/790492.js?file='></script>
+<noscript><pre><code>puts &quot;#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}&quot;
+
+class Foo
+ class Bar
+ end
+end
+
+Baz = Class.new do
+ class Quux
+ end
+end
+
+puts Foo::Bar
+puts Quux
+</code></pre></noscript></div>
+
+
+<p>The block passed to <tt>Class.new</tt> is effectively
+<tt>class_eval</tt>uated, so in this example, the constant <tt>Quux</tt> ends
+up defined at the top level. (And once again 1.9.1 is the exception: it
+defines <tt>Baz::Quux</tt> instead.) This behavior can cause problems if you
+are in the habit of defining test classes in RSpec <tt>describe</tt> blocks:</p>
+
+<div><script src='https://gist.github.com/790496.js?file='></script>
+<noscript><pre><code>require 'rspec'
+
+describe &quot;a TestClass&quot; do
+ class TestClass &lt; String
+ end
+end
+
+describe &quot;other TestClass&quot; do
+ class TestClass &lt; Integer
+ end
+end
+</code></pre></noscript></div>
+
+
+<p>Here <tt>TestClass</tt> winds up in the global scope, not the scope of the
+RSpec example group that <tt>describe</tt> creates. If you have multiple specs
+that define test classes with the same name, you may get collisions unless you
+place each <tt>describe</tt> within a uniquely-named module or diligently
+remove the constants in an <tt>after</tt> block. In the above example, you&#8217;ll
+get the error &#8220;superclass mismatch for class TestClass&#8221;.</p>
+
+<p>If you need to ensure a particular scoping is used (for example, if you need
+to support 1.9.1 as well as 1.8.7/1.9.2), you can always be explicit about it
+by prefixing constants with <tt>::</tt> (for global lookup), <tt>self::</tt>
+(for receiver scope), or the fully qualified desired scope:</p>
+
+<div><script src='https://gist.github.com/790500.js?file='></script>
+<noscript><pre><code>require 'rspec'
+
+describe &quot;a TestClass&quot; do
+ class self::TestClass &lt; String
+ end
+end
+
+describe &quot;other TestClass&quot; do
+ class ::TestClass &lt; Integer
+ end
+end
+
+module A
+ module B
+ end
+end
+
+describe &quot;third TestClass&quot; do
+ class A::B::TestClass &lt; Integer
+ end
+end
+</code></pre></noscript></div>
+
+
+
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">John Firebaugh</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2011-01-21T00:00:00-08:00" pubdate data-updated="true">Jan 21<span>st</span>, 2011</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/ruby/'>Ruby</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jfirebaugh.github.com/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/" data-via="jfire" data-counturl="http://jfirebaugh.github.com/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+ <a class="basic-alignment left" href="/blog/2010/12/22/selenium-on-ruby/" title="Previous Post: Selenium on Ruby">&laquo; Selenium on Ruby</a>
+
+
+ <a class="basic-alignment right" href="/blog/2011/04/03/kernel-density-estimation-with-protovis/" title="Next Post: Kernel Density Estimation with Protovis">Kernel Density Estimation with Protovis &raquo;</a>
+
+ </p>
+ </footer>
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/">Xcode 4.3, homebrew, and autoconf</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/">Visualizing SFpark Demand-Responsive Meter Rate Adjustments</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/04/03/kernel-density-estimation-with-protovis/">Kernel Density Estimation with Protovis</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/">Making sense of constant lookup in Ruby</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2010/12/22/selenium-on-ruby/">Selenium on Ruby</a>
+ </li>
+
+ </ul>
+</section>
+
+<section>
+ <h1>GitHub Repos</h1>
+ <ul id="gh_repos">
+ <li class="loading">Status updating...</li>
+ </ul>
+
+ <a href="https://github.com/jfirebaugh">@jfirebaugh</a> on GitHub
+
+ <script type="text/javascript">
+ $.domReady(function(){
+ if (!window.jXHR){
+ var jxhr = document.createElement('script');
+ jxhr.type = 'text/javascript';
+ jxhr.src = '/javascripts/libs/jXHR.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(jxhr, s);
+ }
+
+ github.showRepos({
+ user: 'jfirebaugh',
+ count: 0,
+ skip_forks: true,
+ target: '#gh_repos'
+ });
+ });
+ </script>
+ <script src="/javascripts/github.js" type="text/javascript"> </script>
+</section>
+
+
+<section>
+ <h1>Latest Tweets</h1>
+ <ul id="tweets">
+ <li class="loading">Status updating...</li>
+ </ul>
+ <script type="text/javascript">
+ $.domReady(function(){
+ getTwitterFeed("jfire", 4, false);
+ });
+ </script>
+ <script src="/javascripts/twitter.js" type="text/javascript"> </script>
+
+ <a href="http://twitter.com/jfire" class="twitter-follow-button" data-show-count="false">Follow @jfire</a>
+
+</section>
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - John Firebaugh -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
298 blog/2011/04/03/kernel-density-estimation-with-protovis/index.html
View
@@ -0,0 +1,298 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Kernel Density Estimation with Protovis - John Firebaugh</title>
+ <meta name="author" content="John Firebaugh">
+
+
+ <meta name="description" content="A kernel density estimate provides a
+means of estimating and visualizing the probability distribution function of a
+random variable based on a &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://jfirebaugh.github.com/blog/2011/04/03/kernel-density-estimation-with-protovis">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="John Firebaugh" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-29668835-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">John Firebaugh</a></h1>
+
+ <h2>Open Source, Ruby, Rubinius, RubySpec, Rails.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:jfirebaugh.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Kernel Density Estimation With Protovis</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2011-04-03T00:00:00-07:00" pubdate data-updated="true">Apr 3<span>rd</span>, 2011</time>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p><a href="http://bl.ocks.org/900762"><img src="http://dl.dropbox.com/u/7078234/KDE.png" alt="" /></a></p>
+
+<p>A <a href="http://en.wikipedia.org/wiki/Kernel_density_estimation">kernel density estimate</a> provides a
+means of estimating and visualizing the probability distribution function of a
+random variable based on a random sample. In contrast to a histogram, a kernel
+density estimate provides a smooth estimate, via the effect of a smoothing
+parameter called the <em>bandwidth</em>, here denoted by <em>h</em>. With the correct choice
+of bandwidth, important features of the distribution can be seen; an incorrect
+choice will result in undersmoothing or oversmoothing and obscure those
+features.</p>
+
+<p>Here we see a histogram and three kernel density estimates for a sample of
+waiting times in minutes between eruptions of
+<a href="http://en.wikipedia.org/wiki/Old_Faithful">Old Faithful Geyser</a> in Yellowstone National
+Park, taken from R&#8217;s
+<a href="http://stat.ethz.ch/R-manual/R-patched/library/datasets/html/faithful.html"><code>faithful</code></a>
+dataset. The data follow a <a href="http://en.wikipedia%0A.org/wiki/Bimodal_distribution">bimodal distribution</a>; short
+eruptions are followed by a wait time averaging about 55 minutes, and long
+eruptions by a wait time averaging about 80 minutes. In recent years, wait
+times have been increasing, possibly due to the effects of earthquakes on the
+geyser&#8217;s geohydrology.</p>
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">John Firebaugh</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2011-04-03T00:00:00-07:00" pubdate data-updated="true">Apr 3<span>rd</span>, 2011</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/protovis/'>Protovis</a>, <a class='category' href='/blog/categories/statistics/'>Statistics</a>, <a class='category' href='/blog/categories/visualization/'>Visualization</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jfirebaugh.github.com/blog/2011/04/03/kernel-density-estimation-with-protovis/" data-via="jfire" data-counturl="http://jfirebaugh.github.com/blog/2011/04/03/kernel-density-estimation-with-protovis/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+ <a class="basic-alignment left" href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/" title="Previous Post: Making sense of constant lookup in Ruby">&laquo; Making sense of constant lookup in Ruby</a>
+
+
+ <a class="basic-alignment right" href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/" title="Next Post: Visualizing SFpark Demand-Responsive Meter Rate Adjustments">Visualizing SFpark Demand-Responsive Meter Rate Adjustments &raquo;</a>
+
+ </p>
+ </footer>
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/">Xcode 4.3, homebrew, and autoconf</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/">Visualizing SFpark Demand-Responsive Meter Rate Adjustments</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/04/03/kernel-density-estimation-with-protovis/">Kernel Density Estimation with Protovis</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/">Making sense of constant lookup in Ruby</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2010/12/22/selenium-on-ruby/">Selenium on Ruby</a>
+ </li>
+
+ </ul>
+</section>
+
+<section>
+ <h1>GitHub Repos</h1>
+ <ul id="gh_repos">
+ <li class="loading">Status updating...</li>
+ </ul>
+
+ <a href="https://github.com/jfirebaugh">@jfirebaugh</a> on GitHub
+
+ <script type="text/javascript">
+ $.domReady(function(){
+ if (!window.jXHR){
+ var jxhr = document.createElement('script');
+ jxhr.type = 'text/javascript';
+ jxhr.src = '/javascripts/libs/jXHR.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(jxhr, s);
+ }
+
+ github.showRepos({
+ user: 'jfirebaugh',
+ count: 0,
+ skip_forks: true,
+ target: '#gh_repos'
+ });
+ });
+ </script>
+ <script src="/javascripts/github.js" type="text/javascript"> </script>
+</section>
+
+
+<section>
+ <h1>Latest Tweets</h1>
+ <ul id="tweets">
+ <li class="loading">Status updating...</li>
+ </ul>
+ <script type="text/javascript">
+ $.domReady(function(){
+ getTwitterFeed("jfire", 4, false);
+ });
+ </script>
+ <script src="/javascripts/twitter.js" type="text/javascript"> </script>
+
+ <a href="http://twitter.com/jfire" class="twitter-follow-button" data-show-count="false">Follow @jfire</a>
+
+</section>
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - John Firebaugh -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
296 blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/index.html
View
@@ -0,0 +1,296 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Visualizing SFpark Demand-Responsive Meter Rate Adjustments - John Firebaugh</title>
+ <meta name="author" content="John Firebaugh">
+
+
+ <meta name="description" content="On July 11th 2011, SFpark announced the
+first set of meter rate adjustments.
+Meter operational hours were divided into six distinct rate periods, and &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://jfirebaugh.github.com/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="John Firebaugh" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-29668835-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">John Firebaugh</a></h1>
+
+ <h2>Open Source, Ruby, Rubinius, RubySpec, Rails.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:jfirebaugh.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Visualizing SFpark Demand-Responsive Meter Rate Adjustments</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2011-09-03T00:00:00-07:00" pubdate data-updated="true">Sep 3<span>rd</span>, 2011</time>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>On July 11th 2011, <a href="http://sfpark.org/">SF<em>park</em></a> announced the
+first set of <a href="http://sfpark.org/how-it-works/pricing/">meter rate adjustments</a>.
+Meter operational hours were divided into six distinct rate periods, and the hourly
+price of metered parking in the project&#8217;s seven pilot areas was adjusted on a
+block-to-block basis in response to parking demand during each period:</p>
+
+<ul>
+<li>+25¢ in periods of 80% or more occupancy</li>
+<li>No change in periods of 60-80% occupancy</li>
+<li>−25¢ in periods of 30-60% occupancy</li>
+<li>−50¢ in periods of less than 40% occupancy</li>
+</ul>
+
+
+<p>I created this visualization using the <a href="http://mbostock.github.com/d3/">d3.js</a>
+framework and data provided by SF<em>park</em>. Click for full size.</p>
+
+<p><a href="/sfpark/rates.html"><img src="/sfpark/SFpark.png" alt="SFpark meter
+rate adjustment visualization" /></a></p>
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">John Firebaugh</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2011-09-03T00:00:00-07:00" pubdate data-updated="true">Sep 3<span>rd</span>, 2011</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/sfpark/'>SFpark</a>, <a class='category' href='/blog/categories/statistics/'>Statistics</a>, <a class='category' href='/blog/categories/visualization/'>Visualization</a>, <a class='category' href='/blog/categories/d3-js/'>d3.js</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jfirebaugh.github.com/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/" data-via="jfire" data-counturl="http://jfirebaugh.github.com/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+ <a class="basic-alignment left" href="/blog/2011/04/03/kernel-density-estimation-with-protovis/" title="Previous Post: Kernel Density Estimation with Protovis">&laquo; Kernel Density Estimation with Protovis</a>
+
+
+ <a class="basic-alignment right" href="/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/" title="Next Post: Xcode 4.3, homebrew, and autoconf">Xcode 4.3, homebrew, and autoconf &raquo;</a>
+
+ </p>
+ </footer>
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/">Xcode 4.3, homebrew, and autoconf</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/">Visualizing SFpark Demand-Responsive Meter Rate Adjustments</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/04/03/kernel-density-estimation-with-protovis/">Kernel Density Estimation with Protovis</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/">Making sense of constant lookup in Ruby</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2010/12/22/selenium-on-ruby/">Selenium on Ruby</a>
+ </li>
+
+ </ul>
+</section>
+
+<section>
+ <h1>GitHub Repos</h1>
+ <ul id="gh_repos">
+ <li class="loading">Status updating...</li>
+ </ul>
+
+ <a href="https://github.com/jfirebaugh">@jfirebaugh</a> on GitHub
+
+ <script type="text/javascript">
+ $.domReady(function(){
+ if (!window.jXHR){
+ var jxhr = document.createElement('script');
+ jxhr.type = 'text/javascript';
+ jxhr.src = '/javascripts/libs/jXHR.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(jxhr, s);
+ }
+
+ github.showRepos({
+ user: 'jfirebaugh',
+ count: 0,
+ skip_forks: true,
+ target: '#gh_repos'
+ });
+ });
+ </script>
+ <script src="/javascripts/github.js" type="text/javascript"> </script>
+</section>
+
+
+<section>
+ <h1>Latest Tweets</h1>
+ <ul id="tweets">
+ <li class="loading">Status updating...</li>
+ </ul>
+ <script type="text/javascript">
+ $.domReady(function(){
+ getTwitterFeed("jfire", 4, false);
+ });
+ </script>
+ <script src="/javascripts/twitter.js" type="text/javascript"> </script>
+
+ <a href="http://twitter.com/jfire" class="twitter-follow-button" data-show-count="false">Follow @jfire</a>
+
+</section>
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - John Firebaugh -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
289 blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/index.html
View
@@ -0,0 +1,289 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Xcode 4.3, homebrew, and autoconf - John Firebaugh</title>
+ <meta name="author" content="John Firebaugh">
+
+
+ <meta name="description" content="Xcode 4.3 no longer includes autotools. If you have installed Xcode 4.3 and
+uninstalled the previous versions, you will no longer have /usr/bin/ &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://jfirebaugh.github.com/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="John Firebaugh" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-29668835-1']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+ </script>
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">John Firebaugh</a></h1>
+
+ <h2>Open Source, Ruby, Rubinius, RubySpec, Rails.</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:jfirebaugh.github.com" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Xcode 4.3, Homebrew, and Autoconf</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-02-18T00:00:00-08:00" pubdate data-updated="true">Feb 18<span>th</span>, 2012</time>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>Xcode 4.3 no longer includes autotools. If you have installed Xcode 4.3 and
+uninstalled the previous versions, you will no longer have <code>/usr/bin/autoconf</code>.
+This isn&#8217;t usually a problem for installing homebrew formulae, since the
+downloaded packages should come with <code>configure</code> pregenerated, but if you want
+to use <code>brew install --HEAD</code> or are building a package from a source
+repository, you may need it. Here&#8217;s how to get it:</p>
+
+<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
+<span class='line-number'>2</span>
+</pre></td><td class='code'><pre><code class=''><span class='line'>brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/autoconf.rb
+</span><span class='line'>brew link autoconf</span></code></pre></td></tr></table></div></figure>
+
+
+<p>At some point in the near future, homebrew will probably add an autoconf formula.
+At that point, you&#8217;ll be able to <code>brew install autoconf</code> directly.</p>
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">John Firebaugh</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-02-18T00:00:00-08:00" pubdate data-updated="true">Feb 18<span>th</span>, 2012</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/homebrew/'>Homebrew</a>, <a class='category' href='/blog/categories/xcode/'>Xcode</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://jfirebaugh.github.com/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/" data-via="jfire" data-counturl="http://jfirebaugh.github.com/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+ <a class="basic-alignment left" href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/" title="Previous Post: Visualizing SFpark Demand-Responsive Meter Rate Adjustments">&laquo; Visualizing SFpark Demand-Responsive Meter Rate Adjustments</a>
+
+
+ </p>
+ </footer>
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/18/xcode-4-dot-3-homebrew-and-autoconf/">Xcode 4.3, homebrew, and autoconf</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/09/03/visualizing-sfpark-demand-responsive-meter-rate-adjustments/">Visualizing SFpark Demand-Responsive Meter Rate Adjustments</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/04/03/kernel-density-estimation-with-protovis/">Kernel Density Estimation with Protovis</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2011/01/21/making-sense-of-constant-lookup-in-ruby/">Making sense of constant lookup in Ruby</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2010/12/22/selenium-on-ruby/">Selenium on Ruby</a>
+ </li>
+
+ </ul>
+</section>
+
+<section>
+ <h1>GitHub Repos</h1>
+ <ul id="gh_repos">
+ <li class="loading">Status updating...</li>
+ </ul>
+
+ <a href="https://github.com/jfirebaugh">@jfirebaugh</a> on GitHub
+
+ <script type="text/javascript">
+ $.domReady(function(){
+ if (!window.jXHR){
+ var jxhr = document.createElement('script');
+ jxhr.type = 'text/javascript';
+ jxhr.src = '/javascripts/libs/jXHR.js';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(jxhr, s);
+ }
+
+ github.showRepos({
+ user: 'jfirebaugh',
+ count: 0,
+ skip_forks: true,
+ target: '#gh_repos'
+ });
+ });
+ </script>
+ <script src="/javascripts/github.js" type="text/javascript"> </script>
+</section>
+
+
+<section>
+ <h1>Latest Tweets</h1>
+ <ul id="tweets">
+ <li class="loading">Status updating...</li>
+ </ul>
+ <script type="text/javascript">
+ $.domReady(function(){
+ getTwitterFeed("jfire", 4, false);
+ });
+ </script>
+ <script src="/javascripts/twitter.js" type="text/javascript"> </script>
+
+ <a href="http://twitter.com/jfire" class="twitter-follow-button" data-show-count="false">Follow @jfire</a>
+
+</section>