Davis W. Frank's blog
Interesting Things
- Webrat + Selenium + IE7 => FAIL - The problem is in the file
label.js, which is custom matcher code that Webrat injects into Selenium at run-time (EEK --ed.). That code was not IE7 compliant. The team decided to fork Webrat, pull out selenium-rc and use their own selenium-rc gem to solve the problem. There's a Lighthouse ticket for this this issue. - For those of you upgrading to Rails 2.3, one team had a large chunk of issues that made the upgrade take over a day. They had myriad issues with: Polonium, RSpec, & Cucumber. Another team reports that ActiveScaffold also made things difficult. Before you point to DHH's RailsConf 2009 Keynote where he said "Don't upgrade if things are working", the former team wanted to use...
default_scope- This is a great idea, but it's not yet ready for prime time. It can't be arbitrarily chained with ActiveRecord associations (much likeacts_as_paranoidwas originally implemented) - so you need to add calls it to the end of your chained association & scoping calls. Which doesn't really make it default, does it?- Think that your brand new download of RubyMine is a little slow? Make sure you have Java 1.6 installed, then open the plist file (locations vary by host OS) and change the value that says
1.5*to1.6*. The Mine will now require Java 1.6, which is known to have snappier garbage collection. (I tried this today and found fewer beach balls of tranquility. YMMV. --ed.). - Stack Overflow DevDays were announced. It's a set of one-day conferences with San Francisco's being October 19th.
Help
Is Rails' built-in
protect_from_forgeryworth using? Does anyone turn it off?
The overall consensus is, "Of course we use it! Why would you turn off this default?" Well, It's a little bit of pain when you're constructing your own Ajax requests - it breaks perf tests, but it's turned off for other tests. You may get Invalid Authenticity Token exceptions. (Joseph?)
How do you aggregate results of background tasks in a nightly report?
At least turn on the cron flag for emailing you results of cron jobs. Or, look at Delayed Job. Since tasks live in the database, you could make a status page or have another job to mail a report.
Interesting Things
- Using Eric Meyer's
reset.cssin an<IFRAME>on an undetermined patch level (but not up-to-date) version of IE6 results in a horrible browser freeze - the kind where it doesn't chew CPU cycles & can't seem to update it's window at all. The team solved the problem by droppingreset.cssand (GASP! --ed.) inlining the necessary styles to make the<IFRAME>look as required. IE8.jsmade IE7 kind of horrible. It's a known issue with this library that big DOMs and/or a lot of CSS can slow the browser down enough as to make it unusable. WhileIE8.jsis configurable (dropping unneeded features), the team wasn't using enough of its features and moved on.- If you've been playing with Compass, a (cool --ed.) CSS framework in SASS that we've talked about before, you've had to build your own HAML gem from scratch since Compass has depended on HAML edge. The open source elves have been working a bit of overtime and have made the
haml-edgegem that removes this step. Check out this Compass commit for more detail.
Help
Who Want's to Buy My Mom's House in Salmon, Idaho?
Pivot Joe has launched his own Internet reality show. Contestant applications are being accepted now.
First, thanks to everyone who came - especially those who laughed at all the right spots. If I didn't get to your question, I'm here through Thursday afternoon.
There were a couple of questions during the talk and lots after the talk about how to deal with remote pairs. Since it's RailsConf and most folks are on MacOS, ScreenSharing.app came up.
As I've mentioned before, I'll be giving a talk at RailsConf on how I "got more agile" once I was able to practice every day. The goal is for my story to help you in your career, telling some good stories in the process.
To celebrate/entice you to come to RailsConf & my talk, (Tuesday, 2:50pm, Ballroom A) and to thank those of you who contributed your own tips, I have two things for you.
First is a promise of Pivotal Labs swag (content TBD) to anyone who submitted a tip & to the first five comment authors who claim it below and identify themselves at the actual session - no sneaking off to Scott's Advanced Git talk.
Second, for everyone, is a RailsConf discount of 15% in case you haven't registered yet. When you register, use the promo code RC09FOS. Note that as of yesterday, the Hilton's room rate has dropped to $99 a night. w00t!
Warning: a bit of Shameless Self-Promotion follows
Sitting in more than one session at RailsConf 2008, I noticed speakers that were advocating, directly or indirectly, Agile practices. But, aside from Kent Beck's great keynote, there wasn't a lot of 'pure Agile' on the program.
I left the conference inspired to write a presentation that would help those in the Rails community get better at their jobs.
I had some ideas, but last summer I asked you what helped you be Agile day-to-day. I took your comments, the tips from fellow Pivots, and my own hacks and made them blend. The result is a presentation called "I Rock, I Suck, I Am" that was accepted for the program at RailsConf 2009.
So thanks to you for your thoughts & comments - they all helped shaped my presentation. And if you're at RailsConf, come on by with your curious and/or reluctant peers and have a listen.
Interesting Things
- A polite reminder that when defining associations that need
:class_nameor:sourcekeys that the values should be strings and not Ruby constants. That way lies madness. - RubyMine build 500 gets running “Focused”
Test::Unittests (file or single test) right viaCtrl-Shift-F10. Specs aren’t working quite right yet, but JetBrains appears to be working on it.
Ask for Help
“Anyone having odd slowness with Google Gears?”
We are having an issue with slowness in a Google Gears app, where certain actions take several times longer on some boxes. It is only slow on some of the client’s windows XP machines, but not all. Never on mac. It is slow in BOTH Firefox 3 and IE 7 on the slow machines.
The Gears sqlite db and dir does not seem to be the problem either - a clean IE data, cache and gears data dir still runs slow, and moving the ‘slow’ gears data dir to a fast machine runs fast.
Also cleared all IE data, compared/upgraded Gears versions, Java versions, and Windows Service Pack versions. Nothing seems to be a common denominator yet. Nothing obvious on google searches…
"Multi-select widget for a 'has_many :through' relationship?”
I have an association like this:
class Foo
has_many :bars, :through => :barrings
end
I'm looking for a 'widget' for the Foos page that will let me assign/unassign multiple Bars at once. Looking at the select, select_tag, options_for_select helpers, etc, reminded me that the Rails built-in stuff is lacking. I was hoping that someone has already written a sweet multi-select widget that I could be lazy and use.
Kent Beck gave a great 'story-driven' talk at RailsConf 2008 regarding Patterns, Test Driven Development, and XP/Agile/Responsible development. Go see it now at Blip.tv along with all the other big presentations from RailsConf.
Yeah, yeah. This was posted ages ago, but I just made it around to watching it tonight.
Two great quotes. First, re: TDD
Testing really isn't the point. The point here is about responsibility. When you say it's done, is it done. Can you go to sleep at night, do you know that the software you finished today . . . works. And will help. And isn't going to take anything away from people.
Second, more generally about ideas:
Smart ideas are useless. Nobody else is going to be dumb enough not to try them - or rather, Everybody's going to try them if it's a smart idea. Ideas with punch are the ones that are really ridiculous...until you try them.
Like Mole. Mole sauce. Chocolate? Chicken? Phbbblblltt! HahahaHA!
I posted a few weeks ago gathering small tips from you regarding how you get and/or stay more Agile.
The goal is a list of short, pithy, sticky aphorisms to help both newbies get Agile and us stay that way. Think Agile Andy's Almanack (or something).
I've thrown everything I got (a lot in person & email) together and categorized a bit. Please comment, add, delete, etc. As I said, I'm working on a presentation around this data and welcome your feedback.
Here goes:
Stick to Conventions
- Follow the local ground rules (indenting, naming, structure, etc.)
- Always take the next story (don't let 'fun' or 'hard' get in the way of business priority)
Use the right tools
- Keep your hand on the manual (Keep browser tabs open for your language & API doc sites)
- Make mini actionable task lists for your story (Get inspired by GTD)
- Index cards are mini whiteboards
- Hardware, hardware, hardware (Big and/or dual monitors, 2 keyboards & 2 mice is better than 1 & 1)
Pair Programming Works
- Expect to Pair
- Pair appropriately
- When you're not sure how to implement a story, pair with someone more senior
- When a task feels obvious, pair with someone more junior or new to the project
- Let the rookie type, give the wookie a toy (so he doesn't)
- Rotate your pairs as often as practical
- 2 pairs are better than 1 on a project
- Always pair interview
Take a test drive
- Writers' block? BEWS (Blank Editor Window Syndrome)? Write a test
- Find some untested code? Write a test.
- Find something you don't understand? Write a test.
- Keep your tests as fast as is practical, or you'll wait for CI to run them
- Write enough tests so that you can sleep at night
Code simply
- Do the simplest thing that could possibly work - no architecture astronauts
- Check-in multiple times before a story is done (try for every hour or so)
- Kill dead code, commented out code, or write tests to cover it
- Make it green, then make it clean
- Tackle code debt with extreme prejudice
- Leave the code cleaner than when you got there (think o2 canisters on Everest)
CI
- Every failing test is sacred
- Red builds are project cancer - fix first, figure out why, then blame (when appropriate)
Stay in sync
- Don't stop talking - to your pair, your team or your customer
- Go to lunch together
Comment away...
I've been passionate about Extreme Programming and Agile Software Development Practices since first hearing Kent Beck speak back in 2002. But it took five years, and finding a job where I was expected by management to be Agile every day (TDD, paring, etc.), before I was able to actually call myself an Agile Engineer.
I'm sure that there are more of you out there who want to be more Agile. And you want more Agile engineers so that you'll have reasonable people to work with and learn from.
In the past 18 months I've picked up a lot of effective small practices that you won't find in the White Book. Things like making sure you pick the next story no matter your comfort level. Or fixing a red CI build ASAP.
In order to spread the knowledge, I'm working on a presentation about the 'practices that work' to share with potential Agile Engineers at a future software conference near you.
So what day-to-day practices make you more Agile?
Interesting Things
- There was an edge version of Rails (this project has a frozen Rails at some point in the past) that had a bug where a namespaced route would send a POST that should go to
MyController#createwas instead going to a POST toMyController#index. The fix is to freeze to current Edge, or usealias_method.
Ask for Help
"Any way to turn off a validation in a re-opened class?"
No way to do this. Best to refactor by pulling the validation out of the class and then mixing it in, or not, at a different level.







