Steffen Hi, the name's Steffen and I'm writing about the Web, programming and all those things coming to my mind. Enjoy your stay.

I'm currently working on fabidoo.com - 3D Printing for everyone!

Memory Leaks in GetText for Ruby on Rails

March 22nd, 2008

Version 1.90.0 of GetText for Ruby has quite some memory leaks in its Rails support files. In my case, the memory Mongrel used increased by 1 MB with each request it served… Quite amazing that you don’t really find someone else having the problem… Well there’s at least a bug report on rubyforge…

Monkey-patching gettext.rb with the following code made things quite more relaxed:

  def bound_target(klass = self) # :nodoc:
    ret = nil
    if klass.kind_of? Class or klass.kind_of? Module
      ret = klass
    else
      ret = klass.class
    end
    ret = GetText if ret.name =~ /^\#<|^$/
    ret
  end

The memory usage grows extremly slow now and is acceptable for our current web site traffic.

Plus: It helps to “every now and then” call GetText.clear_cache - which I don’t like because you have to do it “manually”. It would be much better if GetText did its own garbage collection …

Tags: , , ,

Fat Transparent ShadedBorders

December 2nd, 2007

Ryan gave the idea and some code for a new ShadedBorder feature. Fat semi-transparent borders:

Fat Borders

And thanks alot NewTrax for fixing the hover issues on IE6. It needs a bit more CSS to get going, but will solve any issues. Check out the CSS included in test.html on how to use it.

Ah, right: it’s version 0.6 which has all these features. :-)

NewTrax and loads of others asked about the progress with the Safari 2 performance. Well… There isn’t… Apparently the problems result from the poor rendering performance of Safari 2 when lots of semi-transparent elements are on your page. As for ShadedBorder, there are millions. ;-) So maybe it’s a good approach, as NewTrax suggested, to disabled ShadedBorder on Safari 2 - not that bad, at least we’ve got the graceful degradation feature…

Tags: , , , ,

ShadedBorder with Gracefull Degradation

October 21st, 2007

Yeah well, it was raining… And I’ll be on holiday for quite some days from Tuesday on - without any computer. So this weekend was kind of the perfect time to hack a little bit on my neat little fun project ShadedBorder.

The result: after version 0.3 yesterday, today comes version 0.4. ;-) The new features:

  • Graceful Degradation: If JavaScript is disabled, your page will look almost as good as if ShadedBorder could do its job.
  • Simplified Usage: You no longer have to manually set the “sb” class to the elements you wish to round.
  • New example: Not really a feature, but it may help to see what’s really required to use ShadedBorder. Have a look at the source code of this page.

Graceful Degradation

Plus: maybe the IE7 bug is gone… Not really sure about that, because it seems to depend on how you use ShadedBorder…

Tags: , , , , ,

85839