Will Read's blog
Developers need to do stuff that you will never ask them to do, and if they asked you if it was ok to do it, you would tell them, "Let's do something else." I'm not talking about "gold-plating" an app, or the kind of thing an "architect astronaut" would cook up, I'm talking about real value-adding tasks that are near-impossible to assign a direct business value.
When I joined the project, we went from one pair, to two. Today, we're three pairs, six people strong. But the communication paths now are far more numerous than the one pair days.
There's a debate right now in my team about how to handle a "code freeze", a debate which I find myself on the outside of the majority. The idea behind the code freeze is that one stack of our app will be "frozen" through the holiday season, with few if any changes between now and January. Meanwhile, we'll keep on developing AND releasing to a separate stack.
Interesting Things
- "... not missing constant" ERROR To reproduce this error you do something like this:
Generate a rails app, call it "test".
Create a module scoped model called Post in app/models/mumble/post.rb
class Mumble::Comment < ActiveRecord::Base
belongs_to :post
end
Create a module scoped model called Comment in app/models/mumble/comment.rb
class Mumble::Comment < ActiveRecord::Base
belongs_to :post
end
Then at the command line
$ script/console
Loading development environment (Rails 2.3.3)
comment = Mumble::Comment.first
=> #
comment.post
=> #
exit
$ script/console
Loading development environment (Rails 2.3.3)
post = Mumble::Post.new
=> #
exit
$ script/console
Loading development environment (Rails 2.3.3)
post = Mumble::Post.create!
=> #
comment = post.comments.create!
=> #
comment.post
ArgumentError: Mumble is not missing constant Post!
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:417:inload_missing_constant' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:80:inconst_missing'
Apparently, there are various situations that can cause the infamous "Mumble is not missing constant Post!" error. In this case it appears the associations do not understand the module scoping, despite the statement:
By default, associations will look for objects within the current module scope.
at http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html
The solution was to explicitly declare the class name in the association:
class Mumble::Post < ActiveRecord::Base
has_many :comments, :class_name => "Mumble::Comment"
end
and
class Mumble::Comment < ActiveRecord::Base
belongs_to :post, :class_name => "Mumble::Post"
end
Then to show the error is no longer present
$ script/console
Loading development environment (Rails 2.3.3)
post = Mumble::Post.create!
=> #
comment = post.comments.create!
=> #
comment.post
=> #
- "Rake Set Theory" when running the same thing in rake multiple times, Rake strips out the extra commands. For example: $rake db:rollback db:rollback which you might expect to preform two rollbacks, only does one rollback. This can be frustrating if you're trying to couple rollbacks with a db:test:prepare or some other logical chain of events. At the command line you can of course work around most situations by && together multiple rake commands.
This is Part 2 of my two part series on working with queues in Ruby. If you want some context please head over to part 1. In this post I'll touch on Moqueue, using RSpec to stub out Bunny, and a few other hurdles along the way.
Q: How do you catch a unique rabbit?
A: Unique (you-neek) up on it!
Q: How do you catch a tame rabbit?
A: Tame way!!!!!
We've been using RabbitMQ as a queue server, alongside the clients, Bunny, and AMQP. In this series I'm hoping (hopping?) to show you some of the pitfalls we've learned to avoid and talk about how to write tests that test your code without getting stuck running a queue server in your test environment.
In Part 1 I'll focus on our situation and creating some context around our choices so that you can decide what makes sense for your project. In Part 2, I'll get into the nitty gritty of how to write some tests/specs around your queues.
An informal survey conducted earlier at Pivotal Labs asked "how often do you rotate pairs on your project?" The answer for the Best Buy Remix team is usually every two days, but three days is the hard stop. It was about the same when I worked on the Palm Pre apps. But back on Mavenlink, we rotated ever single day.
Working for Pivotal Labs is different than any other software shop I know. A big part of this is that it is easy to feel good about the product you're delivering to your client. Another reason is that we constantly challenge our own practices, ensuring that we continue to do the right things for the right reasons.
It's hard for me to be excited about participating when I feel like I can't contribute ideas. Sometimes it is a very formal situation created by organizational structure, for instance I don't see those enlisted in the army having much of a voice in how their platoon operates, let alone a base or the army as a whole.
Help
"How do I encrypt a user account on a Mac?"
The short answer is to use the FileVault. The drawback is that disc corruption will eat the entire home directory, instead of maybe just eating part of your home directory and leaving you some salvageable files. [Time Machine was also suggested as a possible solution for encrypting user data.]
Correction: TimeMachine, the back up util that comes with OS X, has trouble with the FileValut due to the encryption.
Interesting Things
- Erik Hanson points out that Amazon has released a web service called Elastic MapReduce which aims to "easily and cost-effectively process vast amounts of data [in parallel]". It supports development in Java, Ruby, Perl, Python, PHP, R, or C++. MapReduce is already being used to run a test suite by one of our clients.
- Related to MapReduce and Hadoop (the framework tused by Amazon's MR) is Zvents' HyperTable which enables the use of structured data with high performance. HyperTable will be presenting at GoGaRuCo.
- StackHub, a tool for making "the collection, analysis, reporting, and notification of your application logging events easy", is looking for Beta users (Java only). Stack Hub is in the same category as services like HopToad, but promises to differentiate itself from the pack.
