<< | Index | >>
query became much faster !!
My imagemagick (and settings) on oddb.org were not installed, correctly.
1. updated
Last night, I installed(upgraded) following libraries,
to take a screenshot with import/animate
commands.
2. backed
Then, I could not restart odddbd (No Error, oddbd didn't respond)
(It seemed that my Postgres SQL also didn't)
Next, I tried downgrade to previous version.
3. denegate error
After reboot, these error caused in this URL.
(this was my state by last night.)
This page has png image.
error in SBSM::Session#to_html: /de/gcc/ddd_chart/for/31706033_Inderal_40_mg_Tageskostenvergleich.png Magick::ImageMagickError no decode delegate for this image format `/tmp/magick-RBdLEIWG-00000001' @ error/constitute.c/ReadImage/532: `(null)' /usr/local/lib/ruby/gems/1.9.1/gems/gruff-0.3.6/lib/gruff/base.rb:1088:in `get_type_metrics' /usr/local/lib/ruby/gems/1.9.1/gems/gruff-0.3.6/lib/gruff/base.rb:1088:in `calculate_caps_height' /var/www/oddb.org/src/view/ajax/ddd_chart.rb:163:in `setup_graph_measurements' /usr/local/lib/ruby/gems/1.9.1/gems/gruff-0.3.6/lib/gruff/base.rb:532:in `setup_drawing' /usr/local/lib/ruby/gems/1.9.1/gems/gruff-0.3.6/lib/gruff/base.rb:508:in `draw' /var/www/oddb.org/src/view/ajax/ddd_chart.rb:14:in `draw' /usr/local/lib/ruby/gems/1.9.1/gems/gruff-0.3.6/lib/gruff/base.rb:493:in `to_blob' /var/www/oddb.org/src/view/ajax/ddd_chart.rb:307:in `to_html' /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.1.4/lib/sbsm/state.rb:179:in `to_html' /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.1.4/lib/sbsm/session.rb:446:in `to_html' /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.1.4/lib/sbsm/session.rb:170:in `block in drb_process' <internal:prelude>:10:in `synchronize' /usr/local/lib/ruby/gems/1.9.1/gems/sbsm-1.1.4/lib/sbsm/session.rb:168:in `drb_process' /usr/local/lib/ruby/1.9.1/drb/drb.rb:1548:in `perform_without_block' /usr/local/lib/ruby/1.9.1/drb/drb.rb:1508:in `perform' /usr/local/lib/ruby/1.9.1/drb/drb.rb:1586:in `block (2 levels) in main_loop' /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `loop' /usr/local/lib/ruby/1.9.1/drb/drb.rb:1582:in `block in main_loop'
4. font for ghostscript.
Zeno-san suggested and taught me that font path of ghostscript are need for oddb.org.
$ cd /usr/share/fonts/default $ sudo ln -s /usr/share/fonts/urw-fonts/ ghostscript
5. USE flag for imagemagick.
before emerge imagemagick, to make sure USE flag "png", "jpg"
USE="...jpeg png"
6. finaly
access via bin/admin
ch.oddb> registration('51352') -> #<ODDB::Registration:0xcf39600> ch.oddb> registration('51352').package('017') -> #<ODDB::Package:0xf536d44> ch.oddb> registration('51352').package('017').ddd_price -> 1680000.00
I checked with p-debug.
Zithromax (reg:51352, pack:017) pulVer.
"ddd_galforms = (?i-mx:tabletten?)" "galenic_group = Lösbar zur Einnahme" "factor = 1.0" "ddose = 0.3 g" "mdose = 200 mg" "price = 16.80" "size = 15 ml"
price / (( size / mdose) / ddose) / factor
Tagesdosis 0.3 g Publikumspreis 16.80 CHF Stärke 200 mg Packungsgrösse 15 ml Berechnung ( 0.3 g / 200 mg ) x ( 16.80 / 15 ml ) = 6.72 CHF / Tag
I added Dose#to_g (to gram) method.
ch.oddb> registration('57524').package('002').dose -> 2 g ch.oddb> registration('57524').package('002').dose.to_i -> 2 ch.oddb> registration('57524').package('002').dose.to_g -> 2
ch.oddb> registration('51352').package('017').dose -> 200 mg ch.oddb> registration('51352').package('017').dose.to_i -> 200 ch.oddb> registration('51352').package('017').dose.to_g -> 0.019999999999999997
Dose#size has following units (as String).
My prerious fix has another problem for Sachet(s).
Then, I improved like this.
... @@ddd_grmforms = /[mg|g|ml]/iu ... def ddd_price ... if size.to_s.match(@@ddd_grmforms) (price / ((size / mdose.to_g).to_f / ddose.to_f)) / factor else (price / ((size * mdose).to_f / ddose.to_f)) / factor end ... end ...
Daily cost of Solubre powder(pulver.) and Glanulat()
needed handling unit of 'ml/mg'.
Fix ddd for Keppra and Granulat
Zeno-san suggested and teached me that old currencyd has slow converter.
I found updates to fix this problem in Masa-san's log.
Slow response were caused by query of currency converter.
module Currency @rates = {} @mutex = Mutex.new def Currency.extract_rate(html) - if(match = /1\s+[^<>=]+=\s+(\d+\.\d+)/.match(html)) + if(match = /\<span class=bld\>(\d+\.\d+) \w+\<\/span\>/.match(html)) match[1] end end def Currency.get_html(origin, target) Net::HTTP.start('www.google.com') { |session| - session.get("/search?q=1+#{origin.upcase}+in+#{target.upcase}").body + session.get("/finance/converter?a=1&from=#{origin.upcase}&to=#{target.upcase}").body } end def Currency.rate(origin, target)
I uninstalled ycurrency-1.0.0
from gem18 (ycurrencyd, too)
then installed ycurrency-1.0.1 via gem19
$ sudo gem19 uninstall ycurrency $ sudo -i gem install ycurrency
search query became much faster, fine !