<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Ruby on Bridge</title><link>https://quarternotecoda.com/tags/ruby/</link><description>Recent content in Ruby on Bridge</description><generator>Hugo -- 0.160.1</generator><language>en-us</language><lastBuildDate>Mon, 22 Jul 2013 00:00:00 +0000</lastBuildDate><atom:link href="https://quarternotecoda.com/tags/ruby/index.xml" rel="self" type="application/rss+xml"/><item><title>Lone Star Ruby Conf 2013</title><link>https://quarternotecoda.com/posts/2013-07-22-lone-star-ruby-conf-2013/</link><pubDate>Mon, 22 Jul 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-07-22-lone-star-ruby-conf-2013/</guid><description>&lt;p&gt;This last weekend I went to the &lt;a href="http://www.lonestarruby.org/2013/lsrc"&gt;Lone Star Ruby Conference 2013&lt;/a&gt;. It was a good conf. Of course, there were some weak talks and bad wifi issues, but overall, it was the most enjoyable and useful conference I&amp;rsquo;ve been to.&lt;/p&gt;
&lt;h2 id="highlights"&gt;Highlights&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://twitter.com/sandimetz"&gt;Sandi Metz&lt;/a&gt;&amp;rsquo;s keynote looking at the history of writing and tech - Always great to hear that you&amp;rsquo;re going to be obselete and thus, you need to remember what your priorities are.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/pragdave"&gt;Dave Thomas&lt;/a&gt;&amp;rsquo;s talk on &lt;a href="http://elixir-lang.org"&gt;Exlir&lt;/a&gt; - Showed off the power of the language by live-coding and having a good time doing it.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/tehviking"&gt;Brandon Hays&lt;/a&gt;&amp;rsquo; talk on &lt;a href="http://emberjs.com/"&gt;Ember.js&lt;/a&gt; and Rails - perhaps the best beginner talk I&amp;rsquo;ve ever seen. Great combo of funny, interesting, informative and technical enough to be useful.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/sarahmei"&gt;Sarah Mei&lt;/a&gt;&amp;rsquo;s talk on fostering creativity and problem solving - Just a great talk&amp;ndash;well delivered and interesting. Best soft talk of the conf.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/nellshamrell"&gt;Nell Shamrell&lt;/a&gt;&amp;rsquo;s talk on &lt;a href="http://rubular.com"&gt;RegEx&lt;/a&gt; - Super informative, well delivered and highly technical without alientating anyone. 200 devs paying attention to every word she&amp;rsquo;s saying about how a RegEx parser works. That&amp;rsquo;s mad skills.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/geeksam"&gt;Sam Livingston-Gray&lt;/a&gt;&amp;rsquo;s talk on Refactoring - Wonderful talk that dove deep enough to give you an idea of HOW to refactor something. I always forget that it is one small thing at a time.&lt;/li&gt;
&lt;li&gt;Getting to meet and visit with people I had only known on twitter before like &lt;a href="http://twitter.com/_zph"&gt;@_zph&lt;/a&gt; and &lt;a href="http://twitter.com/avdi"&gt;@avdi&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Getting to meet lots of people interesting in &lt;a href="http://pairprogramwith.me"&gt;#pairwithme&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/brynary"&gt;Bryan Helmkamp&lt;/a&gt;: &amp;ldquo;Your goal is to make refactoring invisible. It should happen every time you touch the code. Little improvements here and there.&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Getting to give my &lt;a href="https://speakerdeck.com/marksim/practical-number-pairwithme"&gt;Lightning Talk on #pairwithme&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Overall a great conf. It seemed like the best and most interesting talks weren&amp;rsquo;t focused on Ruby&amp;ndash;with the exception of @geeksam&amp;rsquo;s talk on refactoring. Nearly every talk worth it&amp;rsquo;s salt was either talking about broadening your horizons or improving your code quality. That&amp;rsquo;s a tall order, and it&amp;rsquo;s a great thing that the Ruby community embraces it.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @jnanney - OAuth</title><link>https://quarternotecoda.com/posts/2013-07-18-pairing-post-mortem-at-jnanney-oauth/</link><pubDate>Thu, 18 Jul 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-07-18-pairing-post-mortem-at-jnanney-oauth/</guid><description>&lt;p&gt;I finally got a chance to pair with &lt;a href="http://twitter.com/jnanney"&gt;@jnanney&lt;/a&gt; tonight. He had a project dealing with the OnStar API that needed OAuth Authentication, so we took a stab at implementing it.&lt;/p&gt;
&lt;h2 id="setup"&gt;Setup&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Skype - TIL Skype 6.x turns off your video if you connect to a Skype 2.0 client&amp;ndash;but the audio still works!&lt;/li&gt;
&lt;li&gt;TMUX+VIM on a slice (not local)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="experience"&gt;Experience&lt;/h2&gt;
&lt;p&gt;We started by making some large, rough ideas about what we wanted to accomplish and then began looking up some things on OAuth2 to help us accomplish them. Pretty quickly we stopped driving everything via tests and started exploring via &lt;code&gt;IRB&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @willpragnell - Mute Pairing with VIM</title><link>https://quarternotecoda.com/posts/2013-07-09-pairing-post-mortem-at-willpragnell-mute-pairing-with-vim/</link><pubDate>Tue, 09 Jul 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-07-09-pairing-post-mortem-at-willpragnell-mute-pairing-with-vim/</guid><description>&lt;p&gt;Last week I had the opportunity to pair again with &lt;a href="http://twitter.com/willpragnell"&gt;@willpragnell&lt;/a&gt;. He had just moved and didn&amp;rsquo;t have internet access, so I suggested that we try a &amp;ldquo;mute&amp;rdquo; pairing session from a coffee shop, where all our communication happened through VIM.&lt;/p&gt;
&lt;p&gt;He was game, so we started off with a quick chat session on Google+ to get set up, and then switched to a VIM+TMUX setup for the rest of the time.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @peter_v - Improving a Semantic Store</title><link>https://quarternotecoda.com/posts/2013-07-03-pairing-post-mortem-at-peter-v-improving-a-fact-engine/</link><pubDate>Wed, 03 Jul 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-07-03-pairing-post-mortem-at-peter-v-improving-a-fact-engine/</guid><description>&lt;p&gt;Today I got to pair with &lt;a href="http://twitter.com/peter_v"&gt;Peter Vanderabeele&lt;/a&gt;, who is a programmer from Belgium with a highly methodical bent. He has clearly had a lot of experience and it was neat to get to work on his project since it isn&amp;rsquo;t every day you get to work on a high performance fact storage system.&lt;/p&gt;
&lt;p&gt;Peter is creating a data store meant to store semantic facts that have relationships to each other. It&amp;rsquo;s a very different project with a goal, he stated, to have data in this format and extractable for the next 50 years. To try to view code with that lens is very different from how most other Rubyists think. We tend to see our code dying in the next 5 years&amp;hellip; max. So we make decisions with that timeline in mind. Thinking of a timeline longer than my own life has very different implications.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @stuartrexking - Cane Extension</title><link>https://quarternotecoda.com/posts/2013-06-29-pairing-post-mortem-at-stuartrexking-cane-extension/</link><pubDate>Mon, 24 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-29-pairing-post-mortem-at-stuartrexking-cane-extension/</guid><description>&lt;p&gt;Last night&amp;rsquo;s pair session was with &lt;a href="http://twitter.com/stuartrexking"&gt;@stuartrexking&lt;/a&gt; - a very experienced developer and technologist currently working at a really neat company called &lt;a href="http://antipodeanlabs.com/"&gt;Antipodean Labs&lt;/a&gt;. It seems like he&amp;rsquo;s got a great handle on solving problems and staying maintainable.&lt;/p&gt;
&lt;p&gt;We started off by trying to decide what to do. I&amp;rsquo;m increasingly convinced this is the possibly the hardest part of remote pairing with people who aren&amp;rsquo;t part of your company. You don&amp;rsquo;t have a predefined complex project you both find interest in, so the most likely shared interests are either meta problems or highly common ones. Highly common ones are very visible and difficult to find low hanging fruit for. The meta problems are good to solve, but somehow feel like they are less valuable than the &amp;ldquo;real&amp;rdquo; problems. Maybe this is just a feeling I have.&lt;/p&gt;</description></item><item><title>Steps for a Beginner to Learn Ruby</title><link>https://quarternotecoda.com/posts/2013-06-20-5-steps-for-a-beginner-to-learn-ruby/</link><pubDate>Thu, 20 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-20-5-steps-for-a-beginner-to-learn-ruby/</guid><description>&lt;p&gt;Ruby is not Rails. Learn Ruby first.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Get &lt;a href="rbenv.org"&gt;rbenv&lt;/a&gt; (preferred) or &lt;a href="http://rvm.io"&gt;rvm&lt;/a&gt; installed with Ruby 1.8.7, 1.9.3 and 2.0&lt;/li&gt;
&lt;li&gt;Write Hello World and run it&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ruby" data-lang="ruby"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020"&gt;puts&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Hello World&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Go through the &lt;a href="http://rubykoans.com/"&gt;Ruby Koans&lt;/a&gt; (simplest with 1.8.7)&lt;/li&gt;
&lt;li&gt;Go through some &lt;a href="https://quarternotecoda.com/tdd-exercises/"&gt;TDD exercises&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Code a simple ruby script that solves a problem you have, like&amp;hellip;
&lt;ul&gt;
&lt;li&gt;Add a TODO to a file&lt;/li&gt;
&lt;li&gt;Print out the date in another time zone&lt;/li&gt;
&lt;li&gt;Tell you how many days until&amp;hellip;&lt;/li&gt;
&lt;li&gt;Perform some repetative task related to your environment&lt;/li&gt;
&lt;li&gt;Display something silly for your kids&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ruby is not Rails. You do not need to learn all the &amp;ldquo;magic&amp;rdquo; of Rails to learn the &lt;em&gt;awesome&lt;/em&gt; of Ruby. Spend some time and get where you can really drive a script and solve a simple problem. Doing this will get you far beyond a beginning Rails developer. You simply have to learn the magic incantations of Rails to be able to develop web apps after that. And those incantations won&amp;rsquo;t be nearly as scary.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @_zph - Meta Pull Requests</title><link>https://quarternotecoda.com/posts/2013-06-19-pairing-post-mortem-at-zph-meta-pull-requests/</link><pubDate>Wed, 19 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-19-pairing-post-mortem-at-zph-meta-pull-requests/</guid><description>&lt;p&gt;I had a great &lt;a href="http://pairprogramwith.me"&gt;#pairwithme&lt;/a&gt; session with &lt;a href="http://twitter.com/_zph"&gt;@_zph&lt;/a&gt;. Always a pleasure to talk to him and solve a problem together.&lt;/p&gt;
&lt;h2 id="setup"&gt;Setup&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;TMUX + VIM on a slice&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/chrishunt/github-auth"&gt;github-auth&lt;/a&gt; gem&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="experience"&gt;Experience&lt;/h2&gt;
&lt;p&gt;We wanted to add the feature to &lt;code&gt;gh-auth&lt;/code&gt; so you could pass a &lt;code&gt;&amp;ndash;path&lt;/code&gt; or &lt;code&gt;&amp;ndash;user&lt;/code&gt; argument to it. Because we&amp;rsquo;re good developers, we started off by coding the acceptance test. We discussed the merits of how to write good tests and whether to follow convetions within a gem authored by someone else or do things &amp;rsquo;the right way&amp;rsquo; &amp;ndash; according to whatever coding religion you follow. Eventually we decided on sticking to the conventions of the gem while trying to improve&amp;ndash;but not radically change&amp;ndash;the tests/testing that we touched. From there, we dove down into the implementation and unit tests and drove through until we had the &lt;code&gt;&amp;ndash;path&lt;/code&gt; argument working. Along the way we did a little refactoring to use the &lt;a href="http://ruby-doc.org/stdlib-1.9.3/libdoc/optparse/rdoc/OptionParser.html"&gt;OptionParser&lt;/a&gt; instead of requiring a specific ordering of options.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @Shicholas - String Calculator</title><link>https://quarternotecoda.com/posts/2013-06-18-pairing-post-mortem-at-shicholas-string-calculator/</link><pubDate>Tue, 18 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-18-pairing-post-mortem-at-shicholas-string-calculator/</guid><description>&lt;p&gt;Last night I had a great pairing with &lt;a href="http://twitter.com/Schicholas"&gt;@Shicholas&lt;/a&gt; working on the &lt;a href="http://osherove.com/tdd-kata-1/"&gt;String Calculator kata&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="setup"&gt;Setup&lt;/h2&gt;
&lt;p&gt;We again used TMUX + VIM, even though Nick wasn&amp;rsquo;t very familiar with VIM. Based on his experience, I think this might be the &lt;strong&gt;best way to learn VIM&lt;/strong&gt; since you have someone guiding you through. You won&amp;rsquo;t pick up on everything, but you&amp;rsquo;ll learn a handful of new things each time.&lt;/p&gt;
&lt;h2 id="exercise"&gt;Exercise&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://gist.github.com/marksim/5802445"&gt;We went through each of the different rules and ping ponged back and forth&lt;/a&gt;. It was a struggle to do the &lt;em&gt;simplest&lt;/em&gt; possible thing every time, and really let the tests DRIVE your development. Your developer brain wants to generalize the solution to a problem, but the strength of TDD is keeping your &lt;em&gt;actual&lt;/em&gt; solution as simple as possible. Developers are notorious for over complicating things and over desigining.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @willpragnell - Overseas TDD</title><link>https://quarternotecoda.com/posts/2013-06-14-pairing-post-mortem-at-willpragnell-overseas-tdd/</link><pubDate>Fri, 14 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-14-pairing-post-mortem-at-willpragnell-overseas-tdd/</guid><description>&lt;p&gt;I had my first pairing session with &lt;a href="http://twitter.com/willpragnell"&gt;@willpragnell&lt;/a&gt; today. He&amp;rsquo;s a smart guy and my first European pair partner. It was a pleasure to talk to him about his iOS and Ruby experience and I picked up on a lot of little things from our pairing session together.&lt;/p&gt;
&lt;h2 id="setup"&gt;Setup&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;TMUX and VIM - (I got to use my &lt;a href="https://gist.github.com/marksim/5785406"&gt;newly revised pairing script&lt;/a&gt; to set up everything in seconds)&lt;/li&gt;
&lt;li&gt;TicTacToe - RSpec&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="the-session"&gt;The Session&lt;/h2&gt;
&lt;p&gt;We set a couple of goals out for the beginning. We both wanted to learn more of RSpec&amp;rsquo;s new syntax and we wanted to really adhear to the TDD principle of doing the most simple thing next.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @mattr_ - Pending Specs and Assertions First</title><link>https://quarternotecoda.com/posts/2013-06-06-pairing-post-mortem-at-mattr-pending-specs-and-assertions-first/</link><pubDate>Thu, 06 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-06-pairing-post-mortem-at-mattr-pending-specs-and-assertions-first/</guid><description>&lt;p&gt;Today I paired with &lt;a href="http://twitter.com/@mattr_"&gt;@mattr_&lt;/a&gt; and got quite a bit of good input regarding how to attack a problem and write tests. Matt is a super smart guy who has really absorbed some of the fundamentals of TDD and it shows through his ability to break down a problem.&lt;/p&gt;
&lt;h2 id="setup"&gt;Setup&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;TMUX &amp;amp; VIM on my box&lt;/li&gt;
&lt;li&gt;Conway&amp;rsquo;s Game of Life as an exercise&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="process"&gt;Process&lt;/h2&gt;
&lt;p&gt;When &lt;a href="https://gist.github.com/marksim/5723610"&gt;implementing the game of life&lt;/a&gt;, we started off looking at the problem on Wikipedia and found the 4 rules. I immediately started writing the first test when Matt noted that he liked to write all the specs he knows of as pending specs right at the beginning. Then he can really plow forward and know what&amp;rsquo;s next. He also noted that he likes to be able to write the assertion first, based on the test, and then build the test up from there. I felt the lightbulb go off when he pointed these two things out. When I&amp;rsquo;ve struggled to find the test or figure out how to test something, usually it&amp;rsquo;s because I can&amp;rsquo;t figure out how to get to the assertion, and that really comes down to not testing the right thing.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @_zph - VIM and a Gem</title><link>https://quarternotecoda.com/posts/2013-06-05-pairing-post-mortem-at-zph-vim-and-a-gem/</link><pubDate>Wed, 05 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-05-pairing-post-mortem-at-zph-vim-and-a-gem/</guid><description>&lt;p&gt;Last night I had a great &lt;a href="http://pairprogramwith.me"&gt;#pairwithme&lt;/a&gt; session with &lt;a href="http://twitter.com/_zph"&gt;@_zph&lt;/a&gt;. He&amp;rsquo;s been doing Ruby on nights and weekends for the last few years and he&amp;rsquo;s been using &lt;a href="http://www.vim.org"&gt;VIM&lt;/a&gt; much longer than I have. I learned a lot of little tricks about VIM that I just hadn&amp;rsquo;t quite worked out before. We also refactored some of his &lt;a href="http://github.com/zph/buff"&gt;Buff&lt;/a&gt; Gem.&lt;/p&gt;
&lt;p&gt;Setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Zander had a VPS already provisioned with my ssh keys installed. Super Easy setup.&lt;/li&gt;
&lt;li&gt;TMUX + VIM for our editors&lt;/li&gt;
&lt;li&gt;RSpec for testing the Gem&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We started off trying to think of what to pair on within Zander&amp;rsquo;s gem. He was concerned about the tests, so we actually spent a fair amount of time just looking at the WebMocked tests and discussing the pros and cons. Eventually we decided that WebMock might be a good way to start off your TDD of an API wrapper since you have complete control of the response, but VCR gives you the best long term support since you can both get fast tests and confirm that you&amp;rsquo;re still working with the API correctly and that you didn&amp;rsquo;t just magically stub out the wrong thing&amp;ndash;just delete your cassette and you&amp;rsquo;ve got &amp;ldquo;free&amp;rdquo; real API tests, followed by nice fast tests.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @Shicholas - Real World Lessons and Bowling</title><link>https://quarternotecoda.com/posts/2013-06-04-pairing-post-mortem-at-shicholas-angular-dot-js-and-bowling/</link><pubDate>Tue, 04 Jun 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-06-04-pairing-post-mortem-at-shicholas-angular-dot-js-and-bowling/</guid><description>&lt;p&gt;Last night I had my first pairing session with &lt;a href="http://twitter.com/shicholas"&gt;@shicholas&lt;/a&gt;. Nick recently graduated from law school and is looking to pass the bar, but somehow programming calls to him. It&amp;rsquo;s a good thing too, since he&amp;rsquo;s clearly gifted and a fast learner.&lt;/p&gt;
&lt;p&gt;Setup:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ScreenHero&lt;/li&gt;
&lt;li&gt;Sublime Text 2&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/jarhart/shuhari"&gt;shuhari&lt;/a&gt; by &lt;a href="http://twitter.com/jarhart"&gt;@jarhart&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;While we were kicking things off with the &amp;ldquo;get to know you&amp;rdquo; talk, I found that Nick had a Rails + &lt;a href="http://angularjs.org/"&gt;Angular.js&lt;/a&gt; app he was working on. I&amp;rsquo;ve not done any work with Angular and asked him to show me what was going on. He pointed out the general structure as well as the custom &lt;em&gt;directives&lt;/em&gt; that Angular.js allows you to create. I&amp;rsquo;ve watched the &lt;a href="https://peepcode.com/products/emberjs"&gt;Ember.js Peepcode Intro&lt;/a&gt;, and found it difficult to get excited about it. Being introduced to Angular.js in this particular manner gave me real world applications and it seemed much more intriguing. No verdict yet on either, just initial impressions on both frameworks.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @kmeister2000 - Refactoring and MiniTest</title><link>https://quarternotecoda.com/posts/2013-05-29-pairing-post-mortem-at-kmeister-refactoring-and-minitest/</link><pubDate>Wed, 29 May 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-05-29-pairing-post-mortem-at-kmeister-refactoring-and-minitest/</guid><description>&lt;p&gt;Had a great 4th pairing with &lt;a href="http://twitter.com/kmeister2000"&gt;@kmeister2000&lt;/a&gt;. Always a pleasure to work with him.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Interesting Parts of our session setup:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Worked on a real world app Karl was developing&lt;/li&gt;
&lt;li&gt;Used MiniTest instead of RSpec&lt;/li&gt;
&lt;li&gt;Refactored existing code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;MiniTest Takeaways:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MiniTest expectations about method calls are not as clear as in Rspec and the documentation/examples aren&amp;rsquo;t as readily available.&lt;/li&gt;
&lt;li&gt;MiniTest is a lot like RSpec in nearly every other way.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m not a fan of Mocha. I think it promotes antipatterns for how to really test.&lt;/li&gt;
&lt;li&gt;I actually like the explicit &lt;code&gt;mock.verify&lt;/code&gt; in MiniTest::Spec&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;General Takeaways:&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Pairing Post Mortem : @hinbody - TicTacToe and TMUX</title><link>https://quarternotecoda.com/posts/2013-05-29-pairing-post-mortem-at-hinbody-tictactoe-and-tmux/</link><pubDate>Wed, 29 May 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-05-29-pairing-post-mortem-at-hinbody-tictactoe-and-tmux/</guid><description>&lt;p&gt;I just finished my first &lt;a href="https://twitter.com/search?q=%23pairwithme"&gt;#pairwithme&lt;/a&gt; session with &lt;a href="http://twitter.com/hinbody"&gt;@hinbody&lt;/a&gt;. It was my first remote session to use TMUX+VIM instead of ScreenHero &amp;ndash; I have to say, it was quite easy to use and given the fact that it&amp;rsquo;s &lt;em&gt;free&lt;/em&gt;, &lt;em&gt;fast&lt;/em&gt;, and &lt;em&gt;cross-platform&lt;/em&gt;, I&amp;rsquo;ll be using it with any vim users I pair with who are willing. I&amp;rsquo;d &lt;em&gt;love&lt;/em&gt; to get &lt;a href="https://github.com/FredKSchott/CoVim"&gt;CoVim&lt;/a&gt; working since it allows you to use your own vim setup. I drool a little bit at all that. But I digress.&lt;/p&gt;</description></item><item><title>Pairing Post Mortem : @thecommongeek - Ruby Koans</title><link>https://quarternotecoda.com/posts/2013-05-28-pairing-post-mortem-at-thecommongeek-ruby-koans/</link><pubDate>Tue, 28 May 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-05-28-pairing-post-mortem-at-thecommongeek-ruby-koans/</guid><description>&lt;p&gt;I paired with &lt;a href="http://twitter.com/thecommongeek"&gt;@thecommongeek&lt;/a&gt; last night again. This time we were more prepared and I think the session went much better.&lt;/p&gt;
&lt;p&gt;In our &lt;a href="https://quarternotecoda.com/blog/2013/05/13/pairing-as-mentoring-first-impressions/"&gt;first session&lt;/a&gt; I misjudged where Dennis was as a coder and struggled a bit with how to pair with him effectively. This time we had him drive through &lt;a href="http://screenhero.com"&gt;ScreenHero&lt;/a&gt; and decided to start from the &amp;ldquo;basics&amp;rdquo; by doing the &lt;a href="http://rubykoans.com"&gt;RubyKoans&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The RubyKoans are meant for Ruby 1.8.7, but 1.9.3 is commonplace now, so we struggled a bit at the beginning. For anyone going through the RubyKoans on 1.9.3 getting a &lt;code&gt;value19&lt;/code&gt; in nearly all your errors, I&amp;rsquo;d suggest making the following changes on neo.rb (starting on line 34):&lt;/p&gt;</description></item><item><title>Pairing Post Mortem - @javichitone - Improving a Gem</title><link>https://quarternotecoda.com/posts/2013-05-22-pairing-post-mortem-at-javichitone-improving-a-gem/</link><pubDate>Wed, 22 May 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-05-22-pairing-post-mortem-at-javichitone-improving-a-gem/</guid><description>&lt;p&gt;I had my first international pairing session with &lt;a href="http://twitter.com/javichitone"&gt;@javichitone&lt;/a&gt; tonight. He&amp;rsquo;s from Peru and will soon be graduating. He should have no trouble finding a job based on the code I got to read of his :)&lt;/p&gt;
&lt;p&gt;We talked for a bit and settled into looking at a gem he recently published. Since it was his gem, I elected to drive. I&amp;rsquo;m familiar enough with gems that I&amp;rsquo;m comfortable in &lt;em&gt;general&lt;/em&gt;, but he knew the &lt;em&gt;specifics&lt;/em&gt; of his gem, so to get the most out of it, he needed to be commenting on the specifics he knew and I needed to be diving into figuring out those specifics.&lt;/p&gt;</description></item><item><title>Tic Tac Toe TDD</title><link>https://quarternotecoda.com/posts/2013-04-25-tic-tac-toe-tdd/</link><pubDate>Thu, 25 Apr 2013 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2013-04-25-tic-tac-toe-tdd/</guid><description>&lt;p&gt;I spent a little (longer than I thought&amp;hellip; maybe 2 hours?) implementing Tic-Tac-Toe in the TDD As If You Mean It style. Ended up with a VERY different implementation than I ever would have done if I just &amp;ldquo;started coding&amp;rdquo; &amp;ndash; everything was only in one class, including the AI to &amp;ldquo;play&amp;rdquo; against itself.&lt;/p&gt;
&lt;script src="https://gist.github.com/marksim/5460578.js"&gt;&lt;/script&gt;
&lt;p&gt;Observations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It was quite different to implement things inside the test method. I ended up coding like&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;it &amp;#34;does something...&amp;#34; do
player = Player.new
def player.something
# do work
end
player.something.should be_true
end
&lt;/code&gt;&lt;/pre&gt;&lt;ul&gt;
&lt;li&gt;It was difficult to not refactor as I went. Many times I would see the duplication and want to refactor immediately. I resisted this urge until I felt the implementation was done, then refactored out duplication, ensuring that the tests continued to pass after each change.&lt;/li&gt;
&lt;li&gt;I&amp;rsquo;m still not quite sure how you&amp;rsquo;re supposed to improve design without breaking the rules. Doing pure method move seems limiting and doesn&amp;rsquo;t allow for you to see duplication. The only thing I could think of is that there can be additional refactoring after you&amp;rsquo;re &amp;ldquo;done&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;All in all, a very interesting exercise. I want to do it now on something broader, and eventually on something that has a core with a wrapper so that the core is purely TDD&amp;rsquo;d and the wrapper is thin, but swappable. I think Dominion is my next big attempt.&lt;/p&gt;</description></item><item><title>ImageMagick, JPEGs, and Orientation, Oh My</title><link>https://quarternotecoda.com/posts/2012-06-13-imagemagick/</link><pubDate>Wed, 13 Jun 2012 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2012-06-13-imagemagick/</guid><description>&lt;p&gt;I&amp;rsquo;ve been working on a new project and decided to use CarrierWave to handle image uploads (and minor automatic manipulation). Everything looked great, but then my new boss, who has a penchant for finding the one or two things wrong with your latest well-tested feature uploaded a JPEG that looked fine in Preview, but automatically rotated on upload.&lt;/p&gt;
&lt;p&gt;After checking through the directory, it seemed that only the processed images were getting rotated. Actually, &amp;lsquo;rotated&amp;rsquo; is a misnomer, they were actually just losing their orientation. JPEGs have EXIF meta data that can contain the orientation of a picture, no matter how it&amp;rsquo;s stored. This allows cameras to store everything as a 640x480, but display some in the reverse (480x640). The only thing different when the camera writes the image is what orientation the gyroscope adds to the meta data.&lt;/p&gt;</description></item><item><title>DCI Generators in Rails</title><link>https://quarternotecoda.com/posts/2012-05-22-dci-generators-in-rails/</link><pubDate>Tue, 22 May 2012 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2012-05-22-dci-generators-in-rails/</guid><description>&lt;p&gt;Recently, in my new project, I decided to take the &lt;a href="http://en.wikipedia.org/wiki/Data,_context_and_interaction"&gt;DCI&lt;/a&gt; approach that &lt;a href="http://mikepackdev.com/blog_posts/24-the-right-way-to-code-dci-in-ruby"&gt;Mike Pack outlined&lt;/a&gt;, which has been really cool. I&amp;rsquo;ve been able to keep my tests fast, and have very distinct buckets to put data (models), specific roles of that data (rather than cluttering up the models), and an easy way to take a use case and map it out programatically (contexts).&lt;/p&gt;
&lt;p&gt;I noticed that I was generating roles and contexts regularly and copying from previously written code examples so I decided to make role and context generators. The process wasn&amp;rsquo;t bad, but it did take a couple of steps that took a little digging to understand.&lt;/p&gt;</description></item><item><title>Best Way to Bundle</title><link>https://quarternotecoda.com/posts/2012-03-14-best-way-to-bundle/</link><pubDate>Wed, 14 Mar 2012 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2012-03-14-best-way-to-bundle/</guid><description>&lt;p&gt;Thanks to the &lt;a href="http://rubyrogues.com/045-rr-bundler-with-andre-arko/"&gt;RubyRogues Episode on Bundler&lt;/a&gt;, I learned the best way to use bundler.&lt;/p&gt;
&lt;p&gt;You want to always use the &amp;ldquo;pessemistic&amp;rdquo; version numbers for a handful of reasons.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;gem &amp;#39;rails&amp;#39;, &amp;#39;~&amp;gt; 3.0.3&amp;#39;
gem &amp;#39;rspec&amp;#39;, &amp;#39;~&amp;gt; 2.7.0&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This allows the most efficient resolution of gem dependencies (in this case, any version of rails from 3.0.3 up to and not including 3.1, and any version of rspec from 2.7.0 up to and not including 2.8) and the added benefit of allowing you to easily patch everything safely using only &lt;code&gt;bundle update&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Don't Use DateTime in Rails 3</title><link>https://quarternotecoda.com/posts/2011-11-29-dont-use-datetime-in-rails-3/</link><pubDate>Tue, 29 Nov 2011 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2011-11-29-dont-use-datetime-in-rails-3/</guid><description>&lt;p&gt;Rails 3 has good TimeZone support built in, but you have to use the right Date and Time classes to get full support.&lt;/p&gt;
&lt;p&gt;If you have this set in your application.rb &lt;code&gt;config.active_record.default_timezone = :local&lt;/code&gt;, then you really need to use Time so that it properly identifies itself as being in the local timezone and not in UTC when passing to the database insert.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ruby" data-lang="ruby"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ree&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;1&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;8&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;7&lt;/span&gt;&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;2011&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;03&lt;/span&gt; :&lt;span style="color:#40a070"&gt;001&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;DateTime&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;parse(&lt;span style="color:#4070a0"&gt;&amp;#39;2011-11-27 12:00:00 +0000&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;Sun&lt;/span&gt;, &lt;span style="color:#40a070"&gt;27&lt;/span&gt; &lt;span style="color:#60add5"&gt;Nov&lt;/span&gt; &lt;span style="color:#40a070"&gt;2011&lt;/span&gt; &lt;span style="color:#40a070"&gt;12&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt; &lt;span style="color:#666"&gt;+&lt;/span&gt;&lt;span style="color:#40a070"&gt;0000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ree&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;1&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;8&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;7&lt;/span&gt;&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;2011&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;03&lt;/span&gt; :&lt;span style="color:#40a070"&gt;002&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;DateTime&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;parse(&lt;span style="color:#4070a0"&gt;&amp;#39;2011-11-27 12:00:00&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;Sun&lt;/span&gt;, &lt;span style="color:#40a070"&gt;27&lt;/span&gt; &lt;span style="color:#60add5"&gt;Nov&lt;/span&gt; &lt;span style="color:#40a070"&gt;2011&lt;/span&gt; &lt;span style="color:#40a070"&gt;12&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt; &lt;span style="color:#666"&gt;+&lt;/span&gt;&lt;span style="color:#40a070"&gt;0000&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ree&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;1&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;8&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;7&lt;/span&gt;&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;2011&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;03&lt;/span&gt; :&lt;span style="color:#40a070"&gt;003&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;Time&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;parse(&lt;span style="color:#4070a0"&gt;&amp;#39;2011-11-27 12:00:00 +0000&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;Sun&lt;/span&gt; &lt;span style="color:#60add5"&gt;Nov&lt;/span&gt; &lt;span style="color:#40a070"&gt;27&lt;/span&gt; &lt;span style="color:#40a070"&gt;06&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt; &lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;0600&lt;/span&gt; &lt;span style="color:#40a070"&gt;2011&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ree&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;1&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;8&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;7&lt;/span&gt;&lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;2011&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;&lt;span style="color:#40a070"&gt;03&lt;/span&gt; :&lt;span style="color:#40a070"&gt;004&lt;/span&gt; &lt;span style="color:#666"&gt;&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;Time&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;parse(&lt;span style="color:#4070a0"&gt;&amp;#39;2011-11-27 12:00:00&amp;#39;&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#60add5"&gt;Sun&lt;/span&gt; &lt;span style="color:#60add5"&gt;Nov&lt;/span&gt; &lt;span style="color:#40a070"&gt;27&lt;/span&gt; &lt;span style="color:#40a070"&gt;12&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt;:&lt;span style="color:#40a070"&gt;00&lt;/span&gt; &lt;span style="color:#666"&gt;-&lt;/span&gt;&lt;span style="color:#40a070"&gt;0600&lt;/span&gt; &lt;span style="color:#40a070"&gt;2011&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So basically, Time.parse always returns the value in the local timezone, DateTime.parse always returns the value in UTC. To get complete compatibility, always use Time.parse. Trust me, I learned the hard way :)&lt;/p&gt;</description></item><item><title>Code Kata #1 - Supermarket Pricing</title><link>https://quarternotecoda.com/posts/2011-10-14-code-kata-1-supermarket-pricing/</link><pubDate>Fri, 14 Oct 2011 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2011-10-14-code-kata-1-supermarket-pricing/</guid><description>&lt;p&gt;Taken from &lt;a href="http://codekata.pragprog.com/2007/01/code_kata_one_s.html"&gt;Code Kata&amp;rsquo;s by Dave Thomas&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The basic premise of this Kata is asking how you would model super market pricing.  What is the price of an item?  What is the cost?  How do you handle price-per-pound?  Buy 2 get one free?  What&amp;rsquo;s the value of stock? It&amp;rsquo;s interesting, and I thought I&amp;rsquo;d take the time to blog through my thought process.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;d like to iterate over the design and see where it takes me. First task is to represent a product.&lt;/p&gt;</description></item><item><title>A Ruby Scoping Gotcha?</title><link>https://quarternotecoda.com/posts/2010-08-27-a-ruby-scoping-gotcha/</link><pubDate>Fri, 27 Aug 2010 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2010-08-27-a-ruby-scoping-gotcha/</guid><description>&lt;p&gt;Let&amp;rsquo;s take this basic class:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ruby" data-lang="ruby"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020;font-weight:bold"&gt;class&lt;/span&gt; &lt;span style="color:#0e84b5;font-weight:bold"&gt;TestClass&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020"&gt;attr_accessor&lt;/span&gt; &lt;span style="color:#517918"&gt;:one&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;def&lt;/span&gt; &lt;span style="color:#06287e"&gt;my_method&lt;/span&gt;(branch&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#007020"&gt;true&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;if&lt;/span&gt; branch
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020"&gt;puts&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Do nothing to modify `one`&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020"&gt;puts&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Modify `one` but it&amp;#39;s a local variable&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; one &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;test&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; one &lt;span style="color:#60a0b0;font-style:italic"&gt;# local variable&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;def&lt;/span&gt; &lt;span style="color:#06287e"&gt;my_non_modifying_method&lt;/span&gt;(branch&lt;span style="color:#666"&gt;=&lt;/span&gt;&lt;span style="color:#007020"&gt;true&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;if&lt;/span&gt; branch
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020"&gt;puts&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Do nothing to modify `one`&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020"&gt;puts&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Do nothing to modify `one` either&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; one &lt;span style="color:#60a0b0;font-style:italic"&gt;#method call&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#007020;font-weight:bold"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020;font-weight:bold"&gt;end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f0f0f0;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-ruby" data-lang="ruby"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;o &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#60add5"&gt;TestClass&lt;/span&gt;&lt;span style="color:#666"&gt;.&lt;/span&gt;new
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;o&lt;span style="color:#666"&gt;.&lt;/span&gt;one &lt;span style="color:#666"&gt;=&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Value&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020"&gt;puts&lt;/span&gt; o&lt;span style="color:#666"&gt;.&lt;/span&gt;my_method
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#007020"&gt;nil&lt;/span&gt; &lt;span style="color:#60a0b0;font-style:italic"&gt;#might expect &amp;#39;Value&amp;#39; if you&amp;#39;re not paying attention&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020"&gt;puts&lt;/span&gt; o&lt;span style="color:#666"&gt;.&lt;/span&gt;my_non_modifying_method &lt;span style="color:#60a0b0;font-style:italic"&gt;#expects &amp;#34;Value&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Value&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020"&gt;puts&lt;/span&gt; o&lt;span style="color:#666"&gt;.&lt;/span&gt;my_method(&lt;span style="color:#007020"&gt;false&lt;/span&gt;)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;test&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#007020"&gt;puts&lt;/span&gt; o&lt;span style="color:#666"&gt;.&lt;/span&gt;my_non_modifying_method(&lt;span style="color:#007020"&gt;false&lt;/span&gt;) &lt;span style="color:#60a0b0;font-style:italic"&gt;#expects &amp;#34;Value&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#666"&gt;=&amp;gt;&lt;/span&gt; &lt;span style="color:#4070a0"&gt;&amp;#34;Value&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So remember, if you create any local variables anywhere in your method, even if they&amp;rsquo;re not called, they override the accessor methods and will give you results you&amp;rsquo;re not expecting. To get around it, make sure you always use self.&lt;i&gt;accessor&lt;/i&gt;= to assign values when there is ambiguity.&lt;/p&gt;</description></item><item><title>Optional Heirarchal Checkbox Selection with Nested Attributes in Rails</title><link>https://quarternotecoda.com/posts/2010-06-04-optional-heirarchal-checkbox-selection-with-nested-attributes-in-rails/</link><pubDate>Fri, 04 Jun 2010 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2010-06-04-optional-heirarchal-checkbox-selection-with-nested-attributes-in-rails/</guid><description>&lt;p&gt;I had a process where I wanted users to fill out a survey which had hierarchal categories AND be able to specify some additional data for specific capabilities that the user had.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://quarternotecoda.com/images/Screen-shot-2010-06-04-at-2.11.01-PM.png"&gt;&lt;img src="https://quarternotecoda.com/images/Screen-shot-2010-06-04-at-2.11.01-PM.png" alt="" title="Categories Example" width="260" height="276" class="alignnone size-full wp-image-73" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, you could easily do this for a small subset and hand-code every item, but I wanted a flexible survey system that allowed true hierarchy and generalized code.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start off with the basic survey and capabilities models and relationships:&lt;/p&gt;</description></item><item><title>Python vs. Ruby - A Fight To The Death</title><link>https://quarternotecoda.com/posts/2010-02-21-python-vs-ruby-a-fight-to-the-death/</link><pubDate>Sun, 21 Feb 2010 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2010-02-21-python-vs-ruby-a-fight-to-the-death/</guid><description>&lt;p&gt;When you&amp;rsquo;re discussing efficiency, a lot of what comes up is the details.  There is something to be said for the &amp;ldquo;beauty&amp;rdquo; of limitation and the &amp;ldquo;efficiency&amp;rdquo; of beautiful things&amp;ndash;especially the efficiency of our brains processing it.&lt;/p&gt;
&lt;blockquote&gt;A talk about the Zen of Python, monkey patching (several times), the Ruby community&amp;amp;apos;s reckless hastiness, the syntax of RSpec and cucumber, beauty and ugliness in languages and testing tools, the complexity of the languages&amp;amp;apos; grammars, syntactic vs. semantic complexity, the relative taste of grasshoppers and tree bark, etc., etc.&lt;/blockquote&gt;
&lt;iframe src="http://player.vimeo.com/video/9471538?title=0&amp;amp;byline=0&amp;amp;portrait=0" width="400" height="225" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href="http://vimeo.com/9471538"&gt;Python vs. Ruby: A Battle to The Death&lt;/a&gt; from &lt;a href="http://vimeo.com/garybernhardt"&gt;Gary Bernhardt&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>PDF Generation in Rails... The Right Way</title><link>https://quarternotecoda.com/posts/2010-02-12-pdf-generation-in-rails-the-right-way/</link><pubDate>Fri, 12 Feb 2010 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2010-02-12-pdf-generation-in-rails-the-right-way/</guid><description>&lt;p&gt;As long as we&amp;rsquo;re talking about efficiency here, one of the ways to be more efficient is to use the right tool for the job.  I&amp;rsquo;ve done PDF generation on 3 different projects but the PDF generation I did yesterday was by far the easiest.   What I thought would take me 2 days ended up taking about 3 hours (with research, etc).&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re not using Ruby to automate some part of your job or life, I feel sad for you (at least a little).   The next time you need to generate PDFs, why not try out the excellent &lt;a title="Prawn : PDF Generation Done Right" href="http://github.com/sandal/prawn" target="_blank"&gt;Prawn&lt;/a&gt; library?  Not familiar, you say?   Well, let&amp;rsquo;s dive right in, shall we?&lt;/p&gt;</description></item><item><title>The Building Blocks of Ruby</title><link>https://quarternotecoda.com/posts/2010-02-08-the-building-blocks-of-ruby/</link><pubDate>Mon, 08 Feb 2010 00:00:00 +0000</pubDate><guid>https://quarternotecoda.com/posts/2010-02-08-the-building-blocks-of-ruby/</guid><description>&lt;p&gt;While the Python version may not be quite as pretty, nothing about them screams “Ruby has much stronger capabilities here”. Instead, by using examples like Sinatra, Rubyists trade in an argument about great semantic power for one about superficial beauty.&lt;/p&gt;
&lt;p&gt;Rubyists, Pythonistas and others working on web development share a common language in JavaScript. When describing blocks to “outsiders” who share a common knowledge of JavaScript, we tend to point at JavaScript functions as a close analogue. Unfortunately, this only furthers the confusion.&lt;/p&gt;</description></item></channel></rss>