<?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>Will's Web Miscellany &#187; Programming</title>
	<atom:link href="http://willj.net/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://willj.net</link>
	<description>will.thoughts.pop</description>
	<lastBuildDate>Wed, 11 Aug 2010 09:50:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Basic zeroMQ Ruby example</title>
		<link>http://willj.net/2010/08/01/basic-zero-mq-ruby-example/</link>
		<comments>http://willj.net/2010/08/01/basic-zero-mq-ruby-example/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 23:58:16 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[zeroMQ]]></category>

		<guid isPermaLink="false">http://willj.net/?p=738</guid>
		<description><![CDATA[Update: As Jake pointed out in the comments you obviously need zero MQ installed for this example to work. Just &#8216;brew install zeromq&#8217; or &#8216;port install zmq&#8217; on OS X, or use your Linux package manager. I couldn&#8217;t find may examples of zeroMQ usage in Ruby so here is a basic sender/consumer I made to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: As Jake pointed out in the comments you obviously need zero MQ installed for this example to work. Just &#8216;brew install zeromq&#8217; or &#8216;port install zmq&#8217; on OS X, or use your Linux package manager.</p>
<p>I couldn&#8217;t find may examples of zeroMQ usage in Ruby so here is a basic sender/consumer I made to test it. First install the &#8216;zmq&#8217; gem:</p>
<p><code>gem install zmq --no-ri --no-rdoc</code></p>
<p>Now start a worker, you can start as many as you want:</p>
<p><script src="http://gist.github.com/502689.js?file=recv.rb"></script></p>
<p>Now stick some messages on the queue:</p>
<p><script src="http://gist.github.com/502689.js?file=send.rb"></script></p>
<p>You should get messages distributed to all the worker processes you started up. Pretty simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2010/08/01/basic-zero-mq-ruby-example/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>map-reduce using mongoid</title>
		<link>http://willj.net/2010/07/12/map-reduce-using-mongoid/</link>
		<comments>http://willj.net/2010/07/12/map-reduce-using-mongoid/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 23:31:19 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[mongoid]]></category>

		<guid isPermaLink="false">http://willj.net/?p=735</guid>
		<description><![CDATA[It took me a while to work out how to use map-reduce in Ruby using mongoid so I thought I&#8217;d share it here in-case it helps anyone else get there quicker. I start out with a model that includes Mongoid::Document: To map-reduce across the collection I need to define a map and reduce function in [...]]]></description>
			<content:encoded><![CDATA[<p>It took me a while to work out how to use map-reduce in Ruby using mongoid so I thought I&#8217;d share it here in-case it helps anyone else get there quicker. I start out with a model that includes Mongoid::Document:</p>
<p><script src="http://gist.github.com/471933.js?file=gistfile1.rb"></script></p>
<p>To map-reduce across the collection I need to define a map and reduce function in javascript then run the on the collection:</p>
<p><script src="http://gist.github.com/471936.js?file=gistfile1.rb"></script></p>
<p>I can roll this into my VisitorSession model:</p>
<p><script src="http://gist.github.com/471938.js?file=gistfile1.rb"></script></p>
<p>This obviously makes it easier to call:</p>
<p><code>>> VisitorSession.first(:conditions => {:project_id => '2f5178'}).visits_for_project<br />
=> 1</code></p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2010/07/12/map-reduce-using-mongoid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>fixing the rspec2 and rails3 &#8220;there is already a transaction in progress&#8221; error</title>
		<link>http://willj.net/2010/07/08/fixing-the-rspec2-and-rails3-there-is-already-a-transaction-in-progress-error/</link>
		<comments>http://willj.net/2010/07/08/fixing-the-rspec2-and-rails3-there-is-already-a-transaction-in-progress-error/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 21:15:52 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[rspec-rails]]></category>

		<guid isPermaLink="false">http://willj.net/?p=719</guid>
		<description><![CDATA[I upgraded an app to rspec2 and rails3 recently and ran into a problem. I run each test in a transaction which rolls back after each test has finished. This works fine normally, but It seemed that after the upgrade the first failing test would cause this per-test transaction to not get rolled back so [...]]]></description>
			<content:encoded><![CDATA[<p>I upgraded an app to rspec2 and rails3 recently and ran into a problem. I run each test in a transaction which rolls back after each test has finished. This works fine normally, but It seemed that after the upgrade the first failing test would cause this per-test transaction to not get rolled back so all the subsequent tests would run in the same transaction.</p>
<p>This caused the tests so fail with validation errors as test data was getting re-inserted, and a validates_uniqueness_of validation was complaining each time, note the second failing test, this test should have passed but failed with a &#8220;Validation failed: Name has already been taken&#8221; error:</p>
<p><script src="http://gist.github.com/468605.js?file=gistfile1.txt"></script></p>
<p>It turns out that what was actually happening was that an exception raised in the after(:each) block was causing the rollback to fail and the failing test was just masking the error. This was my after(:each) block:</p>
<p><script src="http://gist.github.com/468617.js?file=gistfile1.rb"></script></p>
<p>This code fails when there is no directory to remove and though this worked fine in the older version of rspec (rspec just ignored the error) with rspec2 it caused the issues discussed above. The solution (because I don&#8217;t care if the file exists or not before I delete it) is as simple as adding a condition:</p>
<p><script src="http://gist.github.com/468634.js?file=gistfile1.rb"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2010/07/08/fixing-the-rspec2-and-rails3-there-is-already-a-transaction-in-progress-error/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flushing memcached servers from Ruby</title>
		<link>http://willj.net/2010/01/08/flushing-memcached-servers-from-ruby/</link>
		<comments>http://willj.net/2010/01/08/flushing-memcached-servers-from-ruby/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 12:25:26 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[memcached]]></category>

		<guid isPermaLink="false">http://willj.net/?p=655</guid>
		<description><![CDATA[In Flushing memcached servers the easy way I highlighted a way to flush a memcached server without restarting it: $ echo ”flush_all” &#124; nc localhost 11211 However I almost never use the actual shell version of this, mostly I do the equivalent in Ruby by opening up a socket and communicating through that. Here&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>In <a title="Flushing memcached" href="http://willj.net/2008/06/10/flushing-memcached-servers-the-easy-way/">Flushing memcached servers the easy way</a> I highlighted a way to flush a memcached server without restarting it:</p>
<p><code>$ echo ”flush_all” | nc localhost 11211</code></p>
<p>However I almost never use the actual shell version of this, mostly I do the equivalent in Ruby by opening up a socket and communicating through that. Here&#8217;s a simple example:</p>
<p><code> socket = TCPSocket.new( '127.0.0.1', 11211 )<br />
socket.write( "flush_all\r\n" )<br />
result =  socket.recv(2)<br />
puts "Success!" if result == 'OK'<br />
socket.close</code></p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2010/01/08/flushing-memcached-servers-from-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Optimising the Recycling Group Finder &#8211; Making a Ruby on Rails app faster</title>
		<link>http://willj.net/2009/10/17/optimising-the-recycling-group-finder-making-a-ruby-on-rails-app-faster/</link>
		<comments>http://willj.net/2009/10/17/optimising-the-recycling-group-finder-making-a-ruby-on-rails-app-faster/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 15:34:26 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[finder]]></category>

		<guid isPermaLink="false">http://willj.net/?p=608</guid>
		<description><![CDATA[This is really just the &#8216;story&#8217; of how I fixed a very slight performance issue with the Recycling Group Finder site that I run, but I figured it would be worth a post as an example or motivation to anyone else who needs to get started investigating their own Ruby on Rails app performance issues. [...]]]></description>
			<content:encoded><![CDATA[<p>This is really just the &#8216;story&#8217; of how I fixed a very slight performance issue with the <a title="Recycling Group Finder" href="http://recyclinggroupfinder.com/">Recycling Group Finder</a> site that I run, but I figured it would be worth a post as an example or motivation to anyone else who needs to get started investigating their own Ruby on Rails app performance issues.</p>
<h2>The performance problem</h2>
<p>I&#8217;ve been very happy with the responsiveness of the <a title="Recycling Group Finder" href="http://recyclinggroupfinder.com/">Recycling Group Finder</a>, so just out of interest, just to see what it would tell me, I installed the NewRelic RPM plugin and activated the free Bronze account available to EngineYard customers. The results were pretty satisfying as my average response time for the most popular page was 163ms maximum with the second most popular page at 90ms. Those are good response times and fall well within the <a title="37signals page responsiveness rule" href="http://37signals.com/svn/posts/1506-making-highrise-faster-with-memcached">37signals response time rule</a>:</p>
<blockquote><p>Our general rule of thumb is that most pages should render their HTML on the server in less than 200ms and almost all in less than 500ms.</p></blockquote>
<h2>Suspicious looking</h2>
<p><span>One of the great things about <a title="Flowing Data visualisations" href="http://flowingdata.com/category/visualization/">data visualisations</a> is it can make it really easy to spot patterns. Take this New Relic graph for example:</span></p>
<div id="attachment_610" class="wp-caption alignnone" style="width: 523px"><a href="http://willj.net/wp-content/uploads/2009/10/Recycling-Group-Finder-before-optimisation.jpg"><img class="size-full wp-image-610 " title="Recycling Group Finder - before optimisation" src="http://willj.net/wp-content/uploads/2009/10/Recycling-Group-Finder-before-optimisation.jpg" alt="Recycling Group Finder - graph, before optimisation" width="513" height="178" /></a><p class="wp-caption-text">Recycling Group Finder - before optimisation</p></div>
<p>The yellow on the graph represents time spent in the database, the blue is time spent in Ruby, ie. rendering, controllers etc. Memcached accesses are on there too but they&#8217;re so fast they hardly appear. This graph looked suspicious to me, I&#8217;d normally expect database time to be a much smaller proportion of the overall request time. So it looks like there may be some optimisation that can be done, but in order to optimise I first need to know <em>what</em> to optimise.</p>
<h2>The hunt</h2>
<p>Google for &#8220;<a title="Rules of optimisation" href="http://c2.com/cgi/wiki?RulesOfOptimization">rules</a> <a title="Rules of optimisation" href="http://www.cs.cmu.edu/~jch/java/rules.html">of</a> <a title="Rules of optimisation" href="http://perlbuzz.com/mechanix/2008/02/the-rules-of-optimization-club.html">optimisation</a>&#8220;. Most rules are something like this:</p>
<ol>
<li>Don&#8217;t optimise yet</li>
<li>If you <em>need</em> to optimise, profile first.</li>
</ol>
<p>I&#8217;m never going to be able to optimise my code unless I know what to optimise. If I trawl through looking for places that <em>might</em> be slow and trying to make them faster the chances are I&#8217;m going to spend hours changing code for no benefit. I might even make it slower. I need to know exactly where the bottleneck is, I need to profile my code.</p>
<p>There are a bunch of ways of finding out where your code is slow and I&#8217;ve personally used <a title="ruby-prof" href="http://ruby-prof.rubyforge.org/">ruby-prof</a> before with good results. However I know that the issue here is in the database, and I know that <a title="Rack::Bug" href="http://www.brynary.com/2009/4/22/rack-bug-debugging-toolbar-in-four-minutes">Rack::Bug</a> will show me SQL queries that have run for an action, and importantly how long they took, so that&#8217;s what I&#8217;m going to try first. I install the plugin, configure it and load it up. The issue is immediately obvious:</p>
<div id="attachment_619" class="wp-caption alignnone" style="width: 509px"><a href="http://willj.net/wp-content/uploads/2009/10/rack_bug.jpg"><img class="size-full wp-image-619  " title="Recycling Group Finder - Rack::Bug SQL queries" src="http://willj.net/wp-content/uploads/2009/10/rack_bug.jpg" alt="Recycling Group Finder - Rack::Bug SQL queries" width="499" height="200" /></a><p class="wp-caption-text">Recycling Group Finder - Rack::Bug SQL queries</p></div>
<p>Almost all of the SQL that is executed is under 0.5ms per query, there are a few queries at ~4ms but he one query that really stands out is the third one down. At 44.75ms it is more than half of the overall SQL time. Bingo! Now I know <em>what</em> is slow I need to know <em>why</em> it is slow. Time to break out the query analyser.</p>
<h2>Fixing it</h2>
<p>I needed to dig deeper into that SQL statement to see what it was doing, so I opened up a postgres shell and ran an <code>explain analyse</code> on the query:</p>
<p><script src="http://gist.github.com/212315.js"></script></p>
<p>The issue seems pretty clear. There is a Sequential scan on groups:</p>
<p><code>Seq Scan on groups  (cost=0.00..626.75 rows=4885 width=363) (actual time=0.038..26.495 rows=5126 loops=1)</code></p>
<p>A Sequential scan on a large table is going to sink performance. I can see that the sequential scan is definitely the issue in this case as the cost and time taken are significant proportions of the overall query time. I need to eliminate it. Here&#8217;s the code that generates that query:</p>
<p><code>@groups = Group.find(:all, :include =&gt; :group_page, :origin =&gt; [@location.lat, @location.lng], :limit =&gt; 30, :conditions =&gt; ["defunct = false AND lat is not null and lng is not null and full_address is not null and full_address != '' and country_code = ?", @location.country_code], :order =&gt; 'distance ASC, num_members DESC')</code></p>
<p>I wrote this code ages ago and re-reading it now I can see that although I am limiting the returned results to 30 rows the query will have to hit every row in the table to determine which rows are in the returned 30 as there are no conditions to the query. Whoops. Looking over the <a title="Geokit" href="http://geokit.rubyforge.org/">Geokit docs</a> I see there&#8217;s a <code>:within</code> condition so I added a <code>:within =&gt; 100 </code>to the find. Testing the resultant query in the postgres shell using <code>explain analyse</code> again and the query has dropped to 10ms. Not bad but it&#8217;s still using a sequential scan. Adding an index on the conditions speeds up the query further to ~1.2ms:</p>
<p><script src="http://gist.github.com/212319.js"></script></p>
<p>Not bad when it started out at nearly 45ms. Here is the result reflected in the New Relic graph:</p>
<div id="attachment_614" class="wp-caption alignnone" style="width: 529px"><a href="http://willj.net/wp-content/uploads/2009/10/Recycling-Group-Finder-after-optimisation.jpg"><img class="size-full wp-image-614 " title="Recycling Group Finder - After optimisation" src="http://willj.net/wp-content/uploads/2009/10/Recycling-Group-Finder-after-optimisation.jpg" alt="Recycling Group Finder - After optimisation" width="519" height="175" /></a><p class="wp-caption-text">Recycling Group Finder - after optimisation</p></div>
<p>I deployed the new code approximately in the middle of the graph, it should be pretty obvious where.</p>
<h2>Conclusion</h2>
<p>Before you can optimise your Ruby on Rails app (or your app in any other framework/language for that matter) you need to know know <em>where</em> to optimise. Tools like Rack::Bug and NewRelic allow you to do this effectively and easily allowing you to direct your attention only on those parts of your app that need the attention.</p>
<p>On the <a title="Recycling Group Finder" href="http://recyclinggroupfinder.com/">Recycling Group Finder</a> I cut response times drastically in about half an hour. Without knowing exactly where to make the change I would have been left guessing and may never have made the optimisation I did.</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2009/10/17/optimising-the-recycling-group-finder-making-a-ruby-on-rails-app-faster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looking for a Web-Development job? Learn Ruby and Ruby on Rails</title>
		<link>http://willj.net/2009/10/12/looking-for-a-web-development-job-learn-ruby-and-ruby-on-rails/</link>
		<comments>http://willj.net/2009/10/12/looking-for-a-web-development-job-learn-ruby-and-ruby-on-rails/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 22:22:47 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://willj.net/?p=590</guid>
		<description><![CDATA[Seriously. Not only will you be able to develop web-applications faster and with more joy, but if you fill some of the many Ruby on Rails job vacancies there are going the recruiters might stop bugging me so often. There are Ruby on Rails jobs out there Or that&#8217;s what is seems like from talking [...]]]></description>
			<content:encoded><![CDATA[<p>Seriously. Not only will you be able to develop web-applications faster and with more joy, but if you fill some of the many Ruby on Rails job vacancies there are going the recruiters might stop bugging me so often.</p>
<h3>There are Ruby on Rails jobs out there</h3>
<p>Or that&#8217;s what is seems like from talking to people at the <a title="NWRUG" href="http://nwrug.org/">NWRUG</a> and <a title="Geekup" href="http://geekup.org/">Geekup</a> meetings I go to and by the phone calls I get from recruitment agents. I know of companies worried about using Ruby and Rails because of concerns over the number of developers available. These companies need <em>you</em> and they need you to write web applications for them in <strong>Ruby on Rails</strong>! These are companies who want to use Ruby on Rails and they will hire you if you learn it.</p>
<h3>I&#8217;m fine sticking with $some_other_language but thanks anyway</h3>
<p>That&#8217;s fine, there are lots of jobs available using your programming language. Well, maybe not if that language is Coldfusion. But if you expand your horizons, teach yourself something new and can prove to others that you&#8217;re interested in and capable of learning then you&#8217;re going to be a more valuable asset. That&#8217;s going to translate into more pay and a more fulfilling job using a language as expressive as Ruby and a framework as labor-saving as Ruby on Rails.</p>
<p>Worst case scenario is that you learn Ruby on Rails and you can write your own web-apps a whole lot faster (you <em>do</em> write your own web-apps right?), your CV looks better and you have more time for the dull stuff that you fit around programming. Watching Buffy or something. You know, programmer social life stuff.</p>
<h3>I tried Ruby and Ruby on Rails already but I prefer Python…</h3>
<p>Weirdo.</p>
<h3>I tried Ruby and Ruby on Rails already but I prefer Cobol!</h3>
<p>You don&#8217;t exist, go away.</p>
<h3>You were thoroughly convincing, I&#8217;m sold</h3>
<p>This post is so convincing that when I proof read it I nearly went and learned ruby on Rails myself, even though I already know it. If you want to you learn you can <a title="Learn Rails" href="http://weblog.rubyonrails.org/2009/8/3/how-do-i-learn-ruby-rails">start here</a>, and there&#8217;s going to be a local Ruby user in your area somewhere, sign up to their mailing list, we&#8217;re a pretty helpful bunch.</p>
<p>If you&#8217;re anywhere near Manchester, UK then <a title="NWRUG October 09" href="http://nwrug.org/events/october09/">come along to the next NWRUG meeting</a>, it&#8217;s this Thursday and there&#8217;s free pizza. You need to sign up to attend.</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2009/10/12/looking-for-a-web-development-job-learn-ruby-and-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Nothing left to take away</title>
		<link>http://willj.net/2009/08/07/nothing-left-to-take-away/</link>
		<comments>http://willj.net/2009/08/07/nothing-left-to-take-away/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 12:29:54 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://willj.net/?p=568</guid>
		<description><![CDATA[Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. — Antoine de Saint-Exupéry Coding often feels like this.]]></description>
			<content:encoded><![CDATA[<p style="padding-left: 30px;">Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.<br />
— Antoine de Saint-Exupéry</p>
<p>Coding often feels like this.</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2009/08/07/nothing-left-to-take-away/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whiny git &#8211; getting rid of the &#8216;You did not specify any refspecs&#8217; error</title>
		<link>http://willj.net/2009/07/19/whiny-git-getting-rid-of-the-you-did-not-specify-any-refspecs-error/</link>
		<comments>http://willj.net/2009/07/19/whiny-git-getting-rid-of-the-you-did-not-specify-any-refspecs-error/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 12:48:50 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://willj.net/?p=550</guid>
		<description><![CDATA[Newer versions of git will complain if you just do a git push in your current branch to push it to a remote: pleb:funpop will$ git push warning: You did not specify any refspecs to push, and the current remote warning: has not configured any push refspecs. The default action in this warning: case is [...]]]></description>
			<content:encoded><![CDATA[<p>Newer versions of git will complain if you just do a</p>
<p><code>git push</code></p>
<p>in your current branch to push it to a remote:</p>
<p><code> pleb:funpop will$ git push<br />
warning: You did not specify any refspecs to push, and the current remote<br />
warning: has not configured any push refspecs. The default action in this<br />
warning: case is to push all matching refspecs, that is, all branches<br />
warning: that exist both locally and remotely will be updated.  This may<br />
warning: not necessarily be what you want to happen.<br />
warning:<br />
warning: You can specify what action you want to take in this case, and<br />
warning: avoid seeing this message again, by configuring 'push.default' to:<br />
warning:   'nothing'  : Do not push anything<br />
warning:   'matching' : Push all matching branches (default)<br />
warning:   'tracking' : Push the current branch to whatever it is tracking<br />
warning:   'current'  : Push the current branch<br />
Counting objects: 37, done.<br />
Delta compression using up to 2 threads.<br />
Compressing objects: 100% (20/20), done.<br />
Writing objects: 100% (21/21), 4.58 KiB, done.<br />
Total 21 (delta 11), reused 0 (delta 0)<br />
To git@github.com:wjessop/Funpop.git<br />
e9ca06a..5507c19  master -&gt; master</code></p>
<p>You can get rid of this by just doing:</p>
<p><code>git config --add push.default current</code></p>
<p>and now git will work like it did before, without the noise.</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2009/07/19/whiny-git-getting-rid-of-the-you-did-not-specify-any-refspecs-error/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>NWRUG Code Surgery and an introduction to Zsh &#8211; Tonight</title>
		<link>http://willj.net/2009/06/18/nwrug-code-surgery-and-an-introduction-to-zsh-tonight/</link>
		<comments>http://willj.net/2009/06/18/nwrug-code-surgery-and-an-introduction-to-zsh-tonight/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 12:20:19 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[NWRUG]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://willj.net/?p=542</guid>
		<description><![CDATA[the June NWRUG is tonight. There will be a code surgery and introduction to Zsh. Plus free pizza! Email me or leave a comment to sign up.]]></description>
			<content:encoded><![CDATA[<p>the <a title="June NWRUG" href="http://nwrug.org/events/june09/">June NWRUG is tonight</a>. There will be a code surgery and introduction to Zsh. Plus free pizza!</p>
<p>Email me or leave a comment to sign up.</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2009/06/18/nwrug-code-surgery-and-an-introduction-to-zsh-tonight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocking Internet Explorer 5.5</title>
		<link>http://willj.net/2009/06/15/blocking-internet-explorer-55/</link>
		<comments>http://willj.net/2009/06/15/blocking-internet-explorer-55/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 21:08:49 +0000</pubDate>
		<dc:creator>Will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[rack]]></category>

		<guid isPermaLink="false">http://willj.net/?p=502</guid>
		<description><![CDATA[IE 5.5 is dead. The number of people using it are tiny, at least according to the stats on the most popular sites I run. Here are the numbers. Jokes-o-matic Has a larger proportion of Firefox users than Internet Explorer users due to the high level of traffic from some social bookmarking sites, meaning a [...]]]></description>
			<content:encoded><![CDATA[<p>IE 5.5 is dead. The number of people using it are tiny, at least according to the stats on the most popular sites I run. Here are the numbers.</p>
<h3><a title="jokes site" href="http://jokes-o-matic.com/">Jokes-o-matic<br />
</a></h3>
<p>Has a larger proportion of Firefox users than Internet Explorer users due to the high level of traffic from some social bookmarking sites, meaning a more web-savvy crowd who are more likely to be using alternative browsers:</p>
<div id="attachment_505" class="wp-caption alignnone" style="width: 565px"><img class="size-full wp-image-505" title="jokes-o-matic.com browser breakdown" src="http://willj.net/wp-content/uploads/2009/06/picture-1.png" alt="jokes-o-matic.com browser breakdown" width="555" height="100" /><p class="wp-caption-text">jokes-o-matic.com browser breakdown</p></div>
<p>The level of IE usage is still pretty high though, but even so only a single hit from IE 5.5 recently:</p>
<div id="attachment_506" class="wp-caption alignnone" style="width: 562px"><img class="size-full wp-image-506" title="jokes-o-matic.com IE versions" src="http://willj.net/wp-content/uploads/2009/06/picture-4.png" alt="jokes-o-matic.com IE versions" width="552" height="122" /><p class="wp-caption-text">jokes-o-matic.com IE versions</p></div>
<h3><a title="Recycling Group Finder" href="http://recyclinggroupfinder.com/">Recycling Group Finder</a></h3>
<p>A much more broad and &#8216;average&#8217; user base with Internet Explorer dominant:</p>
<div id="attachment_507" class="wp-caption alignnone" style="width: 565px"><img class="size-full wp-image-507" title="Recycling Group Finder browser breakdown" src="http://willj.net/wp-content/uploads/2009/06/picture-11.png" alt="Recycling Group Finder browser breakdown" width="555" height="122" /><p class="wp-caption-text">Recycling Group Finder browser breakdown</p></div>
<p>Still, only 6 Internet Explorer hits recently, a tiny proportion of overall visits:</p>
<div id="attachment_508" class="wp-caption alignnone" style="width: 563px"><img class="size-full wp-image-508" title="Recycling Group Finder IE versions" src="http://willj.net/wp-content/uploads/2009/06/picture-3.png" alt="Recycling Group Finder IE versions" width="553" height="122" /><p class="wp-caption-text">Recycling Group Finder IE versions</p></div>
<h2>What does this mean?</h2>
<div id="attachment_513" class="wp-caption alignright" style="width: 312px"><img class="size-full wp-image-513" title="Yahoo.com as seen in Internet Explorer 5.5" src="http://willj.net/wp-content/uploads/2009/06/yahoo_cropped.png" alt="Yahoo.com as seen in Internet Explorer 5.5" width="302" height="257" /><p class="wp-caption-text">Yahoo.com as seen in Internet Explorer 5.5</p></div>
<p>These statistics, and others I have seen suggest that almost no-one uses Internet Explorer 5.5 or below any more. The small minority that do must be used to the internet breaking in unique and interesting ways due to the lack of support for more recent developments in CSS and really bad Javascript support (see right for yahoo.com as seen in Internet Explorer 5.5). I predict that a fair number of sites just don&#8217;t work in any usable way on anything less than Internet Explorer 6.</p>
<h2>Time is money</h2>
<p>Designing for multiple browsers takes time. The more browsers you need to support the more time you need to spend supporting them.</p>
<p>A <a title="Bracken Bruiser prototype site" href="http://bracken.supershinyrobot.com/">recent project</a> I worked on required a redesign of the site from the ground-up (aswell as a bunch of other stuff) and making the site work in any version of Internet Explorer lower than 6 just wasn&#8217;t worth the time, and therefore money, put into it. The return just wasn&#8217;t there and I decided that IE 5.5 was gone, dead, obsolete and I wasn&#8217;t going to try and mangle the design to work in it. Rather than just display a really crappy looking site to the user I decided I would let them know via a short and to-the-point message that their browser was not up to displaying the site and directing them to upgrade to a new version of their browser.</p>
<h2>Give them the good news</h2>
<div id="attachment_526" class="wp-caption alignleft" style="width: 297px"><img class="size-full wp-image-526" title="IE 5.5 advice message" src="http://willj.net/wp-content/uploads/2009/06/noie55.png" alt="IE 5.5 advice message" width="287" height="215" /><p class="wp-caption-text">Message displayed to all users visiting project in anything below IE 6</p></div>
<p>But how to do this? The site was developed in Ruby on Rails and I&#8217;d heard of a neat gem called <a title="noie6" href="http://github.com/juliocesar/rack-noie/tree/master">rack-noie6</a> that provides a piece of Rack middleware that blocks Internet Explorer 6 and below, but that isn&#8217;t going to work in most cases. Hard as it may be to make your site look good in Internet Explorer 6 you can see from the stats above there&#8217;s still a large proportion of users using it and to turn them away would be crazy, at least while the pool of IE 6 users out there is still so large.</p>
<p>So a quick fork and patch later (<a title="Github" href="http://github.com/">github</a> we &lt;3 you so much) and the <a title="New noie6" href="http://github.com/wjessop/rack-noie6/tree/master">new noie6</a> was accepting an option for a minimum version of Internet Explorer it should accept instead of just rigidly blocking version 6 and below. Configuration is <em>really</em> simple:</p>
<p><script src="http://gist.github.com/130324.js"></script></p>
<p>Now any users visiting the site in anything <em>below</em> Internet Explorer 6 gets the message above helpfully directing them to update their browser. Not bad for a two line config update.</p>
]]></content:encoded>
			<wfw:commentRss>http://willj.net/2009/06/15/blocking-internet-explorer-55/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
