<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en-US"><title type="text">techno weenie - Home</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/" /><updated>2009-04-21T00:08:54+00:00</updated><generator uri="http://mephistoblog.com">Mephisto Drax</generator><id>tag:techno-weenie.net,2009:mephisto/</id><link rel="self" href="http://feeds.feedburner.com/TechnoWeenie" type="application/atom+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><entry><title type="text">New to the CAN: Widget, json fixes, etc</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/4/20/new-to-the-can-widget-json-fixes-etc" /><author><name>rick</name></author><updated>2009-04-20T17:08:54-07:00</updated><id>tag:techno-weenie.net,2009-04-20:14684</id><content type="html">
            &lt;p&gt;I just pushed a new version the &lt;a href="http://calendaraboutnothing.com"&gt;Calendar About Nothing&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://github.com/mtah"&gt;mtah&lt;/a&gt; fixed a problem with the JSON routes.  Gah, &lt;a href="http://www.sinatrarb.com/testing.html"&gt;totally my fault&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/jqr"&gt;jqr&lt;/a&gt; cleaned things up a little, patching broken windows, etc.  One really nice thing: he fixed a &lt;a href="http://github.com/entp/seinfeld/commit/685f80388cd5953595135e9e7fef862233f17292"&gt;potential infinite loop in feed processing&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Kalin Harvey added a &lt;a href="http://www.capify.org/"&gt;capfile&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/kastner made a [swanky new iPhone/iPod touch icon](http://calendaraboutnothing.com/apple-touch-icon.png"&gt;kastner&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the big update:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://github.com/lachlanhardy"&gt;lachlanhardy&lt;/a&gt; wrote a jQuery widget so you can post the calendar to your site. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thanks for the updates, everyone.&lt;/p&gt;

&lt;p&gt;Also, I’ve been working with the Heroku guys on getting the weird intermittent server error on &lt;a href="http://islostonyet.com/"&gt;IsLOSTOnYet&lt;/a&gt; up and running.  I think &lt;a href="http://github.com/technoweenie/islostonyet.com/commit/2c01ff6d3f73c8d63e664808c05bef0861a2bf0a"&gt;it’s fixed now&lt;/a&gt;.&lt;/p&gt;
          </content></entry><entry><title type="text">poetic tweets</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/3/15/poetic-tweets" /><author><name>rick</name></author><updated>2009-03-15T14:50:18-07:00</updated><id>tag:techno-weenie.net,2009-03-15:14493</id><content type="html">
            &lt;p&gt;&lt;a href="http://saulwilliams.com/"&gt;Saul Williams’&lt;/a&gt; trek through the midwest between shows sparked some musings on Twitter.&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;&lt;a href="http://twitter.com/SaulWilliams/status/1332485979"&gt;Driving from Denver to Kansas City. My mind travels at a faster pace than my body. I mark my way with words. If the newest technology&lt;/a&gt; &lt;a href="http://twitter.com/SaulWilliams/status/1332497786"&gt;enhances transparancy then this is an ideal time to share your process. Share how your mind works. How do you think?&lt;/a&gt;  &lt;/p&gt;
    
    &lt;p&gt;&lt;a href="http://twitter.com/SaulWilliams/status/1332503476"&gt;Do u associate w/negative thoughts and ideas? Are u cynical? What do u profess? What would u proclaim?&lt;/a&gt;  &lt;a href="http://twitter.com/SaulWilliams/status/1332509946"&gt;Are you more concerned with like-minded agreement? Are you a naysayer? Perhaps, like me, you raise questions…&lt;/a&gt;  &lt;/p&gt;
    
    &lt;p&gt;&lt;a href="http://twitter.com/SaulWilliams/status/1332514396"&gt;But who am I fooling? is this viral voice my voice or a thumbprint personae? Is it really that deep?&lt;/a&gt; &lt;a href="http://twitter.com/SaulWilliams/status/1332521722"&gt;Maybe its just a simple way of posting ur whereabouts incase loved ones need to find you. Maybe its a reflection of the human mind….&lt;/a&gt;  &lt;a href="http://twitter.com/SaulWilliams/status/1332528459"&gt;Each tweet a thought yearning to be acknowledged. Where does the quest for attention begin…and how does it beget survival?&lt;/a&gt;  &lt;/p&gt;
    
    &lt;p&gt;&lt;a href="http://twitter.com/SaulWilliams/status/1332539339"&gt;I have passing thoughts all day. Thoughts that I ignore. Thoughts I don’t associate with. Then, there are thoughts that I do identify with.&lt;/a&gt;  &lt;a href="http://twitter.com/SaulWilliams/status/1332561177"&gt;These are the thoughts that I voice and take ownership of by saying ‘I’ or simply pursuing them. For everything I say, there’s a million&lt;/a&gt;  &lt;a href="http://twitter.com/SaulWilliams/status/1332572471"&gt;thoughts I did not say. Some because they came from weak or narrow-minded places. Some because it would leave me too vulnerable.&lt;/a&gt;  &lt;/p&gt;
    
    &lt;p&gt;&lt;a href="http://twitter.com/SaulWilliams/status/1332588991"&gt;The mind, like this stretch between Denver and Kansas City, is an open field. All of this farm land! What will I harvest? Fields of patience&lt;/a&gt;; &lt;a href="http://twitter.com/SaulWilliams/status/1332626412"&gt;rows and rows of clarity. But most importantly, how will I travel? Highways of doubt, winding faithways of fearlessness, step by step….&lt;/a&gt;  &lt;a href="http://twitter.com/SaulWilliams/status/1332649303"&gt;…and here is a train. What does it symbolize? Expedience. Decision making. And the blood, sweat, and tears of those who laid the tracks.&lt;/a&gt;  &lt;/p&gt;
    
    &lt;p&gt;&lt;a href="http://twitter.com/SaulWilliams/status/1332666506"&gt;This is my train of thought as I type into this digital rock and ponder thumb pianos…. Kononolingus…&lt;/a&gt;  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Twitter asks us “What are you doing?”.  But if everyone actually answered that, it’d be a wasteland.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.penny-arcade.com/comic/2008/4/23/"&gt;&lt;img src="http://www.penny-arcade.com/images/2008/20080423.jpg" alt="&amp;amp;quot;Le Twitter&amp;amp;quot; from Penny Arcade" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Luckily, Saul managed to make a stop in Portland on the Oddity Fair tour.  I’d highly recommend checking it out (plus, you’ll get to see Les Paul’s sick bass playing skills).  &lt;/p&gt;

