Week of 2008-05-31 17:00 to 2008-06-07 16:59

Fixing IE6 PNG transparency in Rails applications

I’m a fan of using IE6’s behaviors to fix PNG transparency (PNG Behavior, IE PNG Fix). Unfortunately the scripts that I’ve used do not work out of the box for Rails because of Rails appending a timestamp to the end of the PNG files. To fix this the behavior files need to be updated with a better regular expression for detecting these PNG file requests. It’s not difficult to do once you figure out that is what the problem is.

strftime cheatsheet

I know there are other cheatsheets out there but I want one that’s close to home. I find myself needing to look up strftime parameters quite often in my Rails development work. Particularly difficult is remembering the different forms for the same time item. Anyway, here is a list formatted for my usage.

Recent Firefox add-ons

Here are some add-ons I’ve been testing recently.

  • I noticed that Firebug 1.2 Beta is now available which is good because 1.1 Beta was pretty unstable on my system.
  • I came across HTML Validator and thought I would give it a try.
  • I’ve been trying out ShowIP in order to test DNS round robin.

Capistrano recipes for deploying to Passenger

I did a search for recipes to handle starting/restarting Passenger rails applications. I cam across this dzone snippet that I felt had the right approach. It creates a mod_rails:restart task and then overrides the deploy:start and deploy:restart tasks with a call to that task. This not only accomplishes restarting properly but also removes the default deploy:restart task which is not applicable.

Open source distributed parallel fault tolerant file systems

Just thought I’d make a note of these for further research. Not sure I’ll actually use them in a project but it is a possibility.

  • Gfarm
  • GlusterFS
  • Hadoop - write-once-read-many, not production ready
  • MogileFS - write-once-read-many
  • HAMMER - not production ready

Cheap systems with hardware virtualization support

I need to build 1 or 2 systems to do some testing of virtualization technologies. They need to be as cheap as possible and there is no need for them to be particularly powerful. I decided to document my search here.

Ubuntu 8.04 backport and update requests I'm watching

Maybe it’s just my perception but I feel that backports for Ubuntu 8.04 haven’t been particularly forthcoming. These are the requested backports and updates that I would take advantage of should they become available.

Rails 2.1 Features: Change in find :include behavior

Interesting enough someone had mentioned this change to me over breakfast today but it was the first I had heard of it. That’s unfortunate because it was a change that ended up breaking my code. The jist of it is that when using an include parameter for finds Rails no longer just creates a join query. I agree that this is advantageous is many situations that are common for Rails apps but it neglects when you actually want to have a condition for the joined table. Thankfully it’s not too difficult to get the original behavior back by simply qualifying the column with its table name. I found some helpful details from these posts:

Update: The pluralization is tricky on these. The include must be the name of the association which is plural for has_many and singular for belongs_to. However the qualification must be the table name which is plural. Here is an example.

Rails 2.1 Migration Bugs: BenchmarkForRails

Upon updating an application to Rails 2.1 the first bug I saw prevented the application from loading due to the BenchmarkForRails plugin. Here's how I fixed it.

Rails 2.1 released

So Rails 2.1 is released. Here are some quick thoughts:

  • Even with a newer version of gems memory requirements for the upgrade can be hefty. On virtual servers with 512MB of RAM it is best to stop the app and web server instances before installing the new version.
  • I’m looking forward to phasing out scope_out present in 1 or 2 apps with named_scope (aka has_finder).
  • There have been times in the past where I had much need for gem dependencies but not so much these days. Still a nice feature to have available.
  • I’m really interested in playing with the dirty tracking/partial updates. I’m not sure they’ll make a lot of difference in any of my apps but it’s worth testing.

Comparing options for Xen file-based storage

I’ve concluded that file-based storage for hard disk images is more convenient from a management perspective than using LVM. However, even if one decides to go the route of using files there is still the question of which format to use. Xen supports several options at the moment with more to come (hopefully).

Creative Commons License Except where otherwise noted, content on this site is licensed under a Creative Commons by-nc-sa 3.0 License