Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker
Pivotal Labs

Standup 02/05/2008

Pivotal Labs
Tuesday, February 5, 2008

Interesting Things

  • In exploring options for RSpec testing of XML responses, one project decided
    a custom XPath matcher
    would do the trick nicely:

    items = Item.find(:all)
    get :index
    
    
    response.body.should     have_nodes("//items/item", items.size)
    response.body.should     have_xpath("//items/item[ position() = 1 and @id = '0001' ]")
    response.body.should_not have_xpath("//bogus")
    

    Some other possibilities:

    • Hashes…

      items = Item.find(:all)
      get :index
      
      
      hash = Hash.from_xml(response.body)
      hash['ancestor']['parent']['items']['item'].size.should == items.size
      hash['ancestor']['parent']['items']['item'][0]['id'].should == '0001'
      hash['ancestor']['parent']['bogus'].should be_nil
      
    • Hpricot…

      items = Item.find(:all)
      get :index
      
      
      doc = Hpricot(response.body)
      doc.search("//items/item").size.should == items.size
      doc.at("//items/item[ @id = '0001' ]").position.should == 1
      doc.at("//bogus").should be_nil
      
    • assert_select from Rail’s Test::Unit (using CSS-style selectors)…

      items = Item.find(:all)
      get :index
      
      
      assert_select("items > item", :count => 5)
      assert_select("items > item:nth-child(1)[id=?]", '0001')
      assert_select("bogus", false)
      

    What are your favorite techniques for asserting XML/XPath?

  • Something to consider when test-driving controller code:

    You’re working with ActionController::TestResponse. So, response.success?,
    response.redirect?, etc. are available for you there (since they are
    defined on TestResponse), but not in your actual controllers. That is,
    things blow up if you try to use @response.success? in your application,

    e.g. to determine whether or not to store the current URL and redirect there
    after a login.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mike Grafton

Standup – 1/30/2008

Mike Grafton
Wednesday, January 30, 2008

Help!

  • Does anybody know anything about Lucene scoring using a document boost?

    We see an exponential relationship between document boost and the fieldNorm component of the score for each term. Can anybody explain this?

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 01/28/2008

Pivotal Labs
Tuesday, January 29, 2008

A day late, but…

Interesting Things

  • We’re re-working some internal Rails plugins. This effort includes a redesign of how those plugins deliver routes to the application.

    Look forward to a post from Nathan on designing plugin-provided routes.

  • Teleport:

    A number of Pivots have experimented with using Synergy — often configured with QuickSynergy — as a productivity enhancement tool for pair programming. The basic idea is to have a shared computer set up as a Synergy client of two other, user-driven machines. This allows for collaborative editing in the shared environment as well as individual work, such as reviewing a particular API.

    Jonathon noted that Teleport provides a similar kind of capability which may also be worth checking out. Teleport does differ a bit from Synergy…

    Pluses:

    • Simple, bonjour-enabled configuration via an OS X system preferences pane
    • Bi-directional capabilities. That is, two machines can be both servers and clients of each other
    • Can drag-drop to copy files and folders between machines
    • Pasteboard is synchronized between machines

    Minuses:

    • Pasteboard is synchronized between machines (careful, or you might unintentionally overwrite a copy buffer)
    • OS X only
    • Closed source
    • The one client of two servers setup doesn’t seem to work out right, so only one developer can split of to a “research” machine
    • It’s a bit buggy regarding configuration
    • Can’t do some of the advanced configuration that Synergy can, e.g. re-mapping keys
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Mike Grafton

Standup 01/29/2008

Mike Grafton
Tuesday, January 29, 2008

Help!

  • How do I turn off coloring in the RSpec runner?

    The answer: don’t put

    --color

    in your spec/spec.opts file.

Interesting

  • There’s an easy way to merge hashes in Javascript, using either JQuery or Prototype.

    For JQuery:

    $.extend(target, hash1, hash2, ...)

    For Prototype:

    Object.extend(target, hash)

    JQuery’s syntax is a bit nicer since you can merge any number of hashes into the target hash.

    This is handy for grabbing JSON off the wire and merging it into an existing or “default” object.

    You can use this to merge prototypes, achieving a type of “inheritance” (or what passes for such in Javascript). But be careful, since the rightmost hash wins – IE, its properties overide properties by the same name in the target.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Chad Woolley