&lt;p&gt;&amp;lt;object height="385" width="480"&gt;&amp;lt;param&gt;&amp;lt;/param&gt;&amp;lt;param&gt;&amp;lt;/param&gt;&amp;lt;param&gt;&amp;lt;/param&gt;&amp;lt;embed src="http://www.youtube.com/v/Wq3T0ZqhVbg&amp;amp;amp;hl=en&amp;amp;amp;fs=1&amp;amp;amp;rel=0" height="385" width="480"&gt;&amp;lt;/embed&gt;&amp;lt;/object&gt;&lt;/p&gt;

&lt;p&gt;Oh yea…&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/technoweenie/statuses/1309100879"&gt;&lt;img src="http://twictur.es/i/1309100879.gif" alt="&amp;amp;quot;Whoa just shook @saulwilliams' hand after much prodding from Saige and @towski&amp;amp;quot; from twitter" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the show, Saul jumped the fence to get a chance to meet the fans up close.  It was suggested that I go say hi, but what do you say in those situations?  Saige (friend at ENTP) did go introduce herself, and apparently mentioned that her shy coworker was a huge fan.  She pointed me out, so Saul grabbed my shoulder and said hi.  It was a cool, awkward moment… and I couldn’t think of anything more profound to say than “Oh hey, awesome show – I’m a huge fan blah blah”.&lt;/p&gt;
          </content></entry><entry><title type="text">WTF does that cron do?</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/3/15/wtf-does-that-cron-do" /><author><name>rick</name></author><updated>2009-03-15T10:59:48-07:00</updated><id>tag:techno-weenie.net,2009-03-15:14490</id><content type="html">
            &lt;p&gt;I’ll be the first to admit that I’m not a great system administrator.  I was a windows guy for so long, so my only exposure to linux was haggling with shared hosting accounts to run my stupid php apps.  While my linux/administration skills have grown by leaps and bounds in the last few years, I still get caught up on something as simple as cron jobs.  The syntax is very terse, and probably easy to parse for computers.  For the rest of us…  Well, what the hell does this mean?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;*/6 * * * * rake ts:index:delta&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/3/15/Google.jpg" alt="Google is no help" /&gt;&lt;/p&gt;

&lt;p&gt;According to my new project, &lt;a href="http://cronwtf.github.com/"&gt;CronWTF&lt;/a&gt;, that “runs &lt;code&gt;rake ts:index:delta&lt;/code&gt; at minutes :00, :06, :12, :18, :24, :30, :36, :42, :48, :54, every hour.”&lt;/p&gt;

&lt;p&gt;Okay, to be honest, it’s not &lt;em&gt;that&lt;/em&gt; hard to read.  Most of the time my jobs run multiple times a day, so I’m only dealing with the first 2 fields (minutes and hours).  The real reason I wrote this was for punishment for royally botching up the cron job for the &lt;a href="http://calendaraboutnothing.com/"&gt;Calendar About Nothing&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;I wanted to run the update task every four hours:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;* */4 * * * rake seinfeld:update&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then, my server would periodically run out of memory and my host would have to reboot it.  I happened to be on the server during one of these ruby storms and noticed a bunch of rake processes piling up.  Then I parsed the crontab that I had written:  Runs &lt;code&gt;rake seinfeld:update&lt;/code&gt; &lt;strong&gt;every minute&lt;/strong&gt;, on hours 0, 4, 8, 12, 16, 20, every day.&lt;/p&gt;

&lt;p&gt;Shit!  My intensive job scanning 400 github feeds was running 60 times every 4 hours.  So, the seeds of &lt;a href="http://cronwtf.github.com/"&gt;CronWTF&lt;/a&gt; were planted.  I wanted it browser based, so the library is pure javascript with no knowledge of browsers, frameworks, etc.  My next step is to make this accessible from the command line through spidermonkey.  I could even make it available to ruby apps through the &lt;a href="http://github.com/wycats/ruby-spidermonkey/tree"&gt;ruby/spidermonkey&lt;/a&gt; bridge.  I don’t know how it’d be useful, but who cares?&lt;/p&gt;
          </content></entry><entry><title type="text">How to get hired by ENTP</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/3/12/how-to-get-hired-by-entp" /><author><name>rick</name></author><updated>2009-03-12T13:19:49-07:00</updated><id>tag:techno-weenie.net,2009-03-12:14484</id><content type="html">
            &lt;p&gt;At ActiveReload, our question was “How good are you at Gears of War?”  &lt;a href="http://twitter.com/imagetic"&gt;Will&lt;/a&gt; qualified with flying colors (he was 100th &lt;em&gt;in the world&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/3/12/THUMB-xbox.jpg.jpeg" alt="xbox" /&gt;&lt;/p&gt;

&lt;p&gt;Last year as ENTP was starting, it was “How good are you at Rock Band?”  &lt;a href="http://twitter.com/towski"&gt;Towski&lt;/a&gt; impressed us with his killer Chris Cornell impersonation.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/3/12/THUMB-20080117-031616_004-1.jpg.jpeg" alt="rocking the house" /&gt;&lt;/p&gt;

&lt;p&gt;Now, we’re looking for that person with elite &lt;a href="http://www.korg.co.uk/products/dance_dj/kaossilator/kaossilator.asp"&gt;Korg Kaossilator&lt;/a&gt; experience.  Is that someone out there?&lt;/p&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/3/12/THUMB-kaos_01.jpg.jpeg" alt="korg kaossilator" /&gt;&lt;/p&gt;
          </content></entry><entry><title type="text">The Lie</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/2/9/the-lie" /><author><name>rick</name></author><updated>2009-02-09T17:35:43-08:00</updated><id>tag:techno-weenie.net,2009-02-09:14384</id><summary type="html">&lt;blockquote&gt;
    &lt;p&gt;“No, the problem isn’t you. Fixtures suck, and you were lied to.”&lt;br /&gt;
    – &lt;a href="http://blog.hasmanythrough.com/2009/2/7/the-tyranny-of-choice#comment_1134"&gt;Francis Hwang&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is correct.  This is exactly what the Rails Core team is going for:  &lt;/p&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/2/9/lost_abc_image__medium_.jpg.jpg" alt="John Locke" /&gt;&lt;/p&gt;

&lt;p&gt;Poor John Locke, protector of the island, pushing a damn button. &lt;/p&gt;</summary><content type="html">
            &lt;blockquote&gt;
    &lt;p&gt;“No, the problem isn’t you. Fixtures suck, and you were lied to.”&lt;br /&gt;
    – &lt;a href="http://blog.hasmanythrough.com/2009/2/7/the-tyranny-of-choice#comment_1134"&gt;Francis Hwang&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is correct.  This is exactly what the Rails Core team is going for:  &lt;/p&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/2/9/lost_abc_image__medium_.jpg.jpg" alt="John Locke" /&gt;&lt;/p&gt;

&lt;p&gt;Poor John Locke, protector of the island, pushing a damn button. &lt;/p&gt;
&lt;p&gt;I do agree with Francis on &lt;a href="http://fhwang.net/2009/02/09/On-fixtures-and-first-time-testers"&gt;about everything else&lt;/a&gt; though: Fixtures do suck, and testing is really fucking hard.  By the time you realize you’re getting into Fixture Hell, moving your monstrosity of an application off fixtures is a daunting task.  My solution (and currently the ENTP way): &lt;a href="http://github.com/notahat/machinist"&gt;Machinist&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The problem I’ve had with fixtures, is that having one large set means that tiny tweaks can break tests all over the place.  Also, working with YAML makes me a sad monkey.  &lt;a href="http://code.google.com/p/fixture-scenarios/"&gt;Fixture Scenarios&lt;/a&gt; helped solve the first problem, but not the second.  &lt;/p&gt;

&lt;p&gt;I then worked on &lt;a href="http://github.com/technoweenie/model_stubbing"&gt;Model Stubbing&lt;/a&gt;.  My idea was that I could introduce stubbing definitions (groups of sample data) with a rubyish syntax.  You could use a single stubbing definition for the app, or create one for a specific test case (from scratch, or by inheriting from an existing definition).  This flopped too.  Despite my efforts, this too dragged a project into Model Stubbing Hell.&lt;/p&gt;

&lt;p&gt;I’m not even going to get too much into the rspec mocking.  When I see code that stubs &lt;code&gt;find&lt;/code&gt; or &lt;code&gt;save&lt;/code&gt;, I cringe.  Though after talking with David a bit, this was more a case of something being lost in translation.  You should be replacing your mocks with live code once it’s implemented.  It’s a tool for ping-pong programming, not making your tests fast and fragile.&lt;/p&gt;

&lt;p&gt;So, this bring us to Machinist.  It doesn’t do anything magical, it just creates valid records based on a blueprint that you define:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Post.blueprint do
  title "Example Post"
  body  "Lorem ipsum dolor sit amet"
end

Comment.blueprint do
  post
  author { Sham.name }
  body   "Lorem ipsum dolor sit amet"
end&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The problem here, though, is that factories and manual record creations tend to slow down your tests greatly.  I try to use &lt;code&gt;before(:all)&lt;/code&gt; to help, but I definitely miss a lot of the work that fixtures go through to keep tests speedy.&lt;/p&gt;

&lt;p&gt;What can Rails do to help the situation?  Personally, I’d support the notion of dropping fixtures all together.  But, as someone that hasn’t used fixtures since before foxy fixtures were introduced, I’m not at all bothered by having to ignore them.  Though there is one solution:&lt;/p&gt;

&lt;p&gt;&lt;a&gt;Time Travel :)&lt;/a&gt; (linked for spoiler prevention)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Updated:&lt;/em&gt; Removed the season 5 spoiler… I figured any LOST junkie would’ve seen it already, but apparently some of you are more patient than I am.   &lt;/p&gt;
          </content></entry><entry><title type="text">Autoloading ActiveResource schemas</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/27/autoloading-activeresource-schemas" /><author><name>rick</name></author><updated>2009-01-27T13:05:38-08:00</updated><id>tag:techno-weenie.net,2009-01-27:14324</id><content type="html">
            &lt;p&gt;I just committed my first new Rails feature in months: &lt;a href="http://github.com/technoweenie/rails/commit/be73b3f250373a3b68a680cd7aef8c2116f0f905"&gt;Autoloading ActiveResource schemas&lt;/a&gt;.  Note: this is in my personal fork that’s up to date with the rails repo, and will probably be merged in for Rails 2.3.&lt;/p&gt;

&lt;p&gt;I’ve received some requests for this from people having problems using &lt;code&gt;Lighthouse::Ticket&lt;/code&gt; records with &lt;code&gt;form_for&lt;/code&gt; helpers in their Rails apps.  The idea is that resources can automatically load the starting XML just once, like the way ActiveRecord loads the schema from the database.  This is already part of the current Rails scaffolding:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
class PostsController &amp;lt; ApplicationController
  def new
    @post = Post.new
    respond_to do |format|
      format.html # new.html.erb
      format.xml { render :xml =&gt; @post }
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;There is one problem though, this probably won’t work for protected or nested actions.  Ideally a Rails app will set a top level route for the resource, and disable any before filters if &lt;code&gt;request.format.xml?&lt;/code&gt; is true.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
map.route 'tickets/new.:format', :controller =&gt; 'tickets', :action =&gt; 'new'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can get around this by modifying the &lt;code&gt;#schema&lt;/code&gt; hash directly, or calling &lt;code&gt;#reset_schema&lt;/code&gt; with your own prefixes.  Here’s a sample using the &lt;a href="http://github.com/Caged/lighthouse-api/tree/master"&gt;Lighthouse API lib&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
Lighthouse.account = 'entp'
Lighthouse.token = 'monkey'
Lighthouse::Ticket.reset_schema :project_id =&gt; 1

