libxml 0.96 and 0.97 leak massive amounts of memory. Don’t forget that libxml has other problems, too, as mentioned by us before. That said, it’s our go-to XML parser.
Several teams have had success with the IE6 PNG fix “DD_belatedPNG” by Drew Diller. But, do not attempt with
<td> elements, though
<td><span>...</span></td> does work.
Want to speed up ruby? Who doesn’t? Check it out: when you do not set the TZ environment variable, ruby shells out several times per second to see if the timezone has changed. To avoid this, run the following:
$ export TZ=:/etc/localtime
Thank you Joe Damato!
- One project recently switched to Passenger with great success. Hundreds of mongrel processes are now gone, deploys are easier and speedier, and the site is faster. WIN!
- Rails reminder:
flash[:notice] = "Good Job" will survive a redirect, while
flash.now[:notice] = "Good Job" will not. In general,
flash.now is used when you render a template without a redirect, such as when a form submit has validation errors.
- Pro bono: Would anyone like to help out KUSF for free? Their new website project has been stalled for a year.
Ask for Help
“How do you get Selenium to work with Firefox 3?”
If you know how, pull the jar files out of a later release and use those. Good luck!
Here’s a hot Fluid icon for Pivotal Tracker. Thanks, Ted!
Check out a couple of other icons in this Flickr upload.
- Teaser: Selenium for Flash! We’ve developed a Selenium-like framework for Flash. It’s pre-alpha, and needs to be extracted from it’s current home inside a project. Are you interested in a Selenium-like framework for Flash, or have you written one yourself? Let us know!
STI-weirdness. Rails surprise of the day: given a query of a
has_many :photos where Photos has STI subclasses (got that?) Rails will build a SQL query that includes the subclass types of Photo, which you might not want:
# query will have "... WHERE type IN ('Photo', 'OriginalPhoto', 'ThumbnailPhoto')"
It appears that the retardase_inhibitor might not work with Rails 2.1.X due to fixes in ActionMailer.
- JetBrains has been hard at work: they have released both a new Ruby plugin for IntelliJ, and a ruby-specific IDE (based on IntelliJ) named RubyMine.
Check out Pivot Jonathan’s wife’s art exhibit at Artist-Xchange Gallery in San Francisco, Friday 11/7 from 7-10pm:
3169 16th Street
Ask for Help
“I want to create a custom launcher for Firefox 2 and Firefox 3 with different profiles. Perhaps the real question is how do we create a custom version of a Mac application launcher, passing in the arguments we need?”
… without having to invoke it on the command line every time.
“We’re trying to delete cookies in our Controller, but they keep appearing in the headers anyway.”
Suggestion: make sure you are specifying your URL paths and domains correctly.
“Why won’t our CSS and other assets load the first time when accessing an SSL-protected domain on Engine Yard?”
It’s most likely not Engine Yard or Firefox 3’s fault. More research needed.
- It’s election day! If you are taking the time to read this geeky blog, you better have voted!
Ask for Help
“Is there some order-dependency issue with `has_many_polymorphs?”
We have a test that passes in isolation, but fails when the whole file is run.
“Any advice to setting up Lucine to allow us to search for strings with special characters, such as ‘-‘, without having to wrap them in quotes?”
We have some Lucine knowledge here but feel free to give us your suggestions as well.
- We discovered why a Flash widget was reloading itself: changes the CSS
position value. We were hiding the Flash widget by moving it’s containing
div off the page with
position: absolute; left: -9000, and removing the class that had those values to show it again. It turns out that changing that
position value causes the Flash to reload. By keeping the
position:absolute setting when we both show and hide our container div, the Flash no longer reloads.
Ask for Help
“When using Rails’s date_select helper, is there a corresponding helper method to turn that date format into a Date object in the controller?”
Some Snippets are available, but how about a Rails built-in solution?
- Where am I? — Ever need to find the name of the method you are currently within? Here’s a
this_method method! The magic is in the REGEX, of course.
caller =~ /`([^']*)'/ and $1
- One project wanted to test a very ActiveRecord-specific Module in an isolated, generic way. After spending time researching techniques of mocking and stubbing the many, many ActiveRecord methods that would be touched, they decided to just dynamically create an ActiveRecord and a DB Table for it on the fly! They even used single table inheritance (STI)
describe "MyMagicModule Mixin" do
:force => true do |t|
t.integer "some_model_b_id", :limit => 11
class SomeBaseModel < ActiveRecord::Base;end
class SomeModelA < SomeBaseModel
class SomeModelB < SomeBaseModel
it 'should use special belongs_to stuff from MyMagicModule' do
model_a = SomeModelA.create!(
:name=> "Model A",
:some_model_be => SomeModelB.create!(:name => "Model B"))
# test the functionality from MyMagicModule
At Pivotal, we host tech talks for our and guest developers. You can now subscribe to these video and audio tech talks on iTunes!
Just search for “Pivotal Labs” in iTunes, or click on the ‘Video’ or ‘Audio’ buttons on our Talks page. The current playlist includes:
- Scrum – Christian Sepulveda gives an overview of the Scrum development process as it applies to software.
- HAML – Felix Mario and Aaron Peckham talk about HAML.
- Vertebra – Ezra Zygmuntowicz talks about Vertebra, the distributed cloud application programming platform Engine Yard is building.
- Fire Eagle – Seth and Blaine talk about Fire Eagle, a location-awareness provider for online applications. Fire Eagle is a Yahoo! venture and gives applications and websites user-configurable information about the user’s location.
- New Relic – Lewis Cirne demos New Relic’s real-time Rails performance monitoring and analysis tool.
- Devver – Benk Brinkerhoff and Dan Mayer talk about Devver
- Rubini.us – Evan Phoenix answers questions about Rubinius, a Ruby virtual machine and compiler written as much as possible in Ruby.