view · edit · sidebar · attach · print · history

20111013-date-ruby193-encoding-error-htmlgrid_so-oddb_org-missing-drug-search-bbmb_ch

<< | Index | >>


  1. Date oddb.org on Ruby 1.9.3
  2. 'Arzneimittel A-Z' search
  3. Missing drug search bbmb.ch

Goal/Estimate/Evaluation
  • Date problem oddb.org on Ruby 1.9.3 / 90% / 90%
  • Debug missing drug search bbmb.ch / 100% / 100%
  • Arzneimittel AZ search / 50% / 50%
Milestones
  1. debug ODDB::Date._load
  2. Missing drug search bbmb.ch
  3. Arzneimittel Search oddb.ch

Date oddb.org on Ruby 1.9.3

Run

 ruby193 -I ../oddb/lib bin/oddbd

Access

Log

/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:78: warning: Hash#index is deprecated; use Hash#key
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:78: warning: Hash#index is deprecated; use Hash#key
error in SBSM::Session#to_html: /
NoMethodError
undefined method `new!' for Date:Class
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/18_19_loading_compatibility.rb:44:in `_load'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/marshal.rb:15:in `load'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/marshal.rb:15:in `load'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:588:in `restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:313:in `block in fetch_or_restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:308:in `call'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:308:in `fetch_or_do'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:312:in `fetch_or_restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:62:in `block in bulk_restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:59:in `each'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:59:in `bulk_restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:53:in `bulk_fetch'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:255:in `fetch_collection'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:592:in `restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:313:in `block in fetch_or_restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:308:in `call'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:308:in `fetch_or_do'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:312:in `fetch_or_restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:600:in `restore_object'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:565:in `load_object'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:221:in `block in fetch'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:308:in `call'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:308:in `fetch_or_do'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:220:in `fetch'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/stub.rb:49:in `odba_receiver'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/stub.rb:112:in `method_missing'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/stub.rb:131:in `[]'
/home/masa/ywesee/oddb.org/src/util/oddbapp.rb:1148:in `sponsor'
/home/masa/ywesee/oddb.org/src/util/session.rb:181:in `sponsor'
/home/masa/ywesee/oddb.org/src/view/logohead.rb:25:in `sponsor'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:66:in `create'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:290:in `compose_component'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:209:in `block in compose'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:203:in `each'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:203:in `compose'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:55:in `init'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/component.rb:138:in `initialize'
/home/masa/ywesee/oddb.org/src/view/custom/head.rb:67:in `new'
/home/masa/ywesee/oddb.org/src/view/custom/head.rb:67:in `head'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:66:in `create'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:290:in `compose_component'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:209:in `block in compose'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:203:in `each'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:203:in `compose'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:55:in `init'
/home/masa/ywesee/oddb.org/src/view/publictemplate.rb:50:in `init'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/component.rb:138:in `initialize'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:243:in `new'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:243:in `view'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:179:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:450:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:170:in `block in drb_process'
<internal:prelude>:10:in `synchronize'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:168:in `drb_process'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
ODDB::View::WelcomeHead::COMPONENTS[[1, 0, 0]] in create(sponsor)
ODDB::View::Drugs::Search::COMPONENTS[[0, 0]] in create(head)
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:78: warning: Hash#index is deprecated; use Hash#key
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:78: warning: Hash#index is deprecated; use Hash#key
error in SBSM::Session#http_headers: /
NoMethodError
undefined method `new!' for Date:Class
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/18_19_loading_compatibility.rb:44:in `_load'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/marshal.rb:15:in `load'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/marshal.rb:15:in `load'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:588:in `restore'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/cache.rb:313:in `block in fetch_or_restore'

ODBA::Date._load error

  • ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/18_19_loading_compatibility.rb

Note

  • Date#new! is gone in Ruby 1.9.3 (It is defined in Ruby 1.9.2 also 1.8.7)

Reference

- (Date) initialize(ajd = 0, of = 0, sg = ITALY) 
NOTE this is the documentation for the method new!(). 

ajd is the Astronomical Julian Day Number. 
of is the offset from UTC as a fraction of a day. Both default to 0.
sg specifies the Day of Calendar Reform to use for this Date object. 

Experiment

  • ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/18_19_loading_compatibility.rb
      #new!(ajd, of, sg)
      jd(ajd)

Access

Result

  • No Error

Access

Result

  • Search works

Note

  • of and sg data are not used in the _load method
  • The date data is one day different from the original data

Ruby 1.8.6

Ruby 1.9.3