# or, use a well known public project
Lighthouse.account = 'rails'
Lighthouse::Ticket.reset_schema :project_id =&gt; 8994
Ticket.new # =&gt; #&amp;lt;Lighthouse::Ticket:0x1707898 @attributes={"permalink"=&gt;nil, "updated_at"=&gt;nil, "number"=&gt;nil, "title"=&gt;nil, "creator_id"=&gt;nil, "tag"=&gt;nil, "attachments_count"=&gt;0, "priority"=&gt;0, "closed"=&gt;false, "assigned_user_id"=&gt;nil, "user_id"=&gt;nil, "created_at"=&gt;nil, "state"=&gt;nil, "milestone_id"=&gt;nil}, @prefix_options={:project_id=&gt;8994}&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; I feel like this is more appropriate on Riding Rails, so I cross posted &lt;a href="http://weblog.rubyonrails.org/2009/1/27/autoloading-activeresource-schemas"&gt;there to get additional feedback&lt;/a&gt;.&lt;/p&gt;
          </content></entry><entry><title type="text">IsLOSTOnYet no longer a ghost town</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/21/islostonyet-no-longer-a-ghost-town" /><author><name>rick</name></author><updated>2009-01-21T12:00:09-08:00</updated><id>tag:techno-weenie.net,2009-01-21:14249</id><content type="html">
            &lt;p&gt;I pushed a little update last night that started filling the &lt;a href="http://islostonyet.com/"&gt;IsLOSTOnYet stream&lt;/a&gt; with a flurry of updates.  Where did all this come from?  &lt;a href="http://search.twitter.com/"&gt;search.twitter.com&lt;/a&gt;, courtesy of the &lt;a href="http://twitter.rubyforge.org/"&gt;twitter gem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The first stage of the code looked something like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
