Standup - 1/31/2008
Help!
- Has anybody successfully used the drag-and-drop functionality included in the newer versions of Selenium? It doesn't appear to work - the mouse events never seem to get fired.
Interesting
If you're messing with the solr.war inside of the solr_runner plugin, beware that the webapps directory (in which it sits) is scanned by Jetty for .war files, and that when your use 'rake solr_runner:start', you might not be running off the .war file you think you are. When we started SOLR this way, we saw some output from Jetty that indicated that it was unpacking and using the wrong .war file from that directory (in our case, it apparently used solr.war.new!).
The moral of the story is, if you want to swap in a new version of solr.war, just move it on top of the existing one, and don't put any other files in there.
Standup - 1/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?
Standup 01/28/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.
-
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
Standup 01/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.
Brown Bag: Blaine Cook on Starling
This week we were treated to a lunchtime tech-talk by Blaine Cook of Twitter. He came to talk to us about Starling, the all-Ruby message queue system that runs much of Twitter. Blaine spoke about the history and motivation for creating Starling, then showed how it worked, and talked about possible future enhancements and directions for further development.
Starling looks quite simple to use. The Starling server speaks the memcache protocol, so to talk to it you just need to load up the memcache-client gem and create a client instance. Note, the Starling server doesn't use memcached for its implementation at all; it just speaks the protocol.
Some interesting bits about why Blaine built Starling. It basically comes down to that every other solution had some problem that made it unsuitable for them to use. Here's the list:
- rq (by Ara Howard) - nfs/disk based, high latency
- DRb - not robust under load
- Rinda - very slow! O(n) for take operations
- Apache ActiveMQ - super complex
- RabbitMQ - Erlang dependency
In the last few months we've seen a lot of Starling-like things appear, some inspired by Starling itself.
- beanstalkd - uses memcached for storage, not persistent or recoverable
- bj - database backed
- thruqueue - uses Thrift protocol, ugly
- sparrow - Starling imitator
- ap4r - full-featured
Interesting new directions for Starling... Currently Starling has some overhead from polling on both client and server sides. Kevin Clark and Chris Wanstrath have hacked it to run using EventMachine to eliminate polling. Not sure what happens if clients die while request is waiting to be filled. Also, some issues with load balancing and starvation need to be looked at. And there are opportunities to build a richer client API.
Teaching Your Tests To Report Unused Parameters
Recently I was about to check in some changes and did a last minute click through of the application. All of a sudden I'm staring at a stack trace. My tests were green and I had functional tests for the failing controller/action.
Tests are like pants -- they cover your backside while you focus on other things like adding features to your application. Suddenly I felt a breeze on my cheeks. Something was amiss.
Standup 01/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?
Standup 01/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.
Standup 01/15/2008
Ask for Help
- "Can you use Google Maps on an https page?"
- Probably via an iframe. Is there a preferred way?







