Displaying posts tagged: ruby

Ruby ImageMagick memory allocation errors

No Comments

Summary: A Ruby/RMagick script of mine was failing with a variety of “Cannot allocate memory” errors. Adding a single line to the bottom of my thumbnail generation loop fixed this: img.destroy!.

Bootstrapping Ruby on Fedora Core 7

1 Comment

The context: a GoDaddy VPS running FC7 (apparently, GoDaddy hasn’t updated their VPS distros in years).

Sorting rated content

3 Comments

Anything with user-submitted ratings can be sorted by those ratings. But what is the best way? The naive approach is to sort by average rating. Unfortunately, this would rate 5-stars from a single user as higher than 4.5-stars from 150 users.

Calculating the area under the normal curve in Ruby

No Comments

Summary: Attached is a pure Ruby implementation of the AS66 algorithm (Hill 1973), ported from the Fortran code available here. It estimates the integral of the normal distribution, defaulting to the area under the right tail.

BioRuby's Bio::FlatFileIndex compatibility with BioPerl's Bio::DB::Flat

No Comments

Summary: Attached is a diff that allows Bio::FlatFileIndex to access BDB flatfile databases created by BioPerl’s Bio::DB::Flat. I have not changed the way BioRuby creates its databases, so this likely breaks access to BioRuby-created flatfile indices.