Twitter::Search.new("lost OR kate OR sayid OR jack").each do |s|
  ...
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This worked well, but it brought in a lot of false positives.  I got tweets about lost car keys, friends named Kate that aren’t fugitives rescued from a plane crash, etc.  So, I added a simple algorithm for only displaying relevant tweets.  Giles calls it the &lt;em&gt;automated brain&lt;/em&gt;.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A list of main keywords are defined:  &lt;code&gt;%w(kate sayid #lost)&lt;/code&gt;.  This is used to generate the twitter search query.  Normal words are worth 1 point, and #hashtags are worth two.&lt;/li&gt;
&lt;li&gt;a list of secondary keywords are defined: &lt;code&gt;%w(tv season island episode tonight)&lt;/code&gt;.  These words are only worth one point if a main keyword is in the post.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s how it looks (roughly):&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
def valid_search_result?(main_keywords, secondary_keywords)
  if main_keywords.nil? then return true ; end
  score          = 0
  downcased_body = body.downcase
  score += score_from downcased_body, main_keywords
  if score.zero? then return false ; end
  score += score_from downcased_body, secondary_keywords
  score &gt; 1
end

def score_from(downcased_body, words)
  return 0 if words.nil?
  score = 0
  words = words.dup
  words.each do |key|
    this_score = key =~ /^#/ ? 2 : 1 # hash keywords worth 2 points
    score += this_score if downcased_body =~ %r{(^|\s|\W)#{key}($|\s|\W)}
  end
  score
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It’s very basic, but it filters out a lot of the crap that the search was returning.  While it did let a few &lt;a href="http://twitter.com/m_greelish/status/1137083793"&gt;false positives&lt;/a&gt; in, it also managed to pick up &lt;a href="http://twitter.com/hooliagoolia/status/1137079994"&gt;tweets like this&lt;/a&gt;.  Here’s the &lt;a href="http://github.com/technoweenie/islostonyet.com/blob/d6c24774526c74e6181f9b7aa65ddcec6ca6ffa1/lib/is_lost_on_yet/post.rb#L132-140"&gt;actual implementation&lt;/a&gt; if you’re curious…&lt;/p&gt;
          </content></entry><entry><title type="text">Is [my show] on yet?</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/18/is-my-show-on-yet" /><author><name>rick</name></author><updated>2009-01-18T12:27:15-08:00</updated><id>tag:techno-weenie.net,2009-01-18:14228</id><content type="html">
            &lt;p&gt;Not long after I first deployed &lt;a href="http://islostonyet.com"&gt;isLOSTonyet&lt;/a&gt;, &lt;a href="http://twitter.com/seaofclouds"&gt;seaofclouds&lt;/a&gt; sent me a github message about his own LOST countdown site.   I explained my grand vision for my site, and suggested we join forces.  Luckily, he too liked the idea of tracking fellow LOST geeks on Twitter, and was able come up with a beautiful design for the new site.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://techno-weenie.net/assets/2009/1/18/Is_LOST__Season_5__on_yet_.jpg" alt="is lost on yet? screenshot" /&gt;&lt;/p&gt;

&lt;p&gt;Yes, that is a custom drawn polar bear.  Awesome.&lt;/p&gt;

&lt;p&gt;The site got a major upgrade on my flight back from my holiday trip.  Instead of relying on a static response to the countdown, the site sifts through a listing of episodes to find the next one.  &lt;a href="http://github.com/technoweenie/islostonyet.com/blob/5b937afcdbb7f3e31f243cf6416c6d834b8c1e66/lib/is_lost_on_yet/post.rb#L20-44"&gt;Writing a twitter bot&lt;/a&gt; is also extremely easy now that all the api calls support the since_id parameter.  I still wish that Twitter would give us http callback support, though.&lt;/p&gt;

&lt;p&gt;While developing IsLOSTOnYet, we realized BSG was coming back last week, and was able to deploy a companion &lt;a href="http://isbsgonyet.com/"&gt;IsBSGOnYet&lt;/a&gt; site too.  There’s a 24 themed one coming too…  &lt;/p&gt;

&lt;p&gt;If you’re a hardcore fan of any of these shows, I hope you’re able to participate and get some enjoyment out of it.&lt;/p&gt;
          </content></entry><entry><title type="text">Hint</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/8/hint" /><author><name>rick</name></author><updated>2009-01-08T00:30:50-08:00</updated><id>tag:techno-weenie.net,2009-01-08:14182</id><content type="html">
            &lt;p&gt;&lt;a href="https://twitter.com/home?status=@islostonyet?"&gt;@islostonyet?&lt;/a&gt;&lt;/p&gt;
          </content></entry><entry><title type="text">Tracking Fork Queue commits</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/8/tracking-fork-queue-commits" /><author><name>rick</name></author><updated>2009-01-07T20:58:54-08:00</updated><id>tag:techno-weenie.net,2009-01-08:14180</id><content type="html">
            &lt;p&gt;At first I was all &lt;strong&gt;:(&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;- if entry.title.downcase =~ %r{^#{login.downcase} (pushed|committed)}
+ if entry.title.downcase =~ %r{^#{login.downcase} (pushed|committed|applied fork commits)}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then I was like ”&lt;a href="http://github.com/entp/seinfeld/commit/093224b5b745f3c681ce4f60fc25c7a64fa2b5ec"&gt;git push origin master&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;And now I’m like &lt;a href="http://calendaraboutnothing.com/~technoweenie"&gt;&lt;strong&gt;:)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
          </content></entry><entry><title type="text">path to * mastery</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/6/path-to-mastery" /><author><name>rick</name></author><updated>2009-01-05T22:12:11-08:00</updated><id>tag:techno-weenie.net,2009-01-06:14172</id><content type="html">
            &lt;p&gt;I’ve been keeping up with the &lt;a href="http://rubylearning.com/blog/2009/01/06/little-known-ways-to-ruby-mastery-by-josh-susser/"&gt;Little Known Ways to Ruby Mastery series&lt;/a&gt;.  They all cover some very important topics: such as contributing to open source, keeping up a blog, and learning the standard library.  But there are a couple things I haven’t seen anyone touch on:&lt;/p&gt;

&lt;h3&gt;Break your code&lt;/h3&gt;

&lt;p&gt;Tutorials tend to go by the assumption that the listed code works as advertised, and that you’ll be massively productive.  That rarely happens to be the case.  There are many times when little edge cases make the code blow up in strange ways.  Don’t panic, just learn how to debug the errors and fix the issue.  I don’t mean just commenting out enough code until it starts working, but actually finding the root of the error.  &lt;/p&gt;

&lt;p&gt;Just today, I saw an issue where some background queue code wasn’t working right when started from a rake task.  However, it worked great in production, and the tests all passed.  Rather than just noting that I needed to run the task in production mode somewhere, I researched the issue the found the cause.  As a result, I know my framework a little better, and was able to modify the code so this heisenbug doesn’t rear its ugly head again.&lt;/p&gt;

&lt;h3&gt;Help a newb&lt;/h3&gt;

&lt;p&gt;Don’t wait until you’ve been promoted to &lt;em&gt;Ruby Master&lt;/em&gt; to help people out.  Start on day 1.  Take someone’s question as an opportunity explore another part of the code that you normally wouldn’t, and learn something new.  I spent a lot of time in my early rails days on irc helping folks out.  There are of course various forums, google groups, and even &lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt; full of people needing help.  Stack Overflow is a really good example that encourages users helping each other with the karma and badge system. &lt;/p&gt;
          </content></entry><entry><title type="text">a case study</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/6/a-case-study" /><author><name>rick</name></author><updated>2009-01-05T21:17:20-08:00</updated><id>tag:techno-weenie.net,2009-01-06:14171</id><content type="html">
            &lt;p&gt;&lt;a href="http://twitter.com/technoweenie/statuses/1098772146"&gt;&lt;img src="http://techno-weenie.net/assets/2009/1/6/20090106-x7wjw8kjtsp23wk3xsbcsw5acs.jpg" alt="A case study of the similarity between my new blog design and Josh Susser's" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Apparently I can replicate &lt;a href="http://blog.hasmanythrough.com"&gt;Josh Susser’s blog layout&lt;/a&gt;, but that doesn’t make any of my entries any more interesting :)&lt;/p&gt;
          </content></entry><entry><title type="text">reboot</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/3/reboot" /><author><name>rick</name></author><updated>2009-01-03T16:11:50-08:00</updated><id>tag:techno-weenie.net,2009-01-03:14164</id><summary type="html">&lt;p&gt;My blog had been running on an ancient web host account for years without incident, when one day, my mongrels collapsed.  However, I was extremely busy, and even a little apathetic towards the site.  The holiday break gave me a chance to move it the content over to a modern install of Mephisto.  If you’re actually &lt;em&gt;visiting&lt;/em&gt; the site, you’ll notice I even barreled through a new CSS setup with &lt;a href="http://www.blueprintcss.org/"&gt;Blueprint&lt;/a&gt; as my wingman.  However, I’m still missing some things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comments didn’t make it over for some reason.   Ugh, that’ll be fun to hook up.&lt;/li&gt;
&lt;li&gt;&amp;lt;s&gt;Assets are busted.  Probably some web server configuration settings that need to be tweaked.&amp;lt;/s&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;s&gt;Archives and Search:  Mephisto actually has decent support for this, so why not take advantage?&amp;lt;/s&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I guess you could call this a New Year’s resolution, as lame as that sounds.  I just feel like my &lt;a href="http://omgbloglol.com/"&gt;coworkers&lt;/a&gt; &lt;a href="http://warpspire.com/"&gt;have&lt;/a&gt; &lt;a href="http://gilesbowkett.blogspot.com/"&gt;been&lt;/a&gt; &lt;a href="http://blog.caboo.se/"&gt;kicking&lt;/a&gt; &lt;a href="http://anarchogeek.com/"&gt;ass&lt;/a&gt; at the blogging thing, so I feel like I should put forth some effort.&lt;/p&gt;

&lt;p&gt;As a little &lt;a href="http://mephistoblog.com"&gt;Mephisto&lt;/a&gt; related bonus…&lt;/p&gt;</summary><content type="html">
            &lt;p&gt;My blog had been running on an ancient web host account for years without incident, when one day, my mongrels collapsed.  However, I was extremely busy, and even a little apathetic towards the site.  The holiday break gave me a chance to move it the content over to a modern install of Mephisto.  If you’re actually &lt;em&gt;visiting&lt;/em&gt; the site, you’ll notice I even barreled through a new CSS setup with &lt;a href="http://www.blueprintcss.org/"&gt;Blueprint&lt;/a&gt; as my wingman.  However, I’m still missing some things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comments didn’t make it over for some reason.   Ugh, that’ll be fun to hook up.&lt;/li&gt;
&lt;li&gt;&amp;lt;s&gt;Assets are busted.  Probably some web server configuration settings that need to be tweaked.&amp;lt;/s&gt;&lt;/li&gt;
&lt;li&gt;&amp;lt;s&gt;Archives and Search:  Mephisto actually has decent support for this, so why not take advantage?&amp;lt;/s&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I guess you could call this a New Year’s resolution, as lame as that sounds.  I just feel like my &lt;a href="http://omgbloglol.com/"&gt;coworkers&lt;/a&gt; &lt;a href="http://warpspire.com/"&gt;have&lt;/a&gt; &lt;a href="http://gilesbowkett.blogspot.com/"&gt;been&lt;/a&gt; &lt;a href="http://blog.caboo.se/"&gt;kicking&lt;/a&gt; &lt;a href="http://anarchogeek.com/"&gt;ass&lt;/a&gt; at the blogging thing, so I feel like I should put forth some effort.&lt;/p&gt;

&lt;p&gt;As a little &lt;a href="http://mephistoblog.com"&gt;Mephisto&lt;/a&gt; related bonus…&lt;/p&gt;
&lt;p&gt;Here’s how to generate the archive listing at the bottom:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;
&amp;lt;div id="archives"&gt;
  {% for m in site.home_section.months %}
    {{ m | strftime: "%Y" | assign_to: 'current_year' }}
    {% if displayed_year != current_year %}
      {% if displayed_year %}
        &amp;lt;/div&gt;
      {% endif %}
      &amp;lt;div class="archive-year"&gt;
      &amp;lt;h4&gt;{{ current_year }}&amp;lt;/h4&gt;
    {% endif %}
    &amp;lt;a href="{{ site.home_section | monthly_url: m }}"&gt;{{ m | strftime: "%m" }}&lt;/a&gt;
    {{ current_year | assign_to: 'displayed_year' }}
  {% endfor %}
  &amp;lt;/div&gt;
&amp;lt;/div&gt;
&lt;/code&gt;&lt;/pre&gt;
          </content></entry><entry><title type="text">is LOST on yet?</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/2/is-lost-on-yet" /><author><name>rick</name></author><updated>2009-01-03T15:40:27-08:00</updated><id>tag:techno-weenie.net,2009-01-02:14154</id><content type="html">
            &lt;p&gt;I needed to know, so I wrote one of those trendy single page apps: &lt;a href="http://islostonyet.com/"&gt;is LOST on yet?&lt;/a&gt;.  Naturally, the source &lt;a href="http://github.com/technoweenie/islostonyet.com/tree/master"&gt;is on github&lt;/a&gt;.  It’s really pretty amazing actually:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;def is_lost_on_yet?
  @is_lost_on_yet ||= {:answer =&amp;gt; "no", :reason =&amp;gt; "returns on Jan 21st, 9PM ET"}
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I have about 20 days to finish the site :)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update:&lt;/em&gt; I forgot to mention, it even has &lt;a href="http://islostonyet.com/json?callback=foo"&gt;JSON support&lt;/a&gt;!  &lt;/p&gt;
          </content></entry><entry><title type="text">Hiatus over</title><link rel="alternate" type="text/html" href="http://techno-weenie.net/2009/1/1/hiatus-over" /><author><name>rick</name></author><updated>2009-01-01T17:55:15-08:00</updated><id>tag:techno-weenie.net,2009-01-01:14148</id><content type="html">
            &lt;p&gt;Happy New Year, and all that usual shit people say to each other.  I hope everyone had a great holiday vacation, and will be ready to come back next week &lt;strong&gt;supercharged&lt;/strong&gt;.  Hopefully you're ready to &lt;a href="http://gilesbowkett.blogspot.com/2008/12/no-new-language-in-2009-new-habits.html"&gt;start some new habits&lt;/a&gt; or &lt;a href="http://calendaraboutnothing.com/"&gt;continue your old ones&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You may notice some tweaks with the &lt;a href="http://calendaraboutnothing.com/"&gt;CalendarAboutNothing&lt;/a&gt; now, by the way.  Github tweaked the feeds, and now push events for non-master branches are shown in the events.  Some people noticed that they were missing X's for days with pushes, so I re-scanned everyone's history.  If you've deleted a repository with a substantial number of commits, those days may now be empty (sorry &lt;a href="http://calendaraboutnothing.com/~mattly"&gt;matt&lt;/a&gt;!).  I've also added some debug code  that should clue me into what causes the large jumps in streaks.  Hopefully I can get that stupid bug squashed soon.&lt;/p&gt;
          </content></entry></feed>