Standup 01/18/2008

Chad Woolley
Friday, January 18, 2008

Interesting Things

  • If you use Git, and have problems with gitk, try qgit. It may work better for you.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Chad Woolley

Standup 01/17/2008

Chad Woolley
Thursday, January 17, 2008

Interesting Things

  • There is a gotcha when creating a Ruby Hash with a default value. If you pass a object to the constructor, such as an empty hash, the same object will be used for all default values. That probably isn’t what you want. Instead, use the form of the constructor which takes a block. Here is an illustration:

    $ irb
    >> trickyhash = Hash.new({})
    => {}
    >> trickyhash[:a][:a] = 1
    => 1
    >> trickyhash[:b]
    => {:a=>1}
    >> betterhash = Hash.new {|h,k| h[k] = {} }
    => {}
    >> betterhash[:a][:a] = 1
    => 1
    >> betterhash[:b]
    => {}
    
  • ruby-prof and KCachegrind are very useful for profiling and performance optimization. We had problems compiling the OS X Darwin Port of KCachegrind, though – you may just want to run it on linux.

  • Vine Server and Viewer 3.0 has been released.

Ask for Help

  • “QuickSilver for Dummies?” – What is a good resource to learn about QuickSilver?
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Chad Woolley

Standup 01/16/2008

Chad Woolley
Wednesday, January 16, 2008

Ask for Help

  • “Does Intellij Idea sometimes do an SVN up without asking?”
    • Sometimes, if you do an svn up on the command line, IntelliJ will not always pick up the changes. You need to make sure you click the “refresh” button in the version control “Changes” view, not just the “synchronize” button on the main toolbar.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Chad Woolley

Standup 01/15/2008

Chad Woolley
Wednesday, January 16, 2008

Ask for Help

  • “Can you use Google Maps on an https page?”
    • Probably via an iframe. Is there a preferred way?
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 01/14/2008

Pivotal Labs
Monday, January 14, 2008

Interesting Things

  • Thin is a new webserver that we haven’t tried yet, but we’re interested in. It’s billed as being faster than Mongrel; it uses the Mongrel parsing engine, Event Machine for I/O, and Rack to interface between server and Ruby framework. Because it uses Rack, it may have problems doing streaming. Anyone have experiences with it to report?
  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Pivotal Labs

Standup 2008-01-11

Pivotal Labs
Saturday, January 12, 2008

Interesting Things

  • We’ve started to run across this in one of our projects: Javascript DOM methods can be a nice way to create a DOM tree (with some practice, you can write clear, reusable JS UI components), but it’s slow. You probably won’t notice it if you’re only creating a few DOM nodes, but if you’re drawing thousands of them then it can turn into a performance bottleneck. The generally-accepted solution is to push a bunch of strings into an array, use Array#join(”") to create a single string, then stick it in an element’s innerHTML. Quirksmode has some numbers and Joseph Smarr has a related presentation.
  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (783)
  • rails (117)
  • testing (90)
  • ruby (86)
  • ruby on rails (71)
  • jobs (62)
  • javascript (59)
  • techtalk (44)
  • ironblogger (42)
  • rspec (39)
  • bloggerdome (34)
  • productivity (34)
  • activerecord (30)
  • rubymine (30)
  • git (29)
  • gogaruco (29)
  • nyc (27)
  • design (24)
  • mobile (23)
  • pivotal tracker (22)
  • process (21)
  • cucumber (21)
  • jasmine (19)
  • ios (18)
  • tracker ecosystem (17)
  • webos (17)
  • objective-c (17)
  • fun (16)
  • android (16)
  • palm (16)
  • ci (16)
  • "soft" ware (16)
  • bdd (15)
  • tdd (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • css (14)
  • gem (13)
  • mouse-free development (12)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • api (12)
  • keyboard (11)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
Subscribe to agile Feed
  1. ←
  2. 1
  3. ...
  4. 65
  5. 66
  6. 67
  7. 68
  8. 69
  9. 70
  10. 71
  11. ...
  12. 79
  13. →
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >