<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Baroquebobcat &#187; programming</title>
	<atom:link href="http://blog.baroquebobcat.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.baroquebobcat.com</link>
	<description>Ruby, Computer Science, Japan and Stuff</description>
	<lastBuildDate>Thu, 19 Jan 2012 02:05:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>JRuby, Can&#8217;t Find File in Classpath (You Needed a Slash, in </title>
		<link>http://blog.baroquebobcat.com/2011/01/10/jruby-cant-find-file-in-classpathyou-need-a-slash/</link>
		<comments>http://blog.baroquebobcat.com/2011/01/10/jruby-cant-find-file-in-classpathyou-need-a-slash/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 04:25:44 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=497</guid>
		<description><![CDATA[Update: this is no longer valid as of the release of 1.6.0. I was debugging this Dubious problem where a class I was sure was on the class path couldn&#8217;t be found(link). First, I tried compiling on my local checkout, and it worked oddly. Then I realized I was dumb, because the class was being [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: </strong>this is no longer valid as of the release of 1.6.0.</p>
<p>I was debugging this Dubious problem where a class I was sure was on the class path couldn&#8217;t be found(<a href="https://github.com/mirah/dubious/issues/#issue/19">link</a>). First, I tried compiling on my local checkout, and it worked oddly. Then I realized I was dumb, because the class was being picked up from the finished jar. So, I clobbered my build artifacts and then my local copy didn&#8217;t compile either.</p>
<p>I did some digging and found out why.</p>
<p>In the end it was because of <a href="http://kenai.com/projects/jruby/pages/FAQs?nav=off#How_come_Java_can_t_find_resources_in_class_folders_that_I_ve_appended_to_the_$CLASSPATH_global_variable_at_runtime?">how JRuby implements $CLASSPATH</a>&#8211;the way you can modify the classpath from within JRuby. JRuby uses a subclass of <a href="http://download.oracle.com/javase/1.5.0/docs/api/java/net/URLClassLoader.html">URLClassLoader</a> to implement it which gives it some possibly unexpected behavior. In particular, URLClassLoader treats anything that does not end in a slash as a jar. That&#8217;s why the class files in my build directory were not being picked up properly.</p>
<h4>Lessons Learned:</h4>
<p><strong>Combat &#8220;It Works on My Machine™&#8221;</strong>. Clobber local generated files every now and again, and checkout a fresh tree from time to time to reduce the chance something local is weird.</p>
<p><strong>Look for and ask for help when you don&#8217;t know something</strong>. First time I tried to figure out the problem, I just tinkered and compiled and tinkered and compiled. A little research would have saved some time.</p>
<h4>TL;DR</h4>
<p>If JRuby can&#8217;t find your classes and you think they should have been added to $CLASSPATH, make sure you have trailing slashes on your directory names.</p>
<h4>Update:</h4>
<p>This has actually been fixed, but not released yet: <a href="https://github.com/jruby/jruby/commit/8740a6b3ea946a1442dd7fa833aed3c30d82e23f">https://github.com/jruby/jruby/commit/8740a6b3ea946a1442dd7fa833aed3c30d82e23f</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2011/01/10/jruby-cant-find-file-in-classpathyou-need-a-slash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyConfX: Awesomesauce!? Hells Yes!</title>
		<link>http://blog.baroquebobcat.com/2010/11/18/rubyconfx-awesomesauce-hells-yes/</link>
		<comments>http://blog.baroquebobcat.com/2010/11/18/rubyconfx-awesomesauce-hells-yes/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 04:19:21 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[food]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=498</guid>
		<description><![CDATA[RubyConf X in NOLA last week was epic. Epic. Seriously though, I had a rocking time. I gave part of a talk, I talked to an amazing amount of awesomely smart people and just generally enjoyed my ass off. It was the first RubyConf I&#8217;d been to, and I think the biggest conference I&#8217;ve gone [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rubyconf.org/">RubyConf X </a>in NOLA last week was epic.</p>
<p>Epic.</p>
<p>Seriously though, I had a rocking time. I gave part of a talk, I talked to an amazing amount of awesomely smart people and just generally enjoyed my ass off.</p>
<p>It was the first RubyConf I&#8217;d been to, and I think the biggest conference I&#8217;ve gone to yet as a developer(<a href="http://blog.baroquebobcat.com/2009/07/24/went-to-ala-in-chicago/">ALA doesn&#8217;t count</a>). I liked being in New Orleans again, surrounded by Jazz and a culture that contains people who think it is perfectly reasonable to drive around playing a trombone out of a car window. It&#8217;d be awesome if RubyConf was there next year.</p>
<p>My talk went pretty well I think, though I wish I&#8217;d taken more time to practice. It didn&#8217;t help that I hadn&#8217;t met my co-speaker, Bob Aman before the conference. But, it worked out pretty well, I think (<a href="http://speakerrate.com/talks/5022-app-engine-and-dubious-and-new-google-apis-oh-my">speakerrate</a> may or may not say otherwise). And we got some good feedback on twitter.</p>
<p>New Orleans, as I well know, is a great place to experience. I mean, look at this Po&#8217;Boy:</p>
<p><a title="A Large Dressed Roast Beef Po'Boy by baroquebobcat, on Flickr" href="http://www.flickr.com/photos/baroquebobcat/5181367515/"><img src="http://farm2.static.flickr.com/1286/5181367515_5abeea7260.jpg" alt="A Large Dressed Roast Beef Po'Boy" width="281" height="500" /></a></p>
<p>Running in the  RubyConf Xk(I ran the 5k) was fun. I totally expected to be unable to jog the whole way, but I did. And, I upped my pace on the second lap coming in at a respectable 29:41. Not bad for someone who has not gotten enough exercise in recent months. Oh, and <a href="http://twitter.com/tenderlove">@tenderlove</a> ran too, in spandex no less:</p>
<p><a title="Heroic Race Finishers by baroquebobcat, on Flickr" href="http://www.flickr.com/photos/baroquebobcat/5181368115/"><img src="http://farm5.static.flickr.com/4106/5181368115_fe3e5aa902.jpg" alt="Heroic Race Finishers" width="281" height="500" /></a></p>
<p>I definitely need to up my silliness for the next Ruby conference I go to. I feel out classed.</p>
<p>All in all, I had a freaking blast.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2010/11/18/rubyconfx-awesomesauce-hells-yes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mountain West Ruby Conf Rocked This Year</title>
		<link>http://blog.baroquebobcat.com/2010/03/22/mountain-west-ruby-conf-rocked-this-year/</link>
		<comments>http://blog.baroquebobcat.com/2010/03/22/mountain-west-ruby-conf-rocked-this-year/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 05:51:21 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=421</guid>
		<description><![CDATA[Mountain West Ruby Conf this year was awesome. I totally had a blast. It was the third time I&#8217;ve gone to it. It was my first conference and still is my favorite. I got to meet Matz, I gave a lightning talk, I met all sorts of interesting people and I learned a bunch of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mtnwestrubyconf.org/2010/">Mountain West Ruby Conf</a> this year was awesome. I totally had a blast.</p>
<p>It was the third time I&#8217;ve gone to it. It was my first conference and still is my favorite. I got to meet Matz, I gave a lightning talk, I met all sorts of interesting people and I learned a bunch of new things. To quote Matz, <a href="http://twitter.com/yukihiro_matz/status/10408740916">MountainWest RubyConfはすばらしかった。</a></p>
<p><a title="Matz &amp; me by baroquebobcat, on Flickr" href="http://www.flickr.com/photos/baroquebobcat/4453467686/"><img src="http://farm3.static.flickr.com/2728/4453467686_b9358d6ff0.jpg" alt="Matz &amp; me" width="500" height="375" /></a></p>
<p>Things to revisit</p>
<ul>
<li><a href="http://github.com/gilesbowkett/archaeopteryx">Archaeopteryx</a></li>
</ul>
<ul>
<li><a href="http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release/"> Rails 3</a></li>
</ul>
<ul>
<li> <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/354528">Rack</a>(1.1.0 in particular)</li>
</ul>
<ul>
<li> <a href="http://wiki.opscode.com/display/chef/Home">Chef</a>(looks better than the last time I poked at it)</li>
</ul>
<ul>
<li> <a href="http://timetobleed.com/eventmachine-scalable-non-blocking-io-in-ruby/">EventMachine</a></li>
</ul>
<ul>
<li> <a href="http://github.com/lsegal/yard">Yard</a></li>
</ul>
<p>New things(to me)</p>
<ul>
<li><a href="http://rvm.beginrescueend.com/">RVM</a>(rvm looks pretty handy, especially for cross vm library development)</li>
</ul>
<ul>
<li><a href="http://github.com/jashkenas/ruby-processing"> Ruby-Processing</a></li>
</ul>
<ul>
<li> <a href="http://github.com/mwotton/Hubris">Hubris</a>(this might be a neat way to get into Haskell development)</li>
</ul>
<ul>
<li><a href="http://timetobleed.com/descent-into-darkness-understanding-your-systems-binary-interface-is-the-only-way-out/"> Mucking about with the binary interfaces</a>(because it is awesome.)</li>
</ul>
<p><strong>My lightning talk</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/OjOpCX_OBP4&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/OjOpCX_OBP4&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2010/03/22/mountain-west-ruby-conf-rocked-this-year/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Usdo. Misspellings turn into gem-fu practice</title>
		<link>http://blog.baroquebobcat.com/2009/11/14/usdo-misspellings-turn-into-gem-fu-practice/</link>
		<comments>http://blog.baroquebobcat.com/2009/11/14/usdo-misspellings-turn-into-gem-fu-practice/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 21:03:28 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[geekery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=383</guid>
		<description><![CDATA[A few weeks ago, during a period of frustration, I found myself repeatedly mistyping &#8216;sudo.&#8217; So, in a fit of silliness I wrote a short script to insult me when I did it, and put it in the path. Later, I packaged it as a gem, because a) I had never built a gem with [...]]]></description>
			<content:encoded><![CDATA[<p><a style="float:left;padding: 1em" title="Indian Paintbrush by baroquebobcat, on Flickr" href="http://www.flickr.com/photos/baroquebobcat/4103285795/"><img src="http://farm3.static.flickr.com/2584/4103285795_7bc6bc33a4_m.jpg" alt="Indian Paintbrush" width="180" height="240" /></a><br />
A few weeks ago, during a period of frustration, I found myself repeatedly mistyping &#8216;sudo.&#8217; So, in a fit of silliness I wrote a<a title="usdo.rb gist" href="http://gist.github.com/198514"> short script</a> to insult me when I did it, and put it in the path.</p>
<p>Later, I packaged it as a gem, because a) I had never built a gem with an executable and b) gems are a great way to share things.</p>
<p>The end result?</p>
<p><a href="http://github.com/baroquebobcat/usdo">http://github.com/baroquebobcat/usdo</a></p>
<p>It isn&#8217;t particularly smart, but I happen to find it funny. It also showed to me how far gem packaging has come. <a href="http://www.gemcutter.org/">Gemcutter</a> and <a href="http://github.com/technicalpickles/jeweler">Jeweler</a> make building and distributing ruby gems freakishly easy. This is especially awesome in light of the recent announcement that <a href="http://update.gemcutter.org/2009/10/26/transition.html">gemcutter is going to be the default gems host</a>(though at <a href="rubygems.org">rubygems.org</a>)<strong><br />
</strong></p>
<p><strong>How I put it together</strong></p>
<p>I ran jeweler to create the default directory structure and added a bin dir to it, for the files I wanted to end up in the path.</p>
<pre lang="bash">$ jeweler usdo
cd usdo
mkdir bin</pre>
<p>I put my gist from before in the bin directory, and set up git.</p>
<p>Set up my gem info in my Rakefile</p>
<pre>#...
Jeweler::Tasks.new do |gem|
  gem.name = "usdo"
  gem.summary = %Q{adds usdo command to ridicule mispellings of sudo}
  gem.description = %Q{...}
  gem.email = "ndh@baroquebobcat.com"
  gem.homepage = "http://github.com/baroquebobcat/usdo"
  gem.authors = ["Nick Howard"]
end</pre>
<p>then did the jeweler gem initialization dance</p>
<pre>rake version:write
rake gemspec
rake install</pre>
<p>Testing it out:</p>
<pre>$ usdo -l
----USDO----
    You mispelled sudo
    You can't do anything, you can't even spell sudo
    are you really sure you want to try running
    'sudo -l'????</pre>
<p>Now that was working, to send it up for distribution.</p>
<p>Jeweler is awesome and now has gemcutter support. I followed the jeweler <a href="http://github.com/technicalpickles/jeweler">README</a>&#8216;s directions on uploading to gemcutter. Which makes pushing your gem as simple as</p>
<pre>$ rake gemcutter:release</pre>
<p>Awesome.</p>
<p>Check out <a href="http://github.com/baroquebobcat/usdo">my code</a> if you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/11/14/usdo-misspellings-turn-into-gem-fu-practice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrubyt On A Server Workaround</title>
		<link>http://blog.baroquebobcat.com/2009/11/04/scrubyt-on-a-server-workaround/</link>
		<comments>http://blog.baroquebobcat.com/2009/11/04/scrubyt-on-a-server-workaround/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 06:47:37 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=387</guid>
		<description><![CDATA[So you got some awesome scraper script and you want to deploy it to your server but you don&#8217;t want to have to install firewatir. Or, you don&#8217;t want to pull in the firewatir gem because you are not planning on using it. Whatever. Problem: scrubyt requires the firewatir gem Hacky Solution: comment out the [...]]]></description>
			<content:encoded><![CDATA[<p>So you got some awesome scraper script and you want to deploy it to your server but you don&#8217;t want to have to install <a href="http://code.google.com/p/firewatir/">firewatir</a>. Or, you don&#8217;t want to pull in the firewatir gem because you are not planning on using it. Whatever.</p>
<p><strong>Problem:</strong> scrubyt<br />
requires the firewatir gem</p>
<p><strong>Hacky Solution</strong>: comment out the require</p>
<p>But where you ask?</p>
<pre>/lib/scrubyt/core/navigation/agents/firewatir.rb line 1</pre>
<p>This works on the current rubyforge version(0.4.1).<br />
<strong>Recommended: </strong>Or, you could just use the version on github that is fixed(<a href="http://github.com/scrubber/scrubyt/commit/b1bfe0498939d3836cf5c4261d82889cd05ffd68">see commit</a>)</p>
<p>grab the files via git or archive from <a href="http://github.com/scrubber/scrubyt">github.com/scrubber/scrubyt</a></p>
<p>then</p>
<pre>cd scrubyt-somehash
rake gem
gem install pkg/scrubyt-0.4.26.gem</pre>
<p>Not as nice as using <a href="http://github.com/technicalpickles/jeweler">jeweler </a>where you can just `rake install` it, but pretty nifty none the less.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/11/04/scrubyt-on-a-server-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID Provider in Sinatra</title>
		<link>http://blog.baroquebobcat.com/2009/09/17/openid-provider-in-sinatra/</link>
		<comments>http://blog.baroquebobcat.com/2009/09/17/openid-provider-in-sinatra/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 05:31:35 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=376</guid>
		<description><![CDATA[As part of a personal project, I have been working on an OpenID Provider written in Sinatra. The idea is to make it ridiculously easy to set up an openid provider within a rack middleware stack. It&#8217;s just a single sinatra app without any tests using code I cribbed from the example rails implementation in [...]]]></description>
			<content:encoded><![CDATA[<p>As part of a personal project, I have been working on an OpenID Provider written in Sinatra.</p>
<p>The idea is to make it ridiculously easy to set up an openid provider within a rack middleware stack.</p>
<p>It&#8217;s just a single sinatra app without any tests using code I cribbed from the example rails implementation in <a href="http://openidenabled.com/ruby-openid/">ruby-openid</a>. But, I intend on rewriting it once I get a better feel for how it should go.</p>
<p>The problem I face is a matter of interface, specifically application programming interface. I want it to be simple to use. But that is alittle complicated underneath.</p>
<p>Today I read <a href="http://chaos.troll.no/~shausman/api-design/api-design.pdf">The Little Manual of API Design</a>(pdf), which made me think about my approach to building things in, I think, a good way. It talks about the goals of building a good API and boils it down to five things.</p>
<ul>
<li>Easy to learn and memorize</li>
<li>Leads to readable code</li>
<li>Hard to misuse</li>
<li>Easy to extend</li>
<li>Complete</li>
</ul>
<p>For my app, complete is pretty easy. I&#8217;ve boiled the interface down to two main things:</p>
<ul>
<li>OpenID Store</li>
<li>User/Identity</li>
</ul>
<p>First, for an openid app, you need an openid store to put all the associations, nonces etc.</p>
<p>Then, the meaty bit, the users and their identities. The stuff we are serving up. My current thought is to have one of the app&#8217;s parameters be a lambda or Proc that returns the current user, or nil when called with the request.env. So that using it would look somewhat like this.<br />
<script src="http://gist.github.com/188358.js"></script> It&#8217;s kind of ugly, but I like it better than some of my other options.  One other way I could get the user to the app would be to use rack request hash. I could have users put the user object in the request env before the OpenID provider gets it and tell the provider where to look. But the problem with that is that I would need to add another middleware layer that added the user to the environment.  That would look something like this:   <script src="http://gist.github.com/188360.js"></script></p>
<p>Maybe that would be better.</p>
<p>Ultimately I just need to pick something and run with it.</p>
<p>The thing I wonder about though, is what is the most idomatic way of doing this. Using the most rubyish, most Rack like interface would make it easier to learn and memorize.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/09/17/openid-provider-in-sinatra/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RubyNation Etc</title>
		<link>http://blog.baroquebobcat.com/2009/06/16/rubynation-etc/</link>
		<comments>http://blog.baroquebobcat.com/2009/06/16/rubynation-etc/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 04:38:00 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[anecdote]]></category>
		<category><![CDATA[geekery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=318</guid>
		<description><![CDATA[I am back from RubyNation and reapplying my nose to the grindstone, wheel to the asphalt and hands to the keyboard. I am still planning a big summary and commentary post based on my notes, but as I started working on that, I realized it might need more than one night to see to completion. [...]]]></description>
			<content:encoded><![CDATA[<p>I am back from RubyNation and reapplying my nose to the grindstone, wheel to the asphalt and hands to the keyboard. I am still planning a big summary and commentary post based on my notes, but as I started working on that, I realized it might need more than one night to see to completion.</p>
<p>So, I give you this:</p>
<p><strong>Me</strong><br />
<a href="http://www.flickr.com/photos/baroquebobcat/3630829655/" title="Hyatt Ceiling Pastry and Me in My Hat by baroquebobcat, on Flickr"><img src="http://farm4.static.flickr.com/3345/3630829655_a2dd943865.jpg" width="500" height="375" alt="Hyatt Ceiling Pastry and Me in My Hat" /></a><br />
<strong><br />
Carrot Cake(Thanks Hyatt catering)</strong></p>
<p><a href="http://www.flickr.com/photos/baroquebobcat/3631643308/" title="Mmm Carrot Cake by baroquebobcat, on Flickr"><img src="http://farm4.static.flickr.com/3325/3631643308_60297a6e0c.jpg" width="500" height="375" alt="Mmm Carrot Cake" /></a></p>
<p><strong>And Lys, the cat who is strangely fond of white ceramics.</strong></p>
<p><a href="http://www.flickr.com/photos/baroquebobcat/3631643722/" title="Lys, Sink and You by baroquebobcat, on Flickr"><img src="http://farm3.static.flickr.com/2427/3631643722_95ee64b192.jpg" width="500" height="375" alt="Lys, Sink and You" /></a></p>
<p>Tune in some indeterminate point in the future for a fuller update. Or, you could just read <a href="http://blog.prognosoft.biz/2009/06/12/ruby-nation-2009-first-day/">this guy&#8217;s take.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/06/16/rubynation-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter Search from Javascript</title>
		<link>http://blog.baroquebobcat.com/2009/05/05/twitter-search-from-javascript/</link>
		<comments>http://blog.baroquebobcat.com/2009/05/05/twitter-search-from-javascript/#comments</comments>
		<pubDate>Tue, 05 May 2009 07:45:07 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=251</guid>
		<description><![CDATA[I was working on building a js twitter search app for jazzfest, which I didn&#8217;t finish in time really, but I liked the interface I came up with. Twitter = { _callbacks:[] }; Twitter.search = function(opts){ //opts.q //opts.callback var callback = function(data){ opts.callback(data); Twitter._callbacks = Twitter._callbacks.without(callback) } var len = Twitter._callbacks.push(callback) document.body.insert("") } You call [...]]]></description>
			<content:encoded><![CDATA[<p>I was working on building a js<a href="http://www.baroquebobcat.com/jazzfest/"> twitter search app for jazzfest</a>, which I didn&#8217;t finish in time really, but I liked the interface I came up with.</p>
<pre lang="javascript">Twitter = {
  _callbacks:[]
};
Twitter.search = function(opts){
//opts.q
//opts.callback
var callback = function(data){
    opts.callback(data);
    Twitter._callbacks = Twitter._callbacks.without(callback)
  }
var len = Twitter._callbacks.push(callback)
document.body.insert("<script src='http://search.twitter.com/search.json?q="+escape(opts.q)+"&#038;callback=Twitter._callbacks["+(len-1).toString()+"]'>")
}
</pre>
<p>You call it by doing:</p>
<pre lang="javascript">
Twitter.search({q:'happy birthday',callback: function(data){
  something_awesome(data.results)
}})
</pre>
<p>The next thing to do would be to add support for more of the <a href="http://apiwiki.twitter.com/Twitter-Search-API-Method%3A-search">search API's parameters.</a><br />
Or to remove the dependency on Prototype introduced by using <code>insert</code> on the body rather than something more verbose.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/05/05/twitter-search-from-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS frameworks &amp; Compass</title>
		<link>http://blog.baroquebobcat.com/2009/05/01/css-frameworks-compass/</link>
		<comments>http://blog.baroquebobcat.com/2009/05/01/css-frameworks-compass/#comments</comments>
		<pubDate>Fri, 01 May 2009 05:58:12 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=244</guid>
		<description><![CDATA[I have been looking harder at CSS frameworks recently because I am always looking for ways to improve my craft. I have been playing with typogridphy a little recently after reading giles post on using it for a miniapp. More recently I have read about where typogridphy comes from. I had heard about blueprint, quite [...]]]></description>
			<content:encoded><![CDATA[<p>I have been looking harder at CSS frameworks recently because I am always looking for ways to improve my craft.<br />
I have been playing with <a href="http://csswizardry.com/typogridphy/">typogridphy</a> a little recently after reading giles post on <a href="http://gilesbowkett.blogspot.com/2009/04/miniapp-hacker-newspaper.html">using it for a miniapp.</a></p>
<p>More recently I have read about where typogridphy comes from. I had heard about <a href="http://www.blueprintcss.org/">blueprint</a>, quite a while ago, but I still thought that building things myself was the best way to go. Now, I am tired of dealing with CSS annoyances so frameworks look more appealing. Typogridphy was built on top of <a href="http://960.gs/">960</a> which is a somewhat opinionated CSS framework.(saying CSS framework sounds funny to me). 960 gives you a bunch of reasonable default classes and such to make getting started easier.</p>
<p>This is pretty cool. But, there are some drawbacks. The problem is they create semantically void classes and ids that you need to use for your stuff to work. </p>
<p>Even though I want my hand to be held a bit, I also want my markup to make sense.</p>
<p><strong>What to do?</strong></p>
<p>I have been using <a href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html">sass</a> for styling for a while now, and it has made dealing with CSS easier by making nesting more convenient and added things like variables which CSS does not have. It has been pretty awesome.</p>
<p>Also it has mixins, which are sort of like bags of properties that can be inserted into classes, etc. Check it out.</p>
<pre lang="sass">
=heading_text
  :font
    :size 120%
    :weight bold
h1
  +heading_text
</pre>
<p>These mixins allow you to do all sorts of interesting things, like get around the having to use semantically meaningless classes etc for stuff to work. <a href="http://acts-as-architect.blogspot.com/">Chris Eppstein</a> wrote <a href="http://github.com/chriseppstein/compass/tree/master">Compass</a>, a CSS meta-framework. The idea is to port major CSS frameworks to sass as mixins and then create a way to access them without having all the code hanging out in your app tree.</p>
<p>It redefines what would be classes, ids etc as sass mixins instead, so you can add them to your semantic class names. Which in is what I want to be able to do anyway.</p>
<p><a href="http://wiki.github.com/chriseppstein/compass/getting-started">Check it out.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/05/01/css-frameworks-compass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sprinkle and Passenger Stack</title>
		<link>http://blog.baroquebobcat.com/2009/04/21/sprinkle-and-passenger-stack/</link>
		<comments>http://blog.baroquebobcat.com/2009/04/21/sprinkle-and-passenger-stack/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 05:03:11 +0000</pubDate>
		<dc:creator>nick</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.baroquebobcat.com/?p=224</guid>
		<description><![CDATA[I started using sprinkle with the passenger-stack recently. So far, it has been easy to get started with and fairly intuitive. I chose it rather than puppet or some of the other declarative server configuration DSL because it doesn&#8217;t need to install anything extra on the server to work. This is great for the kinds [...]]]></description>
			<content:encoded><![CDATA[<p>I started using <a href="http://github.com/crafterm/sprinkle/">sprinkle</a> with the <a href="http://github.com/benschwarz/passenger-stack/">passenger-stack</a> recently. So far, it has been easy to get started with and fairly intuitive. I chose it rather than <a href="http://github.com/lak/puppet">puppet</a> or some of the other declarative server configuration <abbr title="Domain Specific Language">DSL</abbr> because it doesn&#8217;t need to install anything extra on the server to work.</p>
<p>This is great for the kinds of things I have been working on, because they are fairly small, and don&#8217;t need many servers.<br />
I think if I were managing more things, I might choose puppet, because the overhead would be justified.</p>
<p>One of the things I like about sprinkle, is the DSL is pretty straight forward, eg the package definition for passenger looks like this:</p>
<pre lang="ruby">
package :passenger, :provides => :appserver do
  description 'Phusion Passenger (mod_rails)'
  version '2.1.3'
  gem 'passenger' do
    post :install, 'echo -en "\n\n\n\n" | sudo passenger-install-apache2-module'

    # Create the passenger conf file
    post :install, 'mkdir -p /etc/apache2/extras'
    post :install, 'touch /etc/apache2/extras/passenger.conf'
    post :install, 'echo "Include /etc/apache2/extras/passenger.conf"|sudo tee -a /etc/apache2/apache2.conf'

    [%Q(LoadModule passenger_module /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}/ext/apache2/mod_passenger.so),
    %Q(PassengerRoot /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}),
    %q(PassengerRuby /usr/local/bin/ruby),
    %q(RailsEnv production)].each do |line|
      post :install, "echo '#{line}' |sudo tee -a /etc/apache2/extras/passenger.conf"
    end

    # Restart apache to note changes
    post :install, '/etc/init.d/apache2 restart'
  end
</pre>
<p>I had some problems, like the version of passenger in the passenger-stack master branch on github is a point release behind the phusion&#8217;s, which is annoying because when passenger updates itself to 2.2.0, the configs are not updated and apache tells you it can&#8217;t find the <code>mod_passenger.so</code> file.</p>
<p>Also, it puts the passenger config in a slightly unusual place(/etc/apache/extras), for an apache module, as well as appending stuff to /etc/apache2/apache2.conf. This prevents it from idempotency, because if you run it twice, it will add additional lines to the config files. So, in the vein of scratching my own itch and what have you&#8211;you know, that open source thing&#8211;I <a href="http://github.com/baroquebobcat/passenger-stack/blob/3448a943ef51cbde327bdea37f7ae4a9a8389027/config/stack/apache.rb#L19">rewrote</a> it.</p>
<pre lang="ruby">
package :passenger, :provides => :appserver do
  description 'Phusion Passenger (mod_rails)'
  version '2.2.0'
  gem 'passenger' do
    post :install, 'echo -en "\n\n\n\n" | sudo passenger-install-apache2-module'

    # Create the passenger conf file
    loading = %Q(LoadModule passenger_module /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}/ext/apache2/mod_passenger.so)
    conf = %Q(PassengerRoot /usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}
PassengerRuby /usr/local/bin/ruby
RailsEnv production)

    post :install, "echo '#{conf}' >> /etc/apache2/mods-available/passenger.conf"
    post :install, "echo '#{loading}' >> /etc/apache2/mods-available/passenger.load"
    post :install, 'a2enmod passenger'
    # Restart apache to note changes
    post :install, '/etc/init.d/apache2 restart'
  end

  verify do
    has_file "/etc/apache2/mods-enabled/passenger.load"
    has_file "/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}/ext/apache2/mod_passenger.so"
    has_directory "/usr/local/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-#{version}"
  end

  requires :apache, :apache2_prefork_dev, :ruby_enterprise
end
</pre>
<p>Now, it takes advantage of the debian convention of keeping module loading and configuration files go in <code>/etc/apache2/mods-available</code> that are symlinked into <code>/etc/apache2/mods-enabled</code> by the <code>a2enmod</code> utility. This is immediately obviously awesome to anyone who has contemplated the horror of trying to parse the apache main config to see if the stuff they want to add is already there and needs updating.</p>
<p>I also added some verifiers so that it won&#8217;t rerun if there were no errors. Pretty cool, no?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.baroquebobcat.com/2009/04/21/sprinkle-and-passenger-stack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

