Correction site for:

Ruby for Medicine and Biology Cover


  1. On page page 7, top line, at the beginning of the line, there should be a linebreak after C:\ftp\rb>irb

  2. The bigsort.pl script on page 150 of Ruby Programming for Medicine and Biology, has a few quirks. First, it assumes that the text file (to be sorted) is a DOS-style file with a two character (carriage-return,line-feed) linebreak. Also, it assumes that every line (in the file to be sorted) contains alphanumeric text.

    This slightly modified Ruby script will work in any type of text file and does not require text to appear on any lines of the file.
    #!/usr/local/bin/ruby
    text = File.open("terms.txt", "r")
    out = File.open("terms.put", "w")
    linearray = Array.new
    begin_position = 0
    text.each_line do
        |line|
        old_position = begin_position
        begin_position = text.pos
        line = line.chomp! + "          "
        linearray << line.slice(0..9) + old_position.to_s
    end
    linearray.sort!
    linearray.each do
      |value|
      seekplace = value.slice(10..20).to_i
      text.seek(seekplace, IO::SEEK_SET)
      out.puts(text.readline)
    end
    exit
    
    Thanks goes to Dr. Tim Rand, who spotted the error and sent me his own version of a fix on February 6, 2008.

  3. On page 288, In the List title, the intended word is MEANINFUL, not MEANINGUL.

  4. On page 290, in the middle of the third paragraph, the word nil shoud appear entirely in Courier font.


  • Contact the author by email.

    Last modified: Feb 9, 2008

    biomedical informatics cover Perl Programming for Medicine and Biology Cover Ruby for Medicine and Biology Cover Ruby: The Programming Language