Experiment

  • ruby193rc1/lib/ruby/gems/1.9.1/gems/odba-1.0.0/lib/odba/18_19_loading_compatibility.rb
      #new!(ajd, of, sg)
      ajd += 1.to_r/2
      jd(ajd)

Result

  • Date becomes correct
  • Let's see tomorrow again

References

'Arzneimittel A-Z' search

Error

  • When an alphabet is clicked, the following error happens
NoMethodError
undefined method `each' for "a":String
/home/masa/ywesee/oddb.org/src/util/interval.rb:96:in `load_model'
/home/masa/ywesee/oddb.org/src/state/page_facade.rb:44:in `init'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:370:in `process'
/home/masa/ywesee/oddb.org/src/util/session.rb:113:in `process'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:169:in `block in drb_process'
error in SBSM::Session#to_html: /de/gcc/sequences/range/a
NoMethodError
undefined method `[]' for nil:NilClass
/home/masa/ywesee/oddb.org/src/state/page_facade.rb:65:in `page'
/home/masa/ywesee/oddb.org/src/state/page_facade.rb:62:in `filter'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:242:in `call'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:242:in `view'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:179:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:450:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:170:in `block in drb_process'
<internal:prelude>:10:in `synchronize'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:168:in `drb_process'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
error in SBSM::Session#http_headers: /de/gcc/sequences/range/a
NoMethodError
undefined method `[]' for nil:NilClass
/home/masa/ywesee/oddb.org/src/state/page_facade.rb:65:in `page'
/home/masa/ywesee/oddb.org/src/state/page_facade.rb:62:in `filter'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:242:in `call'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:242:in `view'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:144:in `http_headers'

Experiment

  • src/util/interval.rb
    def load_model
      if((tmp_rng = user_range) && tmp_rng != @range)
        @model.clear
        parts = @range = tmp_rng
        if(@range == '0-9')
          intervals
          parts = @numbers
        end
        #parts.each { |part|
        parts.each_char { |part|
  • src/util/iso-latin1.rb
    unless instance_methods.include?('_downcase')
    include ODDB::Util::IsoLatin1
    alias :_downcase :downcase
    alias :_downcase! :downcase!
    def downcase
      #res = _downcase
      res = _downcase.force_encoding('utf-8')

Access

Result

error in SBSM::Session#to_html: /de/gcc/sequences/range/r
Encoding::CompatibilityError
incompatible character encodings: UTF-8 and ASCII-8BIT
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:277:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:277:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:277:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:277:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:277:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/composite.rb:277:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:134:in `block in to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:124:in `call'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:124:in `template_tags'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:116:in `block (2 levels) in template_html'
(eval):1086:in `body'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:115:in `block in template_html'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/cgi/html.rb:437:in `block in html'
(eval):1069:in `html'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/cgi/html.rb:437:in `html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:109:in `template_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/lib/htmlgrid/template.rb:131:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/state.rb:179:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:450:in `to_html'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:170:in `block in drb_process'
<internal:prelude>:10:in `synchronize'
/home/masa/bin/ruby193rc1/lib/ruby/gems/1.9.1/gems/sbsm-1.0.0/lib/sbsm/session.rb:168:in `drb_process'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop'
/home/masa/bin/ruby193rc1/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'

Note

  • The error is coming from htmlgrid.so (HtmlGrid::Grid class)
  • rb_force_encoding is a static function
  • -> it is impossible to use in a Ruby extended library

Check

  • htmlgrid/grid.c
printf("encoding type ");
printf("%s %s\n", rb_enc_get(result)->name, rb_enc_get(item_html)->name);
              rb_str_concat(result, item_html);

Make

ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/ext/htmlgrid $ ruby193 extconf.rb 
creating Makefile
ruby193rc1/lib/ruby/gems/1.9.1/gems/htmlgrid-1.0.0/ext/htmlgrid $ make

Access

Result

encoding type ASCII-8BIT UTF-8
encoding type ASCII-8BIT US-ASCII
encoding type UTF-8 US-ASCII
encoding type ASCII-8BIT US-ASCII
encoding type UTF-8 UTF-8
encoding type UTF-8 ASCII-8BIT

Note

  • both result and item_html variables can have different encodings
  • I should fix both encoding

Reference

  • typedef struct OnigEncodingTypeST
  • It is defiined in oniguruma.h, encoding.h

Missing drug search bbmb.ch

Refer to http://dev.ywesee.com/wiki.php/Gag/Bbmbchangelog

Note

  • The git clone source does not work on the log/mnemonic data of the production server
  • This should be fixed in the future
view · edit · sidebar · attach · print · history
Page last modified on October 13, 2011, at 04:49 PM