proposal: debug keyword

467 messages in this thread from ruby-talk in 2004-02

  1.   Simon Strandgaard <neoneye@ad...dk> 02-25 12:24
  2.   missing
  3.   Gavin Sinclair <gsinclair@so...au> 02-01 12:00 Constant visibility
  4.   ts <decoux@mo...fr> 02-01 12:07
  5.   Gavin Sinclair <gsinclair@so...au> 02-01 12:47
  6.   Robert Klemme <bob.news@gm...net> 02-01 12:44
  7.   David Garamond <lists@za...com> 02-01 12:15 check whether a class is defined, listing all classes
  8.   Robert Klemme <bob.news@gm...net> 02-01 12:39
  9.   David Garamond <lists@za...com> 02-01 13:52
  10.   ts <decoux@mo...fr> 02-01 13:58
  11.   David Garamond <lists@za...com> 02-01 15:49
  12.   Robert Klemme <bob.news@gm...net> 02-01 17:29
  13.   Gavin Sinclair <gsinclair@so...au> 02-01 14:21
  14.   Gavin Sinclair <gsinclair@so...au> 02-01 12:57 Save the flip/flop op!
  15.   Robert Klemme <bob.news@gm...net> 02-01 14:04
  16.   Michael campbell <michael_s_campbell@ya...com> 02-01 15:28 Question on the flip/flop op
  17.   Robert Klemme <bob.news@gm...net> 02-01 17:34
  18.   Zach Dennis <zdennis@mk...com> 02-01 17:42 Question on the flip/flop op
  19.   Robert K. <anon@no...de> 02-01 19:44 ruby way to enumerate users
  20.   Mark J. Reed <markjreed@ma...com> 02-01 21:14 ruby way to enumerate users
  21.   Robert K. <anon@no...de> 02-01 21:49
  22.   Gavin Sinclair <gsinclair@so...au> 02-01 21:56
  23.   Mark J. Reed <markjreed@ma...com> 02-01 22:54
  24.   Eric Sunshine <sunshine@su...com> 02-01 23:29
  25.   djberg96@ho...com (Daniel Berger) 02-02 03:34
  26.   KONTRA Gergely <kgergely@ml...hu> 02-02 15:47
  27.   Rove Monteux <rove.monteux@fl...com> 02-02 16:17
  28.   Mark J. Reed <markjreed@ma...com> 02-08 21:04
  29.   Mark J. Reed <markjreed@ma...com> 02-09 01:31
  30.   Robert K. <anon@no...de> 02-08 20:59
  31.   tony summerfelt <snowzone5@ho...com> 02-02 23:10 principle of most suprise
  32.   shasckaw <shasckaw@sk...be> 02-03 11:05 role pattern lib for ruby
  33.   Gennady <gfb@to...com> 02-03 16:55 RCR draft for enhanced "case..when..else..end" syntax
  34.   Robert Klemme <bob.news@gm...net> 02-04 08:35
  35.   Sam Roberts <sroberts@un...com> 02-04 13:38
  36.   Gennady <gfb@to...com> 02-04 15:52
  37.   Robert Klemme <bob.news@gm...net> 02-08 21:41
  38.   Robert Klemme <bob.news@gm...net> 02-09 00:01
  39.   Robert Klemme <bob.news@gm...net> 02-09 01:18
  40.   Simon Strandgaard <neoneye@ad...dk> 02-04 12:40 code that has been reached
  41.   Robert Klemme <bob.news@gm...net> 02-04 13:05
  42.   Robert Klemme <bob.news@gm...net> 02-08 21:46
  43.   Robert Klemme <bob.news@gm...net> 02-09 00:06
  44.   Robert Klemme <bob.news@gm...net> 02-09 01:24
  45.   Austin Ziegler <austin@ha...ca> 02-04 16:52 RCR draft for enhanced "case..when..else..end" syntax
  46.   Guoliang Cao <gcao@le...net> 02-04 17:55
  47.   matz@ru...org (Yukihiro Matsumoto) 02-04 18:29
  48.   Guoliang Cao <gcao@le...net> 02-04 18:41
  49.   missing
  50.   Austin Ziegler <austin@ha...ca> 02-04 18:43
  51.   Guoliang Cao <gcao@le...net> 02-04 19:07
  52.   Sean O'Dell <sean@ce...com> 02-04 19:27
  53.   Austin Ziegler <austin@ha...ca> 02-04 21:55
  54.   Robert Klemme <bob.news@gm...net> 02-05 08:25
  55.   Robert Klemme <bob.news@gm...net> 02-08 21:56
  56.   Robert Klemme <bob.news@gm...net> 02-08 21:57
  57.   Robert Klemme <bob.news@gm...net> 02-09 00:17
  58.   Robert Klemme <bob.news@gm...net> 02-09 01:31
  59.   Robert Klemme <bob.news@gm...net> 02-05 08:55
  60.   Robert Klemme <bob.news@gm...net> 02-09 00:15
  61.   Robert Klemme <bob.news@gm...net> 02-09 01:31
  62.   YANAGAWA Kazuhisa <kjana@dm...to> 02-05 12:03
  63.   tony summerfelt <snowzone5@ho...com> 02-08 21:19 principle of most suprise
  64.   shasckaw <shasckaw@sk...be> 02-08 21:27 role pattern lib for ruby
  65.   tony summerfelt <snowzone5@ho...com> 02-08 23:37 principle of most suprise
  66.   shasckaw <shasckaw@sk...be> 02-08 23:45 role pattern lib for ruby
  67.   tony summerfelt <snowzone5@ho...com> 02-09 00:58 principle of most suprise
  68.   shasckaw <shasckaw@sk...be> 02-09 01:04 role pattern lib for ruby
  69.   tony summerfelt <snowzone5@ho...com> 02-09 01:53 principle of most suprise
  70.   Charles Comstock <cc1@ce...edu> 02-09 09:30 Multi-threading lesson wanted
  71.   Piergiuliano Bossi <p_bossi_AGAINST_SPAM@ti...it> 02-10 13:20 evaluate and print an expression
  72.   missing
  73.   =?ISO-8859-1?Q?Julio_Fern=E1ndez?= <jfc@se...com> 02-10 13:33 How to create babel-17
  74.   Sam Roberts <sroberts@un...com> 02-12 16:18
  75.   rmb25612@ya...com (Richard James) 02-10 23:44 I´m_too_dumb_to_program
  76.   Simon Strandgaard <neoneye@ad...dk> 02-12 12:09 (noob) cast string to array?
  77.   Gavin Sinclair <gsinclair@so...au> 02-12 12:37
  78.   Simon Strandgaard <neoneye@ad...dk> 02-12 12:50
  79.   Simon Strandgaard <neoneye@ad...dk> 02-12 16:50 (noob) cast string to array?
  80.   Robert Klemme <bob.news@gm...net> 02-13 09:28
  81.   Michael Campbell <michael_s_campbell@ya...com> 02-12 01:00
  82.   David Naseby <david.naseby@eo...au> 02-12 02:55
  83.   =?iso-8859-1?Q?=22Pe=F1a=2C_Botp=22?= <botp@de...com> 02-12 03:22
  84.   Kirk Haines <khaines@en...com> 02-12 16:55 Avi Bryant's Kansas package?
  85.   avi@be...com (Avi Bryant) 02-13 02:04
  86.   Kirk Haines <khaines@en...com> 02-13 05:58
  87.   Ara.T.Howard <ahoward@fa...gov> 02-13 16:24 return from yielded block
  88.   aastanti@ho...com (Alfio Astanti) 02-13 17:15 What is a "role pattern"? (wasrole pattern lib for ruby)
  89.   David A. Black <dblack@wo...net> 02-16 11:18 Gateway again
  90.   intc_ctor@ya...com (Phil Tomson) 02-16 22:39 OT: Traits
  91.   David A. Black <dblack@wo...net> 02-16 22:54
  92.   Mark Hubbart <discord@ma...com> 02-17 19:48 Frozen string problem, but I haven't frozen anything?
  93.   Robert Klemme <bob.news@gm...net> 02-18 08:14
  94.   Simon Strandgaard <neoneye@ad...dk> 02-18 12:59 how to raise warning?
  95.   Szymon Drejewicz <drejewic@ws...pl> 02-18 15:39 how to raise warning?
  96.   Robert Klemme <bob.news@gm...net> 02-18 16:29 how to raise warning?
  97.   Andrew Johnson <ajohnson@cp...org> 02-18 17:15 how to raise warning?
  98.   Josef 'Jupp' SCHUGT <jupp@gm...de> 02-19 20:56 how to raise warning?
  99.   matz@ru...org (Yukihiro Matsumoto) 02-20 05:17 how to raise warning?
  100.   Gavin Sinclair <gsinclair@so...au> 02-20 06:52
  101.   Hal Fulton <hal9000@hy...com> 02-20 06:58
  102.   Joel VanderWerf <vjoel@PA...EDU> 02-20 08:22
  103.   Robert Klemme <bob.news@gm...net> 02-20 11:53
  104.   nobu.nokada@so...net 02-20 12:27
  105.   Tim Hunter <Tim.Hunter@sa...com> 02-20 14:09
  106.   jrb3@ei...com 02-20 17:02
  107.   jrb3@ei...com 02-20 17:17
  108.   Josef 'Jupp' SCHUGT <jupp@gm...de> 02-21 12:04
  109.   missing
  110.   jrb3@ei...com 02-22 18:31 OT: XP tester (washow to raise warning?)
  111.   Simon Strandgaard <neoneye@ad...dk> 02-20 11:20 proposal: let kind_of take more arguments
  112.   Robert Klemme <bob.news@gm...net> 02-20 11:20
  113.   Simon Strandgaard <neoneye@ad...dk> 02-20 11:20
  114.   Robert Klemme <bob.news@gm...net> 02-20 11:21
  115.   Simon Strandgaard <neoneye@ad...dk> 02-20 12:19
  116.   Ara.T.Howard <ahoward@fa...gov> 02-20 11:20 proposal: let kind_of take more arguments
  117.   Simon Strandgaard <neoneye@ad...dk> 02-20 11:20
  118.   Ara.T.Howard <ahoward@fa...gov> 02-20 11:20
  119.   Simon Strandgaard <neoneye@ad...dk> 02-20 11:21
  120.   Ara.T.Howard <ahoward@fa...gov> 02-20 11:21
  121.   Robert Klemme <bob.news@gm...net> 02-20 11:23
  122.   Robert Klemme <bob.news@gm...net> 02-20 11:21
  123.   missing
  124.   Szymon Drejewicz <drejewic@ws...pl> 02-20 11:20 how to raise warning?
  125.   Gavri Savio Fernandez <Gavri_F@in...com> 02-20 07:50
  126.   Mark Hubbart <discord@ma...com> 02-20 08:25
  127.   Robert Klemme <bob.news@gm...net> 02-20 11:56
  128.   Hal Fulton <hal9000@hy...com> 02-20 19:09
  129.   Andrew Johnson <ajohnson@cp...org> 02-20 20:54
  130.   missing
  131.   Charles Comstock <cc1@ce...edu> 02-20 23:09
  132.   David A. Black <dblack@wo...net> 02-20 11:54
  133.   Robert <bobx@li...org> 02-22 02:14 Puzzling...
  134.   missing
  135.   =?iso-8859-1?q?Thomas=20Adam?= <thomas_adam16@ya...com> 02-03 15:23 Image conversion ...
  136.   Carlos <angus@qu...ar> 02-03 17:48 Image conversion ...
  137.   paul vudmaska <paul_vudmaska@ya...com> 02-03 18:16
  138.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-03 20:13 Image conversion ...
  139.   Ruby Tuesday <rubytuzdayz@ya...com> 02-03 21:25
  140.   Ruby Tuesday <rubytuzdayz@ya...com> 02-08 21:37
  141.   Ruby Tuesday <rubytuzdayz@ya...com> 02-08 23:54
  142.   Ruby Tuesday <rubytuzdayz@ya...com> 02-09 01:12
  143.   Tim Hunter <Tim.Hunter@sa...com> 02-08 21:34 Image conversion ...
  144.   Ara.T.Howard <ahoward@fa...gov> 02-08 21:34
  145.   Useko Netsumi <usenets_remote_this@ea...net> 02-04 00:00
  146.   Sam Roberts <sroberts@un...com> 02-04 00:22
  147.   Useko Netsumi <usenets_remote_this@ea...net> 02-08 21:39
  148.   Tim Hunter <cyclists@nc...com> 02-08 21:39
  149.   Useko Netsumi <usenets_remote_this@ea...net> 02-08 23:58
  150.   Useko Netsumi <usenets_remote_this@ea...net> 02-09 01:16
  151.   matthew c. mead <mmead@go...com> 02-09 03:44 Image conversion ...
  152.   Useko Netsumi <usenets_remote_this@ea...net> 02-10 02:10
  153.   wsdng@on...de (Sascha D?rdelmann) 02-10 09:44 Image conversion ...
  154.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-11 03:35 Help!
  155.   Erika Lockhart <fiatgirl@pa...net> 02-11 16:30 Help!
  156.   maco@le...jp <kwa@ku...com> 02-12 22:09 (retry) Kwartz -- a template system for Ruby, PHP and Java
  157.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-20 21:40
  158.   missing
  159.   missing
  160.   paul vudmaska <paul_vudmaska@ya...com> 02-05 15:35 Ruby Web Application Framework Roundup
  161.   Kirk Haines <khaines@en...com> 02-05 17:10
  162.   Tom Copeland <tom@in...com> 02-05 17:25
  163.   Kirk Haines <khaines@en...com> 02-05 17:34
  164.   Carlos <angus@qu...ar> 02-22 02:49 tainted symbols?
  165.   Jon A. Lambert <jlsysinc@al...net> 02-24 01:50
  166.   daz <dooby@d1...uk> 03-15 02:49 Ruby Vim Download Link Broken?
  167.   John W. Long <ng@jo...com> 03-15 03:19
  168.   daz <dooby@d1...uk> 03-15 04:14
  169.   Gavin Sinclair <gsinclair@so...au> 03-15 11:55
  170.   daz <dooby@d1...uk> 03-16 03:19
  171.   daz <dooby@d1...uk> 03-16 06:54
  172.   Jon A. Lambert <jlsysinc@al...net> 02-12 10:00 Problems getting Apache 2.0.43 and erb to work
  173.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-21 09:46
  174.   John W. Long <ng@jo...com> 02-21 16:02
  175.   Robert <bobx@li...org> 02-21 20:39
  176.   Charles Comstock <cc1@ce...edu> 02-21 20:49
  177.   Ruby Tuesday <rubytuezdayz@ya...com> 02-23 01:49
  178.   Kent S. <happy@us...com> 02-23 01:59
  179.   missing
  180.   Jon A. Lambert <jlsysinc@al...net> 02-24 00:36 Puzzling... no longer
  181.   Ruby Tuesday <rubytuezdayz@ya...com> 02-24 00:44
  182.   Ruby Tuesday <rubytuezdayz@ya...com> 02-24 03:49 Puzzling... no longer
  183.   Ruby Tuesday <rubytuezdayz@ya...com> 02-24 03:49 Puzzling... no longer
  184.   Jon A. Lambert <jlsysinc@al...net> 02-24 04:51 Puzzling... no longer
  185.   Ruby Tuesday <rubytuezdayz@ya...com> 02-24 05:54 Puzzling... no longer
  186.   Ruby Tuesday <rubytuezdayz@ya...com> 02-20 22:09
  187.   Robert <bobx@li...org> 02-20 23:09
  188.   Ruby Tuesday <rubytuezdayz@ya...com> 02-20 23:44
  189.   Jon A. Lambert <jlsysinc@al...net> 02-21 00:02
  190.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-21 00:16
  191.   Ruby Tuesday <rubytuezdayz@ya...com> 02-21 03:44
  192.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-21 06:07
  193.   Jon A. Lambert <jlsysinc@al...net> 02-21 06:45
  194.   Ruby Tuesday <rubytuezdayz@ya...com> 02-23 01:54
  195.   Osuka Adartse <rocioestradacastaneda@pr...mx> 02-23 03:41
  196.   Jon A. Lambert <jlsysinc@al...net> 02-24 01:19
  197.   Jon A. Lambert <jlsysinc@al...net> 02-21 06:42
  198.   Mark Hubbart <discord@ma...com> 02-22 18:54
  199.   Trey Campbell <drtrey@mi...com> 02-22 15:11
  200.   Ruby Tuesday <rubytuezdayz@ya...com> 02-23 01:54
  201.   Trey Campbell <drtrey@mi...com> 02-23 03:25
  202.   Mark Hubbart <discord@ma...com> 02-23 05:27 OT: mime types and file extensions (wasPuzzling...)
  203.   Robert Klemme <bob.news@gm...net> 02-23 19:29
  204.   Josef 'Jupp' SCHUGT <jupp@gm...de> 02-24 21:21
  205.   gabriele renzi <surrender_it@rc...com> 02-24 08:19 At last!!! mod_ruby/eruby for mswin32 for Ruby 1.8.1/Apache2.0.48
  206.   dhtapp <dhtapp@co...net> 02-24 22:34 HTML/XML Parsing...
  207.   missing
  208.   Mark Hubbart <discord@ma...com> 02-24 22:57
  209.   Ara.T.Howard <ahoward@fa...gov> 05-04 04:23 Regex question(how easy/hard to do it in ruby)
  210.   Mehr, Assaph (Assaph) <assaph@av...com> 05-04 03:43
  211.   Rove Monteux <rove.monteux@fl...com> 05-04 17:30 What so special about PostgreSQL and other RDBMS?
  212.   Volker Hetzer <volker.hetzer@ie...org> 05-04 17:38 What so special about PostgreSQL and other RDBMS?
  213.   Fred Emmott <pcfreak65@ho...com> 05-04 18:23 What so special about PostgreSQL and other RDBMS?
  214.   Tom Copeland <tom@in...com> 05-04 18:31
  215.   Armin Roehrl <armin@xs...de> 05-04 18:45
  216.   mikharakiri_nospaum@ya...com (Mikito Harakiri) 05-05 01:38
  217.   Daniel Morgan <damorgan@x....edu> 05-04 18:43 What so special about PostgreSQL and other RDBMS?
  218.   rkusenet <rkusenet@sy...ca> 05-04 19:33
  219.   missing
  220.   Daniel Morgan <damorgan@x....edu> 05-04 21:19
  221.   Carl Youngblood <carl@yo...org> 05-04 21:47
  222.   rkusenet <rkusenet@sy...ca> 05-05 01:28
  223.   sybrandb@ya...com 05-05 07:53
  224.   Rove Monteux <rove.monteux@fl...com> 05-07 10:12
  225.   shoad316@ho...com (Dave) 05-07 14:08
  226.   Matt O'Toole <matt@de...com> 05-08 00:28
  227.   Daniel Morgan <damorgan@x....edu> 05-08 02:13
  228.   pagesflames@us...net (Dusan Bolek) 05-05 06:19
  229.   rolo <rohitlodha@ho...com> 05-05 08:15
  230.   rkusenet <rkusenet@sy...ca> 05-05 10:18
  231.   Michael Shigorin <mike@os...ua> 05-05 12:10 What so special about PostgreSQL and other RDBMS?
  232.   rkusenet <rkusenet@sy...ca> 05-05 14:44
  233.   Daniel Morgan <damorgan@x....edu> 05-05 16:09
  234.   Brian Peasland <dba@ym...com> 05-05 16:09
  235.   rkusenet <rkusenet@sy...ca> 05-05 16:34
  236.   Paul Vudmaska <paul@vu...com> 05-05 16:36
  237.   norwoodthree@my...com (NorwoodThree) 05-05 17:53
  238.   Richard Torkar <richard.torkar@ht...se> 05-05 18:05 OT:What so special about PostgreSQL and other RDBMS?
  239.   joel-garry@ho...com (Joel Garry) 05-05 22:13
  240.   stevesusenet@ya...com (Steve) 05-12 10:59
  241.   Geoff Berrow <blthecat@ck...uk> 05-12 11:58
  242.   Volker Hetzer <volker.hetzer@ie...org> 05-12 12:13
  243.   Aredridel <aredridel@nb...org> 05-12 15:05
  244.   missing
  245.   missing
  246.   missing
  247.   Doug Hutcheson <doug.blot.hutcheson@nr...au> 05-05 05:53 The quest for opensource database...
  248.   missing
  249.   missing
  250.   missing
  251.   missing
  252.   Sascha Ebach <se@he...de> 05-05 07:08
  253.   Mark Hubbart <discord@ma...com> 05-05 16:13
  254.   Martin Hart <martin@zs...com> 05-05 15:41 ACT 6 conversion, data manipulation, & mailmerge
  255.   kenfar42@ya...com (Ken) 05-05 19:18 What so special about PostgreSQL and other RDBMS?
  256.   quirk@sy...net (Quirk) 05-06 15:14 What so special about PostgreSQL and other RDBMS?
  257.   Volker Hetzer <volker.hetzer@ie...org> 05-06 16:08
  258.   missing
  259.   quirk@sy...net (Quirk) 05-07 08:48
  260.   Volker Hetzer <volker.hetzer@ie...org> 05-07 09:39
  261.   Howard J. Rogers <hjr@di...com> 05-07 11:19
  262.   quirk@sy...net (Quirk) 05-07 15:08
  263.   edwardh@hi...net (Edward Lloyd Hillman) 05-07 23:18
  264.   quirk@sy...net (Quirk) 05-10 08:29
  265.   Volker Hetzer <volker.hetzer@ie...org> 05-10 15:39
  266.   quirk@sy...net (Quirk) 05-11 09:43
  267.   Volker Hetzer <volker.hetzer@ie...org> 05-12 12:04
  268.   quirk@sy...net (Quirk) 05-12 20:08
  269.   Volker Hetzer <volker.hetzer@ie...org> 05-17 16:58
  270.   quirk@sy...net (Quirk) 05-19 10:08
  271.   Howard J. Rogers <hjr@di...com> 05-19 10:39
  272.   missing
  273.   quirk@sy...net (Quirk) 05-19 17:03
  274.   Galen Boyer <galenboyer@ho...com> 05-19 18:53
  275.   quirk@sy...net (Quirk) 05-24 10:18
  276.   pagesflames@us...net (Dusan Bolek) 05-24 16:53
  277.   quirk@sy...net (Quirk) 05-25 09:48
  278.   wizofoz2k@ya...au (Noons) 05-19 22:48
  279.   Doug Hutcheson <doug.blot.hutcheson@nr...au> 05-20 00:03
  280.   missing
  281.   Niall Litchfield <niall.litchfield@di...com> 05-20 20:13
  282.   quirk@sy...net (Quirk) 05-22 11:08
  283.   Noons <wizofoz2k@ya...nospam> 05-22 15:53
  284.   missing
  285.   quirk@sy...net (Quirk) 05-22 12:08
  286.   Niall Litchfield <niall.litchfield@di...com> 05-24 20:53
  287.   Doug Hutcheson <doug.blot.hutcheson@nr...au> 05-24 22:58
  288.   quirk@sy...net (Quirk) 05-25 08:38
  289.   Jim Kennedy <kennedy-downwithspammersfamily@at...net> 05-25 12:23
  290.   Galen Boyer <galenboyer@ho...com> 05-25 15:43
  291.   quirk@sy...net (Quirk) 05-26 08:58
  292.   missing
  293.   quirk@sy...net (Quirk) 05-25 18:38
  294.   Volker Hetzer <volker.hetzer@ie...org> 05-21 19:13
  295.   quirk@sy...net (Quirk) 05-11 08:58
  296.   Volker Hetzer <volker.hetzer@ie...org> 05-12 11:15
  297.   joel-garry@ho...com (Joel Garry) 05-12 21:23
  298.   Gawnsoft <xlucid@us...net> 05-13 11:43
  299.   Volker Hetzer <volker.hetzer@ie...org> 05-17 17:08
  300.   missing
  301.   quirk@sy...net (Quirk) 05-19 11:23
  302.   joel-garry@ho...com (Joel Garry) 05-19 23:23
  303.   joel-garry@ho...com (Joel Garry) 05-20 21:03
  304.   bucknuggets@ya...com (Buck Nuggets) 05-07 17:18
  305.   quirk@sy...net (Quirk) 05-10 07:58
  306.   Daniel Morgan <damorgan@x....edu> 05-10 13:28
  307.   quirk@sy...net (Quirk) 05-11 10:13
  308.   Erland Sommarskog <sommar@al...se> 05-09 22:08
  309.   quirk@sy...net (Quirk) 05-10 08:33
  310.   Erland Sommarskog <sommar@al...se> 05-10 21:48
  311.   quirk@sy...net (Quirk) 05-11 10:23
  312.   Erland Sommarskog <sommar@al...se> 05-11 21:48
  313.   quirk@sy...net (Quirk) 05-12 08:38
  314.   Greg D. Moore (Strider) <mooregr_deleteth1s@gr...com> 05-13 03:03
  315.   missing
  316.   quirk@sy...net (Quirk) 05-13 11:43
  317.   Greg D. Moore (Strider) <mooregr_deleteth1s@gr...com> 05-14 03:13
  318.   missing
  319.   quirk@sy...net (Quirk) 05-14 14:13
  320.   Rick Caldwell <rickc@da...com> 05-13 21:53 The quest for opensource database...
  321.   Jeff Rodriguez <newsgroup1@gu...com> 05-14 05:23 What so special about PostgreSQL and other RDBMS?
  322.   quirk@sy...net (Quirk) 05-14 13:09
  323.   Jeff Rodriguez <newsgroup1@gu...com> 05-15 00:18
  324.   Daniel Morgan <damorgan@x....edu> 05-15 04:13
  325.   Gavin Kistner <gavin@re...com> 05-24 19:05
  326.   Ruby Tuesday <rubytuezdayz@ya...com> 02-22 05:19
  327.   Michael Davis <mdavis@se...com> 02-23 15:15 Calling JDBC from with Ruby
  328.   missing
  329.   Robert Klemme <bob.news@gm...net> 02-23 15:34
  330.   dhtapp <dhtapp@co...net> 02-23 16:14
  331.   missing
  332.   Michael Davis <mdavis@se...com> 02-23 17:04
  333.   missing
  334.   Dick Davies <rasputnik@he...net> 02-23 17:21
  335.   Michael Davis <mdavis@se...com> 02-23 17:39
  336.   Bill Kelly <billk@ct...com> 02-23 17:30
  337.   Robert Klemme <bob.news@gm...net> 02-23 19:34
  338.   Michael Davis <mdavis@se...com> 02-23 20:24
  339.   missing
  340.   Robert Klemme <bob.news@gm...net> 02-24 12:39
  341.   ser@ge...com (Sean Russell) 02-23 20:29
  342.   Michael Davis <mdavis@se...com> 02-23 22:04
  343.   missing
  344.   Markus Spath <mspath@ar...de> 02-23 23:59
  345.   Michael Davis <mdavis@se...com> 02-24 05:39
  346.   missing
  347.   Markus Spath <mspath@ar...de> 02-24 11:04
  348.   Robert Klemme <bob.news@gm...net> 02-24 12:34
  349.   Charles Miller <cmiller@pa...org> 02-23 21:20
  350.   Simon Strandgaard <neoneye@ad...dk> 02-25 13:54
  351.   Robert Klemme <bob.news@gm...net> 02-25 14:09
  352.   Simon Strandgaard <neoneye@ad...dk> 02-25 14:29
  353.   Robert Klemme <bob.news@gm...net> 02-25 14:39
  354.   Simon Strandgaard <neoneye@ad...dk> 02-25 15:00 proposal: debug keyword
  355.   missing
  356.   Gavin Sinclair <gsinclair@so...au> 02-02 01:14 Documentation approaches (was: Python 25 times as popular as Ruby !?)
  357.   gedb@ru...uk (Ged) 02-02 12:14
  358.   Aredridel <aredridel@nb...org> 02-09 07:09
  359.   Charles Comstock <cc1@ce...edu> 02-03 01:05
  360.   Charles Comstock <cc1@ce...edu> 02-08 21:21
  361.   Charles Comstock <cc1@ce...edu> 02-08 23:39
  362.   Charles Comstock <cc1@ce...edu> 02-09 00:59
  363.   Charles Comstock <cc1@ce...edu> 02-09 01:57
  364.   Bob Calco <bobcalco@al...net> 02-03 02:00 Documentation approaches
  365.   Bermejo, Rodrigo <rodrigo.bermejo@ps...com> 02-05 17:22 Irb Ri integration (Was: An assimilators guide to Python?)
  366.   Joel VanderWerf <vjoel@PA...EDU> 02-05 19:46 Irb Ri integration (Was: An assimilators guide to Python?)
  367.   ppi@am...org 02-05 20:50
  368.   gabriele renzi <surrender_it@rc...com> 02-08 22:00 Irb Ri integration (Was: An assimilators guide to Python?)
  369.   Simon Strandgaard <neoneye@ad...dk> 02-08 23:18 graphics lib?
  370.   Charles Comstock <cc1@ce...edu> 02-03 00:30
  371.   Hal Fulton <hal9000@hy...com> 02-03 00:33
  372.   Tim Hunter <cyclists@nc...com> 02-03 12:25
  373.   Ara.T.Howard <ahoward@fa...gov> 02-08 21:25
  374.   Charles Comstock <cc1@ce...edu> 02-03 05:00
  375.   Charles Comstock <cc1@ce...edu> 02-08 21:26
  376.   Ara.T.Howard <ahoward@fa...gov> 02-08 21:31
  377.   Charles Comstock <cc1@ce...edu> 02-08 23:45
  378.   Charles Comstock <cc1@ce...edu> 02-09 01:03
  379.   Charles Comstock <cc1@ce...edu> 02-08 23:39
  380.   Charles Comstock <cc1@ce...edu> 02-09 00:59
  381.   Charles Comstock <cc1@ce...edu> 02-09 01:56
  382.   gabriele renzi <surrender_it@rc...com> 02-08 23:23 Python 25 times as popular as Ruby !?
  383.   Robert Klemme <bob.news@gm...net> 02-09 10:04 Multi-threading lesson wanted
  384.   gabriele renzi <surrender_it@rc...com> 02-10 15:14 simple lexing/parsing task
  385.   Martin DeMello <martindemello@ya...com> 02-10 21:10
  386.   Gavin Kistner <gavin@re...com> 02-10 22:45 YAPV (Yet Another Pickaxe Version)
  387.   missing
  388.   Charles Comstock <cc1@ce...edu> 02-11 07:44
  389.   Harpo <harpo@ne...fr> 02-11 08:14
  390.   Harpo <harpo@ne...fr> 02-11 14:10 YAPV (Yet Another Pickaxe Version)
  391.   missing
  392.   Dennis Ranke <dennis.ranke@ep...de> 02-11 14:10
  393.   Simon Strandgaard <neoneye@ad...dk> 02-11 22:19 XML/HTML display code for Ruby
  394.   Simon Strandgaard <neoneye@ad...dk> 02-12 13:14
  395.   Paul Brannan <pbrannan@at...com> 02-12 13:31
  396.   Jim Weirich <jim@we...org> 02-12 14:15
  397.   Tim Hunter <cyclists@nc...com> 02-13 00:24
  398.   aero6dof@ya...com (Alan Chen) 02-12 16:44
  399.   Charles Comstock <cc1@ce...edu> 02-12 19:19
  400.   Bermejo, Rodrigo <rodrigo.bermejo@ps...com> 02-12 23:40
  401.   NAKAMURA, Hiroshi <nahi@ke...com> 02-14 12:40 DRb / Rinda Examples
  402.   missing
  403.   Charles Comstock <cc1@ce...edu> 02-15 02:45
  404.   missing
  405.   gabriele renzi <surrender_it@rc...com> 02-15 09:39 win32-sound 0.1.0
  406.   Mark <msparshatt@ya...uk> 02-21 21:21 Ruby to Parrot compiler
  407.   Robert Feldt <feldt@ce...se> 02-22 09:05
  408.   Robert Klemme <bob.news@gm...net> 02-21 23:39 Puzzling...
  409.   Minero Aoki <aamine@lo...net> 02-16 06:07 Using RACC with 1.8.1
  410.   Charles Comstock <cc1@ce...edu> 02-16 06:19
  411.   gabriele renzi <surrender_it@rc...com> 02-20 11:21 speed benchmarks comparing Ruby to Py/Perl/PHP/etc?
  412.   Charles Comstock <cc1@ce...edu> 02-21 20:49 Puzzling...
  413.   Mark <msparshatt@ya...uk> 02-21 21:17 Ruby to Parrot compiler (where is Ruth?)
  414.   Aredridel <aredridel@nb...org> 02-23 04:18 Docs
  415.   Mauricio =?iso-8859-1?Q?Fern=E1ndez?= <batsman.geo@ya...com> 02-23 11:23
  416.   Larry Felton Johnson <larryj@gs...edu> 02-27 03:29
  417.   Andrew Johnson <ajohnson@cp...org> 02-27 07:59
  418.   Charles Comstock <cc1@ce...edu> 02-27 08:05
  419.   Larry Felton Johnson <larryj@gs...edu> 02-27 10:14
  420.   missing
  421.   Larry Felton Johnson <larryj@gs...edu> 02-27 10:38
  422.   Larry Felton Johnson <larryj@gs...edu> 02-27 11:05
  423.   Mark Hubbart <discord@ma...com> 02-23 06:22 how to raise warning?
  424.   Robert Klemme <bob.news@gm...net> 02-26 09:39
  425.   Simon Strandgaard <neoneye@ad...dk> 02-26 12:54 ruby2html -wasCongrats to Matz...working 11 years on Ruby an d counting!
  426.   Charles Comstock <cc1@ce...edu> 02-26 13:54
  427.   James Britt <jamesUNDERBARb@ne...com> 02-27 12:27 tutorial directory
  428.   Charles Comstock <cc1@ce...edu> 02-25 23:39
  429.   Steve Tuckner <stevetuckner@ya...com> 02-25 14:58
  430.   Ara.T.Howard <ahoward@fa...gov> 02-25 14:24 io/nonblock - blocks w/threads?
  431.   Robert Klemme <bob.news@gm...net> 02-25 14:49
  432.   Jim Weirich <jim@we...org> 02-25 16:29
  433.   Ara.T.Howard <ahoward@fa...gov> 02-25 17:04
  434.   Ara.T.Howard <ahoward@fa...gov> 02-25 17:04
  435.   Simon Strandgaard <neoneye@ad...dk> 02-25 15:29 Operators +, += and = in Ruby 2
  436.   Austin Ziegler <austin@ha...ca> 02-25 16:05
  437.   Robert Klemme <bob.news@gm...net> 02-26 09:29
  438.   Austin Ziegler <austin@ha...ca> 02-25 15:56 Operators +, += and = in Ruby 2
  439.   David A. Black <dblack@wo...net> 02-25 17:58 Operators +, += and = in Ruby 2
  440.   Dennis Ranke <dennis.ranke@ep...de> 02-26 09:59 Operators +, += and = in Ruby 2
  441.   Robert Klemme <bob.news@gm...net> 02-26 11:24
  442.   Dennis Ranke <dennis.ranke@ep...de> 02-26 12:04
  443.   Robert Klemme <bob.news@gm...net> 02-26 12:34
  444.   Dennis Ranke <dennis.ranke@ep...de> 02-26 12:54
  445.   Robert Klemme <bob.news@gm...net> 02-26 13:29
  446.   David Garamond <lists@za...com> 02-26 13:07 Why don't $global and @instance variables need *initialization*?
  447.   ts <decoux@mo...fr> 02-26 13:10
  448.   David Garamond <lists@za...com> 02-26 13:48
  449.   David Garamond <lists@za...com> 02-26 14:55
  450.   ts <decoux@mo...fr> 02-26 15:01
  451.   David Garamond <lists@za...com> 02-26 15:36
  452.   Robert Klemme <bob.news@gm...net> 02-26 15:59
  453.   David Garamond <lists@za...com> 02-26 16:07
  454.   Mark Hubbart <discord@ma...com> 02-27 17:32 Introducing myself and my interest in ruby
  455.   Jim Weirich <jim@we...org> 02-27 17:58
  456.   gabriele renzi <surrender_it@rc...com> 02-27 19:19
  457.   Mark Hubbart <discord@ma...com> 02-27 20:16
  458.   Hal Fulton <hal9000@hy...com> 02-27 20:23
  459.   Curt Hibbs <curt@hi...com> 02-28 05:37 Ruby Compiler
  460.   Mark Hubbart <discord@ma...com> 02-28 07:21
  461.   Mark <msparshatt@ya...uk> 02-28 08:36
  462.   Mark Hubbart <discord@ma...com> 02-28 09:04
  463.   Mark <msparshatt@ya...uk> 02-28 09:15
  464.   Hal Fulton <hal9000@hy...com> 02-28 09:28
  465.   Lyle Johnson <lyle@kn...net> 02-28 16:09
  466.   Kent Dahl <kentda+news@st...no> 02-28 16:24
  467.   Mark Hubbart <discord@ma...com> 02-29 02:01
  468.   Robert Feldt <feldt@ce...se> 02-28 10:08
  469.   ptkwt@ar...com (Phil Tomson) 02-28 18:59
  470.   Robert Feldt <feldt@ce...se> 02-29 06:54
  471.   Mark <msparshatt@ya...uk> 02-29 18:34
  472.   Robert Feldt <feldt@ce...se> 02-29 19:11
  473.   gabriele renzi <surrender_it@rc...com> 03-01 13:19
  474.   Mark Hubbart <discord@ma...com> 02-29 01:54
  475.   ptkwt@ar...com (Phil Tomson) 02-28 18:59
  476.   Mark <msparshatt@ya...uk> 02-29 18:32
  477.   Robert Feldt <feldt@ce...se> 02-29 20:19
  478.   Chad Fowler <chad@ch...com> 03-01 02:34
  479.   Robert Feldt <feldt@ce...se> 03-01 10:10
  480.   Charles Hixson <charleshixsn@ea...net> 02-29 19:40
  481.   Mark <msparshatt@ya...uk> 02-29 19:59
  482.   Sean Russell <ser@ge...com> 06-10 15:53
  483.   Nicholas Van Weerdenburg <nick@ac...com> 06-11 04:00
  484.   Claus Spitzer <DocBoobenstein@gm...com> 06-11 04:14
  485.   Robert Klemme <bob.news@gm...net> 06-11 11:28
  486.   llothar@we...de (Lothar Scholz) 06-11 15:04
  487.   gabriele renzi <surrender_it@rc...com> 06-11 15:08
  488.   Tom Copeland <tom@in...com> 06-11 15:13
  489.   Mark Hubbart <discord@ma...com> 06-11 17:20
  490.   Tobias Nurmiranta <spyck@ly...se> 02-28 11:46
  491.   Mark Hubbart <discord@ma...com> 02-28 19:10
  492.   Its Me <itsme213@ho...com> 02-27 17:34 Extensible meta-data ?
  493.   han.holl@po...com (Han Holl) 02-27 22:04 Callback
  494.   Robert Klemme <bob.news@gm...net> 02-27 22:19
  495.   han.holl@po...com (Han Holl) 02-28 09:34
  496.   Robert Klemme <bob.news@gm...net> 02-28 10:24
  497.   missing
  498.   Robert Klemme <bob.news@gm...net> 02-27 22:29 Extensible meta-data ?
  499.   David A. Black <dblack@wo...net> 02-28 18:22 UnboundMethod#hash apparently broken in 1.8.1
  500.   Nathaniel Talbott <nathaniel@ta...ws> 02-28 23:18 Gateway not working?
  501.   David A. Black <dblack@wo...net> 02-29 01:44
  502.   matz@ru...org (Yukihiro Matsumoto) 02-29 09:08
  503.   Robert Klemme <bob.news@gm...net> 03-01 09:59
  504.   Robert Klemme <bob.news@gm...net> 02-25 13:29
  505.   Simon Strandgaard <neoneye@ad...dk> 02-26 13:14
  506.   Robert Klemme <bob.news@gm...net> 02-26 13:49
  507.   Simon Strandgaard <neoneye@ad...dk> 02-27 12:34

Simon Strandgaard <neoneye@ad...dk>

2004-02-25 12:24:53
A debug keyword which enables debug-output for a specific method.
I have found its useful when there is many testcases which fails 
at the same time, letting me faster identify where the problem is.

I think this would be a good idea to have distributed with Ruby?
I am thinking of submitting an RCR, should I do this?



Its syntax is

    debug :method [, :method]*

What it does is to enable the global flag $debug.

If we type  'debug :test_a1', then we get the following output

server> ruby example.rb
Loaded suite TestA
Started
test_a1(TestA): before #test_a1
A#compute, begin
A#dostuff, begin
A#dostuff, end
A#compute, end
after #test_a1
..

Finished in 0.002609 seconds.

1 tests, 1 assertions, 0 failures, 0 errors
server>

However if we doesn't type it, then we get our normal output.

server> ruby example.rb
Loaded suite TestA
Started
test_a1(TestA): .

Finished in 0.001572 seconds.

1 tests, 1 assertions, 0 failures, 0 errors
server>



Its a bit hackish, but it works.

server> expand -t2 debug_keyword.rb 
BEGIN {
  $debug = false
}

# purpose:
# make it easy to enable/disable debugging
#
# if $debug == nil then  output are disabled
# if $debug != nil then  output are enabled
module Debuggable
  def printx(*args)
    if $debug
      super(*args)
    end
  end
  def puts(*args)
    if $debug
      super(*args)
    end
  end
  def p(*args)
    if $debug
      super(*args)
    end
  end
  def print(*args)
    if $debug
      super(*args)
    end
  end
end


# purpose:
# enable $debug flag inside a method
#
# class Test
#   include Debuggable
#   def test_x; p 42; end
#   debug :test_x
# end
# Test.new.test_x  #-> (before 'test_x') 42 (after 'test_x')
# 
class Module
  # enable the global debug flag for just a single method
  def debug(*args)
    debug_methods = private_instance_methods(true)
    args.each do |symbol| 
      name = symbol.id2name
      org = "_debug_"+name
      if debug_methods.include?(org)
        $stderr.puts "ERROR: already debugging method: #{name}"
        next
      end
      begin
        meth = instance_method(symbol)
      rescue => e
        $stderr.puts "ERROR: symbol2method failure, " + e.inspect
        next
      end  
      arguments = (meth.arity != 0) ? "(*a,&b)" : "(&b)"
      alias_method org, name
      module_eval %{
        def #{name}#{arguments}
          $stdout.puts("before ##{name}")
          debug, $debug = $debug, true
          result = #{org}#{arguments}
          $stdout.puts("after ##{name}")
          result
        ensure
          $debug = debug
        end
        private :#{org}
      }
    end
  end
end
server>


server> expand -t2 example.rb 
require 'debug_keyword'
class A
  include Debuggable
  def dostuff
    puts "A#dostuff, begin"
    puts "A#dostuff, end"
  end
  def compute
    puts "A#compute, begin"
    dostuff
    puts "A#compute, end"
    42
  end
end

require 'test/unit'
class TestA < Test::Unit::TestCase
  def test_a1
    assert_equal(42, A.new.compute)
  end
  debug :test_a1  # enable/disable debugging
end

require 'test/unit/ui/console/testrunner'
Test::Unit::UI::Console::TestRunner.run(TestA, Test::Unit::UI::VERBOSE)
server>

--
Simon Strandgaard

BTW:  Thanks Nobu, Decoux for helping working the debug keyword ;-)

This message appeared in a previous month, was never archived, or was lost.

Gavin Sinclair <gsinclair@so...au>

2004-02-01 12:00:47
Replies: ts Robert Klemme
On Sunday, February 1, 2004, 10:19:53 PM, Robert wrote:


>> The problem is that when you use 'class M::C' to open a class, you
>> can't access constants declared in M, whereas if you use 'module M;
>> class C', you can.
>>
>> 1) Why is this?

> Because when doing "class M::C" you're still in another scope while defining
> class C.  So you have to explicitely scope constants from module M. (see
> below)
"Another scope"?  Sounds convincing, but I don't know what it means.
'self' is the same object in the following two examples:

  module M
    class C
      p self.id
    end
  end

  class M::C
    p self.id
  end

>> 2) Is is an intentional behaviour of Ruby?

> I think so.
Can it be justified in terms of correctness, language design
principles, POLS, convenience, expedience, or anything else?

To my mind, the way things work (scope-wise) should depend on the
value of 'self' and little if not nothing else.

Cheers,
Gavin
>>>>> "G" == Gavin Sinclair <gsinclair@so...au> writes:
G> To my mind, the way things work (scope-wise) should depend on the
G> value of 'self' and little if not nothing else.

 well, another example to see that ruby sometimes use something else than
 self 

svg% ruby -e 'Array.instance_eval { p self; def a() puts "a"; end }; Array.a'
Array
a
svg%

svg% ruby -e 'Array.module_eval { p self; def a() puts "a"; end }; [].a'
Array
a
svg% 



Guy Decoux

Gavin Sinclair <gsinclair@so...au>

2004-02-01 12:47:57
On Sunday, February 1, 2004, 11:07:11 PM, ts wrote:

>>>>>> "G" == Gavin Sinclair <gsinclair@so...au> writes:
G>> To my mind, the way things work (scope-wise) should depend on the
G>> value of 'self' and little if not nothing else.

>  well, another example to see that ruby sometimes use something else than
>  self 

> svg% ruby -e 'Array.instance_eval { p self; def a() puts "a"; end }; Array.a'
> Array
> a
> svg%

> svg% ruby -e 'Array.module_eval { p self; def a() puts "a"; end }; [].a'
> Array
> a
> svg% 
Good point.  Still the exception rather than the rule, I hope :)

Gavin

Robert Klemme <bob.news@gm...net>

2004-02-01 12:44:50
"Gavin Sinclair" <gsinclair@so...au> schrieb im Newsbeitrag
news:421724876381.20040201225914@so...au...
> On Sunday, February 1, 2004, 10:19:53 PM, Robert wrote:
>
>
> >> The problem is that when you use 'class M::C' to open a class, you
> >> can't access constants declared in M, whereas if you use 'module M;
> >> class C', you can.
> >>
> >> 1) Why is this?
>
> > Because when doing "class M::C" you're still in another scope while
defining
> > class C.  So you have to explicitely scope constants from module M. (see
> > below)
>
> "Another scope"?  Sounds convincing, but I don't know what it means.
> 'self' is the same object in the following two examples:
>
>   module M
>     class C
>       p self.id
>     end
>   end
>
>   class M::C
>     p self.id
>   end
It's the other self, the one that is used for the const lookup I guess:

module M
  p self.id

  class C; end
end

p self.id
class M::C;end


> >> 2) Is is an intentional behaviour of Ruby?
>
> > I think so.
>
> Can it be justified in terms of correctness, language design
> principles, POLS, convenience, expedience, or anything else?
>
> To my mind, the way things work (scope-wise) should depend on the
> value of 'self' and little if not nothing else.
see above.  Just my 0.02 EUR

    robert

David Garamond <lists@za...com>

2004-02-01 12:15:50
Robert Klemme wrote:
>>  p class_defined?("Test::Unit::TestCase") # false
>>  require 'test/unit/testcase'
>>  p class_defined?("Test::Unit::TestCase") # true
>>
>>Is there an easier way?
> 
> irb(main):009:0> defined? Test::Unit::TestCase
> => nil
> irb(main):010:0> require 'test/unit/testcase'
> => true
> irb(main):011:0> defined? Test::Unit::TestCase
> => "constant"
But what if the class name to be checked is a string? 
("Test::Unit::TestCase")? Btw, is "defined?" a method (of what class?)? 
A statement?

>>A bonus question, how do I list all the defined classes in their fully
>>qualified name? Example output:
> 
> ObjectSpace.each_object( Class ){|cl| p cl}
> ObjectSpace.each_object( Class ){|cl| p cl.name}
Ah, Class#name... Thanks, I'm so glad it's straightforward & easy.

-- 
dave

Robert Klemme <bob.news@gm...net>

2004-02-01 12:39:50
"David Garamond" <lists@za...com> schrieb im Newsbeitrag
news:401CEDC9.8000804@za...com...
> Robert Klemme wrote:
> >>  p class_defined?("Test::Unit::TestCase") # false
> >>  require 'test/unit/testcase'
> >>  p class_defined?("Test::Unit::TestCase") # true
> >>
> >>Is there an easier way?
> >
> > irb(main):009:0> defined? Test::Unit::TestCase
> > => nil
> > irb(main):010:0> require 'test/unit/testcase'
> > => true
> > irb(main):011:0> defined? Test::Unit::TestCase
> > => "constant"
>
> But what if the class name to be checked is a string?
> ("Test::Unit::TestCase")?
irb(main):005:0> eval "defined? " + "Test::Unit::TestCase"
=> nil
irb(main):006:0> require 'test/unit/testcase'
=> true
irb(main):007:0> eval "defined? " + "Test::Unit::TestCase"
=> "constant"


> Btw, is "defined?" a method (of what class?)?
> A statement?
It's an operator:
http://www.rubycentral.com/book/tut_expressions.html

> >>A bonus question, how do I list all the defined classes in their fully
> >>qualified name? Example output:
> >
> > ObjectSpace.each_object( Class ){|cl| p cl}
> > ObjectSpace.each_object( Class ){|cl| p cl.name}
>
> Ah, Class#name... Thanks, I'm so glad it's straightforward & easy.
:-)

    robert

David Garamond <lists@za...com>

2004-02-01 13:52:30
Robert Klemme wrote:
>>But what if the class name to be checked is a string?
>>("Test::Unit::TestCase")?
> 
> irb(main):005:0> eval "defined? " + "Test::Unit::TestCase"
> => nil
> irb(main):006:0> require 'test/unit/testcase'
> => true
> irb(main):007:0> eval "defined? " + "Test::Unit::TestCase"
> => "constant"
Hm, I should've added that I didn't want to involve 'eval'. But then why 
not, I'll just need to check the input using a simple regexp. After all, 
almost everything in Ruby (require, load, irb, class_eval) is using eval 
anyway...

Thanks again.

-- 
dave
>>>>> "D" == David Garamond <lists@za...com> writes:
D> Hm, I should've added that I didn't want to involve 'eval'. But then why 
D> not, I'll just need to check the input using a simple regexp.

 well, if you think that a simple regexp can do anything against the evil
 eval, then you have perhaps a P background :-)


Guy Decoux

David Garamond <lists@za...com>

2004-02-01 15:49:22
ts wrote:
>>>>>>"D" == David Garamond <lists@za...com> writes:
> D> Hm, I should've added that I didn't want to involve 'eval'. But then why 
> D> not, I'll just need to check the input using a simple regexp.
> 
>  well, if you think that a simple regexp can do anything against the evil
>  eval, then you have perhaps a P background :-)
Don't you also have a P background? :)  (Or Matz? Or many others?)

  http://www.google.com/search?num=100&q=guy+decoux+perl

Anyway, I didn't say regexp can make eval safe generally, but only for 
my case:

  def class_defined?(classname)
    classname.kind_of? String or
      raise ArgumentError, "please give me string"
    classname =~ /\A[A-Z][A-Za-z0-9_]*(::[A-Z][A-Za-z0-9_]*)*\z/ or
      raise ArgumentError, "invalid class name"
    eval("defined? " + classname) != nil
  end

Please do tell me if the above is unsafe...

-- 
dave

Robert Klemme <bob.news@gm...net>

2004-02-01 17:29:53
"David Garamond" <lists@za...com> schrieb im Newsbeitrag
news:401D1FF4.6000900@za...com...
> ts wrote:
> >>>>>>"D" == David Garamond <lists@za...com> writes:
> > D> Hm, I should've added that I didn't want to involve 'eval'. But then
why
> > D> not, I'll just need to check the input using a simple regexp.
> >
> >  well, if you think that a simple regexp can do anything against the
evil
> >  eval, then you have perhaps a P background :-)
>
> Don't you also have a P background? :)  (Or Matz? Or many others?)
>
>   http://www.google.com/search?num=100&q=guy+decoux+perl
>
> Anyway, I didn't say regexp can make eval safe generally, but only for
> my case:
>
>   def class_defined?(classname)
>     classname.kind_of? String or
>       raise ArgumentError, "please give me string"
>     classname =~ /\A[A-Z][A-Za-z0-9_]*(::[A-Z][A-Za-z0-9_]*)*\z/ or
>       raise ArgumentError, "invalid class name"
>     eval("defined? " + classname) != nil
You don't need to compare with nil, that's converting something to a boolean
that is essentially a boolean already - unless, of course, if you want to
hide the outcome of "defined?"...

To make the methods semantic match the name you should do

eval("defined? " + classname) && Class === eval(classname)

Because otherwise you will get true for all sorts of constants. (Try with
"IO::CREAT")

>   end
>
> Please do tell me if the above is unsafe...
Looks safe enough.

    robert

Gavin Sinclair <gsinclair@so...au>

2004-02-01 14:21:52
On Monday, February 2, 2004, 12:52:30 AM, David wrote:

> Robert Klemme wrote:
>>>But what if the class name to be checked is a string?
>>>("Test::Unit::TestCase")?
>> 
>> irb(main):005:0> eval "defined? " + "Test::Unit::TestCase"
>> => nil
>> irb(main):006:0> require 'test/unit/testcase'
>> => true
>> irb(main):007:0> eval "defined? " + "Test::Unit::TestCase"
>> => "constant"

> Hm, I should've added that I didn't want to involve 'eval'. But then why
> not, I'll just need to check the input using a simple regexp. After all,
> almost everything in Ruby (require, load, irb, class_eval) is using eval
> anyway...
Take a look at StandardClassExtensions on the Wiki.  There's something
in there just for you :)

Cheers,
Gavin

Gavin Sinclair <gsinclair@so...au>

2004-02-01 12:57:27
Replies: Robert Klemme
On Sunday, February 1, 2004, 11:29:50 PM, Robert wrote:

>> Comments, Phil? Nathaniel? Others?

> I wouldn't put it into File or IO since this is too specialized
> functionality.  It deserves a class of it's own:

> class FlipFlop
>   def initialize(on, off)
>     @on, @off = on, off
>     @state = false
>   end
>
>   def ===(o)
>     if @state
>       @state = false if @off === o
>     else
>       @state = true if @on === o
>     end
>
>     @state
>   end
> end
Nice implementation.  The usage is still more verbose than the FF
operator, though.  Perhaps some method to process an enumerable
object?

# Untested
class FlipFlop
  def process(enum)
    enum.each do |o|
      yield(o) if self === o
    end
  end
end


File.open(path) do |io|
  FlipFlop.new(/BEGIN/, /END/).process(io) do |line|
    puts line
  end
end

Is that any good?

Gavin

Robert Klemme <bob.news@gm...net>

2004-02-01 14:04:51
"Gavin Sinclair" <gsinclair@so...au> schrieb im Newsbeitrag
news:1221728269450.20040201235547@so...au...
> On Sunday, February 1, 2004, 11:29:50 PM, Robert wrote:
>
> >> Comments, Phil? Nathaniel? Others?
>
> > I wouldn't put it into File or IO since this is too specialized
> > functionality.  It deserves a class of it's own:
>
> > class FlipFlop
> >   def initialize(on, off)
> >     @on, @off = on, off
> >     @state = false
> >   end
> >
> >   def ===(o)
> >     if @state
> >       @state = false if @off === o
> >     else
> >       @state = true if @on === o
> >     end
> >
> >     @state
> >   end
> > end
>
>
> Nice implementation.
Thanks!

>  The usage is still more verbose than the FF
> operator, though.
Yeah, but it avoids the speciality of treating ".." and "..." differently
when they appear in an if clause.

>  Perhaps some method to process an enumerable
> object?
>
> # Untested
> class FlipFlop
>   def process(enum)
>     enum.each do |o|
>       yield(o) if self === o
>     end
>   end
> end
>
>
> File.open(path) do |io|
>   FlipFlop.new(/BEGIN/, /END/).process(io) do |line|
>     puts line
>   end
> end
>
> Is that any good?
It looks good.  The only thing that bothers me a bit is that the iteration
is kind of "hidden".  In Ruby we typically do enum.each{|elem| do sth. with
elem}.  It's just a feeling, I can't exactly point to why this might be bad.
The only thing that comes to my mind is that you make the whole block
dependend on the FF's state while you might want to do something else with
the line even if the FF doesn't match.  E.g. you could be wanting to do:

io.each_line do |line|
  line.chomp!

  case line
  when ff1
    # do stuff
  when ff2
    # do other stuff
    if ff3 === line
      # nested
    end
  end
end

Dunno whether that is realistic.

Regards

    robert

Michael campbell <michael_s_campbell@ya...com>

2004-02-01 15:28:19
Replies: Robert Klemme
Robert Klemme wrote:

> First of all, you can use FF only in if statements. 
Do you mean "only as a scalar"?  FF's work just fine in other statements; "while" comes to mind.

Robert Klemme <bob.news@gm...net>

2004-02-01 17:34:49
"Michael campbell" <michael_s_campbell@ya...com> schrieb im Newsbeitrag
news:401D1B11.1010001@ya...com...
> Robert Klemme wrote:
>
> > First of all, you can use FF only in if statements.
>
> Do you mean "only as a scalar"?  FF's work just fine in other statements;
"while" comes to mind.

Well, yes.  I should've included while and the like.  But you can't use a FF
in "foo = /flip/ .. /flop/":

irb(main):013:0> foo = /flip/ .. /flop/
ArgumentError: bad value for range
        from (irb):13

So ".." and "..." behave differently in a context like "if", "unless",
"while" etc.

Hope that cleared it up.

    robert

Zach Dennis <zdennis@mk...com>

2004-02-01 17:42:50
Sorry for the misposted code, I meant:

f.each_line {|line|
	in_header = $.==1 .. line=~/^$/ ? true : false
      in_body   = line=~/^$/ .. f.eof ? true : false }


Thank you for your description and definition. And thanks for the link. They
both were very helpful in my understanding of the flip flop op.

Zach

-----Original Message-----
From: Robert Klemme [mailto:bob.news@gm...net]
Sent: Sunday, February 01, 2004 6:55 AM
To: ruby-talk ML
Subject: Re: Question on the flip/flop op



"Zach Dennis" <zdennis@mk...com> schrieb im Newsbeitrag
news:LLENJLJKHAOFKOLPKLAFOENLCAAA.zdennis@mk...com...
> With the following code where 'f' is an file handle:
>
> f.each_line{ |line|
> header = 1 .. $.=~$^ ? true : false
> body =  $^ .. f.eof ? true : false }

First of all, you can use FF only in if statements.  Then, using "?:" to
convert boolean values to boolean values is superfluous.  And btw your code
doesn't compile for me.

> Say body becomes true after the first \n. What is stopping header from
> becoming true again on the next \n? Since it will be between 1 and the $^.
> Is the flip flop op somehow storing that $^ was already reached and not to
> test the condition again?

The behavior of the FF is like this: it's false until the first condition
matches.  If that's the case it becomes true and stays true as long as the
second doesn't match.  After that it's false until the first condition
matches again.

The easiest way to separate header and body of a file in mbox format is
possibly this:

io.each_line do |line|
  line.chomp!

  if /^From / =~ line .. /^$/ =~ line
    puts "Header: " + line unless line.length == 0
  else
    puts "Body: " + line
  end
end

Of course you will have to do more processing to treat individual header
lines and deal with continued header lines.  You can look into gurgitate
mail to see how it does it.

http://rubyforge.org/projects/gurgitate-mail/

Regards

    robert



---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004

          

Robert K. <anon@no...de>

2004-02-01 19:44:49
> Maybe something like this
> 
> ruby -naF: -e 'printf "%s\t%s\n", $F[0], $F[5]' /etc/passwd
Is this allways applicable? For example in an NIS+ env
  - that's why I'm asking.



THX

Mark J. Reed <markjreed@ma...com>

2004-02-01 21:14:50
On Sun, Feb 01, 2004 at 08:43:11PM +0100, Robert K. wrote:
> >Maybe something like this
> >
> >ruby -naF: -e 'printf "%s\t%s\n", $F[0], $F[5]' /etc/passwd
> >
> 
> Is this always applicable? For example in an NIS+ env
>  - that's why I'm asking.
Definitely not.  NIS, NIS+, NetInfo, non-UNIX POSIX environments, . . .
all sorts of different places the info could be.  What is needed is a
Ruby interface to the getpwent() family of system calls.
I don't see any such thing in the standard library, RAA, or Ruby Forge;
maybe I'm just not looking in the right place, or maybe you have just
discovered your first module project! :)

-Mark

Robert K. <anon@no...de>

2004-02-01 21:49:49
> I don't see any such thing in the standard library, RAA, or Ruby Forge;
> maybe I'm just not looking in the right place, or maybe you have just
> discovered your first module project! :)
Others: Is this the case?
Do I have to or may I develope that module?

> -Mark

Gavin Sinclair <gsinclair@so...au>

2004-02-01 21:56:10
On Monday, February 2, 2004, 8:14:50 AM, Mark wrote:

> On Sun, Feb 01, 2004 at 08:43:11PM +0100, Robert K. wrote:
>> >Maybe something like this
>> >
>> >ruby -naF: -e 'printf "%s\t%s\n", $F[0], $F[5]' /etc/passwd
>> >
>> 
>> Is this always applicable? For example in an NIS+ env
>>  - that's why I'm asking.

> Definitely not.  NIS, NIS+, NetInfo, non-UNIX POSIX environments, . . .
> all sorts of different places the info could be.  What is needed is a
> Ruby interface to the getpwent() family of system calls.
> I don't see any such thing in the standard library, RAA, or Ruby Forge;
> maybe I'm just not looking in the right place, or maybe you have just
> discovered your first module project! :)
require 'etc'

(Should be in PickAxe, definitely in Nutshell.)

Gavin

Mark J. Reed <markjreed@ma...com>

2004-02-01 22:54:50
Me> What is needed is a Ruby interface to the getpwent() family of system calls.
Me> I don't see any such thing in the standard library

GS> require 'etc'

Ah!  I don't know how I would have found that, though, given the name. :)

Okay, so enumerating users is easy enough.

require 'etc'
class Users
    include Etc
    include Enumerable

    def each
        setpwent
        while pw = getpwent
            yield pw
        end
        endpwent
    end
end

Users.new.each { |u| puts u.name }

Eric Sunshine <sunshine@su...com>

2004-02-01 23:29:11
On Mon, 2 Feb 2004 07:54:50 +0900, Mark J. Reed wrote:
> Okay, so enumerating users is easy enough.
> require 'etc'
> class Users
>   include Etc
>   include Enumerable
>   def each
>     setpwent
>     while pw = getpwent
>       yield pw
>     end
>     endpwent
>   end
> end
> Users.new.each { |u| puts u.name }
Simpler:

require 'etc'
class Users
    include Etc
    include Enumerable
    alias :each :passwd
    public :each
end

Users.new.each { |u| puts u.name }

djberg96@ho...com (Daniel Berger)

2004-02-02 03:34:50
Eric Sunshine <sunshine@su...com> wrote in message news:<200402012329.AA01538@su...com>...
> On Mon, 2 Feb 2004 07:54:50 +0900, Mark J. Reed wrote:
> > Okay, so enumerating users is easy enough.
> > require 'etc'
> > class Users
> >   include Etc
> >   include Enumerable
> >   def each
> >     setpwent
> >     while pw = getpwent
> >       yield pw
> >     end
> >     endpwent
> >   end
> > end
> > Users.new.each { |u| puts u.name }
> 
> Simpler:
> 
> require 'etc'
> class Users
>     include Etc
>     include Enumerable
>     alias :each :passwd
>     public :each
> end
> 
> Users.new.each { |u| puts u.name }
Apparently my earlier message got lost.  There is no need to wrap this
with the etc module.

require "etc"
Etc.passwd{ |s|
   p s.name
   p s.dir
}

This is documented in the Nutshell book and at
http://www.rubygarden.org/ruby?ProgrammingRubyTwo/Etc

Regards,

Dan

KONTRA Gergely <kgergely@ml...hu>

2004-02-02 15:47:46
On 0202, Daniel Berger wrote:
> This is documented in the Nutshell book and at
> http://www.rubygarden.org/ruby?ProgrammingRubyTwo/Etc
BTW how can I read this book *offline*?

Gergo

-- 
+-[ Kontra, Gergely<kgergely@mc...hu> PhD student Room IB113 ]---------+
| http://www.mcl.hu/~kgergely            "Olyan langesz vagyok, hogy  |
| Mobil:(+36 20) 356 9656 ICQ: 175564914   poroltoval kellene jarnom" |
+-- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+

Rove Monteux <rove.monteux@fl...com>

2004-02-02 16:17:50
Something like Httrack will do the trick.

http://www.theopenidea.org/tikiwiki/tiki-index.php?page=HTTrack


Cheers

Rove Monteux


KONTRA Gergely wrote:

>On 0202, Daniel Berger wrote:
>  
>
>>This is documented in the Nutshell book and at
>>http://www.rubygarden.org/ruby?ProgrammingRubyTwo/Etc
>>    
>>
>
>BTW how can I read this book *offline*?
>
>Gergo
-- 
Rove Monteux
Systems Administrator

rove.monteux@fl...com

Mark J. Reed <markjreed@ma...com>

2004-02-08 21:04:18
On Sun, Feb 01, 2004 at 07:33:52PM -0800, Daniel Berger wrote:
> Apparently my earlier message got lost.  There is no need to wrap this
> with the etc module.
> 
> require "etc"
> Etc.passwd{ |s|
>    p s.name
>    p s.dir
> }
And when you pass a block it automatically resets to the first user,
too.   Cool.  Thanks!

-Mark

Mark J. Reed <markjreed@ma...com>

2004-02-09 01:31:32
MJR>  require 'etc'
MJR>  class Users
MJR>    include Etc
MJR>    include Enumerable
MJR>    def each
MJR>      setpwent
MJR>      while pw = getpwent
MJR>        yield pw
MJR>      end
MJR>      endpwent
MJR>    end
MJR>  end
MJR>  Users.new.each { |u| puts u.name }

ES> Simpler:
ES> 
ES> require 'etc'
ES> class Users
ES>     include Etc
ES>     include Enumerable
ES>     alias :each :passwd
ES>     public :each
ES> end

Simpler, but not equivalent.  That version starts wherever the last
call to getpwent passwd left off, instead of starting over at the 
first entry.

-Mark

Robert K. <anon@no...de>

2004-02-08 20:59:00
> I don't see any such thing in the standard library, RAA, or Ruby Forge;
> maybe I'm just not looking in the right place, or maybe you have just
> discovered your first module project! :)
Others: Is this the case?
Do I have to or may I develope that module?

> -Mark

tony summerfelt <snowzone5@ho...com>

2004-02-02 23:10:04
On Mon, 02 Feb 2004 at 09:13 GMT, Robert Klemme <bob.news@gm...net> wrote:

> Just to keep improving: change

> logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x")
> to
> logline="+ 30 Jan 12:20:09 [3988] addr: x.x.x.x"
yup, thought of that one already :)

> To make results look a bit nicer you could also do
i just needed to get the string in usable format, for testing the age.

-- 
http://home.cogeco.ca/~tsummerfelt1

shasckaw <shasckaw@sk...be>

2004-02-03 11:05:06
Robert Klemme wrote:
> "shasckaw" <shasckaw@sk...be> schrieb im Newsbeitrag
> news:401ee616$0$320$ba620e4c@ne...be...
> 
>>Thansk for the link, it looks interesting but it is perhaps too complex
>>for what I intend to do. But I can give it a try... well, I'd be happy
>>to try it but there isn't any files in the package, and project activity
>>is near to death. I'll try to get more info about it, but I haven't much
>>hope.
>>
>>If anyone has another solution, please help me!
> 
> 
> Depending on what you need to do it might even be built into the language
> already.  If you only need to add roles over time you could define some
> modules for the roles and add them as needed:
> 
> irb(main):001:0> class Foo;end
> => nil
> irb(main):002:0> f=Foo.new
> => #<Foo:0x1019dfe0>
> irb(main):003:0> f.respond_to? :inject
> => false
> irb(main):004:0> f.extend Enumerable
> => #<Foo:0x1019dfe0>
> irb(main):005:0> f.respond_to? :inject
> => true
> 
> Other than that SimpleDelegator might help you as well:
> http://www.rubycentral.com/book/lib_patterns.html
> 
>     robert
I'll try that way,
thanks for the advices,
Lio

Gennady <gfb@to...com>

2004-02-03 16:55:55
Robert Klemme wrote:
> "Gennady" <gfb@to...com> schrieb im Newsbeitrag
> news:401FC5BB.10809@to...com...
> 
>>Guoliang Cao wrote:
>>
>>>Hi,
>>>
>>>I'm thinking of submitting a RCR. Here is the draft. Comments are
> 
> welcome.
> 
>>>Thanks,
>>>Cao
>>
>>Do you know about this syntax currently available?
>>
>>a = "aaa"
>>b = "bbb"
>>case
>>   when a == "aaa", b == "bbb"
>>     puts "Lowercase detected"
>>   when a == "AAA", b == "BBB"
>>     puts "Uppercase detected"
>>   else
>>     puts "Detection failed"
>>end
> 
> 
> Since which version of Ruby?  Thx!
> 
>     robert
I checked that it works in 1.6.8. I remember somebody (Nobu?) mentioning 
it on ruby-talk some time ago.

Gennady.

Robert Klemme <bob.news@gm...net>

2004-02-04 08:35:03
"Gennady" <gfb@to...com> schrieb im Newsbeitrag
news:401FD2C6.1010703@to...com...
> Robert Klemme wrote:
> > "Gennady" <gfb@to...com> schrieb im Newsbeitrag
> > news:401FC5BB.10809@to...com...
> >
> >>Guoliang Cao wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm thinking of submitting a RCR. Here is the draft. Comments are
> >
> > welcome.
> >
> >>>Thanks,
> >>>Cao
> >>
> >>Do you know about this syntax currently available?
> >>
> >>a = "aaa"
> >>b = "bbb"
> >>case
> >>   when a == "aaa", b == "bbb"
> >>     puts "Lowercase detected"
> >>   when a == "AAA", b == "BBB"
> >>     puts "Uppercase detected"
> >>   else
> >>     puts "Detection failed"
> >>end
> >
> >
> > Since which version of Ruby?  Thx!
> >
> >     robert
> >
> >
>
> I checked that it works in 1.6.8. I remember somebody (Nobu?) mentioning
> it on ruby-talk some time ago.
I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures
of Ruby"... :-)

Thanks!

    robert

Sam Roberts <sroberts@un...com>

2004-02-04 13:38:33
Quoteing bob.news@gm...net, on Wed, Feb 04, 2004 at 05:35:03PM +0900:
> > >>Do you know about this syntax currently available?
> > >>
> > >>a = "aaa"
> > >>b = "bbb"
> > >>case
> > >>   when a == "aaa", b == "bbb"
> > >>     puts "Lowercase detected"
> > >>   when a == "AAA", b == "BBB"
> > >>     puts "Uppercase detected"
> > >>   else
> > >>     puts "Detection failed"
> > >>end
> 
> I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures
> of Ruby"... :-)
There's a lot of info jammed into the corners of the pickaxe book!

For this syntax, there's an example in the section "Case Expressions",
p84, and then in chapter 18 it shows the syntax:

case target
  when comparison [, comparison]]... [then]
    body
  when comparison [, comparison]]... [then]
    body
  ...
  [ else
      body ]
end


Cheers,
Sam

Gennady <gfb@to...com>

2004-02-04 15:52:25
Sam Roberts wrote:
> Quoteing bob.news@gm...net, on Wed, Feb 04, 2004 at 05:35:03PM +0900:
> 
>>>>>Do you know about this syntax currently available?
>>>>>
>>>>>a = "aaa"
>>>>>b = "bbb"
>>>>>case
>>>>>  when a == "aaa", b == "bbb"
>>>>>    puts "Lowercase detected"
>>>>>  when a == "AAA", b == "BBB"
>>>>>    puts "Uppercase detected"
>>>>>  else
>>>>>    puts "Detection failed"
>>>>>end
>>
>>I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures
>>of Ruby"... :-)
> 
> 
> There's a lot of info jammed into the corners of the pickaxe book!
> 
> For this syntax, there's an example in the section "Case Expressions",
> p84, and then in chapter 18 it shows the syntax:
> 
> case target
>   when comparison [, comparison]]... [then]
>     body
>   when comparison [, comparison]]... [then]
>     body
>   ...
>   [ else
>       body ]
> end
> 
> 
> Cheers,
> Sam
We are not talking about general "case" syntax, most of folks here are 
well aware of it (thanks for refreshing it anyway ;-)). It is rather 
about a special case when <target> is not specified in "case" clause. It 
looks like it defaults to "true" so that <comparison> may contain 
logical operators like "a == <something>". And I could not find it 
mentioned in the Pickaxe either.

Gennady.

Robert Klemme <bob.news@gm...net>

2004-02-08 21:41:26
"Gennady" <gfb@to...com> schrieb im Newsbeitrag
news:401FD2C6.1010703@to...com...
> Robert Klemme wrote:
> > "Gennady" <gfb@to...com> schrieb im Newsbeitrag
> > news:401FC5BB.10809@to...com...
> >
> >>Guoliang Cao wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm thinking of submitting a RCR. Here is the draft. Comments are
> >
> > welcome.
> >
> >>>Thanks,
> >>>Cao
> >>
> >>Do you know about this syntax currently available?
> >>
> >>a = "aaa"
> >>b = "bbb"
> >>case
> >>   when a == "aaa", b == "bbb"
> >>     puts "Lowercase detected"
> >>   when a == "AAA", b == "BBB"
> >>     puts "Uppercase detected"
> >>   else
> >>     puts "Detection failed"
> >>end
> >
> >
> > Since which version of Ruby?  Thx!
> >
> >     robert
> >
> >
>
> I checked that it works in 1.6.8. I remember somebody (Nobu?) mentioning
> it on ruby-talk some time ago.
I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures
of Ruby"... :-)

Thanks!

    robert

Robert Klemme <bob.news@gm...net>

2004-02-09 00:01:30
"Gennady" <gfb@to...com> schrieb im Newsbeitrag
news:401FD2C6.1010703@to...com...
> Robert Klemme wrote:
> > "Gennady" <gfb@to...com> schrieb im Newsbeitrag
> > news:401FC5BB.10809@to...com...
> >
> >>Guoliang Cao wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm thinking of submitting a RCR. Here is the draft. Comments are
> >
> > welcome.
> >
> >>>Thanks,
> >>>Cao
> >>
> >>Do you know about this syntax currently available?
> >>
> >>a = "aaa"
> >>b = "bbb"
> >>case
> >>   when a == "aaa", b == "bbb"
> >>     puts "Lowercase detected"
> >>   when a == "AAA", b == "BBB"
> >>     puts "Uppercase detected"
> >>   else
> >>     puts "Detection failed"
> >>end
> >
> >
> > Since which version of Ruby?  Thx!
> >
> >     robert
> >
> >
>
> I checked that it works in 1.6.8. I remember somebody (Nobu?) mentioning
> it on ruby-talk some time ago.
I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures
of Ruby"... :-)

Thanks!

    robert

Robert Klemme <bob.news@gm...net>

2004-02-09 01:18:42
"Gennady" <gfb@to...com> schrieb im Newsbeitrag
news:401FD2C6.1010703@to...com...
> Robert Klemme wrote:
> > "Gennady" <gfb@to...com> schrieb im Newsbeitrag
> > news:401FC5BB.10809@to...com...
> >
> >>Guoliang Cao wrote:
> >>
> >>>Hi,
> >>>
> >>>I'm thinking of submitting a RCR. Here is the draft. Comments are
> >
> > welcome.
> >
> >>>Thanks,
> >>>Cao
> >>
> >>Do you know about this syntax currently available?
> >>
> >>a = "aaa"
> >>b = "bbb"
> >>case
> >>   when a == "aaa", b == "bbb"
> >>     puts "Lowercase detected"
> >>   when a == "AAA", b == "BBB"
> >>     puts "Uppercase detected"
> >>   else
> >>     puts "Detection failed"
> >>end
> >
> >
> > Since which version of Ruby?  Thx!
> >
> >     robert
> >
> >
>
> I checked that it works in 1.6.8. I remember somebody (Nobu?) mentioning
> it on ruby-talk some time ago.
I couldn't find it in the Pickaxe - I'll file it under "Hidden Treasures
of Ruby"... :-)

Thanks!

    robert
On Wed, 04 Feb 2004 11:22:05 +0100, Robert Klemme wrote:

> 
> "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> news:pan.2004.02.04.09.26.42.335507@ad...dk...
>> On Wed, 04 Feb 2004 00:46:20 +0900, nobu.nokad wrote:
>> > At Wed, 4 Feb 2004 00:30:04 +0900,
>> > Simon Strandgaard wrote:
>> >> If I do "cat report.txt" then my terminal just scrolls for 10
> seconds,
>> >> which is much larger than what my terminal history can remember.
>> >> If I pipe it into "less" then the coloring disappears. How do you
> view
>> >> ANSI files?
>> >
>> > less -r
>>
>> Thanks..
>>
>> I have done some improvements to the original 'coverage.rb', so that
>> HTML is now generated. For an example have a look at:
>> http://neoneye.dk/parser.rb.coverage.html
>>
>> As you may notice comments/arrays appears as if they are not executed!
>> How can I fix this?
> 
> Dunno whether it's worth the effort.  I guess, comments could be fixed by
> identifying regions of comment lines and marking them as reached if the
> line above and below is reached.  For arrays you could try to find the
> matching "[" for a closing "]" and mark all lines in between if the line
> of the closing "]" is marked.
> 
> Apart from that: nice output!
Ok.. I now propagate the marked status to comments.. output is much better
now. Still Arrays/Hashes/=begin=end needs to be fixed.

Try compare the new output agains the old:
http://neoneye.dk/parser.rb.coverage.ver2.html

Suggestions for improvements is welcome.. also patches is welcome.

For the courius; try to execute the attached code by 
requiring it on the commandline.  
ruby -rcoverage helloworld.rb
That should output a 'helloworld.rb.coverage.html' file.

--
Simon Strandgaard

module PrettyCoverage
  class HTML
    def initialize
      @files = {}
    end
    def execute
      puts "execute"
      create_file_index
      @fi...each{|file, line_marked|
        create_file(file, line_marked)
      }
    end
    def mk_filename(name)  
      name+".coverage.html" 
    end
    def create_file_index
      output_filename = "index.html"
      rows = []
      @fi...each{|file, line_marked|
        filename = mk_filename(file)
        rows << "<tr><td><a href=\"#{filename}\">#{file}</a></td></tr>"
      }
      result = rows.join("\n")
      body = "<table>#{result}</table>"
      title = "coverage"
      css = <<EOCSS
body {
  background-color: rgb(180, 180, 180);
}
div.marked {
  background-color: rgb(185, 200, 200);
}
div.overview {
  border-bottom: 8px solid black;
}
EOCSS
      html = <<EOHTML 
<html><head><title>#{title}</title>
<style type="text/css">#{css}</style></head>
<body>#{body}</body></html> 
EOHTML
      File.open(output_filename, "w+") do |f|
        f.puts html
      end
    end
    def add_file(file, line_marked)
      percent = calc_coverage(line_marked)
      printf("file=#{file} coverage=%02.1f%\n", percent)

      # comments and empty lines.. we must
      # propagate marked-value backwards 
      line_marked << ["", false]
      (line_marked.size).downto(1) do |index|
        line, marked = line_marked[index-1]
        next_line, next_marked = line_marked[index]
        if line =~ /^\s*(#|$)/ and marked == false
          marked = next_marked
          #line = "hest" + line 
          line_marked[index-1] = [line, marked]
        end
      end
      line_marked.pop

      @files[file] = line_marked
    end
    def calc_coverage(line_marked)
      marked = line_marked.transpose[1]
      n = marked.inject(0) {|r, i| (i) ? (r+1) : r } 
      percent = n.to_f * 100 / marked.size
    end
    def format_overview(file, line_marked)
      percent = "%02.1f" % calc_coverage(line_marked)
      html = <<EOHTML
<div class="overview">
<table>
<tr><td>filename</td><td><tt>#{file}</tt></td></tr>
<tr><td>coverage</td><td>#{percent}</td></tr>
</table>
</div>
EOHTML
      html
    end
    def format_lines(line_marked)
      result = ""
      last = nil
      end_of_div = ""
      format_line = "%#{line_marked.size.to_s.size}d"
      line_no = 1
      line_marked.each {|(line, marked)|
        if marked != last
          result += end_of_div
          case marked
          when true
            result += "<div class=\"marked\">"
            end_of_div = "</div>"
          when false
            end_of_div = ""
          end
        end
        result += (format_line % line_no) + " " + line + "\n"
        last = marked
        line_no += 1
      }
      result += end_of_div
      "<pre>#{result}</pre>"
    end
    def create_file(file, line_marked)
      output_filename = mk_filename(file)
      puts "outputting #{output_filename.inspect}"
      body = 
        format_overview(file, line_marked) + 
        format_lines(line_marked)
      title = file + " - coverage"
      css = <<EOCSS
body {
  background-color: rgb(180, 180, 180);
}
div.marked {
  background-color: rgb(185, 200, 200);
}
div.overview {
  border-bottom: 8px solid black;
}
EOCSS
      html = <<EOHTML 
<html><head><title>#{title}</title>
<style type="text/css">#{css}</style></head>
<body>#{body}</body></html> 
EOHTML
      File.open(output_filename, "w+") do |f|
        f.puts html
      end
    end
  end
end

SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__

module COVERAGE__
  COVER = {}
  def self.trace_func(event, file, line, id, binding, klass)
    case event
    when 'c-call', 'c-return', 'class'
      return
    end
    COVER[file] ||= []
    COVER[file][line] ||= 0
    COVER[file][line] += 1
  end

  END {
    set_trace_func(nil)
  printer = PrettyCoverage::HTML.new
    COVER.each do |file, lines|
    next if SCRIPT_LINES__.has_key?(file) == false
    lines = SCRIPT_LINES__[file]
    covers = COVER[file]
    line_status = []
    0.upto(lines.size - 1) do |c|
      line = lines[c].chomp
      marked = false
      if covers[c + 1]
        marked = true
      elsif /^\s*(?:begin\s*(?:#.*)?|ensure\s*(?:#.*)?|else\s*(?:#.*)?)$/ =~ line and covers[c + 1 + 1]
        covers[c + 1] = covers[c + 1 + 1]
        marked = true
      elsif /^\s*(?:end|})\s*$/ =~ line && covers[c + 1 - 1]
        covers[c + 1] = covers[c + 1 - 1]
        marked = true
      end
      line_status << [line, marked]
    end
    printer.add_file(file, line_status)
    end
  printer.execute
  }

  set_trace_func(COVERAGE__.method(:trace_func).to_proc)
end

Robert Klemme <bob.news@gm...net>

2004-02-04 13:05:04
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.04.12.36.20.824346@ad...dk...
> On Wed, 04 Feb 2004 11:22:05 +0100, Robert Klemme wrote:
>
> >
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> > news:pan.2004.02.04.09.26.42.335507@ad...dk...
> >> On Wed, 04 Feb 2004 00:46:20 +0900, nobu.nokad wrote:
> >> > At Wed, 4 Feb 2004 00:30:04 +0900,
> >> > Simon Strandgaard wrote:
> >> >> If I do "cat report.txt" then my terminal just scrolls for 10
> > seconds,
> >> >> which is much larger than what my terminal history can remember.
> >> >> If I pipe it into "less" then the coloring disappears. How do you
> > view
> >> >> ANSI files?
> >> >
> >> > less -r
> >>
> >> Thanks..
> >>
> >> I have done some improvements to the original 'coverage.rb', so that
> >> HTML is now generated. For an example have a look at:
> >> http://neoneye.dk/parser.rb.coverage.html
> >>
> >> As you may notice comments/arrays appears as if they are not
executed!
> >> How can I fix this?
> >
> > Dunno whether it's worth the effort.  I guess, comments could be fixed
by
> > identifying regions of comment lines and marking them as reached if
the
> > line above and below is reached.  For arrays you could try to find the
> > matching "[" for a closing "]" and mark all lines in between if the
line
> > of the closing "]" is marked.
> >
> > Apart from that: nice output!
>
> Ok.. I now propagate the marked status to comments.. output is much
better
> now. Still Arrays/Hashes/=begin=end needs to be fixed.
>
> Try compare the new output agains the old:
> http://neoneye.dk/parser.rb.coverage.ver2.html
>
> Suggestions for improvements is welcome.. also patches is welcome.
Apparently "end" lines are not reported so the comment is marked "not
reached" in line 72.  Maybe it's better to check the reached status of the
last line before a comment region.  This should also be easier to do.

Regards

    robert

> For the courius; try to execute the attached code by
> requiring it on the commandline.
> ruby -rcoverage helloworld.rb
> That should output a 'helloworld.rb.coverage.html' file.
>
> --
> Simon Strandgaard
>
> module PrettyCoverage
>   class HTML
>     def initialize
>       @files = {}
>     end
>     def execute
>       puts "execute"
>       create_file_index
>       @fi...each{|file, line_marked|
>         create_file(file, line_marked)
>       }
>     end
>     def mk_filename(name)
>       name+".coverage.html"
>     end
>     def create_file_index
>       output_filename = "index.html"
>       rows = []
>       @fi...each{|file, line_marked|
>         filename = mk_filename(file)
>         rows << "<tr><td><a href=\"#{filename}\">#{file}</a></td></tr>"
>       }
>       result = rows.join("\n")
>       body = "<table>#{result}</table>"
>       title = "coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>     def add_file(file, line_marked)
>       percent = calc_coverage(line_marked)
>       printf("file=#{file} coverage=%02.1f%\n", percent)
>
>       # comments and empty lines.. we must
>       # propagate marked-value backwards
>       line_marked << ["", false]
>       (line_marked.size).downto(1) do |index|
>         line, marked = line_marked[index-1]
>         next_line, next_marked = line_marked[index]
>         if line =~ /^\s*(#|$)/ and marked == false
>           marked = next_marked
>           #line = "hest" + line
>           line_marked[index-1] = [line, marked]
>         end
>       end
>       line_marked.pop
>
>       @files[file] = line_marked
>     end
>     def calc_coverage(line_marked)
>       marked = line_marked.transpose[1]
>       n = marked.inject(0) {|r, i| (i) ? (r+1) : r }
>       percent = n.to_f * 100 / marked.size
>     end
>     def format_overview(file, line_marked)
>       percent = "%02.1f" % calc_coverage(line_marked)
>       html = <<EOHTML
> <div class="overview">
> <table>
> <tr><td>filename</td><td><tt>#{file}</tt></td></tr>
> <tr><td>coverage</td><td>#{percent}</td></tr>
> </table>
> </div>
> EOHTML
>       html
>     end
>     def format_lines(line_marked)
>       result = ""
>       last = nil
>       end_of_div = ""
>       format_line = "%#{line_marked.size.to_s.size}d"
>       line_no = 1
>       line_marked.each {|(line, marked)|
>         if marked != last
>           result += end_of_div
>           case marked
>           when true
>             result += "<div class=\"marked\">"
>             end_of_div = "</div>"
>           when false
>             end_of_div = ""
>           end
>         end
>         result += (format_line % line_no) + " " + line + "\n"
>         last = marked
>         line_no += 1
>       }
>       result += end_of_div
>       "<pre>#{result}</pre>"
>     end
>     def create_file(file, line_marked)
>       output_filename = mk_filename(file)
>       puts "outputting #{output_filename.inspect}"
>       body =
>         format_overview(file, line_marked) +
>         format_lines(line_marked)
>       title = file + " - coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>   end
> end
>
> SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
>
> module COVERAGE__
>   COVER = {}
>   def self.trace_func(event, file, line, id, binding, klass)
>     case event
>     when 'c-call', 'c-return', 'class'
>       return
>     end
>     COVER[file] ||= []
>     COVER[file][line] ||= 0
>     COVER[file][line] += 1
>   end
>
>   END {
>     set_trace_func(nil)
>   printer = PrettyCoverage::HTML.new
>     COVER.each do |file, lines|
>     next if SCRIPT_LINES__.has_key?(file) == false
>     lines = SCRIPT_LINES__[file]
>     covers = COVER[file]
>     line_status = []
>     0.upto(lines.size - 1) do |c|
>       line = lines[c].chomp
>       marked = false
>       if covers[c + 1]
>         marked = true
>       elsif
/^\s*(?:begin\s*(?:#.*)?|ensure\s*(?:#.*)?|else\s*(?:#.*)?)$/ =~ line and
covers[c + 1 + 1]
>         covers[c + 1] = covers[c + 1 + 1]
>         marked = true
>       elsif /^\s*(?:end|})\s*$/ =~ line && covers[c + 1 - 1]
>         covers[c + 1] = covers[c + 1 - 1]
>         marked = true
>       end
>       line_status << [line, marked]
>     end
>     printer.add_file(file, line_status)
>     end
>   printer.execute
>   }
>
>   set_trace_func(COVERAGE__.method(:trace_func).to_proc)
> end
>

Robert Klemme <bob.news@gm...net>

2004-02-08 21:46:52
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.04.12.36.20.824346@ad...dk...
> On Wed, 04 Feb 2004 11:22:05 +0100, Robert Klemme wrote:
>
> >
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> > news:pan.2004.02.04.09.26.42.335507@ad...dk...
> >> On Wed, 04 Feb 2004 00:46:20 +0900, nobu.nokad wrote:
> >> > At Wed, 4 Feb 2004 00:30:04 +0900,
> >> > Simon Strandgaard wrote:
> >> >> If I do "cat report.txt" then my terminal just scrolls for 10
> > seconds,
> >> >> which is much larger than what my terminal history can remember.
> >> >> If I pipe it into "less" then the coloring disappears. How do you
> > view
> >> >> ANSI files?
> >> >
> >> > less -r
> >>
> >> Thanks..
> >>
> >> I have done some improvements to the original 'coverage.rb', so that
> >> HTML is now generated. For an example have a look at:
> >> http://neoneye.dk/parser.rb.coverage.html
> >>
> >> As you may notice comments/arrays appears as if they are not
executed!
> >> How can I fix this?
> >
> > Dunno whether it's worth the effort.  I guess, comments could be fixed
by
> > identifying regions of comment lines and marking them as reached if
the
> > line above and below is reached.  For arrays you could try to find the
> > matching "[" for a closing "]" and mark all lines in between if the
line
> > of the closing "]" is marked.
> >
> > Apart from that: nice output!
>
> Ok.. I now propagate the marked status to comments.. output is much
better
> now. Still Arrays/Hashes/=begin=end needs to be fixed.
>
> Try compare the new output agains the old:
> http://neoneye.dk/parser.rb.coverage.ver2.html
>
> Suggestions for improvements is welcome.. also patches is welcome.
Apparently "end" lines are not reported so the comment is marked "not
reached" in line 72.  Maybe it's better to check the reached status of the
last line before a comment region.  This should also be easier to do.

Regards

    robert

> For the courius; try to execute the attached code by
> requiring it on the commandline.
> ruby -rcoverage helloworld.rb
> That should output a 'helloworld.rb.coverage.html' file.
>
> --
> Simon Strandgaard
>
> module PrettyCoverage
>   class HTML
>     def initialize
>       @files = {}
>     end
>     def execute
>       puts "execute"
>       create_file_index
>       @fi...each{|file, line_marked|
>         create_file(file, line_marked)
>       }
>     end
>     def mk_filename(name)
>       name+".coverage.html"
>     end
>     def create_file_index
>       output_filename = "index.html"
>       rows = []
>       @fi...each{|file, line_marked|
>         filename = mk_filename(file)
>         rows << "<tr><td><a href=\"#{filename}\">#{file}</a></td></tr>"
>       }
>       result = rows.join("\n")
>       body = "<table>#{result}</table>"
>       title = "coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>     def add_file(file, line_marked)
>       percent = calc_coverage(line_marked)
>       printf("file=#{file} coverage=%02.1f%\n", percent)
>
>       # comments and empty lines.. we must
>       # propagate marked-value backwards
>       line_marked << ["", false]
>       (line_marked.size).downto(1) do |index|
>         line, marked = line_marked[index-1]
>         next_line, next_marked = line_marked[index]
>         if line =~ /^\s*(#|$)/ and marked == false
>           marked = next_marked
>           #line = "hest" + line
>           line_marked[index-1] = [line, marked]
>         end
>       end
>       line_marked.pop
>
>       @files[file] = line_marked
>     end
>     def calc_coverage(line_marked)
>       marked = line_marked.transpose[1]
>       n = marked.inject(0) {|r, i| (i) ? (r+1) : r }
>       percent = n.to_f * 100 / marked.size
>     end
>     def format_overview(file, line_marked)
>       percent = "%02.1f" % calc_coverage(line_marked)
>       html = <<EOHTML
> <div class="overview">
> <table>
> <tr><td>filename</td><td><tt>#{file}</tt></td></tr>
> <tr><td>coverage</td><td>#{percent}</td></tr>
> </table>
> </div>
> EOHTML
>       html
>     end
>     def format_lines(line_marked)
>       result = ""
>       last = nil
>       end_of_div = ""
>       format_line = "%#{line_marked.size.to_s.size}d"
>       line_no = 1
>       line_marked.each {|(line, marked)|
>         if marked != last
>           result += end_of_div
>           case marked
>           when true
>             result += "<div class=\"marked\">"
>             end_of_div = "</div>"
>           when false
>             end_of_div = ""
>           end
>         end
>         result += (format_line % line_no) + " " + line + "\n"
>         last = marked
>         line_no += 1
>       }
>       result += end_of_div
>       "<pre>#{result}</pre>"
>     end
>     def create_file(file, line_marked)
>       output_filename = mk_filename(file)
>       puts "outputting #{output_filename.inspect}"
>       body =
>         format_overview(file, line_marked) +
>         format_lines(line_marked)
>       title = file + " - coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>   end
> end
>
> SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
>
> module COVERAGE__
>   COVER = {}
>   def self.trace_func(event, file, line, id, binding, klass)
>     case event
>     when 'c-call', 'c-return', 'class'
>       return
>     end
>     COVER[file] ||= []
>     COVER[file][line] ||= 0
>     COVER[file][line] += 1
>   end
>
>   END {
>     set_trace_func(nil)
>   printer = PrettyCoverage::HTML.new
>     COVER.each do |file, lines|
>     next if SCRIPT_LINES__.has_key?(file) == false
>     lines = SCRIPT_LINES__[file]
>     covers = COVER[file]
>     line_status = []
>     0.upto(lines.size - 1) do |c|
>       line = lines[c].chomp
>       marked = false
>       if covers[c + 1]
>         marked = true
>       elsif
/^\s*(?:begin\s*(?:#.*)?|ensure\s*(?:#.*)?|else\s*(?:#.*)?)$/ =~ line and
covers[c + 1 + 1]
>         covers[c + 1] = covers[c + 1 + 1]
>         marked = true
>       elsif /^\s*(?:end|})\s*$/ =~ line && covers[c + 1 - 1]
>         covers[c + 1] = covers[c + 1 - 1]
>         marked = true
>       end
>       line_status << [line, marked]
>     end
>     printer.add_file(file, line_status)
>     end
>   printer.execute
>   }
>
>   set_trace_func(COVERAGE__.method(:trace_func).to_proc)
> end
>

Robert Klemme <bob.news@gm...net>

2004-02-09 00:06:36
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.04.12.36.20.824346@ad...dk...
> On Wed, 04 Feb 2004 11:22:05 +0100, Robert Klemme wrote:
>
> >
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> > news:pan.2004.02.04.09.26.42.335507@ad...dk...
> >> On Wed, 04 Feb 2004 00:46:20 +0900, nobu.nokad wrote:
> >> > At Wed, 4 Feb 2004 00:30:04 +0900,
> >> > Simon Strandgaard wrote:
> >> >> If I do "cat report.txt" then my terminal just scrolls for 10
> > seconds,
> >> >> which is much larger than what my terminal history can remember.
> >> >> If I pipe it into "less" then the coloring disappears. How do you
> > view
> >> >> ANSI files?
> >> >
> >> > less -r
> >>
> >> Thanks..
> >>
> >> I have done some improvements to the original 'coverage.rb', so that
> >> HTML is now generated. For an example have a look at:
> >> http://neoneye.dk/parser.rb.coverage.html
> >>
> >> As you may notice comments/arrays appears as if they are not
executed!
> >> How can I fix this?
> >
> > Dunno whether it's worth the effort.  I guess, comments could be fixed
by
> > identifying regions of comment lines and marking them as reached if
the
> > line above and below is reached.  For arrays you could try to find the
> > matching "[" for a closing "]" and mark all lines in between if the
line
> > of the closing "]" is marked.
> >
> > Apart from that: nice output!
>
> Ok.. I now propagate the marked status to comments.. output is much
better
> now. Still Arrays/Hashes/=begin=end needs to be fixed.
>
> Try compare the new output agains the old:
> http://neoneye.dk/parser.rb.coverage.ver2.html
>
> Suggestions for improvements is welcome.. also patches is welcome.
Apparently "end" lines are not reported so the comment is marked "not
reached" in line 72.  Maybe it's better to check the reached status of the
last line before a comment region.  This should also be easier to do.

Regards

    robert

> For the courius; try to execute the attached code by
> requiring it on the commandline.
> ruby -rcoverage helloworld.rb
> That should output a 'helloworld.rb.coverage.html' file.
>
> --
> Simon Strandgaard
>
> module PrettyCoverage
>   class HTML
>     def initialize
>       @files = {}
>     end
>     def execute
>       puts "execute"
>       create_file_index
>       @fi...each{|file, line_marked|
>         create_file(file, line_marked)
>       }
>     end
>     def mk_filename(name)
>       name+".coverage.html"
>     end
>     def create_file_index
>       output_filename = "index.html"
>       rows = []
>       @fi...each{|file, line_marked|
>         filename = mk_filename(file)
>         rows << "<tr><td><a href=\"#{filename}\">#{file}</a></td></tr>"
>       }
>       result = rows.join("\n")
>       body = "<table>#{result}</table>"
>       title = "coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>     def add_file(file, line_marked)
>       percent = calc_coverage(line_marked)
>       printf("file=#{file} coverage=%02.1f%\n", percent)
>
>       # comments and empty lines.. we must
>       # propagate marked-value backwards
>       line_marked << ["", false]
>       (line_marked.size).downto(1) do |index|
>         line, marked = line_marked[index-1]
>         next_line, next_marked = line_marked[index]
>         if line =~ /^\s*(#|$)/ and marked == false
>           marked = next_marked
>           #line = "hest" + line
>           line_marked[index-1] = [line, marked]
>         end
>       end
>       line_marked.pop
>
>       @files[file] = line_marked
>     end
>     def calc_coverage(line_marked)
>       marked = line_marked.transpose[1]
>       n = marked.inject(0) {|r, i| (i) ? (r+1) : r }
>       percent = n.to_f * 100 / marked.size
>     end
>     def format_overview(file, line_marked)
>       percent = "%02.1f" % calc_coverage(line_marked)
>       html = <<EOHTML
> <div class="overview">
> <table>
> <tr><td>filename</td><td><tt>#{file}</tt></td></tr>
> <tr><td>coverage</td><td>#{percent}</td></tr>
> </table>
> </div>
> EOHTML
>       html
>     end
>     def format_lines(line_marked)
>       result = ""
>       last = nil
>       end_of_div = ""
>       format_line = "%#{line_marked.size.to_s.size}d"
>       line_no = 1
>       line_marked.each {|(line, marked)|
>         if marked != last
>           result += end_of_div
>           case marked
>           when true
>             result += "<div class=\"marked\">"
>             end_of_div = "</div>"
>           when false
>             end_of_div = ""
>           end
>         end
>         result += (format_line % line_no) + " " + line + "\n"
>         last = marked
>         line_no += 1
>       }
>       result += end_of_div
>       "<pre>#{result}</pre>"
>     end
>     def create_file(file, line_marked)
>       output_filename = mk_filename(file)
>       puts "outputting #{output_filename.inspect}"
>       body =
>         format_overview(file, line_marked) +
>         format_lines(line_marked)
>       title = file + " - coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>   end
> end
>
> SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
>
> module COVERAGE__
>   COVER = {}
>   def self.trace_func(event, file, line, id, binding, klass)
>     case event
>     when 'c-call', 'c-return', 'class'
>       return
>     end
>     COVER[file] ||= []
>     COVER[file][line] ||= 0
>     COVER[file][line] += 1
>   end
>
>   END {
>     set_trace_func(nil)
>   printer = PrettyCoverage::HTML.new
>     COVER.each do |file, lines|
>     next if SCRIPT_LINES__.has_key?(file) == false
>     lines = SCRIPT_LINES__[file]
>     covers = COVER[file]
>     line_status = []
>     0.upto(lines.size - 1) do |c|
>       line = lines[c].chomp
>       marked = false
>       if covers[c + 1]
>         marked = true
>       elsif
/^\s*(?:begin\s*(?:#.*)?|ensure\s*(?:#.*)?|else\s*(?:#.*)?)$/ =~ line and
covers[c + 1 + 1]
>         covers[c + 1] = covers[c + 1 + 1]
>         marked = true
>       elsif /^\s*(?:end|})\s*$/ =~ line && covers[c + 1 - 1]
>         covers[c + 1] = covers[c + 1 - 1]
>         marked = true
>       end
>       line_status << [line, marked]
>     end
>     printer.add_file(file, line_status)
>     end
>   printer.execute
>   }
>
>   set_trace_func(COVERAGE__.method(:trace_func).to_proc)
> end
>

Robert Klemme <bob.news@gm...net>

2004-02-09 01:24:14
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.04.12.36.20.824346@ad...dk...
> On Wed, 04 Feb 2004 11:22:05 +0100, Robert Klemme wrote:
>
> >
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> > news:pan.2004.02.04.09.26.42.335507@ad...dk...
> >> On Wed, 04 Feb 2004 00:46:20 +0900, nobu.nokad wrote:
> >> > At Wed, 4 Feb 2004 00:30:04 +0900,
> >> > Simon Strandgaard wrote:
> >> >> If I do "cat report.txt" then my terminal just scrolls for 10
> > seconds,
> >> >> which is much larger than what my terminal history can remember.
> >> >> If I pipe it into "less" then the coloring disappears. How do you
> > view
> >> >> ANSI files?
> >> >
> >> > less -r
> >>
> >> Thanks..
> >>
> >> I have done some improvements to the original 'coverage.rb', so that
> >> HTML is now generated. For an example have a look at:
> >> http://neoneye.dk/parser.rb.coverage.html
> >>
> >> As you may notice comments/arrays appears as if they are not
executed!
> >> How can I fix this?
> >
> > Dunno whether it's worth the effort.  I guess, comments could be fixed
by
> > identifying regions of comment lines and marking them as reached if
the
> > line above and below is reached.  For arrays you could try to find the
> > matching "[" for a closing "]" and mark all lines in between if the
line
> > of the closing "]" is marked.
> >
> > Apart from that: nice output!
>
> Ok.. I now propagate the marked status to comments.. output is much
better
> now. Still Arrays/Hashes/=begin=end needs to be fixed.
>
> Try compare the new output agains the old:
> http://neoneye.dk/parser.rb.coverage.ver2.html
>
> Suggestions for improvements is welcome.. also patches is welcome.
Apparently "end" lines are not reported so the comment is marked "not
reached" in line 72.  Maybe it's better to check the reached status of the
last line before a comment region.  This should also be easier to do.

Regards

    robert

> For the courius; try to execute the attached code by
> requiring it on the commandline.
> ruby -rcoverage helloworld.rb
> That should output a 'helloworld.rb.coverage.html' file.
>
> --
> Simon Strandgaard
>
> module PrettyCoverage
>   class HTML
>     def initialize
>       @files = {}
>     end
>     def execute
>       puts "execute"
>       create_file_index
>       @fi...each{|file, line_marked|
>         create_file(file, line_marked)
>       }
>     end
>     def mk_filename(name)
>       name+".coverage.html"
>     end
>     def create_file_index
>       output_filename = "index.html"
>       rows = []
>       @fi...each{|file, line_marked|
>         filename = mk_filename(file)
>         rows << "<tr><td><a href=\"#{filename}\">#{file}</a></td></tr>"
>       }
>       result = rows.join("\n")
>       body = "<table>#{result}</table>"
>       title = "coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>     def add_file(file, line_marked)
>       percent = calc_coverage(line_marked)
>       printf("file=#{file} coverage=%02.1f%\n", percent)
>
>       # comments and empty lines.. we must
>       # propagate marked-value backwards
>       line_marked << ["", false]
>       (line_marked.size).downto(1) do |index|
>         line, marked = line_marked[index-1]
>         next_line, next_marked = line_marked[index]
>         if line =~ /^\s*(#|$)/ and marked == false
>           marked = next_marked
>           #line = "hest" + line
>           line_marked[index-1] = [line, marked]
>         end
>       end
>       line_marked.pop
>
>       @files[file] = line_marked
>     end
>     def calc_coverage(line_marked)
>       marked = line_marked.transpose[1]
>       n = marked.inject(0) {|r, i| (i) ? (r+1) : r }
>       percent = n.to_f * 100 / marked.size
>     end
>     def format_overview(file, line_marked)
>       percent = "%02.1f" % calc_coverage(line_marked)
>       html = <<EOHTML
> <div class="overview">
> <table>
> <tr><td>filename</td><td><tt>#{file}</tt></td></tr>
> <tr><td>coverage</td><td>#{percent}</td></tr>
> </table>
> </div>
> EOHTML
>       html
>     end
>     def format_lines(line_marked)
>       result = ""
>       last = nil
>       end_of_div = ""
>       format_line = "%#{line_marked.size.to_s.size}d"
>       line_no = 1
>       line_marked.each {|(line, marked)|
>         if marked != last
>           result += end_of_div
>           case marked
>           when true
>             result += "<div class=\"marked\">"
>             end_of_div = "</div>"
>           when false
>             end_of_div = ""
>           end
>         end
>         result += (format_line % line_no) + " " + line + "\n"
>         last = marked
>         line_no += 1
>       }
>       result += end_of_div
>       "<pre>#{result}</pre>"
>     end
>     def create_file(file, line_marked)
>       output_filename = mk_filename(file)
>       puts "outputting #{output_filename.inspect}"
>       body =
>         format_overview(file, line_marked) +
>         format_lines(line_marked)
>       title = file + " - coverage"
>       css = <<EOCSS
> body {
>   background-color: rgb(180, 180, 180);
> }
> div.marked {
>   background-color: rgb(185, 200, 200);
> }
> div.overview {
>   border-bottom: 8px solid black;
> }
> EOCSS
>       html = <<EOHTML
> <html><head><title>#{title}</title>
> <style type="text/css">#{css}</style></head>
> <body>#{body}</body></html>
> EOHTML
>       File.open(output_filename, "w+") do |f|
>         f.puts html
>       end
>     end
>   end
> end
>
> SCRIPT_LINES__ = {} unless defined? SCRIPT_LINES__
>
> module COVERAGE__
>   COVER = {}
>   def self.trace_func(event, file, line, id, binding, klass)
>     case event
>     when 'c-call', 'c-return', 'class'
>       return
>     end
>     COVER[file] ||= []
>     COVER[file][line] ||= 0
>     COVER[file][line] += 1
>   end
>
>   END {
>     set_trace_func(nil)
>   printer = PrettyCoverage::HTML.new
>     COVER.each do |file, lines|
>     next if SCRIPT_LINES__.has_key?(file) == false
>     lines = SCRIPT_LINES__[file]
>     covers = COVER[file]
>     line_status = []
>     0.upto(lines.size - 1) do |c|
>       line = lines[c].chomp
>       marked = false
>       if covers[c + 1]
>         marked = true
>       elsif
/^\s*(?:begin\s*(?:#.*)?|ensure\s*(?:#.*)?|else\s*(?:#.*)?)$/ =~ line and
covers[c + 1 + 1]
>         covers[c + 1] = covers[c + 1 + 1]
>         marked = true
>       elsif /^\s*(?:end|})\s*$/ =~ line && covers[c + 1 - 1]
>         covers[c + 1] = covers[c + 1 - 1]
>         marked = true
>       end
>       line_status << [line, marked]
>     end
>     printer.add_file(file, line_status)
>     end
>   printer.execute
>   }
>
>   set_trace_func(COVERAGE__.method(:trace_func).to_proc)
> end
>

Austin Ziegler <austin@ha...ca>

2004-02-04 16:52:23
Replies: Guoliang Cao
On Wed, 4 Feb 2004 00:45:07 +0900, Robert Klemme wrote:
> Do we need this?
No. It's ugly and (IMO) not needed. Any program which seems to need it is in 
need of a redesign. The specific case can be handled as you suggested it, or 
better yet with a lookup table. This sort of problem is handled easily by 
intelligent data-driven design.

There is no need for a new or modified language construct here.

-austin
--
austin ziegler    * austin@ha...ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2004.02.04
                                         * 11.49.59

Guoliang Cao <gcao@le...net>

2004-02-04 17:55:46
---- Original Message ----
> On Wed, 4 Feb 2004 00:45:07 +0900, Robert Klemme wrote:
>> Do we need this?

> No. It's ugly and (IMO) not needed. Any program which seems to need it is in
> need of a redesign. The specific case can be handled as you suggested it, or

Robert's code looks good, but a bit over-engineering to me.

> better yet with a lookup table. This sort of problem is handled easily by
> intelligent data-driven design.

Don't mix system design with language capabilities please. I think it's not
a bad thing to let "case" to take more than one expressions. Just like a
function can take any number of arguments. Why does "case" have to be
limited to zero or one? Because all our languages are designed this way?
(AFAIK only Ruby "case" can take 0 expressions. That's some good stuff
introduced by Ruby, right? So why not go one step further?) Or because it's
impossible?

> There is no need for a new or modified language construct here.

Since 2.0 is a major update to 1.x, why can't we introduce new language
constructs if they really makes sense?

Cao

> -austin
> --
> austin ziegler    * austin@ha...ca * Toronto, ON, Canada
> software designer * pragmatic programmer * 2004.02.04
>                                          * 11.49.59

          

matz@ru...org (Yukihiro Matsumoto)

2004-02-04 18:29:43
Hi,

In message "Re: RCR draft for enhanced "case..when..else..end" syntax"
    on 04/02/05, Guoliang Cao <gcao@le...net> writes:

|Don't mix system design with language capabilities please. I think it's not
|a bad thing to let "case" to take more than one expressions. Just like a
|function can take any number of arguments. Why does "case" have to be
|limited to zero or one? Because all our languages are designed this way?
|(AFAIK only Ruby "case" can take 0 expressions. That's some good stuff
|introduced by Ruby, right? So why not go one step further?) Or because it's
|impossible?

Natural extension is not always a good thing.  We can inherit from one
class, hey, why not inheriting from multiple classes?  Because it
introduces complexity, mix-in is a better solution.

|Since 2.0 is a major update to 1.x, why can't we introduce new language
|constructs if they really makes sense?

You are right, we can, when (and only when) I agree with the new
design.  I personally don't see much usage of your new syntax.

							matz.

Guoliang Cao <gcao@le...net>

2004-02-04 18:41:14
---- Original Message ----
> Hi,

> In message "Re: RCR draft for enhanced "case..when..else..end" syntax"
>     on 04/02/05, Guoliang Cao <gcao@le...net> writes:

> |Don't mix system design with language capabilities please. I think it's not
> |a bad thing to let "case" to take more than one expressions. Just like a
> |function can take any number of arguments. Why does "case" have to be
> |limited to zero or one? Because all our languages are designed this way?
> |(AFAIK only Ruby "case" can take 0 expressions. That's some good stuff
> |introduced by Ruby, right? So why not go one step further?) Or because it's
> |impossible?

> Natural extension is not always a good thing.  We can inherit from one
> class, hey, why not inheriting from multiple classes?  Because it
> introduces complexity, mix-in is a better solution.

> |Since 2.0 is a major update to 1.x, why can't we introduce new language
> |constructs if they really makes sense?

> You are right, we can, when (and only when) I agree with the new
> design.  I personally don't see much usage of your new syntax.

I'm fine with that. Thanks for taking a look, Matz.

Cao

          

This message appeared in a previous month, was never archived, or was lost.

Austin Ziegler <austin@ha...ca>

2004-02-04 18:43:12
On Wed, 4 Feb 2004 12:55:42 -0500, Guoliang Cao wrote:
>> better yet with a lookup table. This sort of problem is handled easily
>> by intelligent data-driven design.
> Don't mix system design with language capabilities please.
I'm not. This proposal does. What you're wanting to do is effectively make
it so that case operates in parallel on multiple conditions. I can count on
zero hands the number of times that I've needed this capability. I have
found it more useful to worry about my data design and make sure that I
have a proper lookup table. Robert's design does exactly that with multiple
custom objects instead of a lookup table.

> I think it's not a bad thing to let "case" to take more than one
> expressions. Just like a function can take any number of arguments. Why
> does "case" have to be limited to zero or one? Because all our languages
> are designed this way? (AFAIK only Ruby "case" can take 0 expressions.
> That's some good stuff introduced by Ruby, right? So why not go one step
> further?) Or because it's impossible?
Nothing is impossible. It's a question as to whether it's a good idea.
Frankly, your proposal is a bad idea. I said as much to your initial posting
on RubyGarden.

>> There is no need for a new or modified language construct here.
> Since 2.0 is a major update to 1.x, why can't we introduce new language
> constructs if they really makes sense?
Except that your construct doesn't make sense.

1. It introduces unnecessary complexity.
2. It adds a lot of "magic" that isn't clear (_ or ~ -- both are really
   ugly). Ruby2 seems to be getting rid of a lot of that silly magic.
3. It adds a language "feature" that is better handled by proper program
   design.

-austin
--
austin ziegler    * austin@ha...ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2004.02.04
* 13.31.26

Guoliang Cao <gcao@le...net>

2004-02-04 19:07:06
---- Original Message ----
> On Wed, 4 Feb 2004 12:55:42 -0500, Guoliang Cao wrote:
>>> better yet with a lookup table. This sort of problem is handled easily
>>> by intelligent data-driven design.
>> Don't mix system design with language capabilities please.

> I'm not. This proposal does. What you're wanting to do is effectively make
> it so that case operates in parallel on multiple conditions. I can count on
> zero hands the number of times that I've needed this capability. I have

When you are thinking it's not something you'll need, the count is always
zero.

> found it more useful to worry about my data design and make sure that I
> have a proper lookup table. Robert's design does exactly that with multiple
> custom objects instead of a lookup table.

>> I think it's not a bad thing to let "case" to take more than one
>> expressions. Just like a function can take any number of arguments. Why
>> does "case" have to be limited to zero or one? Because all our languages
>> are designed this way? (AFAIK only Ruby "case" can take 0 expressions.
>> That's some good stuff introduced by Ruby, right? So why not go one step
>> further?) Or because it's impossible?

> Nothing is impossible. It's a question as to whether it's a good idea.
> Frankly, your proposal is a bad idea. I said as much to your initial posting
> on RubyGarden.

It might be. I can accept that. ;-)

>>> There is no need for a new or modified language construct here.
>> Since 2.0 is a major update to 1.x, why can't we introduce new language
>> constructs if they really makes sense?

> Except that your construct doesn't make sense.

> 1. It introduces unnecessary complexity.

I can't see how complex it is. It might be though. I might have mixed too
many things in one proposal.

> 2. It adds a lot of "magic" that isn't clear (_ or ~ -- both are really
>    ugly). Ruby2 seems to be getting rid of a lot of that silly magic.

Once it's clear, it's clear.

> 3. It adds a language "feature" that is better handled by proper program
>    design.

About my example, I don't think people should do a complex design.
"if..elsif" is the answer in current Ruby capability.

Cao

> -austin
> --
> austin ziegler    * austin@ha...ca * Toronto, ON, Canada
> software designer * pragmatic programmer * 2004.02.04
> * 13.31.26

          

Sean O'Dell <sean@ce...com>

2004-02-04 19:27:06
On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> About my example, I don't think people should do a complex design.
> "if..elsif" is the answer in current Ruby capability.
Personally, I like the idea of a more readable way to replace the if...elsif 
paradigm.  It's a great idea!

	Sean O'Dell

Austin Ziegler <austin@ha...ca>

2004-02-04 21:55:08
On Thu, 5 Feb 2004 04:27:06 +0900, Sean O'Dell wrote:
> On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
>> About my example, I don't think people should do a complex design.
>> "if..elsif" is the answer in current Ruby capability.
> Personally, I like the idea of a more readable way to replace the
> if...elsif paradigm.  It's a great idea!
It's called lookup tables or object oriented programming using virtual 
calls, as Robert Klemme implemented.

-austin
--
austin ziegler    * austin@ha...ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2004.02.04
                                         * 16.54.18

Robert Klemme <bob.news@gm...net>

2004-02-05 08:25:01
"Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
news:200402041127.02778.sean@ce...com...
> On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > About my example, I don't think people should do a complex design.
> > "if..elsif" is the answer in current Ruby capability.
>
> Personally, I like the idea of a more readable way to replace the
if...elsif
> paradigm.  It's a great idea!
Hmm...  As someone else pointed out, if you are in excessive need of such
a construct, you should consider redesign.  Case constructs (or
if...elsif...end cascades) are regarded to be not very OO IMHO.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-08 21:56:42
"Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
news:200402041127.02778.sean@ce...com...
> On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > About my example, I don't think people should do a complex design.
> > "if..elsif" is the answer in current Ruby capability.
>
> Personally, I like the idea of a more readable way to replace the
if...elsif
> paradigm.  It's a great idea!
Hmm...  As someone else pointed out, if you are in excessive need of such
a construct, you should consider redesign.  Case constructs (or
if...elsif...end cascades) are regarded to be not very OO IMHO.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-08 21:57:09
"Robert Klemme" <bob.news@gm...net> schrieb im Newsbeitrag news:...
> "Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
> news:200402041127.02778.sean@ce...com...
> > On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > > About my example, I don't think people should do a complex design.
> > > "if..elsif" is the answer in current Ruby capability.
> >
> > Personally, I like the idea of a more readable way to replace the
> if...elsif
> > paradigm.  It's a great idea!
>
> Hmm...  As someone else pointed out, if you are in excessive need of
such
> a construct, you should consider redesign.  Case constructs (or
> if...elsif...end cascades) are regarded to be not very OO IMHO.
Just to illustrate what I mean: in the case of the point coloring one
solve the problem with a mapping:

#!/usr/bin/ruby

Point = Struct.new( :x, :y )

class Point
  def range_x; x / 50; end
  def range_y; y / 50; end
end

colours = {
  [0, 0] => "white",
  [0, 1] => "white",
  [0, 2] => "white",
  [0, 3] => "white",
  [3, 0] => "white",
  [3, 1] => "white",
  [3, 2] => "white",
  [3, 3] => "white",

  [1, 0] => "blue",
  [2, 0] => "blue",

  [1, 1] => "grey",
  [1, 2] => "grey",
  [1, 3] => "grey",
}

colours.default= "black"

points = [
  Point.new( 0, 0 ),
  Point.new( 100, 0 ),
  Point.new( 55, 55 ),
  Point.new( 120, 210 ),
]

points.each do |point|
  p [point, colours[ [point.range_x, point.range_y] ] ]
end

IMHO this is also more efficient because the number of operations is
smaller than in a case / if...elsif...end cascade.  And it doesn't grow
linea with the number of colors involved.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-09 00:17:06
"Robert Klemme" <bob.news@gm...net> schrieb im Newsbeitrag news:...
> "Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
> news:200402041127.02778.sean@ce...com...
> > On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > > About my example, I don't think people should do a complex design.
> > > "if..elsif" is the answer in current Ruby capability.
> >
> > Personally, I like the idea of a more readable way to replace the
> if...elsif
> > paradigm.  It's a great idea!
>
> Hmm...  As someone else pointed out, if you are in excessive need of
such
> a construct, you should consider redesign.  Case constructs (or
> if...elsif...end cascades) are regarded to be not very OO IMHO.
Just to illustrate what I mean: in the case of the point coloring one
solve the problem with a mapping:

#!/usr/bin/ruby

Point = Struct.new( :x, :y )

class Point
  def range_x; x / 50; end
  def range_y; y / 50; end
end

colours = {
  [0, 0] => "white",
  [0, 1] => "white",
  [0, 2] => "white",
  [0, 3] => "white",
  [3, 0] => "white",
  [3, 1] => "white",
  [3, 2] => "white",
  [3, 3] => "white",

  [1, 0] => "blue",
  [2, 0] => "blue",

  [1, 1] => "grey",
  [1, 2] => "grey",
  [1, 3] => "grey",
}

colours.default= "black"

points = [
  Point.new( 0, 0 ),
  Point.new( 100, 0 ),
  Point.new( 55, 55 ),
  Point.new( 120, 210 ),
]

points.each do |point|
  p [point, colours[ [point.range_x, point.range_y] ] ]
end

IMHO this is also more efficient because the number of operations is
smaller than in a case / if...elsif...end cascade.  And it doesn't grow
linea with the number of colors involved.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-09 01:31:44
"Robert Klemme" <bob.news@gm...net> schrieb im Newsbeitrag news:...
> "Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
> news:200402041127.02778.sean@ce...com...
> > On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > > About my example, I don't think people should do a complex design.
> > > "if..elsif" is the answer in current Ruby capability.
> >
> > Personally, I like the idea of a more readable way to replace the
> if...elsif
> > paradigm.  It's a great idea!
>
> Hmm...  As someone else pointed out, if you are in excessive need of
such
> a construct, you should consider redesign.  Case constructs (or
> if...elsif...end cascades) are regarded to be not very OO IMHO.
Just to illustrate what I mean: in the case of the point coloring one
solve the problem with a mapping:

#!/usr/bin/ruby

Point = Struct.new( :x, :y )

class Point
  def range_x; x / 50; end
  def range_y; y / 50; end
end

colours = {
  [0, 0] => "white",
  [0, 1] => "white",
  [0, 2] => "white",
  [0, 3] => "white",
  [3, 0] => "white",
  [3, 1] => "white",
  [3, 2] => "white",
  [3, 3] => "white",

  [1, 0] => "blue",
  [2, 0] => "blue",

  [1, 1] => "grey",
  [1, 2] => "grey",
  [1, 3] => "grey",
}

colours.default= "black"

points = [
  Point.new( 0, 0 ),
  Point.new( 100, 0 ),
  Point.new( 55, 55 ),
  Point.new( 120, 210 ),
]

points.each do |point|
  p [point, colours[ [point.range_x, point.range_y] ] ]
end

IMHO this is also more efficient because the number of operations is
smaller than in a case / if...elsif...end cascade.  And it doesn't grow
linea with the number of colors involved.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-05 08:55:01
"Robert Klemme" <bob.news@gm...net> schrieb im Newsbeitrag news:...
> "Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
> news:200402041127.02778.sean@ce...com...
> > On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > > About my example, I don't think people should do a complex design.
> > > "if..elsif" is the answer in current Ruby capability.
> >
> > Personally, I like the idea of a more readable way to replace the
> if...elsif
> > paradigm.  It's a great idea!
>
> Hmm...  As someone else pointed out, if you are in excessive need of
such
> a construct, you should consider redesign.  Case constructs (or
> if...elsif...end cascades) are regarded to be not very OO IMHO.
Just to illustrate what I mean: in the case of the point coloring one
solve the problem with a mapping:

#!/usr/bin/ruby

Point = Struct.new( :x, :y )

class Point
  def range_x; x / 50; end
  def range_y; y / 50; end
end

colours = {
  [0, 0] => "white",
  [0, 1] => "white",
  [0, 2] => "white",
  [0, 3] => "white",
  [3, 0] => "white",
  [3, 1] => "white",
  [3, 2] => "white",
  [3, 3] => "white",

  [1, 0] => "blue",
  [2, 0] => "blue",

  [1, 1] => "grey",
  [1, 2] => "grey",
  [1, 3] => "grey",
}

colours.default= "black"

points = [
  Point.new( 0, 0 ),
  Point.new( 100, 0 ),
  Point.new( 55, 55 ),
  Point.new( 120, 210 ),
]

points.each do |point|
  p [point, colours[ [point.range_x, point.range_y] ] ]
end

IMHO this is also more efficient because the number of operations is
smaller than in a case / if...elsif...end cascade.  And it doesn't grow
linea with the number of colors involved.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-09 00:15:14
"Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
news:200402041127.02778.sean@ce...com...
> On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > About my example, I don't think people should do a complex design.
> > "if..elsif" is the answer in current Ruby capability.
>
> Personally, I like the idea of a more readable way to replace the
if...elsif
> paradigm.  It's a great idea!
Hmm...  As someone else pointed out, if you are in excessive need of such
a construct, you should consider redesign.  Case constructs (or
if...elsif...end cascades) are regarded to be not very OO IMHO.

Regards

    robert

Robert Klemme <bob.news@gm...net>

2004-02-09 01:31:07
"Sean O'Dell" <sean@ce...com> schrieb im Newsbeitrag
news:200402041127.02778.sean@ce...com...
> On Wednesday 04 February 2004 11:07 am, Guoliang Cao wrote:
> > About my example, I don't think people should do a complex design.
> > "if..elsif" is the answer in current Ruby capability.
>
> Personally, I like the idea of a more readable way to replace the
if...elsif
> paradigm.  It's a great idea!
Hmm...  As someone else pointed out, if you are in excessive need of such
a construct, you should consider redesign.  Case constructs (or
if...elsif...end cascades) are regarded to be not very OO IMHO.

Regards

    robert

YANAGAWA Kazuhisa <kjana@dm...to>

2004-02-05 12:03:59
In Message-Id: <1851592490.20040204140703@le...net>
Guoliang Cao <gcao@le...net> writes:

> About my example, I don't think people should do a complex design.
> "if..elsif" is the answer in current Ruby capability.
I wonder why those who have informed that case which has no following
expressions is equivalent to `case true', and when clause can take an
arbitrary expression, doesn't try:

    case
    when a == "aaa" && b == "bbb"
      puts "lowercase"
    when a == "AAA" && b == "BBB"
      puts "uppercase"
    else
      puts "???"
    end

That looks nice, doesn't it?


-- 
kjana@dm...to                                 February 5, 2004
It is comparison that makes men happy or miserable.

tony summerfelt <snowzone5@ho...com>

2004-02-08 21:19:35
On Mon, 02 Feb 2004 at 09:13 GMT, Robert Klemme <bob.news@gm...net> wrote:

> Just to keep improving: change

> logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x")
> to
> logline="+ 30 Jan 12:20:09 [3988] addr: x.x.x.x"
yup, thought of that one already :)

> To make results look a bit nicer you could also do
i just needed to get the string in usable format, for testing the age.

-- 
http://home.cogeco.ca/~tsummerfelt1

shasckaw <shasckaw@sk...be>

2004-02-08 21:27:16
Robert Klemme wrote:
> "shasckaw" <shasckaw@sk...be> schrieb im Newsbeitrag
> news:401ee616$0$320$ba620e4c@ne...be...
> 
>>Thansk for the link, it looks interesting but it is perhaps too complex
>>for what I intend to do. But I can give it a try... well, I'd be happy
>>to try it but there isn't any files in the package, and project activity
>>is near to death. I'll try to get more info about it, but I haven't much
>>hope.
>>
>>If anyone has another solution, please help me!
> 
> 
> Depending on what you need to do it might even be built into the language
> already.  If you only need to add roles over time you could define some
> modules for the roles and add them as needed:
> 
> irb(main):001:0> class Foo;end
> => nil
> irb(main):002:0> f=Foo.new
> => #<Foo:0x1019dfe0>
> irb(main):003:0> f.respond_to? :inject
> => false
> irb(main):004:0> f.extend Enumerable
> => #<Foo:0x1019dfe0>
> irb(main):005:0> f.respond_to? :inject
> => true
> 
> Other than that SimpleDelegator might help you as well:
> http://www.rubycentral.com/book/lib_patterns.html
> 
>     robert
I'll try that way,
thanks for the advices,
Lio

tony summerfelt <snowzone5@ho...com>

2004-02-08 23:37:56
On Mon, 02 Feb 2004 at 09:13 GMT, Robert Klemme <bob.news@gm...net> wrote:

> Just to keep improving: change

> logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x")
> to
> logline="+ 30 Jan 12:20:09 [3988] addr: x.x.x.x"
yup, thought of that one already :)

> To make results look a bit nicer you could also do
i just needed to get the string in usable format, for testing the age.

-- 
http://home.cogeco.ca/~tsummerfelt1

shasckaw <shasckaw@sk...be>

2004-02-08 23:45:58
Robert Klemme wrote:
> "shasckaw" <shasckaw@sk...be> schrieb im Newsbeitrag
> news:401ee616$0$320$ba620e4c@ne...be...
> 
>>Thansk for the link, it looks interesting but it is perhaps too complex
>>for what I intend to do. But I can give it a try... well, I'd be happy
>>to try it but there isn't any files in the package, and project activity
>>is near to death. I'll try to get more info about it, but I haven't much
>>hope.
>>
>>If anyone has another solution, please help me!
> 
> 
> Depending on what you need to do it might even be built into the language
> already.  If you only need to add roles over time you could define some
> modules for the roles and add them as needed:
> 
> irb(main):001:0> class Foo;end
> => nil
> irb(main):002:0> f=Foo.new
> => #<Foo:0x1019dfe0>
> irb(main):003:0> f.respond_to? :inject
> => false
> irb(main):004:0> f.extend Enumerable
> => #<Foo:0x1019dfe0>
> irb(main):005:0> f.respond_to? :inject
> => true
> 
> Other than that SimpleDelegator might help you as well:
> http://www.rubycentral.com/book/lib_patterns.html
> 
>     robert
I'll try that way,
thanks for the advices,
Lio

tony summerfelt <snowzone5@ho...com>

2004-02-09 00:58:11
On Mon, 02 Feb 2004 at 09:13 GMT, Robert Klemme <bob.news@gm...net> wrote:

> Just to keep improving: change

> logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x")
> to
> logline="+ 30 Jan 12:20:09 [3988] addr: x.x.x.x"
yup, thought of that one already :)

> To make results look a bit nicer you could also do
i just needed to get the string in usable format, for testing the age.

-- 
http://home.cogeco.ca/~tsummerfelt1

shasckaw <shasckaw@sk...be>

2004-02-09 01:04:31
Robert Klemme wrote:
> "shasckaw" <shasckaw@sk...be> schrieb im Newsbeitrag
> news:401ee616$0$320$ba620e4c@ne...be...
> 
>>Thansk for the link, it looks interesting but it is perhaps too complex
>>for what I intend to do. But I can give it a try... well, I'd be happy
>>to try it but there isn't any files in the package, and project activity
>>is near to death. I'll try to get more info about it, but I haven't much
>>hope.
>>
>>If anyone has another solution, please help me!
> 
> 
> Depending on what you need to do it might even be built into the language
> already.  If you only need to add roles over time you could define some
> modules for the roles and add them as needed:
> 
> irb(main):001:0> class Foo;end
> => nil
> irb(main):002:0> f=Foo.new
> => #<Foo:0x1019dfe0>
> irb(main):003:0> f.respond_to? :inject
> => false
> irb(main):004:0> f.extend Enumerable
> => #<Foo:0x1019dfe0>
> irb(main):005:0> f.respond_to? :inject
> => true
> 
> Other than that SimpleDelegator might help you as well:
> http://www.rubycentral.com/book/lib_patterns.html
> 
>     robert
I'll try that way,
thanks for the advices,
Lio

tony summerfelt <snowzone5@ho...com>

2004-02-09 01:53:49
On Mon, 02 Feb 2004 at 09:13 GMT, Robert Klemme <bob.news@gm...net> wrote:

> Just to keep improving: change

> logline=String.new("+ 30 Jan 12:20:09 [3988] addr: x.x.x.x")
> to
> logline="+ 30 Jan 12:20:09 [3988] addr: x.x.x.x"
yup, thought of that one already :)

> To make results look a bit nicer you could also do
i just needed to get the string in usable format, for testing the age.

-- 
http://home.cogeco.ca/~tsummerfelt1

Charles Comstock <cc1@ce...edu>

2004-02-09 09:30:04
Robert Klemme wrote:

> "Tim Bates" <tim@ba...au> schrieb im Newsbeitrag
> news:4025CA70.9090202@ba...au...
> <snip>
> 
>>Below is the code I have written. The idea is that other application
>>code calls SAMS::Database.get_handle{ |handle| handle.execute... } and
>>this module takes care of the rest. Also, the application's shutdown
>>code will call SAMS::Database.destroy to cleanly disconnect all the
> 
> handles.
> 
> You definitely need some kind of synchronization mechanism that makes
> accesses to the shared connection pool thread safe.  In your case a
> ConditionVariable will help you with the max connection logic.
> 
> See section "Logging from multiple threads" for example usage of a
> ConditionVariable at
> http://www.rubygarden.org/ruby?MultiThreading
> 
> I'd implement a Semaphore using a ConditionVariable and a Mutex; that way
> you can initialize the semaphore with the max connection value and count
> the semaphore down when you take a connection from the pool and increment
> it when you put it back.  If the semaphore is zero, the next thread trying
> to decrease the semaphore is put to sleep and will wake up when another
> thread increments the semaphore.
> 
> You can as well use the semaphore implementation in the RAA:
> http://raa.ruby-lang.org/list.rhtml?name=semaphore
> 
> <snip>
> 
> As an additional note: I would not use module methods for the pool
> handling.  Instead I'd instantiate an instance of the pool.  This is IMHO
> better since the pool is not necessarily a singleton: Just think of an
> application that needs to access more than one database and hence use more
> than one connection configuration.
> 
> Kind regards
> 
>     robert
Why doesn't the counting semaphore library come standard with Ruby?  I 
haven't done anything multithreaded in a little while, but I remember 
being annoyed I didn't have a counting semaphore.  Is there a particular 
reason it's not part of the standard library?  Obviously not everything 
should come standard but this seems to be the sort of thing that should.

	Charles Comstock

Piergiuliano Bossi <p_bossi_AGAINST_SPAM@ti...it>

2004-02-10 13:20:00
Robert Klemme wrote:

>>I know that in lisp this can be easily done due to its nature (that is,
>>code is data and data is code), but in ruby?
> 
> 
> You can't without manually parsing the source file.  The closest you might
> get without extra parsing might be this, but still "code" is a String:
> 
> code=<<CODE
> 1 + 2 == 3
> CODE
> puts "#{code} --> #{eval code}"
Thanks Robert, I understand what you mean: it looks like code, but it's 
a String.

Smart, but I was looking for real code.

Thanks anyway.
Ciao, Giuliano

-- 
If you want to send me an email in the address you have to write 'p', 
then a dot, followed by 'bossi' at 'quinary', another dot and 'com' at last

This message appeared in a previous month, was never archived, or was lost.

Sam Roberts <sroberts@un...com>

2004-02-12 16:18:56
Quoteing jfc@se...com, on Tue, Feb 10, 2004 at 10:33:53PM +0900:
> 
> http://www.rubyist.net/~matz/slides/oscon2003/mgp00001.html
Cool! I thought I was the only one who'd read Babel-17!

Delaney is one of the most interesting scifi writers ever. Two other
novels dealing with how language affects thought are 1984 (of course),
and SnowCrash, by Neal Stephenson.

Sam

rmb25612@ya...com (Richard James)

2004-02-10 23:44:58
> > With that said, would people recommend Ruby to someone like me?
> > I read about the "principle of least surprise" (or something to
> > that effect), and I was intrigued. I have tried Perl, and I am
> > dismayed at the "explosion at an ASCII factory" effect. I have
> > tried PHP, and I love it but I'd like something more OOP and more
> > general purpose both.
> >
If you're using MS Windows then try out the FREE Gui4Cli script
language.

http://gui4cli.com
or
http://users.hol.gr/~dck/g4c/

Gui4Cli is designed to bring the ease and power of a scripting
language to MS Windows API programming.

With the included Gui4Cli version of the SciTE editor, you'll be able
to write simple programs with REAL Windows displays. In fact you can
put the SciTE editor into your own GUIs.

Gui4Cli is what MSDOS batch programming should have become on Windows.
You can even make all your old command line programs look like Windows
programs!

You can use Gui4Cli as it's own complete programming language. Or you
can just use it to let your user select your program options from a
professional looking Windows GUI using Menus, Textboxes, Buttons,
Checkboxes, Radiobuttons etc. And then running a Ruby program from the
GUI at the touch of a button is as easy as creating a MyGui.gui script
like:
--------
G4C MyGui
WINDOW #center #center 300 100 "My First Gui"

xOnClose
   guiquit MyGui

xOnLoad
   guiopen MyGui

xCheckBox 10 10 280 25 "Run with option X?" optX On Off ON

xCheckBox 10 35 280 25 "Run with option Y?" opty On Off OFF

xButton 75 60 150 25 "Run My Ruby Program"
   run ":myprog.rbw" "$optX $optY"
---------

And when you have that killer application perfected, you can use
Gui4Cli to create a installation package to distribute your program as
a single .exe file!

If you need to talk between your different G4C GUI's, it is built in:
---------
address MyOtherGui
send data "hello I need report z"
---------

There also is an optional g4c.pyd dll to talk with Python scripts.

And you can even extend the G4C language with dll's written in C. And
you call your new functions just by adding lines like:
--------
mydllname.myfirstfunction arg1 arg2
mydllname.mysecondfunction arg1 arg2 arg3
--------

There are many tutorial GUI programs to examine. The documention is
extensive and if you can't figure something out just go to the Gui4Cli
users group on Yahoo and ask.

http://groups.yahoo.com/group/gui4cli/archives.cgi

Note: If someone knows Ruby Win32Api programming, Gui4Cli it is just
waiting to be interfaced to Ruby! And the Python dll window interface
source is available to copy from!

Simon Strandgaard <neoneye@ad...dk>

2004-02-12 12:09:58
Replies: Gavin Sinclair
On Thu, 12 Feb 2004 12:59:21 +0100, Robert Klemme wrote:
> "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
>>
>>   result.sub!(/\{/,'[')
>>   result.sub!(/\}/,']')
>>
>> Above can be chained, so it becomes
>>
>>   result.sub!(/\{/,'[').sub!(/\}/,']')
> 
> I always feel unconfortable chaining (g)sub! since the result here *may*
> be nil.
[snip]

I am curious to when 'nil' may be returned?

--
Simon Strandgaard

Gavin Sinclair <gsinclair@so...au>

2004-02-12 12:37:24
On Thursday, February 12, 2004, 11:09:58 PM, Simon wrote:

>> I always feel unconfortable chaining (g)sub! since the result here *may*
>> be nil.
>>
> [snip]

> I am curious to when 'nil' may be returned?
Here you go:

irb(main):001:0> "xyz".gsub!(/a/, "b")
=> nil

Gavin

Simon Strandgaard <neoneye@ad...dk>

2004-02-12 12:50:00
On Thu, 12 Feb 2004 21:37:24 +0900, Gavin Sinclair wrote:

> On Thursday, February 12, 2004, 11:09:58 PM, Simon wrote:
> 
>>> I always feel unconfortable chaining (g)sub! since the result here *may*
>>> be nil.
>>>
>> [snip]
> 
>> I am curious to when 'nil' may be returned?
> 
> Here you go:
> 
> irb(main):001:0> "xyz".gsub!(/a/, "b")
> => nil
Bommer, I feel sleepy :-)

--
Simon Strandgaard

Simon Strandgaard <neoneye@ad...dk>

2004-02-12 16:50:09
Replies: Robert Klemme
On Thu, 12 Feb 2004 17:35:20 +0100, Robert Klemme wrote:
> "Koncept" <user@un...invalid> schrieb im Newsbeitrag
> news:120220041122469448%user@un...invalid...
>>
>> irb(main):001:0> result = '{ "robert","trey","adrian", "pat" }'
>> => "{ \"robert\",\"trey\",\"adrian\", \"pat\" }"
>>
>> irb(main):002:0> result.scan(/"(.*?)"/).flatten
>> => ["robert", "trey", "adrian", "pat"]
Try

  result = result.scan(/"(.*?)"/).flatten


>> irb(main):004:0> result.class
>> => *String*
>>
--
Simon Strandgaard
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.12.16.43.18.895279@ad...dk...
> On Thu, 12 Feb 2004 17:35:20 +0100, Robert Klemme wrote:
> > "Koncept" <user@un...invalid> schrieb im Newsbeitrag
> > news:120220041122469448%user@un...invalid...
> >>
> >> irb(main):001:0> result = '{ "robert","trey","adrian", "pat" }'
> >> => "{ \"robert\",\"trey\",\"adrian\", \"pat\" }"
> >>
> >> irb(main):002:0> result.scan(/"(.*?)"/).flatten
> >> => ["robert", "trey", "adrian", "pat"]
>
>
> Try
>
>   result = result.scan(/"(.*?)"/).flatten
>
>
> >> irb(main):004:0> result.class
> >> => *String*
Dunno what you did, but scan returns an array:

irb(main):004:0> result = '{ "robert","trey","adrian", "pat" }'
=> "{ \"robert\",\"trey\",\"adrian\", \"pat\" }"
irb(main):005:0> result.scan(/"(.*?)"/).flatten
=> ["robert", "trey", "adrian", "pat"]
irb(main):006:0> result.scan(/"(.*?)"/).flatten.class
=> Array
irb(main):007:0> result = result.scan(/"(.*?)"/).flatten
=> ["robert", "trey", "adrian", "pat"]
irb(main):008:0> result.class
=> Array
irb(main):009:0>

    robert

Michael Campbell <michael_s_campbell@ya...com>

2004-02-12 01:00:28
Simon Strandgaard wrote:
> What you has written is the same as (notice the '!' suffix)
> 
>   result.sub!(/\{/,'[')
>   result.sub!(/\}/,']')
> 
> Above can be chained, so it becomes
> 
>   result.sub!(/\{/,'[').sub!(/\}/,']')
>  
> 
>>Any suggestions are more than welcome.
> 
> 
> Try 'gsub'
> 
>   result.gsub!(/\{/,'[').gsub!(/\}/,']')
Very dangerous.  If one of the ! methods doesn't actually do 
anything, it returns nil, which responds poorly to subsequent ! 
methods.


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

David Naseby <david.naseby@eo...au>

2004-02-12 02:55:26
>-----Original Message-----
>From: "Peña, Botp" [mailto:botp@de...com]
>> and cast result as an array so that I can have some fun within Ruby.
>> 
>
>I think you do not need "[]" replacement since you just _need_ 
>an "array".
>Remember, it just "looks like" ;-)
>
>c:\family\ruby>ruby -w a1.rb
>u is of class Array
>0 'this'
>1 'is a'
>2 'test of wits'
>
>c:\family\ruby>cat a1.rb
>s = "{'this','is a','test of wits'}"	# just a string
>t = s.gsub(/[\{}]/,'')				# no more {}
>u = t.split(',').to_a				# convert to array
>puts "u is of class #{u.class}"
>u.each_index {|i| puts "#{i} #{u[i]}"}
>
>
>I used each_index just in case you'll doubt if it's really an 
>array. note,
>no eval there :-)
Or easier, avoiding eval again:

 u = s.scan( /[\w\s]+/ )

David

=?iso-8859-1?Q?=22Pe=F1a=2C_Botp=22?= <botp@de...com>

2004-02-12 03:22:20
David Naseby [mailto:david.naseby@eo...au] humbly suggested:
> >
> >c:\family\ruby>cat a1.rb
> >s = "{'this','is a','test of wits'}"	# just a string
> >t = s.gsub(/[\{}]/,'')				# no more {}
> >u = t.split(',').to_a				# 
> convert to array
> >puts "u is of class #{u.class}"
> >u.each_index {|i| puts "#{i} #{u[i]}"}
> >
> >
> >I used each_index just in case you'll doubt if it's really an
> >array. note,
> >no eval there :-)
> >
> 
> Or easier, avoiding eval again:
> 
>  u = s.scan( /[\w\s]+/ )
wow. thanks for the tip, david.

fr here:
s = "{'this','is a','test of wits'}"	# just a string
t = s.gsub(/[\{}]/,'')				# no more {}
u = t.split(',').to_a				# 
puts "u is of class #{u.class}"
u.each_index {|i| puts "#{i} #{u[i]}"}

to here:
s = "{'this','is a','test of wits'}"
u = s.scan(/[\w\s]+/)
puts "u is of class #{u.class}"
u.each_index {|i| puts "#{i} #{u[i]}"}

btw, I have a personal dislike for scan. Scan is too generic a name and the
method returns two kinds of output (array or string) depending on how you
use it.

As a result, I have created 2 sibling methods for scan:

scan_toa      #returns array, no block; method errs if block is passed
scan_tostring #returns string, with block; method errs if block isn't passed

> David
kind regards -botp

Kirk Haines <khaines@en...com>

2004-02-12 16:55:12
Replies: avi@be...com
Packed with Avi's old Iowa release is a neat little extra that he called 
Kansas.  It's a nifty little package that wraps database accesses in an 
object interface along with some automatic inspection of table structure 
so that one need not code the exact structure.  One just tells it, 
optionally, what the one to one and one to many relationships are between 
the tables.

It's more or less exactly the sort of thing that I was looking for, as it 
lets me interacts with the database and get my result sets as objects 
without requiring me to mirror database structure exactly in my code.  And 
to think that I ignored it for almost two years!  Shameful.

Anyway, my question is -- is there a more evolved/tested/commented version 
of Kansas out there anywhere?  If not, I am going to, with Avi's 
permission, pull it off from the Iowa code tree into it's own package with 
a few enhancements to it that I have made and make it available for 
seperate download.  It's really a sweet little package.


Kirk Haines

avi@be...com (Avi Bryant)

2004-02-13 02:04:56
Kirk Haines <khaines@en...com> wrote in message news:<Pine.LNX.4.44.0402121144580.12056-100000@en...com>...
> Anyway, my question is -- is there a more evolved/tested/commented version 
> of Kansas out there anywhere?  If not, I am going to, with Avi's 
> permission, pull it off from the Iowa code tree into it's own package with 
> a few enhancements to it that I have made and make it available for 
> seperate download.  It's really a sweet little package.
Feel free to do whatever you like with that code.  It was even more of
a hack than IOWA - literally an evening or two's work, so don't expect
too much from it.  I would be surprised if there weren't better O/R
mapping tools for Ruby out there by now, but I haven't kept up.  Oh,
and make sure you have the version with PragDave's modifications (if
you pulled it from CVS you should have them).

Most recently I've been experimenting with the idea of modelling the
relational algebra directly as (in my case) first class Smalltalk
expressions, so that you can compose and iterate over SQL queries in
an object oriented way instead of through string manipulation - kind
of like Criteria but more rigorous and (I think) more flexible.  It's
pretty nifty.  I've blogged about it a couple of times:
http://www.cincomsmalltalk.com/userblogs/avi/blogView?searchCategory=databases

If I were going to build yet another relational mapping tool I would
start with that.  Luckily all my projects right now use object
databases...

Kirk Haines <khaines@en...com>

2004-02-13 05:58:48
On Fri, 13 Feb 2004, Avi Bryant wrote:

> Feel free to do whatever you like with that code.  It was even more of
> a hack than IOWA - literally an evening or two's work, so don't expect
> too much from it.  I would be surprised if there weren't better O/R
> mapping tools for Ruby out there by now, but I haven't kept up.  Oh,
> and make sure you have the version with PragDave's modifications (if
> you pulled it from CVS you should have them).
Yes, what I have is what you had in the Iowa CVS.  What I like about it is 
it's lightweight simplicity.  There are _definitely_ areas where the 
library needs to be fleshed out a bit for robustness, but my initial 
experiments with it show it working pretty well after some light 
modifications to make it work with preexisting database connections so 
that I could use my db connection pooling.

99% of my database accesses are pretty simplistic interactions.  Given a 
key, pull one or more records from a table, with only occasional joins 
between two tables.  And the only _real_ hassle that I've had using SQL 
and manipulating query results directly is one of convenience.  I don't 
like having to explicitly maintain two seperate representations of table 
data -- one in the database and one in some Struct declaration so that I 
have an object to put query results into.  It's ugly and a pain in the 
butt sometimes.  All I really want from a package is for it to do the work 
of looking at a table and making a usable object representation, and for 
it to give me a simple way of making queries and getting the results back 
in one of those object representations.  If there is a better or more 
mature package for Ruby that does this in a lightweight way, I'd love to 
know about it.  If not, though, I'll clean up and strengthen Kansas a bit 
and be happy with it.  It's basically all that I want.

> Most recently I've been experimenting with the idea of modelling the
> relational algebra directly as (in my case) first class Smalltalk
> expressions, so that you can compose and iterate over SQL queries in
> an object oriented way instead of through string manipulation - kind
> of like Criteria but more rigorous and (I think) more flexible.  It's
> pretty nifty.  I've blogged about it a couple of times:
> http://www.cincomsmalltalk.com/userblogs/avi/blogView?searchCategory=databases
That's really interesting.  I'll have to read it again in the morning, 
though, and see if my brain can parse the Smalltalk examples better.


Thanks,

Kirk Haines

Ara.T.Howard <ahoward@fa...gov>

2004-02-13 16:24:58
On Fri, 13 Feb 2004, Robert Klemme wrote:

> Date: Fri, 13 Feb 2004 17:04:33 +0100
> From: Robert Klemme <bob.news@gm...net>
> Newsgroups: comp.lang.ruby
> Subject: Re: return from yielded block
> 
> 
> "Ara.T.Howard" <ahoward@fa...gov> schrieb im Newsbeitrag
> news:Pine.LNX.4.44.0402130622000.31453-100000@fa...gov...
> > On Fri, 13 Feb 2004 nobu.nokada@so...net wrote:
> >
> > > Date: Fri, 13 Feb 2004 15:08:34 +0900
> > > From: nobu.nokada@so...net
> > > Newsgroups: comp.lang.ruby
> > > Subject: Re: return from yielded block
> > >
> > > Hi,
> > >
> > > At Fri, 13 Feb 2004 14:54:56 +0900,
> > > Ara.T.Howard wrote in [ruby-talk:92771]:
> > > > the problem is that you can't 'return' from a block - so how is this
> done?
> > >
> > > Return to where?  The next statement of yield?
> > > If so, you may want "next".
> >
> > return a value.  i was not clear enough, let me try again:
> >
> > def meth s
> >   x =
> >     block_meth do
> >       if s =~ /forty/
> >         return 40
> >       else
> >         return 0
> >       end
> >     end
> >   x + 2
> > end
> >
> > def block_meth; yield; end
> >
> > p(meth('forty')) # this prints 40 - i want it to print 42
> 
> Simply delete the "return"'s:
> 
> irb(main):001:0> def meth s
> irb(main):002:1>   x =
> irb(main):003:1*     block_meth do
> irb(main):004:2*       if s =~ /forty/
> irb(main):005:3>         40
> irb(main):006:3>       else
> irb(main):007:3*         0
> irb(main):008:3>       end
> irb(main):009:2>     end
> irb(main):010:1>   x + 2
> irb(main):011:1> end
> => nil
> irb(main):012:0>
> irb(main):013:0* def block_meth; yield; end
> => nil
> irb(main):014:0>
> irb(main):015:0* p(meth('forty')) # this prints 40 - i want it to print 42
> 42
> => nil
> irb(main):016:0>
> 
> I guess you are aware of the fact that this kind of construction is a bit,
> err, complicated and your real world code does a lot more in between...  :-)
yes.  and yes - about 1700 lines to be exact ;-)

nobu's reply was the answer - your response works here but i also had a bunch
of stuff after the if/else/end : it was not the default return value.  for
some reason i just didn't explain myself well enough - sorry.  the bottom line
is that i needed a way to prematurely 'return' a value from a yielded block
under $DEBUG/$NOOP conditions for testing...

cheers.

-a
-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================

aastanti@ho...com (Alfio Astanti)

2004-02-13 17:15:02
"Robert Klemme" <bob.news@gm...net> wrote in message news:<c0i3fc$16pa88$1@ID...de>...
> > Is there a "role pattern" definition somewhere? Is it a design
> > pattern? Or an analysis pattern? Or ...
> 
> See http://c2.com/cgi/wiki?RoleAndPlayer - always a good place to look for
> patterns.
Thanks a lot!! I have searched c2 indeed, but for some obscure reasons
I skip that specific page ... :-)

AA

David A. Black <dblack@wo...net>

2004-02-16 11:18:14
Hi --

On Mon, 16 Feb 2004, Robert Klemme wrote:

> This explains my impression that message traffic has dropped since two or
> three weeks. (I'm reading news only.)
Yeah, according to Google I've posted 4 msgs in the past month.  In
fact it's more like 15-20.  


David

-- 
David A. Black
dblack@wo...net

intc_ctor@ya...com (Phil Tomson)

2004-02-16 22:39:54
Replies: David A. Black
"Robert Klemme" <bob.news@gm...net> wrote in message news:<c0q8nb$19imk0$1@ID...de>...
> "Daniel Berger" <djberg96@ho...com> schrieb im Newsbeitrag
> news:6e613a32.0402140823.6e549b24@po...com...
> > matz@ru...org (Yukihiro Matsumoto) wrote in message
>  news:<1076736977.263683.27564.nullmailer@pi...jp>...
> > > Hi,
> > >
> > > In message "OT: Traits"
> > >     on 04/02/14, Daniel Berger <djberg96@ho...com> writes:
> > >
> > > |Since I haven't seen a full discussion on the topic, I thought I
>  would
> > > |see what Ruby programmers think of "traits" as an OO concept.  Cool
> > > |idea?  Or a solution in need of a problem?
> > >
> > > "module" in Ruby and "trait" are very similar idea.
> > >
> > > matz.
> >
> > Yes, I thought so, too.  Their argument against mixins boiled down to
> > "What if you have identical methods in two different modules that you
> > wish to 'include'?".  But, so far that just hasn't happened in my
> > personal experience.
> 
> The problem that I see is with using Modules is when traits have to be
> exchanged during the life time of an instance.  At least I didn't manage
> to include a Module and de-include if afterwards.   
It has been brought up a few times here in the past: 
Sometimes you want an object's role to change so it would be nice if
there were some sort of uninclude <module> or unextend <module>
methods.

In the meantime, it probably wouldn't be too hard to 'roll your own'
uninclude.  Just get the list of instance methods from the module and
undef_method <methname> in the class.  Something like:

 class Module
   def uninclude(mod)
     mod.instance_methods.each {|meth|
       undef_method meth
     }
   end
 end

....I'm still figuring out how to do unextend (which is arguably more
useful than uninclude).

Phil

David A. Black <dblack@wo...net>

2004-02-16 22:54:30
Hi --

On Tue, 17 Feb 2004, Phil Tomson wrote:

> It has been brought up a few times here in the past: 
> Sometimes you want an object's role to change so it would be nice if
> there were some sort of uninclude <module> or unextend <module>
> methods.
> 
> In the meantime, it probably wouldn't be too hard to 'roll your own'
> uninclude.  Just get the list of instance methods from the module and
> undef_method <methname> in the class.  Something like:
> 
>  class Module
>    def uninclude(mod)
>      mod.instance_methods.each {|meth|
>        undef_method meth
>      }
>    end
>  end
> 
> ....I'm still figuring out how to do unextend (which is arguably more
> useful than uninclude).
Maybe something like:

  class Object
    def unextend(mod)
      (class << self; self; end) .class_eval <<-EOE
	mod.instance_methods.each {|meth| undef_method(meth) }
      EOE
    end
  end


David

-- 
David A. Black
dblack@wo...net

Mark Hubbart <discord@ma...com>

2004-02-17 19:48:24
Replies: Robert Klemme
On Feb 17, 2004, at 6:14 AM, Robert Klemme wrote:

> Why don't you just do
>
> $cvsroot_in, $cvsuser, $modulepath_in, *$cvsfiles = *ARGV
>
> $cvsroot.tr_s('/', '/')
> $modulepath.tr_s('/', '/')
You probably meant:
$cvsroot = $cvsroot_in.tr_s('/', '/')
$modulepath = $modulepath_in.tr_s('/', '/')

but how about:
$cvsroot, $cvsuser, $modulepath, *$cvsfiles = *ARGV.map{|a|a.dup}

this unfreezes everything automagically.

Cheers,
Mark

Robert Klemme <bob.news@gm...net>

2004-02-18 08:14:59
"Mark Hubbart" <discord@ma...com> schrieb im Newsbeitrag
news:3AA77270-6182-11D8-B680-000502FDD5CC@ma...com...
> On Feb 17, 2004, at 6:14 AM, Robert Klemme wrote:
>
> > Why don't you just do
> >
> > $cvsroot_in, $cvsuser, $modulepath_in, *$cvsfiles = *ARGV
> >
> > $cvsroot.tr_s('/', '/')
> > $modulepath.tr_s('/', '/')
>
> You probably meant:
> $cvsroot = $cvsroot_in.tr_s('/', '/')
> $modulepath = $modulepath_in.tr_s('/', '/')
Yes. Thanks for correcting that.

> but how about:
> $cvsroot, $cvsuser, $modulepath, *$cvsfiles = *ARGV.map{|a|a.dup}
>
> this unfreezes everything automagically.
As always there are tons of ways to do things with Ruby.  Which is good.
:-)

Regards

    robert

Simon Strandgaard <neoneye@ad...dk>

2004-02-18 12:59:53
On Wed, 18 Feb 2004 13:39:50 +0100, Robert Klemme wrote:
> "Szymon Drejewicz" <drejewic@ws...pl> schrieb im Newsbeitrag
> news:c0vhrk$if$1@po...pl...
>> How to raise warning?
> 
> Do you mean:
> 
> How to raise an exception?  ("raise Exception, msg")
> 
> How to print out a warning? ("$stderr.puts "This is a warning")
There is also #warn

server> irb
irb(main):001:0> warn("hello")
hello
=> nil
irb(main):002:0>


--
Simon Strandgaard

Szymon Drejewicz <drejewic@ws...pl>

2004-02-18 15:39:52
I need something like 'weak exception' raising. "warn 'message' " works like
"puts 'message'", but I'd like to have line number like I have when I raise
exception.

-- 
Szymon Drejewicz

Robert Klemme <bob.news@gm...net>

2004-02-18 16:29:53
"Szymon Drejewicz" <drejewic@ws...pl> schrieb im Newsbeitrag
news:c100nt$p0s$1@po...pl...
> I need something like 'weak exception' raising. "warn 'message' " works
like
> "puts 'message'", but I'd like to have line number like I have when I
raise
> exception.
warn "#{__FILE__}:#{__LINE__}: there is an error"

    robert

Andrew Johnson <ajohnson@cp...org>

2004-02-18 17:15:04
On Wed, 18 Feb 2004 16:35:29 +0100, Szymon Drejewicz <drejewic@ws...pl> 
wrote:

> I need something like 'weak exception' raising. "warn 'message' " works like
> "puts 'message'", but I'd like to have line number like I have when I raise
> exception.
The Kernel#caller method gives you the trace information. So you
can redefine Kernel#warn along these lines:

  module Kernel
    alias :oldwarn :warn
    def warn(msg="", fulltrace=nil)
      trace = caller(1)
      where = trace[0].sub(/:in.*/,'')
      $stderr.puts "#{where}: Warning: #{msg}"
      $stderr.puts trace.map {|t| "\tfrom #{t}"} if fulltrace
    end
  end


regards,
andrew

Josef 'Jupp' SCHUGT <jupp@gm...de>

2004-02-19 20:56:44
Hi!

* Robert Klemme:
> warn "#{__FILE__}:#{__LINE__}: there is an error"
If it is an error it raises an exception. A warning is used when
there is doubt wether something is wanted:

warn "#{__FILE__}:#{__LINE__}: no config file, using defaults"

As a rule of thumb a warning can be replaced by an 'Are you sure?' 
dialog.

Josef 'Jupp' SCHUGT
-- 
http://oss.erdfunkstelle.de/ruby/    -     German comp.lang.ruby FAQ
http://rubyforge.org/users/jupp/     -     Ruby projects at Rubyforge

matz@ru...org (Yukihiro Matsumoto)

2004-02-20 05:17:00
Replies: Gavin Sinclair
Hi,

In message "Re: how to raise warning?"
    on 04/02/19, "Robert Klemme" <bob.news@gm...net> writes:

|warn "#{__FILE__}:#{__LINE__}: there is an error"

Do you guys expect "warn" to prepend the place information before the
message?

							matz.

Gavin Sinclair <gsinclair@so...au>

2004-02-20 06:52:33
> Hi,
>
> In message "Re: how to raise warning?"
>     on 04/02/19, "Robert Klemme" <bob.news@gm...net> writes:
>
> |warn "#{__FILE__}:#{__LINE__}: there is an error"
>
> Do you guys expect "warn" to prepend the place information before the
> message?
>
> 							matz.
I don't.  A warning is often a user-level piece of information that does
not warrant file and line information.

Having a variant of 'warn' that displays that information would be nice IMO.

  warn "You didn't provide such and such", true

Not perfect, but not bad.

Gavin
Gavin Sinclair wrote:
>>Hi,
>>
>>In message "Re: how to raise warning?"
>>    on 04/02/19, "Robert Klemme" <bob.news@gm...net> writes:
>>
>>|warn "#{__FILE__}:#{__LINE__}: there is an error"
>>
>>Do you guys expect "warn" to prepend the place information before the
>>message?
>>
>>							matz.
> 
> 
> 
> I don't.  A warning is often a user-level piece of information that does
> not warrant file and line information.
> 
> Having a variant of 'warn' that displays that information would be nice IMO.
> 
>   warn "You didn't provide such and such", true
Mmm. I would expect that just to print 'true' after the warning.

The problem as I see it is that we use warnings in two ways:
1. As Ruby does, to complain about something happening at a specific
    place in the source -- a highly source-related message. In that
    case, I'd want to see file/line info (as Ruby does when it says I
    need to add parens or something).
2. To complain about some general condition occurring at runtime that
    doesn't warrant bailing out of the app.

My suggestion: Two names. Call the first one "warning" (the kind of
warning that Ruby gives us) and the second one "warn" (a simple verb
that just prints to stderr).

Hal

Joel VanderWerf <vjoel@PA...EDU>

2004-02-20 08:22:48
Hal Fulton wrote:
...
> The problem as I see it is that we use warnings in two ways:
> 1. As Ruby does, to complain about something happening at a specific
>    place in the source -- a highly source-related message. In that
>    case, I'd want to see file/line info (as Ruby does when it says I
>    need to add parens or something).
> 2. To complain about some general condition occurring at runtime that
>    doesn't warrant bailing out of the app.
> 
> My suggestion: Two names. Call the first one "warning" (the kind of
> warning that Ruby gives us) and the second one "warn" (a simple verb
> that just prints to stderr).
If we were talking about exceptions, the distinction between 1 and 2 
would be the distinction between ScriptError and StandardError. Maybe 
there should be Warning classes, analogous with Exception classes? This 
would give us the flexibility of saying which Warning classes we want to 
be reported ("ruby --ignore-warning=ScriptWarning").

Robert Klemme <bob.news@gm...net>

2004-02-20 11:53:21
"Hal Fulton" <hal9000@hy...com> schrieb im Newsbeitrag
news:4035B01E.6040509@hy...com...
> Gavin Sinclair wrote:
> >>Hi,
> >>
> >>In message "Re: how to raise warning?"
> >>    on 04/02/19, "Robert Klemme" <bob.news@gm...net> writes:
> >>
> >>|warn "#{__FILE__}:#{__LINE__}: there is an error"
> >>
> >>Do you guys expect "warn" to prepend the place information before the
> >>message?
> >>
> >> matz.
> >
> >
> >
> > I don't.  A warning is often a user-level piece of information that
does
> > not warrant file and line information.
> >
> > Having a variant of 'warn' that displays that information would be
nice IMO.
> >
> >   warn "You didn't provide such and such", true
>
> Mmm. I would expect that just to print 'true' after the warning.
>
> The problem as I see it is that we use warnings in two ways:
> 1. As Ruby does, to complain about something happening at a specific
>     place in the source -- a highly source-related message. In that
>     case, I'd want to see file/line info (as Ruby does when it says I
>     need to add parens or something).
> 2. To complain about some general condition occurring at runtime that
>     doesn't warrant bailing out of the app.
Good analysis!

> My suggestion: Two names. Call the first one "warning" (the kind of
> warning that Ruby gives us) and the second one "warn" (a simple verb
> that just prints to stderr).
I like the suggestion, but I'm not fully satisfied with the naming.  They
are too similar and thus too easy to confuse.  Trying to think of
something better...  What about leaving "warn" as it is (i.e. no info on
location) and one of "report" or "source_warn" for a message with file and
line info?  This way, no existing code would be broken and we had a clear
naming distinction.

Regards

    robert
Hi,

At Fri, 20 Feb 2004 20:53:21 +0900,
Robert Klemme wrote in [ruby-talk:93233]:
> > My suggestion: Two names. Call the first one "warning" (the kind of
> > warning that Ruby gives us) and the second one "warn" (a simple verb
> > that just prints to stderr).
> 
> I like the suggestion, but I'm not fully satisfied with the naming.  They
> are too similar and thus too easy to confuse.  Trying to think of
> something better...  What about leaving "warn" as it is (i.e. no info on
> location) and one of "report" or "source_warn" for a message with file and
> line info?  This way, no existing code would be broken and we had a clear
> naming distinction.
Doesn't perl use carp or croak for it?

-- 
Nobu Nakada

Tim Hunter <Tim.Hunter@sa...com>

2004-02-20 14:09:52
On Fri, 20 Feb 2004 15:58:48 +0900, Hal Fulton
<hal9000@hy...com> wrote:

>
>My suggestion: Two names. Call the first one "warning" (the kind of
>warning that Ruby gives us) and the second one "warn" (a simple verb
>that just prints to stderr).
My faithful online thesaurus suggests "alert" or "caution" as good,
distinctive synonyms for "warn".
>> I don't.  A warning is often a user-level piece of information that does
>> not warrant file and line information.
>>
>> Having a variant of 'warn' that displays that information would be nice
>> IMO.
>>
>>   warn "You didn't provide such and such", true
>
> Mmm. I would expect that just to print 'true' after the warning.
>
> The problem as I see it is that we use warnings in two ways:
> 1. As Ruby does, to complain about something happening at a specific
>     place in the source -- a highly source-related message. In that
>     case, I'd want to see file/line info (as Ruby does when it says I
>     need to add parens or something).
> 2. To complain about some general condition occurring at runtime that
>     doesn't warrant bailing out of the app.
>
> My suggestion: Two names. Call the first one "warning" (the kind of
> warning that Ruby gives us) and the second one "warn" (a simple verb
> that just prints to stderr).
Well, I use 'fyi' for the second (acronym common in the United States
standing for "For Your Information").  Since the application name tends to
be more interesting than the file and line information for the end-user, I
have the application name in the output.

---
def fyi( *message )
    puts( "#{}: FYI: " + message.join('\n\t') )
end
fyi "Hi Mom!" "Love you much!"

-->
whatYouInvoked: FYI: Hi Mom!
        Love you much!
---

If I really do want the file/line info, I add that into an exception,
throw it, and catch it for display (or logging) elsewhere.

        Joseph Beckenbach
        lead XP tester, Eidogen Inc.
Whoops, missing an important part there, sorry ....


> ---
  #!/usr/bin/ruby
  ME = File.basename( $0 )
> def fyi( *message )
      puts( "#{ME}: FYI: " + message.join('\n\t') )
> end
> fyi "Hi Mom!" "Love you much!"
>
> -->
> whatYouInvoked: FYI: Hi Mom!
>         Love you much!
> ---
        Joseph Beckenbach
        lead XP tester, Eidogen Inc.

Josef 'Jupp' SCHUGT <jupp@gm...de>

2004-02-21 12:04:28
Hi!

* jrb3@ei...com:
> Well, I use 'fyi' for the second (acronym common in the United
> States standing for "For Your Information").
Actually the above did result in this reaction:

What the hell means 'fyi' and why is that an Acron...
Oh I see: 'FYI'

One is used to read acronyms in all uppercase.

>         lead XP tester, Eidogen Inc.
               ^^^^^^^^^

A somewhat off-topic and perhaps stupic question:

I am a bit confused about the term 'XP tester'. If 'XP' stands for
'eXtreme Programming' the word 'XP tester' rather raises the picture
of a computer that permanently runs test cases. Does the term mean
that you supervise the creation of test cases?

Josef 'Jupp' SCHUGT
-- 
http://oss.erdfunkstelle.de/ruby/    -     German comp.lang.ruby FAQ
http://rubyforge.org/users/jupp/     -     Ruby projects at Rubyforge

This message appeared in a previous month, was never archived, or was lost.

Guten tag, Josef Schugt (und freunde)!

(Goodness, has it been that long since my high-school German classes? :-)

> One is used to read acronyms in all uppercase.
    True, but one must also fit into Ruby idiom.  I expect an object's
methods to start lowercase, and all-uppercase symbols to represent
some sort of constant.  'def FYI( *message ) ... ; FYI "yada yada"'
just grates.

    Overall, the "warn!" idea seems better for including file/line
information.  I might go back to some form where some kind of level is
one of the arguments (eg, ::WARN, ::ERROR, ::FATAL, ::DEBUG, ...), but
I've forgotten or misused (or abused :-) this often enough, that I
prefer to have the method name cite the level of severity.  I use so
few as it is ....


>>         lead XP tester, Eidogen Inc.
>                ^^^^^^^^^
>
> A somewhat off-topic and perhaps stupic question:
>
> I am a bit confused about the term 'XP tester'. If 'XP' stands for
> 'eXtreme Programming' the word 'XP tester' rather raises the picture
> of a computer that permanently runs test cases. Does the term mean
> that you supervise the creation of test cases?
    Yes.  In Extreme Programming parlance, I'm part of the 'Customer
team'.  I help automate as much of the Customer ("acceptance") tests
as we can.  We do have a machine dedicated to continually building our
product, which runs all the unit-tests and a few acceptance tests on
each source-code check-in.  Two other machines run a large
acceptance-test suite daily (combined run time around 19 hours).  The
team's large enough that it takes a full-time person for this: 
actually, it's six developers and two testers so far, and it really
should become closer to 5:3 or 4:4 soon ....

    Because I started my career as a releaser, buildmaster, and toolsmith,
I tend to oversee the build machine too.  Some days it feels like I'm
not doing much of anything:  nothing regressed during the past 24
hours, nothing broke down and needs fixing, and the team just keeps
ticking along steadily adding functionality.  That's the norm around
here.  I will *not* trade that for any other software job I've worked
at -- we're racheting forward, and everyone has confidence that
they're receiving solid software with the most valuable pieces in
place and usable.  Besides, we get home on time, with enough left of
the day for our families, and get in each morning ready to give the
team another good day of work.

        Joseph Beckenbach
        lead XP tester, Eidogen Inc.

Simon Strandgaard <neoneye@ad...dk>

2004-02-20 11:20:25
On Thu, 19 Feb 2004 15:43:05 +0100, Robert Klemme wrote:
> "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
>>
>> def push(choice)
>>   if choice.kind_of?(Zero) == false and choice.kind_of?(One) == false
> 
> Never compare boolean values to get boolean values.  This can lead to
> hideous bugs if the method at hand does not return "true" or "false" -
> especially with languages that have more than one value for either.
Thanks for the warning.  I have actually had a few problems with it
earlier, without realizing this.


>> def push(choice)
>>   unless choice.kind_of?(Zero, One)
>>     raise "got #{choice.class}"
> 
> ArgumentError is a good choice here. :-)
I don't have full overview over Ruby's exception hierarchy, but yes
I should use this one here (which I do now).  ;-)

>>   end
>>   @choices << choice
>> end
> 
> Why don't you just do
> 
> def push(choice)
>   case choice
>     when Zero, One
>       @choices << choice
>     else
>       raise ArgumentError, "got #{choice.class}"
>   end
> end
a switch statement.. easier to read. 
However I like to do bailout as soon as possible, 
raising ArgumentError this late may make confusion.



> or
> 
> def push(choice)
>   raise ArgumentError, "got #{choice.class}" unless [Zero,
> One].map{|cl|choice.kind_of? cl}.any?
>   @choices << choice
> end
Confusion :-)




> def Object#kind_of_any?( *classes )
Yes thought of this.. which maked me propose this idea.

--
Simon Strandgaard

Robert Klemme <bob.news@gm...net>

2004-02-20 11:20:29
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.19.14.51.57.777201@ad...dk...
> On Thu, 19 Feb 2004 15:43:05 +0100, Robert Klemme wrote:
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> >>
> >> def push(choice)
> >>   if choice.kind_of?(Zero) == false and choice.kind_of?(One) == false
> >
> > Never compare boolean values to get boolean values.  This can lead to
> > hideous bugs if the method at hand does not return "true" or "false" -
> > especially with languages that have more than one value for either.
>
> Thanks for the warning.  I have actually had a few problems with it
> earlier, without realizing this.
:-))

I forgot to mention, that it's totally superfluous, too, and thus may cost
you some machine cycles... :-))

> >> def push(choice)
> >>   unless choice.kind_of?(Zero, One)
> >>     raise "got #{choice.class}"
> >
> > ArgumentError is a good choice here. :-)
>
> I don't have full overview over Ruby's exception hierarchy, but yes
> I should use this one here (which I do now).  ;-)
:-))

> >>   end
> >>   @choices << choice
> >> end
> >
> > Why don't you just do
> >
> > def push(choice)
> >   case choice
> >     when Zero, One
> >       @choices << choice
> >     else
> >       raise ArgumentError, "got #{choice.class}"
> >   end
> > end
>
> a switch statement.. easier to read.
> However I like to do bailout as soon as possible,
> raising ArgumentError this late may make confusion.
What do you mean by "late"?  Do you mean that the line with "raise" stands
below the actual operation.  Didn't think of that, but yes, it might be
confusing.  OTOH, if you can read "case" then it's not so difficult, is
it?

> > or
> >
> > def push(choice)
> >   raise ArgumentError, "got #{choice.class}" unless [Zero,
> > One].map{|cl|choice.kind_of? cl}.any?
> >   @choices << choice
> > end
>
> Confusion :-)
http://lyricsheaven.topcities.com/survey_d_k_bestanden/ELO.htm#confusion

> > def Object#kind_of_any?( *classes )
>
> Yes thought of this.. which maked me propose this idea.
I'm wondering though whether it's worth the effort.  When using duck
typing, you don't need kind_of? anyway.

Btw, I had another idea:

PUSH_ALLOWED = {Zero, One}

def push(choice)
  raise ArgumentError, "got #{choice.class}" unless
PUSH_ALLOWED[choice.class]
  @choices << choice
end

Of course there is a subtle difference since this does not take sub
classes into consideration.  But other than that, it should be faster -
especially if you have more classes that shoule be checked.

:-)

Kind regards

    robert

Simon Strandgaard <neoneye@ad...dk>

2004-02-20 11:20:37
On Thu, 19 Feb 2004 16:14:13 +0100, Robert Klemme wrote:
> "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
>> On Thu, 19 Feb 2004 15:43:05 +0100, Robert Klemme wrote:
>> >
>> > Why don't you just do
>> >
>> > def push(choice)
>> >   case choice
>> >     when Zero, One
>> >       @choices << choice
>> >     else
>> >       raise ArgumentError, "got #{choice.class}"
>> >   end
>> > end
>>
>> a switch statement.. easier to read.
>> However I like to do bailout as soon as possible,
>> raising ArgumentError this late may make confusion.
> 
> What do you mean by "late"?  Do you mean that the line with "raise" stands
> below the actual operation.  Didn't think of that, but yes, it might be
> confusing.  OTOH, if you can read "case" then it's not so difficult, is
> it?
It isn't clear at first sight when the method bailouts, and if
the switch statement spans over many lines, then its not visible at all
that its capable of raising exceptions.

Kind_of? similar to bouncer pattern, see
http://www.rubygarden.org/ruby?BouncerPattern


>>
>> Confusion :-)
> 
> http://lyricsheaven.topcities.com/survey_d_k_bestanden/ELO.htm#confusion
:-)


>> > def Object#kind_of_any?( *classes )
>>
>> Yes thought of this.. which maked me propose this idea.
> 
> I'm wondering though whether it's worth the effort.  When using duck
> typing, you don't need kind_of? anyway.
> 
> Btw, I had another idea:
> 
> PUSH_ALLOWED = {Zero, One}
> 
> def push(choice)
>   raise ArgumentError, "got #{choice.class}" unless
> PUSH_ALLOWED[choice.class]
>   @choices << choice
> end
Good idea, but gives a complex impression at first sight.


> Of course there is a subtle difference since this does not take sub
> classes into consideration.  But other than that, it should be faster -
> especially if you have more classes that shoule be checked.
Im in the make it work phase.

There is 3 phases: 
1)  make it work
2)  make it right
3)  make it fast   ;-)

--
Simon Strandgaard

Robert Klemme <bob.news@gm...net>

2004-02-20 11:21:10
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.19.15.25.31.227855@ad...dk...
> On Thu, 19 Feb 2004 16:14:13 +0100, Robert Klemme wrote:
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> >> On Thu, 19 Feb 2004 15:43:05 +0100, Robert Klemme wrote:
> >> >
> >> > Why don't you just do
> >> >
> >> > def push(choice)
> >> >   case choice
> >> >     when Zero, One
> >> >       @choices << choice
> >> >     else
> >> >       raise ArgumentError, "got #{choice.class}"
> >> >   end
> >> > end
> >>
> >> a switch statement.. easier to read.
> >> However I like to do bailout as soon as possible,
> >> raising ArgumentError this late may make confusion.
> >
> > What do you mean by "late"?  Do you mean that the line with "raise"
stands
> > below the actual operation.  Didn't think of that, but yes, it might
be
> > confusing.  OTOH, if you can read "case" then it's not so difficult,
is
> > it?
>
> It isn't clear at first sight when the method bailouts, and if
> the switch statement spans over many lines, then its not visible at all
> that its capable of raising exceptions.
>
> Kind_of? similar to bouncer pattern, see
> http://www.rubygarden.org/ruby?BouncerPattern
I see, you want to save the extra method check_arg_xyz().  :-)

> >>
> >> Confusion :-)
> >
> >
http://lyricsheaven.topcities.com/survey_d_k_bestanden/ELO.htm#confusion
> :-)
>
>
> >> > def Object#kind_of_any?( *classes )
> >>
> >> Yes thought of this.. which maked me propose this idea.
> >
> > I'm wondering though whether it's worth the effort.  When using duck
> > typing, you don't need kind_of? anyway.
> >
> > Btw, I had another idea:
> >
> > PUSH_ALLOWED = {Zero, One}
> >
> > def push(choice)
> >   raise ArgumentError, "got #{choice.class}" unless
> > PUSH_ALLOWED[choice.class]
> >   @choices << choice
> > end
>
> Good idea, but gives a complex impression at first sight.
Really?  PUSH_ALLOWED[choice.class] looks pretty much like a method call
to me...  And it's blindingly fast even for large amounts of classes.
Well, I guess it's a matter of taste then...

You could also use a Set for this like in

require 'Set'
PUSH_ALLOWED = Set.new([Zero, One])

def push(choice)
  raise ArgumentError, "got #{choice.class}" unless
    PUSH_ALLOWED.include? choice.class

  @choices << choice
end

Did I say there are tons of ways in Ruby?  :-))

> > Of course there is a subtle difference since this does not take sub
> > classes into consideration.  But other than that, it should be
faster -
> > especially if you have more classes that shoule be checked.
>
> Im in the make it work phase.
>
> There is 3 phases:
> 1)  make it work
> 2)  make it right
> 3)  make it fast   ;-)
:-)))

Have fun!

    robert

Simon Strandgaard <neoneye@ad...dk>

2004-02-20 12:19:58
On Thu, 19 Feb 2004 18:21:47 +0100, Robert Klemme wrote:
> "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
>> On Thu, 19 Feb 2004 16:14:13 +0100, Robert Klemme wrote:
>> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
>> >> On Thu, 19 Feb 2004 15:43:05 +0100, Robert Klemme wrote:
>> >> >
>> >> > Why don't you just do
>> >> >
>> >> > def push(choice)
>> >> >   case choice
>> >> >     when Zero, One
>> >> >       @choices << choice
>> >> >     else
>> >> >       raise ArgumentError, "got #{choice.class}"
>> >> >   end
>> >> > end
>> >>
>> >> a switch statement.. easier to read.
>> >> However I like to do bailout as soon as possible,
>> >> raising ArgumentError this late may make confusion.
>> >
>> > What do you mean by "late"?  Do you mean that the line with "raise"
>> > stands below the actual operation.  Didn't think of that, but yes, 
>> > it might be confusing.  OTOH, if you can read "case" then it's not 
>> > so difficult, is it?
>>
>> It isn't clear at first sight when the method bailouts, and if
>> the switch statement spans over many lines, then its not visible at all
>> that its capable of raising exceptions.
>>
>> Kind_of? similar to bouncer pattern, see
>> http://www.rubygarden.org/ruby?BouncerPattern
> 
> I see, you want to save the extra method check_arg_xyz().  :-)
Yes, it depends on if its understandable at first sight and isn't 
too visually disturbing. The concept of minimizing visual noise.

If it isn't clear what is going on, then turn that piece of code into a
check_something method.

If the 'if-statement' is simple, then I typically don't make a
check_something method out of that.

--
Simon Strandgaard

Ara.T.Howard <ahoward@fa...gov>

2004-02-20 11:20:32
On Thu, 19 Feb 2004, Robert Klemme wrote:

> Date: Thu, 19 Feb 2004 15:43:05 +0100
> From: Robert Klemme <bob.news@gm...net>
> Newsgroups: comp.lang.ruby
> Subject: Re: proposal: let kind_of take more arguments
> 
> 
> "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> news:pan.2004.02.19.14.25.27.611885@ad...dk...
> > It just hit me.. why not let kind_of? take more arguments?
> >
> > irb(main):001:0> x = 3
> > => 3
> > irb(main):002:0> x.kind_of?(String)
> > => false
> > irb(main):003:0> x.kind_of?(String, Fixnum)
> > ArgumentError: wrong number of arguments(2 for 1)
> >         from (irb):3:in `kind_of?'
> >         from (irb):3
> > irb(main):004:0>
> >
> >
> >
> > For instance I have
> >
> > def push(choice)
> >   if choice.kind_of?(Zero) == false and choice.kind_of?(One) == false
> 
> Never compare boolean values to get boolean values.  This can lead to
> hideous bugs if the method at hand does not return "true" or "false" -
> especially with languages that have more than one value for either.
what do you reccomend (when a case won't do) ?

....
  unless choice.kind_of?(Zero) or choice.kind_of?(One)
....

-a
-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================

Simon Strandgaard <neoneye@ad...dk>

2004-02-20 11:20:45
On Thu, 19 Feb 2004 08:19:33 -0700, Ara.T.Howard wrote:
> 
> what do you reccomend (when a case won't do) ?
> 
> ...
>   unless choice.kind_of?(Zero) or choice.kind_of?(One)
> ...
My brain is terrible at dealing with 'unless'.
If its just "unless something" then its ok.
But when its "unless a or b and c" then it chokes.

Am I the only one feeling like this?

Where can I seek help ?  ;-)

--
Simon Strandgaard

Ara.T.Howard <ahoward@fa...gov>

2004-02-20 11:20:51
On Thu, 19 Feb 2004, Simon Strandgaard wrote:

> Date: Thu, 19 Feb 2004 16:29:42 +0100
> From: Simon Strandgaard <neoneye@ad...dk>
> Newsgroups: comp.lang.ruby
> Subject: Re: proposal: let kind_of take more arguments
> 
> On Thu, 19 Feb 2004 08:19:33 -0700, Ara.T.Howard wrote:
> > 
> > what do you reccomend (when a case won't do) ?
> > 
> > ...
> >   unless choice.kind_of?(Zero) or choice.kind_of?(One)
> > ...
> > 
> 
> My brain is terrible at dealing with 'unless'.
> If its just "unless something" then its ok.
> But when its "unless a or b and c" then it chokes.
> 
> Am I the only one feeling like this?
> 
> Where can I seek help ?  ;-)
a digital logic book, the simplest, will help.  de morgan's laws..., eg.

noting that 'unless' is the negation of 'if', in otherwords 'unless' => 'if
not'

  let

    ^ => and

    v => or

    ~ => negation 

    Z => kind_of? Zero

    O => kind_of? One 

  then we can say your original statement

    choice.kind_of?(Zero) == false and choice.kind_of?(One) == false

  as simply

    ~Z ^ ~O

  if we want use this conjunction in the negative sense (convert to 'unless')
  we can convert using the following heuristic 'negate each clause and flip
  the operation'

  so

    ~(~Z ^ ~O) => Z v 0

  or

    choice.kind_of?(Zero) or choice.kind_of?(One)


  now we have the _negation_ of the conjuction.  this is want we want though
  since were are trying to use it in the negative sense (unless).  eg. we're
  done:

    unless choice.kind_of?(Zero) or choice.kind_of?(One)
      ...
    end


if you express in simple terms it's pretty easy. eg.

HTH.

-a
-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================

Simon Strandgaard <neoneye@ad...dk>

2004-02-20 11:21:15
On Thu, 19 Feb 2004 09:30:16 -0700, Ara.T.Howard wrote:
> On Thu, 19 Feb 2004, Simon Strandgaard wrote:
>> From: Simon Strandgaard <neoneye@ad...dk>
>> On Thu, 19 Feb 2004 08:19:33 -0700, Ara.T.Howard wrote:
>> > 
>> > what do you reccomend (when a case won't do) ?
>> > 
>> > ...
>> >   unless choice.kind_of?(Zero) or choice.kind_of?(One)
>> > ...
>> > 
>> 
>> My brain is terrible at dealing with 'unless'.
>> If its just "unless something" then its ok.
>> But when its "unless a or b and c" then it chokes.
>> 
>> Am I the only one feeling like this?
>> 
>> Where can I seek help ?  ;-)
> 
> a digital logic book, the simplest, will help.  de morgan's laws..., eg.
[snip talk about de morgans law]

Yes I know these rules.. also karnough maps helps gaining overview of
boolean operations. When an expression gets too complex then I like 
place a comment with the corresponding karnough map. 

What I should have said was that I grew up with 'if then else'.
The 'unless' keyword is a recent addition to my vocabulary, I am still 
a bit rusty in its usage.

--
Simon Strandgaard

Ara.T.Howard <ahoward@fa...gov>

2004-02-20 11:21:17
On Thu, 19 Feb 2004, Simon Strandgaard wrote:

> Date: Thu, 19 Feb 2004 18:44:23 +0100
> From: Simon Strandgaard <neoneye@ad...dk>
> Newsgroups: comp.lang.ruby
> Subject: Re: proposal: let kind_of take more arguments
> 
> On Thu, 19 Feb 2004 09:30:16 -0700, Ara.T.Howard wrote:
> > On Thu, 19 Feb 2004, Simon Strandgaard wrote:
> >> From: Simon Strandgaard <neoneye@ad...dk>
> >> On Thu, 19 Feb 2004 08:19:33 -0700, Ara.T.Howard wrote:
> >> > 
> >> > what do you reccomend (when a case won't do) ?
> >> > 
> >> > ...
> >> >   unless choice.kind_of?(Zero) or choice.kind_of?(One)
> >> > ...
> >> > 
> >> 
> >> My brain is terrible at dealing with 'unless'.
> >> If its just "unless something" then its ok.
> >> But when its "unless a or b and c" then it chokes.
> >> 
> >> Am I the only one feeling like this?
> >> 
> >> Where can I seek help ?  ;-)
> > 
> > a digital logic book, the simplest, will help.  de morgan's laws..., eg.
> [snip talk about de morgans law]
> 
> Yes I know these rules.. also karnough maps helps gaining overview of
> boolean operations. When an expression gets too complex then I like 
> place a comment with the corresponding karnough map. 
> 
> What I should have said was that I grew up with 'if then else'.
> The 'unless' keyword is a recent addition to my vocabulary, I am still 
> a bit rusty in its usage.
ah.  i got it from a the 'p' language - one of the good things about it IMHO.
;-)

-a
-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================

Robert Klemme <bob.news@gm...net>

2004-02-20 11:23:22
"Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
news:pan.2004.02.19.17.44.22.899443@ad...dk...
> On Thu, 19 Feb 2004 09:30:16 -0700, Ara.T.Howard wrote:
> > On Thu, 19 Feb 2004, Simon Strandgaard wrote:
> >> From: Simon Strandgaard <neoneye@ad...dk>
> >> On Thu, 19 Feb 2004 08:19:33 -0700, Ara.T.Howard wrote:
> >> >
> >> > what do you reccomend (when a case won't do) ?
> >> >
> >> > ...
> >> >   unless choice.kind_of?(Zero) or choice.kind_of?(One)
> >> > ...
> >> >
> >>
> >> My brain is terrible at dealing with 'unless'.
> >> If its just "unless something" then its ok.
> >> But when its "unless a or b and c" then it chokes.
> >>
> >> Am I the only one feeling like this?
> >>
> >> Where can I seek help ?  ;-)
> >
> > a digital logic book, the simplest, will help.  de morgan's laws...,
eg.
> [snip talk about de morgans law]
>
> Yes I know these rules.. also karnough maps helps gaining overview of
> boolean operations. When an expression gets too complex then I like
> place a comment with the corresponding karnough map.
>
> What I should have said was that I grew up with 'if then else'.
> The 'unless' keyword is a recent addition to my vocabulary, I am still
> a bit rusty in its usage.
.... unless you use it more and more: this will accustom you to the u-word.

:-))

    robert

Robert Klemme <bob.news@gm...net>

2004-02-20 11:21:09
"Ara.T.Howard" <ahoward@fa...gov> schrieb im Newsbeitrag
news:Pine.LNX.4.44.0402190818210.8086-100000@fa...gov...
> On Thu, 19 Feb 2004, Robert Klemme wrote:
>
> > Date: Thu, 19 Feb 2004 15:43:05 +0100
> > From: Robert Klemme <bob.news@gm...net>
> > Newsgroups: comp.lang.ruby
> > Subject: Re: proposal: let kind_of take more arguments
> >
> >
> > "Simon Strandgaard" <neoneye@ad...dk> schrieb im Newsbeitrag
> > news:pan.2004.02.19.14.25.27.611885@ad...dk...
> > > It just hit me.. why not let kind_of? take more arguments?
> > >
> > > irb(main):001:0> x = 3
> > > => 3
> > > irb(main):002:0> x.kind_of?(String)
> > > => false
> > > irb(main):003:0> x.kind_of?(String, Fixnum)
> > > ArgumentError: wrong number of arguments(2 for 1)
> > >         from (irb):3:in `kind_of?'
> > >         from (irb):3
> > > irb(main):004:0>
> > >
> > >
> > >
> > > For instance I have
> > >
> > > def push(choice)
> > >   if choice.kind_of?(Zero) == false and choice.kind_of?(One) ==
false
> >
> > Never compare boolean values to get boolean values.  This can lead to
> > hideous bugs if the method at hand does not return "true" or "false" -
> > especially with languages that have more than one value for either.
>
>
> what do you reccomend (when a case won't do) ?
>
> ...
>   unless choice.kind_of?(Zero) or choice.kind_of?(One)
> ...
Exactly.  Boolean operators are for transformation of boolean values.
Comparison with 'true', 'false', 'nil' or whatever is not appropriate for
the stated reasons.

:-)

    robert

This message appeared in a previous month, was never archived, or was lost.

Szymon Drejewicz <drejewic@ws...pl>

2004-02-20 11:20:57
>   module Kernel
>     alias :oldwarn :warn
>     def warn(msg="", fulltrace=nil)
>       trace = caller(1)
>       where = trace[0].sub(/:in.*/,'')
>       $stderr.puts "#{where}: Warning: #{msg}"
>       $stderr.puts trace.map {|t| "\tfrom #{t}"} if fulltrace
>     end
>   end
Yes, this is exactly what I need :-) thank you
Now it is possible to use just 

warn "Message body"

and ruby adds line number by itself without using redundant syntax like

warn "#{__FILE__}:#{__LINE__}: Message body."

:-)

-- 
Szymon Drejewicz

Gavri Savio Fernandez <Gavri_F@in...com>

2004-02-20 07:50:56
> From: Hal Fulton [mailto:hal9000@hy...com]
> Subject: Re: how to raise warning?

> > Having a variant of 'warn' that displays that information 
> would be nice IMO.
> > 
> >   warn "You didn't provide such and such", true
> 
> Mmm. I would expect that just to print 'true' after the warning.
> 
> The problem as I see it is that we use warnings in two ways:
> 1. As Ruby does, to complain about something happening at a specific
>     place in the source -- a highly source-related message. In that
>     case, I'd want to see file/line info (as Ruby does when it says I
>     need to add parens or something).
> 2. To complain about some general condition occurring at runtime that
>     doesn't warrant bailing out of the app.
> 
> My suggestion: Two names. Call the first one "warning" (the kind of
> warning that Ruby gives us) and the second one "warn" (a simple verb
> that just prints to stderr).
One of the main things I like about Ruby is that the names are so intuitive.
Once i check out a particular class or method in the reference, it is pretty much guaranteed that i won't forget it ever. Even better, sometimes i just guess what the name of a particular entity might be, type it in and the program runs. This, for me, is a major plus for ruby.
Even if a particular name is esoteric, it is esoteric in a way i remember and find difficult to forget.

Okay, what i'm driving at is this: Naming one method 'warn' (A verb. I like that) and another 'warning' (A noun. Don't like it much) is quite confusing :(
There doesn't seem to be any clue in their names to differentiate their functionality from each other.

Maybe there's a better way than Gavin's proposal (more mnemonic names like 'warn_with_sourceinfo'. i know this name sucks but you get the idea) but for now i prefer it his way:
warn "You didn't provide such and such"
warn "You didn't provide such and such", true


> Hal
gavri
On Feb 19, 2004, at 11:50 PM, Gavri Savio Fernandez wrote:

>> From: Hal Fulton [mailto:hal9000@hy...com]
>> Subject: Re: how to raise warning?
>>> Having a variant of 'warn' that displays that information would be 
>>> nice IMO.
>>>
>>>   warn "You didn't provide such and such", true
>>
>> Mmm. I would expect that just to print 'true' after the warning.
I second that. Adding an optional boolean argument to the function to 
get different results doesn't quite seem rubyish to me.

>> The problem as I see it is that we use warnings in two ways:
>> 1. As Ruby does, to complain about something happening at a specific
>>     place in the source -- a highly source-related message. In that
>>     case, I'd want to see file/line info (as Ruby does when it says I
>>     need to add parens or something).
>> 2. To complain about some general condition occurring at runtime that
>>     doesn't warrant bailing out of the app.
>>
>> My suggestion: Two names. Call the first one "warning" (the kind of
>> warning that Ruby gives us) and the second one "warn" (a simple verb
>> that just prints to stderr).
>
> One of the main things I like about Ruby is that the names are so 
> intuitive.
> Once i check out a particular class or method in the reference, it is 
> pretty much guaranteed that i won't forget it ever. Even better, 
> sometimes i just guess what the name of a particular entity might be, 
> type it in and the program runs. This, for me, is a major plus for 
> ruby.
> Even if a particular name is esoteric, it is esoteric in a way i 
> remember and find difficult to forget.
>
> Okay, what i'm driving at is this: Naming one method 'warn' (A verb. I 
> like that) and another 'warning' (A noun. Don't like it much) is quite 
> confusing :(
> There doesn't seem to be any clue in their names to differentiate 
> their functionality from each other.
How about:
warn "Server timed out. retrying."
warn! "That number seemed a bit high... Possible error."

This would keep the old behavior for warn(), but add a new function 
warn!(), which would be used for more serious warnings where you want 
to include a traceback.

-Mark

Robert Klemme <bob.news@gm...net>

2004-02-20 11:56:51
"Mark Hubbart" <discord@ma...com> schrieb im Newsbeitrag
news:4A25FA2C-637E-11D8-9977-000502FDD5CC@ma...com...
> On Feb 19, 2004, at 11:50 PM, Gavri Savio Fernandez wrote:
>
> >> From: Hal Fulton [mailto:hal9000@hy...com]
> >> Subject: Re: how to raise warning?
> >>> Having a variant of 'warn' that displays that information would be
> >>> nice IMO.
> >>>
> >>>   warn "You didn't provide such and such", true
> >>
> >> Mmm. I would expect that just to print 'true' after the warning.
> I second that. Adding an optional boolean argument to the function to
> get different results doesn't quite seem rubyish to me.
It's generally considered bad to have an interface method that changes
it's behavior dependend on a flag.  The typical solution is to have two
methods for the job.  If they have something in common they can use a
private method for the implementation.

> >> The problem as I see it is that we use warnings in two ways:
> >> 1. As Ruby does, to complain about something happening at a specific
> >>     place in the source -- a highly source-related message. In that
> >>     case, I'd want to see file/line info (as Ruby does when it says I
> >>     need to add parens or something).
> >> 2. To complain about some general condition occurring at runtime that
> >>     doesn't warrant bailing out of the app.
> >>
> >> My suggestion: Two names. Call the first one "warning" (the kind of
> >> warning that Ruby gives us) and the second one "warn" (a simple verb
> >> that just prints to stderr).
> >
> > One of the main things I like about Ruby is that the names are so
> > intuitive.
> > Once i check out a particular class or method in the reference, it is
> > pretty much guaranteed that i won't forget it ever. Even better,
> > sometimes i just guess what the name of a particular entity might be,
> > type it in and the program runs. This, for me, is a major plus for
> > ruby.
> > Even if a particular name is esoteric, it is esoteric in a way i
> > remember and find difficult to forget.
> >
> > Okay, what i'm driving at is this: Naming one method 'warn' (A verb. I
> > like that) and another 'warning' (A noun. Don't like it much) is quite
> > confusing :(
> > There doesn't seem to be any clue in their names to differentiate
> > their functionality from each other.
>
> How about:
> warn "Server timed out. retrying."
> warn! "That number seemed a bit high... Possible error."
>
> This would keep the old behavior for warn(), but add a new function
> warn!(), which would be used for more serious warnings where you want
> to include a traceback.
Ops, didn't read your post before I send mine.  Similar thoughts. :-)

Kind regards

    robert

Hal Fulton <hal9000@hy...com>

2004-02-20 19:09:05
Mark Hubbart wrote:
> 
> On Feb 19, 2004, at 11:50 PM, Gavri Savio Fernandez wrote:
>> Okay, what i'm driving at is this: Naming one method 'warn' (A verb. I 
>> like that) and another 'warning' (A noun. Don't like it much) is quite 
>> confusing :(
>> There doesn't seem to be any clue in their names to differentiate 
>> their functionality from each other.
Agreed. Clear in my mind, but that probably says more about my mind
than about the syntax. :)

> How about:
> warn "Server timed out. retrying."
> warn! "That number seemed a bit high... Possible error."
> 
> This would keep the old behavior for warn(), but add a new function 
> warn!(), which would be used for more serious warnings where you want to 
> include a traceback.
I like Mark's idea better than mine.

Hal

Andrew Johnson <ajohnson@cp...org>

2004-02-20 20:54:51
On Fri, 20 Feb 2004 17:25:17 +0900, Mark Hubbart <discord@ma...com> wrote:

> I second that. Adding an optional boolean argument to the function to 
> get different results doesn't quite seem rubyish to me.
Well, it's certainly not unprecedented in Ruby:

  Range.new(start, end, exclusive=false)
  load(filename, wrap=false)
  obj.respond_to?(symbol, include_private=false)
  obj.private_methods(all=true)
  obj.protected_methods(all=true)
  obj.public_methods(all=true)


regards,
andrew

This message appeared in a previous month, was never archived, or was lost.

Charles Comstock <cc1@ce...edu>

2004-02-20 23:09:52
Andrew Johnson wrote:
> On Fri, 20 Feb 2004 17:25:17 +0900, Mark Hubbart <discord@ma...com> wrote:
> 
> 
>>I second that. Adding an optional boolean argument to the function to 
>>get different results doesn't quite seem rubyish to me.
> 
> 
> Well, it's certainly not unprecedented in Ruby:
> 
>   Range.new(start, end, exclusive=false)
>   load(filename, wrap=false)
>   obj.respond_to?(symbol, include_private=false)
>   obj.private_methods(all=true)
>   obj.protected_methods(all=true)
>   obj.public_methods(all=true)
> 
> 
> regards,
> andrew
Right but not in things that print strings, the precedent there is not 
to use a boolean argument, since often you want to print multiple 
things.  I like the warn! idea though.  I would however say, that this 
is the classic use of a macro.  Most other uses of macro's we can 
replace with a call to eval.  But we lose the ability to do inplace code 
expansion which is so important for __LINE__ and things like that.  That 
and there is a way in C that you can get something to print out the name 
of the variable.  So you can have a macro that say:
v = 5

but your macro just says DEBUGV(v);

It seems like we might be able to do something like that with a symbol, 
but I haven't figured out how.

Charlie

David A. Black <dblack@wo...net>

2004-02-20 11:54:31
Hi --

On Fri, 20 Feb 2004, Gavri Savio Fernandez wrote:

> > From: Hal Fulton [mailto:hal9000@hy...com]
> > Subject: Re: how to raise warning?
> 
> > > Having a variant of 'warn' that displays that information 
> > would be nice IMO.
> > > 
> > >   warn "You didn't provide such and such", true
> > 
> > Mmm. I would expect that just to print 'true' after the warning.
> > 
> > The problem as I see it is that we use warnings in two ways:
> > 1. As Ruby does, to complain about something happening at a specific
> >     place in the source -- a highly source-related message. In that
> >     case, I'd want to see file/line info (as Ruby does when it says I
> >     need to add parens or something).
> > 2. To complain about some general condition occurring at runtime that
> >     doesn't warrant bailing out of the app.
> > 
> > My suggestion: Two names. Call the first one "warning" (the kind of
> > warning that Ruby gives us) and the second one "warn" (a simple verb
> > that just prints to stderr).
> 
> One of the main things I like about Ruby is that the names are so intuitive.
[..]
> Maybe there's a better way than Gavin's proposal (more mnemonic
> names like 'warn_with_sourceinfo'. i know this name sucks but you
> get the idea) but for now i prefer it his way:
> warn "You didn't provide such and such"
> warn "You didn't provide such and such", true
I would love to see every case of boolean arguments (like
"methods(true)") disappear from Ruby -- for exactly the reason you've
given, namely that they're hard to understand and remember.  I've
always thought they should be split into separate methods. 


David

-- 
David A. Black
dblack@wo...net

Robert <bobx@li...org>

2004-02-22 02:14:53
Replies: Ruby Tuesday
Robert Klemme wrote:
> "Charles Comstock" <cc1@ce...edu> schrieb im Newsbeitrag
> news:c18g6f$maq$2@ne...edu...
> 
>>Charles Comstock wrote:
>>
>>
>>>Robert wrote:
>>>
>>>
>>>>Jon A. Lambert wrote:
>>>>
>>>>
>>>>>"Ruby Tuesday" wrote:
>>>>
>>>>
>>>><snip>
>>>>
>>>>>BTW this is incorrect.
>>>>>print "Content-type: text/html \n\n\n"
>>>>>
>>>>>It should be
>>>>>print "Content-type: text/html \r\n\r\n"
>>>>>
>>>>>
>>>>
>>>>Is that a Ruby thing? That certainly isn't how Perl does it. Perl does
>>>>the following:
>>>>
>>>>print "Content-type: text/html\n\n";
>>>>
>>>>Which I believe is the standard header.
>>>
>>>
>>>I'm pretty sure under the rfs your supposed to do \r\n\r\n, but I think
>>>most servers are setup to just look for a single blank line before
>>>actual content, and so they generally just look for a \n and thus the
>>>\n\n works.  But technically it's supposed to be \r\n\r\n I think.
>>>
>>>Charles Comstock
>>
>>Oops dunno what I was typing, I meant RFC, not rfs,
>>
>>Charles Comstock
> 
> 
> Nevertheless you are right.  The RFC requires \r\n sequences as line
> termination in an HTTP header.  Never mind what "Perl does", it's better to
> just comply to the standard - "Better safe than sorry." :-)
> 
> See
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.1
> 
> Regards
> 
>     robert
I would agree except every tutorial I have ever seen on it uses \n\n and 
not the other.

This message appeared in a previous month, was never archived, or was lost.

=?iso-8859-1?q?Thomas=20Adam?= <thomas_adam16@ya...com>

2004-02-03 15:23:37
--- Useko Netsumi <usenets_remote_this@ea...net> wrote: 

> Hi, is there any Ruby code snippets I can use to transform my photo to
> lower
> resolution, uniform size but maintaining aspect ration, etc ...?
As far as I know, Ruby has bindings to imagemagick, but I would personally
use the shell:

man convert

(from imagemagick)

-- Thomas Adam

=====
"The Linux Weekend Mechanic" -- http://linuxgazette.net
"TAG Editor"                 -- http://linuxgazette.net

"<shrug> We'll just save up your sins, Thomas, and punish 
you for all of them at once when you get better. The 
experience will probably kill you. :)"

 -- Benjamin A. Okopnik (Linux Gazette Technical Editor)


	
	
		
___________________________________________________________
BT Yahoo! Broadband - Free modem offer, sign up online today and save £80 http://btyahoo.yahoo.co.uk

Carlos <angus@qu...ar>

2004-02-03 17:48:58
Replies: paul vudmaska
> Hi, is there any Ruby code snippets I can use to transform my photo to lower
> resolution, uniform size but maintaining aspect ration, etc ...?
The documentation of RMagick has a lot of examples.

http://rmagick.rubyforge.org/

paul vudmaska <paul_vudmaska@ya...com>

2004-02-03 18:16:54
--- Carlos <angus@qu...ar> wrote:
> > Hi, is there any Ruby code snippets I can use to
> transform my photo to lower
> > resolution, uniform size but maintaining aspect
> ration, etc ...?
> 
> The documentation of RMagick has a lot of examples.
> 
> http://rmagick.rubyforge.org/
THAT, is just the coolest! Done thumbs with php...but
i had no idea you could with ruby! Thanks for the link!

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-03 20:13:26
Useko Netsumi wrote:
> Hi, is there any Ruby code snippets I can use to transform my photo to lower
> resolution, uniform size but maintaining aspect ration, etc ...?
> 
> Thanks
I use GD and this lil' code, it keeps aspect ratio and ONLY works on jpg 
and png, since you say you use php, this could look familiar, the code 
could be *better* but does what I want use it or take it as reference, 
usage of copyResampled would give better output but haven't been able to 
use it.

*warning nuby code ahead*

require "GD"
class Thumber
   #imgpath=Full path to src image         i.e. 
"/home/osuka/pics/good_looking_me.jpg"
   #thumb_dir=dir path ro dest directory   i.e. "/home/osuka/backups/" 
*notice* trailing /
   #newx=new image width                   i.e. 320
   #newy=new image height                  i.e. 240
   #prefix=prefix to add to given image    i.e. "thumb_"
   #type=image type of uotput thumb        i.e. "jpg"|png|gif <-depends 
on GD image write support this particular code
   #uses only jpg and png, haven't need anything else, or in gif case 
can modified it to use an external app like Magick.
   #or gif2png
   def initialize(imgpath,thumb_dir,newx,newy,prefix,type)
     @prefix=prefix
     @imgpath=imgpath
     @thumb_dir=thumb_dir
     @type=type

     if(@im...downcase=~/[a-zA-Z0-9]+.(jpg||jpeg)+/)
       #comment out if noisy
       puts @srctype="jpeg"
       @srcimg=GD::Image.new_from_jpeg(imgpath)
       @ratio=@sr...to_f/@sr...height
     elsif(@im...downcase=~/[a-zA-Z0-9]+.(png)+/)
       #comment out if noisy
       puts @srctype="png"
       @srcimg=GD::Image.new_from_png(imgpath)
       @ratio=@sr...to_f/@sr...height
     elsif(@im...downcase=~/[a-zA-Z0-9]+.(gif)+/)
       #comment out if noisy
       puts @srctype="gif"
       @srcimg=GD::Image.new_from_gif(imgpath)
       @ratio=@sr...to_f/@sr...height
     else
       #comment out if noisy
       puts "other"
     end
     @newx=newx
     @newy=newy
     #comment out if noisy
     puts @ratio
     if(@newy>@newx)
       @newy=(@newx/@ratio).round
     else
       puts @newx=(@newy*@ratio).round
     end

     if(File.exists?(@thumb_dir+@prefix+File.basename(@imgpath)))
       #comment out if noisy
       puts "file exist"
     else
       #comment out if noisy
       puts "file doesn't exist"
       @dstimg=GD::Image.new(@newx,@newy)

@sr...copyResized(@dstimg,0,0,0,0,@newx,@newy,@sr...width,@sr...height)
       @thumbf=File.new(@thumb_dir+@prefix+File.basename(@imgpath),"wb")
       if(@type=="jpg")
         @ds...jpeg(@thumbf,85)
       elsif(@type=="png")
         @ds...png(@thumbf)
       else(@type=="gif")
         #@ds...gif(thumbf,85)
       end
     end

   end
end

#example usage:
#img1="e:/adartse/DNA.JPG"
#mypic=Thumber.new(img1,"e:/temp/",80,100,"","jpg")

Ruby Tuesday <rubytuzdayz@ya...com>

2004-02-03 21:25:05
Hi Osuka, I will try what you suggested.

Thank you very much for your help.

"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:40201B0B.9090905@pr...mx...
> Useko Netsumi wrote:
> > Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > Thanks
> >
> >
> >
> >
> I use GD and this lil' code, it keeps aspect ratio and ONLY works on jpg
> and png, since you say you use php, this could look familiar, the code
> could be *better* but does what I want use it or take it as reference,
> usage of copyResampled would give better output but haven't been able to
> use it.
>
> *warning nuby code ahead*
>
> require "GD"
> class Thumber
>    #imgpath=Full path to src image         i.e.
> "/home/osuka/pics/good_looking_me.jpg"
>    #thumb_dir=dir path ro dest directory   i.e. "/home/osuka/backups/"
> *notice* trailing /
>    #newx=new image width                   i.e. 320
>    #newy=new image height                  i.e. 240
>    #prefix=prefix to add to given image    i.e. "thumb_"
>    #type=image type of uotput thumb        i.e. "jpg"|png|gif <-depends
> on GD image write support this particular code
>    #uses only jpg and png, haven't need anything else, or in gif case
> can modified it to use an external app like Magick.
>    #or gif2png
>    def initialize(imgpath,thumb_dir,newx,newy,prefix,type)
>      @prefix=prefix
>      @imgpath=imgpath
>      @thumb_dir=thumb_dir
>      @type=type
>
>      if(@im...downcase=~/[a-zA-Z0-9]+.(jpg||jpeg)+/)
>        #comment out if noisy
>        puts @srctype="jpeg"
>        @srcimg=GD::Image.new_from_jpeg(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(png)+/)
>        #comment out if noisy
>        puts @srctype="png"
>        @srcimg=GD::Image.new_from_png(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(gif)+/)
>        #comment out if noisy
>        puts @srctype="gif"
>        @srcimg=GD::Image.new_from_gif(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      else
>        #comment out if noisy
>        puts "other"
>      end
>      @newx=newx
>      @newy=newy
>      #comment out if noisy
>      puts @ratio
>      if(@newy>@newx)
>        @newy=(@newx/@ratio).round
>      else
>        puts @newx=(@newy*@ratio).round
>      end
>
>      if(File.exists?(@thumb_dir+@prefix+File.basename(@imgpath)))
>        #comment out if noisy
>        puts "file exist"
>      else
>        #comment out if noisy
>        puts "file doesn't exist"
>        @dstimg=GD::Image.new(@newx,@newy)
@sr...copyResized(@dstimg,0,0,0,0,@newx,@newy,@sr...width,@sr...height
)
>        @thumbf=File.new(@thumb_dir+@prefix+File.basename(@imgpath),"wb")
>        if(@type=="jpg")
>          @ds...jpeg(@thumbf,85)
>        elsif(@type=="png")
>          @ds...png(@thumbf)
>        else(@type=="gif")
>          #@ds...gif(thumbf,85)
>        end
>      end
>
>    end
> end
>
> #example usage:
> #img1="e:/adartse/DNA.JPG"
> #mypic=Thumber.new(img1,"e:/temp/",80,100,"","jpg")
>

Ruby Tuesday <rubytuzdayz@ya...com>

2004-02-08 21:37:27
Hi Osuka, I will try what you suggested.

Thank you very much for your help.

"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:40201B0B.9090905@pr...mx...
> Useko Netsumi wrote:
> > Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > Thanks
> >
> >
> >
> >
> I use GD and this lil' code, it keeps aspect ratio and ONLY works on jpg
> and png, since you say you use php, this could look familiar, the code
> could be *better* but does what I want use it or take it as reference,
> usage of copyResampled would give better output but haven't been able to
> use it.
>
> *warning nuby code ahead*
>
> require "GD"
> class Thumber
>    #imgpath=Full path to src image         i.e.
> "/home/osuka/pics/good_looking_me.jpg"
>    #thumb_dir=dir path ro dest directory   i.e. "/home/osuka/backups/"
> *notice* trailing /
>    #newx=new image width                   i.e. 320
>    #newy=new image height                  i.e. 240
>    #prefix=prefix to add to given image    i.e. "thumb_"
>    #type=image type of uotput thumb        i.e. "jpg"|png|gif <-depends
> on GD image write support this particular code
>    #uses only jpg and png, haven't need anything else, or in gif case
> can modified it to use an external app like Magick.
>    #or gif2png
>    def initialize(imgpath,thumb_dir,newx,newy,prefix,type)
>      @prefix=prefix
>      @imgpath=imgpath
>      @thumb_dir=thumb_dir
>      @type=type
>
>      if(@im...downcase=~/[a-zA-Z0-9]+.(jpg||jpeg)+/)
>        #comment out if noisy
>        puts @srctype="jpeg"
>        @srcimg=GD::Image.new_from_jpeg(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(png)+/)
>        #comment out if noisy
>        puts @srctype="png"
>        @srcimg=GD::Image.new_from_png(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(gif)+/)
>        #comment out if noisy
>        puts @srctype="gif"
>        @srcimg=GD::Image.new_from_gif(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      else
>        #comment out if noisy
>        puts "other"
>      end
>      @newx=newx
>      @newy=newy
>      #comment out if noisy
>      puts @ratio
>      if(@newy>@newx)
>        @newy=(@newx/@ratio).round
>      else
>        puts @newx=(@newy*@ratio).round
>      end
>
>      if(File.exists?(@thumb_dir+@prefix+File.basename(@imgpath)))
>        #comment out if noisy
>        puts "file exist"
>      else
>        #comment out if noisy
>        puts "file doesn't exist"
>        @dstimg=GD::Image.new(@newx,@newy)
@sr...copyResized(@dstimg,0,0,0,0,@newx,@newy,@sr...width,@sr...height
)
>        @thumbf=File.new(@thumb_dir+@prefix+File.basename(@imgpath),"wb")
>        if(@type=="jpg")
>          @ds...jpeg(@thumbf,85)
>        elsif(@type=="png")
>          @ds...png(@thumbf)
>        else(@type=="gif")
>          #@ds...gif(thumbf,85)
>        end
>      end
>
>    end
> end
>
> #example usage:
> #img1="e:/adartse/DNA.JPG"
> #mypic=Thumber.new(img1,"e:/temp/",80,100,"","jpg")
>

Ruby Tuesday <rubytuzdayz@ya...com>

2004-02-08 23:54:11
Hi Osuka, I will try what you suggested.

Thank you very much for your help.

"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:40201B0B.9090905@pr...mx...
> Useko Netsumi wrote:
> > Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > Thanks
> >
> >
> >
> >
> I use GD and this lil' code, it keeps aspect ratio and ONLY works on jpg
> and png, since you say you use php, this could look familiar, the code
> could be *better* but does what I want use it or take it as reference,
> usage of copyResampled would give better output but haven't been able to
> use it.
>
> *warning nuby code ahead*
>
> require "GD"
> class Thumber
>    #imgpath=Full path to src image         i.e.
> "/home/osuka/pics/good_looking_me.jpg"
>    #thumb_dir=dir path ro dest directory   i.e. "/home/osuka/backups/"
> *notice* trailing /
>    #newx=new image width                   i.e. 320
>    #newy=new image height                  i.e. 240
>    #prefix=prefix to add to given image    i.e. "thumb_"
>    #type=image type of uotput thumb        i.e. "jpg"|png|gif <-depends
> on GD image write support this particular code
>    #uses only jpg and png, haven't need anything else, or in gif case
> can modified it to use an external app like Magick.
>    #or gif2png
>    def initialize(imgpath,thumb_dir,newx,newy,prefix,type)
>      @prefix=prefix
>      @imgpath=imgpath
>      @thumb_dir=thumb_dir
>      @type=type
>
>      if(@im...downcase=~/[a-zA-Z0-9]+.(jpg||jpeg)+/)
>        #comment out if noisy
>        puts @srctype="jpeg"
>        @srcimg=GD::Image.new_from_jpeg(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(png)+/)
>        #comment out if noisy
>        puts @srctype="png"
>        @srcimg=GD::Image.new_from_png(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(gif)+/)
>        #comment out if noisy
>        puts @srctype="gif"
>        @srcimg=GD::Image.new_from_gif(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      else
>        #comment out if noisy
>        puts "other"
>      end
>      @newx=newx
>      @newy=newy
>      #comment out if noisy
>      puts @ratio
>      if(@newy>@newx)
>        @newy=(@newx/@ratio).round
>      else
>        puts @newx=(@newy*@ratio).round
>      end
>
>      if(File.exists?(@thumb_dir+@prefix+File.basename(@imgpath)))
>        #comment out if noisy
>        puts "file exist"
>      else
>        #comment out if noisy
>        puts "file doesn't exist"
>        @dstimg=GD::Image.new(@newx,@newy)
@sr...copyResized(@dstimg,0,0,0,0,@newx,@newy,@sr...width,@sr...height
)
>        @thumbf=File.new(@thumb_dir+@prefix+File.basename(@imgpath),"wb")
>        if(@type=="jpg")
>          @ds...jpeg(@thumbf,85)
>        elsif(@type=="png")
>          @ds...png(@thumbf)
>        else(@type=="gif")
>          #@ds...gif(thumbf,85)
>        end
>      end
>
>    end
> end
>
> #example usage:
> #img1="e:/adartse/DNA.JPG"
> #mypic=Thumber.new(img1,"e:/temp/",80,100,"","jpg")
>

Ruby Tuesday <rubytuzdayz@ya...com>

2004-02-09 01:12:59
Hi Osuka, I will try what you suggested.

Thank you very much for your help.

"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:40201B0B.9090905@pr...mx...
> Useko Netsumi wrote:
> > Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > Thanks
> >
> >
> >
> >
> I use GD and this lil' code, it keeps aspect ratio and ONLY works on jpg
> and png, since you say you use php, this could look familiar, the code
> could be *better* but does what I want use it or take it as reference,
> usage of copyResampled would give better output but haven't been able to
> use it.
>
> *warning nuby code ahead*
>
> require "GD"
> class Thumber
>    #imgpath=Full path to src image         i.e.
> "/home/osuka/pics/good_looking_me.jpg"
>    #thumb_dir=dir path ro dest directory   i.e. "/home/osuka/backups/"
> *notice* trailing /
>    #newx=new image width                   i.e. 320
>    #newy=new image height                  i.e. 240
>    #prefix=prefix to add to given image    i.e. "thumb_"
>    #type=image type of uotput thumb        i.e. "jpg"|png|gif <-depends
> on GD image write support this particular code
>    #uses only jpg and png, haven't need anything else, or in gif case
> can modified it to use an external app like Magick.
>    #or gif2png
>    def initialize(imgpath,thumb_dir,newx,newy,prefix,type)
>      @prefix=prefix
>      @imgpath=imgpath
>      @thumb_dir=thumb_dir
>      @type=type
>
>      if(@im...downcase=~/[a-zA-Z0-9]+.(jpg||jpeg)+/)
>        #comment out if noisy
>        puts @srctype="jpeg"
>        @srcimg=GD::Image.new_from_jpeg(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(png)+/)
>        #comment out if noisy
>        puts @srctype="png"
>        @srcimg=GD::Image.new_from_png(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      elsif(@im...downcase=~/[a-zA-Z0-9]+.(gif)+/)
>        #comment out if noisy
>        puts @srctype="gif"
>        @srcimg=GD::Image.new_from_gif(imgpath)
>        @ratio=@sr...to_f/@sr...height
>      else
>        #comment out if noisy
>        puts "other"
>      end
>      @newx=newx
>      @newy=newy
>      #comment out if noisy
>      puts @ratio
>      if(@newy>@newx)
>        @newy=(@newx/@ratio).round
>      else
>        puts @newx=(@newy*@ratio).round
>      end
>
>      if(File.exists?(@thumb_dir+@prefix+File.basename(@imgpath)))
>        #comment out if noisy
>        puts "file exist"
>      else
>        #comment out if noisy
>        puts "file doesn't exist"
>        @dstimg=GD::Image.new(@newx,@newy)
@sr...copyResized(@dstimg,0,0,0,0,@newx,@newy,@sr...width,@sr...height
)
>        @thumbf=File.new(@thumb_dir+@prefix+File.basename(@imgpath),"wb")
>        if(@type=="jpg")
>          @ds...jpeg(@thumbf,85)
>        elsif(@type=="png")
>          @ds...png(@thumbf)
>        else(@type=="gif")
>          #@ds...gif(thumbf,85)
>        end
>      end
>
>    end
> end
>
> #example usage:
> #img1="e:/adartse/DNA.JPG"
> #mypic=Thumber.new(img1,"e:/temp/",80,100,"","jpg")
>

Tim Hunter <Tim.Hunter@sa...com>

2004-02-08 21:34:12
Replies: Ara.T.Howard
On Tue, 3 Feb 2004 08:47:16 -0500, "Useko Netsumi"
<usenets_remote_this@ea...net> wrote:

>Hi, is there any Ruby code snippets I can use to transform my photo to lower
>resolution, uniform size but maintaining aspect ration, etc ...?
RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
functionality, but it's way more than a code snippet.

Ara.T.Howard <ahoward@fa...gov>

2004-02-08 21:34:47
On Tue, 3 Feb 2004, Tim Hunter wrote:

> Date: Tue, 03 Feb 2004 12:30:39 -0500
> From: Tim Hunter <Tim.Hunter@sa...com>
> Newsgroups: comp.lang.ruby
> Subject: Re: Image conversion ...
> 
> On Tue, 3 Feb 2004 08:47:16 -0500, "Useko Netsumi"
> <usenets_remote_this@ea...net> wrote:
> 
> >Hi, is there any Ruby code snippets I can use to transform my photo to lower
> >resolution, uniform size but maintaining aspect ration, etc ...?
> 
> RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
> functionality, but it's way more than a code snippet.
if you have image magick installed you can also simply

  mogrify -size 50x50 image.jpg

do

  man mogrify

-a

-- 

ATTN: please update your address books with address below!

===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| STP     :: http://www.ngdc.noaa.gov/stp/
| NGDC    :: http://www.ngdc.noaa.gov/
| NESDIS  :: http://www.nesdis.noaa.gov/
| NOAA    :: http://www.noaa.gov/
| US DOC  :: http://www.commerce.gov/
|
| The difference between art and science is that science is what we
| understand well enough to explain to a computer.  
| Art is everything else.  
|   -- Donald Knuth, "Discover"
|
| /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' 
===============================================================================

Useko Netsumi <usenets_remote_this@ea...net>

2004-02-04 00:00:09
Thanks Ara, I'll get Rmagick and try them out.

"Ara.T.Howard" <ahoward@fa...gov> wrote in message
news:Pine.LNX.4.44.0402031119350.29981-100000@fa...gov...
> On Tue, 3 Feb 2004, Tim Hunter wrote:
>
> > Date: Tue, 03 Feb 2004 12:30:39 -0500
> > From: Tim Hunter <Tim.Hunter@sa...com>
> > Newsgroups: comp.lang.ruby
> > Subject: Re: Image conversion ...
> >
> > On Tue, 3 Feb 2004 08:47:16 -0500, "Useko Netsumi"
> > <usenets_remote_this@ea...net> wrote:
> >
> > >Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > >resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
> > functionality, but it's way more than a code snippet.
>
> if you have image magick installed you can also simply
>
>   mogrify -size 50x50 image.jpg
>
> do
>
>   man mogrify
>
> -a
>
> -- 
>
> ATTN: please update your address books with address below!
============================================================================
===
> | EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
> | PHONE   :: 303.497.6469
> | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
> | STP     :: http://www.ngdc.noaa.gov/stp/
> | NGDC    :: http://www.ngdc.noaa.gov/
> | NESDIS  :: http://www.nesdis.noaa.gov/
> | NOAA    :: http://www.noaa.gov/
> | US DOC  :: http://www.commerce.gov/
> |
> | The difference between art and science is that science is what we
> | understand well enough to explain to a computer.
> | Art is everything else.
> |   -- Donald Knuth, "Discover"
> |
> | /bin/sh -c 'for l in ruby perl;do $l -e "print
\"\x3a\x2d\x29\x0a\"";done'
============================================================================
===
>

Sam Roberts <sroberts@un...com>

2004-02-04 00:22:13
> > > >Hi, is there any Ruby code snippets I can use to transform my photo to lower
> > > >resolution, uniform size but maintaining aspect ration, etc ...?
> > >
> > > RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
> > > functionality, but it's way more than a code snippet.
http://www.simplesystems.org/RMagick/doc/comtasks.html#thumb

  img = Image.new "bigimage.gif"
  thumb = img.scale(125, 125)
  thumb.write "thumb.gif"

I am truly impressed, I had no idea it was this easy!

Sam

Useko Netsumi <usenets_remote_this@ea...net>

2004-02-08 21:39:42
Thanks Ara, I'll get Rmagick and try them out.

"Ara.T.Howard" <ahoward@fa...gov> wrote in message
news:Pine.LNX.4.44.0402031119350.29981-100000@fa...gov...
> On Tue, 3 Feb 2004, Tim Hunter wrote:
>
> > Date: Tue, 03 Feb 2004 12:30:39 -0500
> > From: Tim Hunter <Tim.Hunter@sa...com>
> > Newsgroups: comp.lang.ruby
> > Subject: Re: Image conversion ...
> >
> > On Tue, 3 Feb 2004 08:47:16 -0500, "Useko Netsumi"
> > <usenets_remote_this@ea...net> wrote:
> >
> > >Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > >resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
> > functionality, but it's way more than a code snippet.
>
> if you have image magick installed you can also simply
>
>   mogrify -size 50x50 image.jpg
>
> do
>
>   man mogrify
>
> -a
>
> -- 
>
> ATTN: please update your address books with address below!
============================================================================
===
> | EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
> | PHONE   :: 303.497.6469
> | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
> | STP     :: http://www.ngdc.noaa.gov/stp/
> | NGDC    :: http://www.ngdc.noaa.gov/
> | NESDIS  :: http://www.nesdis.noaa.gov/
> | NOAA    :: http://www.noaa.gov/
> | US DOC  :: http://www.commerce.gov/
> |
> | The difference between art and science is that science is what we
> | understand well enough to explain to a computer.
> | Art is everything else.
> |   -- Donald Knuth, "Discover"
> |
> | /bin/sh -c 'for l in ruby perl;do $l -e "print
\"\x3a\x2d\x29\x0a\"";done'
============================================================================
===
>

Tim Hunter <cyclists@nc...com>

2004-02-08 21:39:56
On Tue, 03 Feb 2004 18:57:21 -0500, Useko Netsumi wrote:

> Thanks Ara, I'll get Rmagick and try them out.
> 
> "Ara.T.Howard" <ahoward@fa...gov> wrote in message
> news:Pine.LNX.4.44.0402031119350.29981-100000@fa...gov...
>> On Tue, 3 Feb 2004, Tim Hunter wrote:
>>
>> if you have image magick installed you can also simply
>>
>>   mogrify -size 50x50 image.jpg
>>
Using RMagick, the Ruby equivalent to this command is:

require 'RMagick'
include Magick

img = Image.read("image.jpg").first
img.change_geometry("50x50") { |cols, rows|
	img.resize!(cols, rows)
	}
img.write("image.jpg")

Useko Netsumi <usenets_remote_this@ea...net>

2004-02-08 23:58:51
Thanks Ara, I'll get Rmagick and try them out.

"Ara.T.Howard" <ahoward@fa...gov> wrote in message
news:Pine.LNX.4.44.0402031119350.29981-100000@fa...gov...
> On Tue, 3 Feb 2004, Tim Hunter wrote:
>
> > Date: Tue, 03 Feb 2004 12:30:39 -0500
> > From: Tim Hunter <Tim.Hunter@sa...com>
> > Newsgroups: comp.lang.ruby
> > Subject: Re: Image conversion ...
> >
> > On Tue, 3 Feb 2004 08:47:16 -0500, "Useko Netsumi"
> > <usenets_remote_this@ea...net> wrote:
> >
> > >Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > >resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
> > functionality, but it's way more than a code snippet.
>
> if you have image magick installed you can also simply
>
>   mogrify -size 50x50 image.jpg
>
> do
>
>   man mogrify
>
> -a
>
> -- 
>
> ATTN: please update your address books with address below!
============================================================================
===
> | EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
> | PHONE   :: 303.497.6469
> | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
> | STP     :: http://www.ngdc.noaa.gov/stp/
> | NGDC    :: http://www.ngdc.noaa.gov/
> | NESDIS  :: http://www.nesdis.noaa.gov/
> | NOAA    :: http://www.noaa.gov/
> | US DOC  :: http://www.commerce.gov/
> |
> | The difference between art and science is that science is what we
> | understand well enough to explain to a computer.
> | Art is everything else.
> |   -- Donald Knuth, "Discover"
> |
> | /bin/sh -c 'for l in ruby perl;do $l -e "print
\"\x3a\x2d\x29\x0a\"";done'
============================================================================
===
>

Useko Netsumi <usenets_remote_this@ea...net>

2004-02-09 01:16:53
Thanks Ara, I'll get Rmagick and try them out.

"Ara.T.Howard" <ahoward@fa...gov> wrote in message
news:Pine.LNX.4.44.0402031119350.29981-100000@fa...gov...
> On Tue, 3 Feb 2004, Tim Hunter wrote:
>
> > Date: Tue, 03 Feb 2004 12:30:39 -0500
> > From: Tim Hunter <Tim.Hunter@sa...com>
> > Newsgroups: comp.lang.ruby
> > Subject: Re: Image conversion ...
> >
> > On Tue, 3 Feb 2004 08:47:16 -0500, "Useko Netsumi"
> > <usenets_remote_this@ea...net> wrote:
> >
> > >Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > >resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > RMagick (http://raa.ruby-lang.org/list.rhtml?name=rmagick) has this
> > functionality, but it's way more than a code snippet.
>
> if you have image magick installed you can also simply
>
>   mogrify -size 50x50 image.jpg
>
> do
>
>   man mogrify
>
> -a
>
> -- 
>
> ATTN: please update your address books with address below!
============================================================================
===
> | EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
> | PHONE   :: 303.497.6469
> | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
> | STP     :: http://www.ngdc.noaa.gov/stp/
> | NGDC    :: http://www.ngdc.noaa.gov/
> | NESDIS  :: http://www.nesdis.noaa.gov/
> | NOAA    :: http://www.noaa.gov/
> | US DOC  :: http://www.commerce.gov/
> |
> | The difference between art and science is that science is what we
> | understand well enough to explain to a computer.
> | Art is everything else.
> |   -- Donald Knuth, "Discover"
> |
> | /bin/sh -c 'for l in ruby perl;do $l -e "print
\"\x3a\x2d\x29\x0a\"";done'
============================================================================
===
>

matthew c. mead <mmead@go...com>

2004-02-09 03:44:05
Replies: Useko Netsumi
I would start with this:
http://rmagick.rubyforge.org/

Having used JMagick to build an HtmlGallery generation app, I may
rewrite in ruby to build a gtk gui into it.

Shameless plug:

http://www.goof.com/~mmead/HtmlGallery/



-matt

On Mon, Feb 09, 2004 at 06:28:23AM +0900, Useko Netsumi wrote:
> Hi, is there any Ruby code snippets I can use to transform my photo to lower
> resolution, uniform size but maintaining aspect ration, etc ...?
> 
> Thanks
-- 
matthew c. mead

http://www.goof.com/~mmead/

Useko Netsumi <usenets_remote_this@ea...net>

2004-02-10 02:10:01
Do they have the mswin32 version of RMagick? They mention to have the cygwin
version but how do I mix and match between mswin32 ruby and cygwin RMagick?

I do have a development Linux server in the same machine with my Windows
Development. I have to use the windows for my day jobs and use it
exclusively. Perhaps if there are  the mswin32 version of all Ruby related
apps would be convenience for beginer such as myself.

Thanks

"matthew c. mead" <mmead@go...com> wrote in message
news:20040208220720.GA98015@go...com...
> I would start with this:
> http://rmagick.rubyforge.org/
>
> Having used JMagick to build an HtmlGallery generation app, I may
> rewrite in ruby to build a gtk gui into it.
>
> Shameless plug:
>
> http://www.goof.com/~mmead/HtmlGallery/
>
>
>
> -matt
>
> On Mon, Feb 09, 2004 at 06:28:23AM +0900, Useko Netsumi wrote:
> > Hi, is there any Ruby code snippets I can use to transform my photo to
lower
> > resolution, uniform size but maintaining aspect ration, etc ...?
> >
> > Thanks
> >
> >
> >
>
> -- 
> matthew c. mead
>
> http://www.goof.com/~mmead/
>

wsdng@on...de (Sascha D?rdelmann)

2004-02-10 09:44:59
"Useko Netsumi" <usenets_remote_this@ea...net> wrote:
> Hi, is there any Ruby code snippets I can use to transform my photo to lower
> resolution, uniform size but maintaining aspect ration, etc ...?
Besides other solutions you could use the command line tool or the
library behind xnview
http://perso.wanadoo.fr/pierre.g/xnview/enhome.html. It's easy to
install and easy to use via Ruby scripts.

Simple things can be done by fox but I wouldn't recommend it for batch
image processing.

Cheers
Sascha

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-11 03:35:55
Useko Netsumi wrote:
> Need step by step instruction(and what other windows dlls to get) on how to
> get CGI to work with my apache 2.0.48(windows version) for the following
> scripting language: ruby, perl, and php.
> 
> Thanks
did this:

#in the /apache2/conf/httpd.conf
#adjust DocumentRoot "E:/dev/Daemon/Apache2/htdocs" to your dir holding 
the pages my case
DocumentRoot "E:/dev/Daemon/Apache2/htdocs" --> DocumentRoot "e:/dev/webpub"
#windows doesn't like .files so dot.htaccess works or whatever fancies you.
AccessFileName dot.htaccess --> AccessFileName dot.htaccess
<Files ~ "^\.ht"> --> <Files ~ "^dot.ht">
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t *.rb


**Eruby install only [if you're going to use Eruby ALONE no mod_ruby]**
download binary from ruby-mirror/binaries/mswin32|mingw/1.8/ext
MSWIN
http://www.ibiblio.org/pub/languages/ruby/binaries/mswin32/ext/eruby-1.0.4-i386-mswin32-1.8.zip
MINGW
http://www.ibiblio.org/pub/languages/ruby/binaries/mingw/1.8/ext/eruby-1.0.5-i386-mingw32-1.8.tar.gz
or compile eruby with your compiler(mingw in my case) sources at 
http://modruby.net/ current: eruby-1.0.5.tar.gz

tar -xvzf eruby-1.0.5.tar.gz
ruby configure.rb --enable-shared && make && make install

in httpd.conf add:
   AddType application/x-httpd-eruby .rhtml
   #use your own path to eruby
   Action application/x-httpd-eruby "e:/usr/local/bin/eruby.exe"
   AddType application/x-httpd-cgi .rhtml
   #not really needed
   AddHandler cgi-script .cgi

add "+ExecCGI" directive to pertinent directories sections or add it in 
the global DocumentRoot(be warned thought, this allows executable cgis 
in ALL DocumentRoot an subdirs good for localhost but probably not smart 
for real servers).

add as first line to the cgi files(*.rb,*.rhtml...) 
#!e:/usr/local/bin/eruby.exe <--change to own path, to avoid internal 
server errors.
Save this in docroot as eruby_test.rhtml, run it.
------------------------------------
#!e:/usr/local/bin/eruby.exe
<%
begin
require 'Find' #test to check requiring
puts "<HTML><HEAD><TITLE>Welcome to eruby Test</TITLE></HEAD><BODY><pre>"
val=Dir["*"]
val.each do |entry|
   if FileTest.directory?(entry)
     print '<img src="/icons/folder.gif" alt="[DIR]" /> <a href="'
   else
     print '<img src="/icons/unknown.gif" alt="[DIR]" /> <a href="'
   end
   printf("#{entry}\">#{entry}</a>\t\t\t#{File.mtime(entry)}\n")
end
puts "</pre></BODY>"
rescue
   puts "Content-Type: text/plain"
   puts "<br><br>"
   puts "Error #{$!}: #{$!.backtrace}<br>"
end

-------------------------------------

**Install using mod_ruby + eruby**
get mod_ruby binary at:
http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/
sources at http://modruby.net/

copy *.so to apache2/modules/ add the line in httpd.conf
from the source of eruby copy the /lib/apache + autoreload.rb to the 
\usr\local\lib\ruby\site_ruby\1.8

LoadModule ruby_module modules/mod_ruby.so
<Location / >
   Options Indexes FollowSymLinks ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all	
</Location>
	
<IfModule mod_ruby.c>
   RubyRequire "E:/usr/local/lib/ruby/site_ruby/1.8/apache/ruby-run"
   <Files *.rbx>
     SetHandler ruby-object
     RubyHandler Apache::RubyRun.instance
   </Files>
   <Files *.rhtml>
     SetHandler ruby-object
     RubyHandler Apache::ERubyRun.instance
   </Files>
</IfModule>

test file 1.rbx:
--------------------
#!e:/usr/local/bin/ruby
#print "HTTP/1.1 200 OK\n"
#print "Content-Type: text/plain\n\n"
require 'cgi'
cgi = CGI.new
cgi.out {
   "hello world"
}
--------------------

:-( been unable to run mod_ruby
[Tue Feb 10 20:45:03 2004] [error] access to E:/dev/webpub/ruby/1.rbx 
failed for (null), reason: file permissions deny server execution
OK maybe I'm doing something wrong on the conf file, so the files aren't 
autorized to execute...check later

trying to run eruby_test gives me:
[Tue Feb 10 20:47:01 2004] [error] mod_ruby: error in ruby
(eval): (eval)uninitialized constant Apache::ERubyRun (NameError)
	from (eval):0:in `value'
the *.so doesn't have eruby support?

SO I get my conf back to eruby only, anyway eruby is enough for me, 
there's fcgi but haven't gotten around installing it.

php? install is quite simple, thought(like eruby) but there's files that 
need to be copied here and there, mostly php4apache2.dll,php4ts.dll to 
php dir and lots|few changes to php ini depending on your needs, easier 
to go but, been there...now using eruby.

perl, :-O? well never have used it, but it should be as eruby/cgi:
#!/usr/bin/perl
-code-
install Activeperl point your *.pl with a shebang and done

hope it helps, btw got around thumbnails? ;-)

Erika Lockhart <fiatgirl@pa...net>

2004-02-11 16:30:00
I just installed apache/php this weekend with Windows XP and got great
instructions at inikis.com.



-- 

"Useko Netsumi" <usenets_remote_this@ea...net> wrote in message
news:c0bkoq$14oro8$1@ID...de...
> Need step by step instruction(and what other windows dlls to get) on how
to
> get CGI to work with my apache 2.0.48(windows version) for the following
> scripting language: ruby, perl, and php.
>
> Thanks
>

maco@le...jp <kwa@ku...com>

2004-02-12 22:09:13
Quoting Ruby Tuesday <rubytuzdayz@ya...com>:

> Does it run on ms-windows? Thanks
Yes.
Kwartz is implemented in pure ruby.
And it runs on ruby 1.6 or 1.8.

--
regards
kwa

> <kwa@ku...com> wrote in message
> news:3AC3F1AB414F4Fkwa@ku...com...
> > I send the following message again:
> > ----------------------
> > Hi all,
> >
> > I'm pleased to announce a public release of Kwartz.
> >
> > Kwartz(*1) is a template sysmtem for web-designer and web-programmer.
> >
> > Kwartz has the following features.
> >
> >     * Kwartz can separate presentation logic from a template.
> >     * Kwartz can be available in Ruby, PHP and Java.
> >     * Kwartz runs very fast.
> >     * Kwartz doesn't break HTML design at all.
> >     * Kwartz can handle any type of text file.
> >     * Kwartz can sanitize automatically.
> >
> > See Kwartz User's Guide for more detail.
> >
> > Homepage:
> >     http://www.kuwata-lab.com/webtech/kwartz/index.html
> >
> > Download:
> >     http://www.kuwata-lab.com/webtech/kwartz/kwartz_2004-02-12.tar.gz
> >
> > User's Guide:
> >     (English)
> >     http://www.kuwata-lab.com/webtech/kwartz/users-guide.en.html
> >     (Japanese)
> >     http://www.kuwata-lab.com/webtech/kwartz/users-guide.ja.html
> >
> >
> >     (*1) Development of Kwartz is subsidized by Exploratory Software
> >          Project of IPA  (Information-Technology Promotion Agency
> Japan).
> >
> >
> > Have fun!
> >
> > --
> > regards,
> > kwa
> >
> >
> >
> >
>

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-20 21:40:37
Ruby Tuesday wrote:
> Hi, I have these 2 files, one work and the other does not.
> 
> #!c:/apps/ruby/bin/ruby.exe
> print "Content-type: text/html \n\n\n"
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
> 
> And this is the other one(DOES NOT WORK!)
> #!c:/apps/ruby/bin/ruby.exe
> print "Content-type: text/plain \n\n\n"
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
> 
> The only difference is that the 2nd file has text/plain in the header
> instead of text/html. Please advise. Thanks
Well, both work...what error are you getting?, how are you using those?
my results:
Content-type: text/html


1st line 2nd line 3rd line
and:
Content-type: text/plain


1st line 2nd line 3rd line

This message appeared in a previous month, was never archived, or was lost.

This message appeared in a previous month, was never archived, or was lost.

paul vudmaska <paul_vudmaska@ya...com>

2004-02-05 15:35:09
Replies: Kirk Haines
--- "John W. Long" <ng@jo...com> wrote:
> ----"paul vudmaska" wrote:----
> > something like...
> >   <html>
> >      <body>
> >         <h1><%=data['title']%></h1>
> >         <p><%=data['body']%></p>
> >          ...just testing what i get for data
> >            <%
> >                  data.each do |d|
> >                     puts d
> >                  end
> > 
> >            %>
> >      </body>
> >   </html>
> > 
> > So, leave the heavy lifting to the developer but
> let
> > the designer play too.
> 
> This is essentially eruby.
Exactly - i use eruby in lieu of Amrita for
presentation and/or content. Let me explain.

In a simple CMS system i'm creating, i have a ui that
allows the owner of the site to edit/create (static)
content on the fly. Then i started thinking that i'd
like to have some smarts in these files. Instead of
setting up a harnessing mechanism with Amrita, i added
a property to the content, executable, and if it is
on, i complile the text through the eruby compiler and
eval the code. Dangerous, i know, but it works
amazingly well so far. Now, I can create content as
well as logic  on the fly. Right now, within these
files, the world is my oyster (read destruction zone
:). 

My next step is sandboxing (perhaps safe level 4, i
dont know) and/or data injection(like Amrita) for
these files and/or only allowing developers(as opposed
to editors) to create an executable. I've also thot
about forcing these files thru some sort of simple
authorization process  (there will be a simple work
flow anyway) where a developer/admin would need to
look at the code before it's available/executable.
This has obvious advantages(and disadvantages), but it
also has one BIG advantage that is not immidiately
clear - i can compile the code with eruby and save
THAT, <b>which is now pure ruby</b>, into a supporting
table. So it is compiled only ONCE. 

My view currently (it changes often :), is, why learn
a templating language when you can use eruby and some
basic but powerful ruby (for popping in vars/iterating
etc)? Keep in mind i dont expect these files to have a
lot of logic - theyre for presentation after all.

Interestingly, all of a sudden, i'm a few short steps
toward having something like zope - content/user 
management, work flow, and to some extent, logic
creation from within the browser.

I'm kind of clued in to the dangers/folly of this, but
you guys out there that know better, rip me up!


PS: I've babbled quite a bit, I know,  but since i'm
at it let me tell you a little more about the overall
system i'm building, why i started it etc.

I'm creating 3 sites currently. All for one customer.

I wanted 
1) To share code between them(for user and content mgt
etc)
2) To be able to have a different look and feel for
each.

So the basics(it is simple!) are, for each site, i
have a config/data file(xml) and a template(eruby).
The config file holds things like what template to
use, admin email, contact info, default title/content,
toolbar items etc.

Adding a new site is trivial (one file in the root
with one line of code). It can have it's own look and
feel or use the default. It has all the capabilities
needed to create the whole site through the browser.

The one thing missing from many of these Web
Application Platforms/Frameworks is the ability to
simply create websites - with content mgt and a common
look and feel. I'm not as interested in the webobjects
or j2ee platform/methodology as i am in creating sites
that are easy to build and maintain. For me, i guess
i'm more interested in a Web Site Platform - that i
can extend as i see fit. The above works pretty good
for me so far. I'd be interested in any constructive
crit you may have.

Paul






__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

Kirk Haines <khaines@en...com>

2004-02-05 17:10:43
On Fri, 6 Feb 2004, paul vudmaska wrote:

> In a simple CMS system i'm creating, i have a ui that
> allows the owner of the site to edit/create (static)
> content on the fly. Then i started thinking that i'd
> like to have some smarts in these files. Instead of
> setting up a harnessing mechanism with Amrita, i added
> a property to the content, executable, and if it is
> on, i complile the text through the eruby compiler and
> eval the code. Dangerous, i know, but it works
> amazingly well so far. Now, I can create content as
> well as logic  on the fly. Right now, within these
> files, the world is my oyster (read destruction zone
> :). 
I used to be a big fan of mixing code right into the HTML, but have, over 
time, developed an aversion to that paradigm.  I don't find that the 
advantages outweigh the disadvantages.

I understand where you are coming from with the approach you have taken.  
I have a static content CMS system that many of my clients use to maintain 
their sites.  I'm reimplementing it in Ruby with better design and a 
better feature set, and one of the things that I wanted to do was to allow 
for the possibility of executable content.

What I have settled on is, basically, a file permissions sort of 
arrangement for the web content.  Each component of content has a 
presentation file, and may have a code file.  Whether a site and a user is 
allowed access to the code files is set by permissions flags.

This lets me setup components that do things like handle the site 
navigation creation and basic page layout, and lets me make them 
uneditable by the client, or lets me make the code portion uneditable, 
whil still, at least potentially, giving the client access to at least 
some of the power of code, if they want/need it themselves, while still 
keeping the code blocks out of the HTML.

> This has obvious advantages(and disadvantages), but it
> also has one BIG advantage that is not immidiately
> clear - i can compile the code with eruby and save
> THAT, <b>which is now pure ruby</b>, into a supporting
> table. So it is compiled only ONCE. 
That is nice.  One of the future enhancements for Iowa that I am looking 
at is the ability to save the components after they have been parsed so 
that on startup, they do not necessarily all have to be reparsed.  While 
the system is running, the components only get reparsed if they change, 
but during startup, if there are a lot of components with a lot of HTML in 
them, parsing all of them can take a while.

> The one thing missing from many of these Web
> Application Platforms/Frameworks is the ability to
> simply create websites - with content mgt and a common
> look and feel. I'm not as interested in the webobjects
> or j2ee platform/methodology as i am in creating sites
> that are easy to build and maintain. For me, i guess
> i'm more interested in a Web Site Platform - that i
> can extend as i see fit. The above works pretty good
> for me so far. I'd be interested in any constructive
> crit you may have.
That is more or less where I am headed, as well.  In my case, clients are 
typically businesses that want to be able to manipulate their site content 
at will without having to worry about the tricky bits like overall site 
layout or getting the navigation right.  So I need a system that lets me 
give them an overall structure, provide certain tools or components to 
them for their use, and that gives them control while at the same time 
limiting the damage that they can do if they mess up.  It needs to be easy 
to setup a site in, easy to change look and feel aspects of the overall 
site with, and I want to use Ruby because I just enjoy using it so damn 
much.

Iowa is about perfect for the way that I work, at least as I have adjusted 
it, and I'm hopeful that after I release the current in-progress code 
tree, that a few other people might give it a whirl.


Kirk Haines

Tom Copeland <tom@in...com>

2004-02-05 17:25:08
On Thu, 2004-02-05 at 12:10, Kirk Haines wrote:
> Iowa is about perfect for the way that I work, at least as I have adjusted 
> it, and I'm hopeful that after I release the current in-progress code 
> tree, that a few other people might give it a whirl.
I know just the place for it!

http://rubyforge.org/ :-)

Tom

Kirk Haines <khaines@en...com>

2004-02-05 17:34:05
On Fri, 6 Feb 2004, Tom Copeland wrote:

> I know just the place for it!
> 
> http://rubyforge.org/ :-)
Probably maybe.  I looked at Rubyforge a couple of months ago but decided 
against it then.  I have the CVS tree local to my development environment 
right now.  When I am ready to release I'll make an entry in RAA and may 
flip Rubyforge then.


Kirk Haines

Carlos <angus@qu...ar>

2004-02-22 02:49:17
>>$SAFE=1
>>
>>ut = "'Hello world'" # untainted string
>>us = ut.intern      # untainted symbol
>>
>>t = gets.chomp # -> happens to be 'Hello world'
>>s = t.intern   # tainted
>>
>>now 'us' points to a tainted symbol... I think that would be
>>undesirable...
>>
> 
> 
> I'm not quite sure what you are trying to point out here. In the above
> example 'us' would always be untainted. To my mind 'us' should have the same
> taint that the string it was created from had.
'us' and 's' refer to the same object.

Symbols are like Fixnums; there is only one object for each different 
symbol. So, "aa".id != "aa".id, but "aa".intern.id == "aa".intern.id.

Jon A. Lambert <jlsysinc@al...net>

2004-02-24 01:50:13
"John W. Long" wrote:
> ---- Jon A. Lambert wrote: ----
> > mod_ruby works only on Apache 1.x
> 
> I'm running it right now on Apache 2.
Oops sorry, you are correct sir.  

I was having trouble under Windows XP.  But r.e. my last post, I have that licked.  
Hopefully that is, at least I haven't encountered any show stoppers since 
yesterday.    :-)

--
J. Lambert
John W. Long wrote:
>
> As the link for the download of ruby-vim. This currently returns a 404. Is
> this the correct link?
Try here:

http://www.rubyforge.org/projects/vim-ruby



daz

John W. Long <ng@jo...com>

2004-03-15 03:19:27
> >
> > As the link for the download of ruby-vim. This currently returns a 404.
Is
> > this the correct link?
> >
>
> Try here:
>
> http://www.rubyforge.org/projects/vim-ruby
Cool. Can this be updated on raa?

--
John
John W. Long wrote:
> >
> > http://www.rubyforge.org/projects/vim-ruby
> >
>
> Can this be updated on raa?
I forwarded your request to Shugo Maeda but it
looks like there's been a change of management.

The new owners won't be authorised to update
the RAA page and I've tried asking RAA admin[1]
on a previous occasion but they seem hesitant
to override the originator's control, even
in cases which may seem obvious to us.


[1] raa-admin@ru...org


daz

Gavin Sinclair <gsinclair@so...au>

2004-03-15 11:55:56
In Reply To Replies: daz
On Monday, March 15, 2004, 2:19:27 PM, John wrote:

>> >
>> > As the link for the download of ruby-vim. This currently returns a 404.
> Is
>> > this the correct link?
>> >
>>
>> Try here:
>>
>> http://www.rubyforge.org/projects/vim-ruby
>>

> Cool. Can this be updated on raa?
It's not the same project.  The RubyForge project contains
configuration files to make Vim work nicer with Ruby (syntax,
indenting, compiler).

Cheers,
Gavin

daz <dooby@d1...uk>

2004-03-16 03:19:49
In Reply To Replies: daz
Gavin Sinclair wrote:
>
>
> It's not the same project. [...]
>
> Cheers,
> Gavin
Oops, when the project names are the same, Google is /not/ our friend :(

.... unless this works for the OP:

http://shugo.net/archive/vim-ruby/vim-6.0h-if_ruby-2.diff.gz


daz
>>
>> http://shugo.net/archive/vim-ruby/vim-6.0h-if_ruby-2.diff.gz
>>
Shugo replies ...


> My ruby support was merged into the upstream version of vim, so
> I'll delete this entry from RAA.

> Thanks a lot,
> Shugo

Jon A. Lambert <jlsysinc@al...net>

2004-02-12 10:00:28
"Jon A. Lambert" wrote:
> I'm running Apache 2.0.43 on Windows XP and trying to setup erb (eruby?).
> 
> I receive the following in the apache error.log
> [error] [client 10.0.0.2] Premature end of script headers: erb
> 
> My http.conf configuration contains:
> AddType application/x-httpd-eruby .rhtml
> Action application/x-httpd-eruby /cgi-bin/erb
FWIW, In case others are having this problem, I finally got erb to work.

I had to make the following modifications to the erb starting script:
115: #      src = $<.read
116:      src = File.new(ENV['PATH_TRANSLATED']).read  # $< is nil 
117:      exit 2 unless src
118:      print "Content-type: text/html\r\n\r\n"    # Malformed header unless content-type given

--
J. Lambert

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-21 09:46:28
Jon A. Lambert wrote:
> 
> Do you know what the difference is between erb.rb and eruby.exe?  
> Is it just that eruby is compiled or are there additional features?
> 
> --
> J. Lambert
Good question, I haven't used erb before, short and honest answer: not 
really, I don't.

AFAIK both embed Ruby, using the taskmanager I noticed that a page that 
uses erb calls ruby.exe, but if is an eruby page it calls itself. Maybe 
someone who really knows will answer. Note the description of ERB: "ERB 
is an implementation of eRuby (embedded ruby)".

ps: I just remembered that one "web app" that I installed, uses erb (I 
thought it was eruby cgi, but no, it's Ruby+cgi+ERB) maybe You would 
want to take a look at it, in sourceforge or RAA look for Tdiary.

John W. Long <ng@jo...com>

2004-02-21 16:02:57
---- Jon A. Lambert wrote: ----
> mod_ruby works only on Apache 1.x

I'm running it right now on Apache 2.
___________________
John Long
www.wiseheartdesign.com

          

Robert <bobx@li...org>

2004-02-21 20:39:52
Jon A. Lambert wrote:
> "Ruby Tuesday" wrote:
<snip>
> BTW this is incorrect.
> print "Content-type: text/html \n\n\n"
> 
> It should be
> print "Content-type: text/html \r\n\r\n"
Is that a Ruby thing? That certainly isn't how Perl does it. Perl does 
the following:

print "Content-type: text/html\n\n";

Which I believe is the standard header.

Charles Comstock <cc1@ce...edu>

2004-02-21 20:49:49
Robert wrote:

> Jon A. Lambert wrote:
> 
>> "Ruby Tuesday" wrote:
> 
> <snip>
> 
>>
>> BTW this is incorrect.
>> print "Content-type: text/html \n\n\n"
>>
>> It should be
>> print "Content-type: text/html \r\n\r\n"
>>
>>
> Is that a Ruby thing? That certainly isn't how Perl does it. Perl does 
> the following:
> 
> print "Content-type: text/html\n\n";
> 
> Which I believe is the standard header.
I'm pretty sure under the rfs your supposed to do \r\n\r\n, but I think 
most servers are setup to just look for a single blank line before 
actual content, and so they generally just look for a \n and thus the 
\n\n works.  But technically it's supposed to be \r\n\r\n I think.

Charles Comstock

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-23 01:49:50
> One way around the problem is to change the extension from .rb to
> cgi or remove the extension.  Apache2 will execute the script based on the
> shebang line.
Well, the same problem appears with Perl(.pl) as well. Anyone has the same
issues. The header "Content-type: text/plain \r\n\r\n" gives me so much
grief in IE6.

> mod_ruby works only on Apache 1.x
I'd love to run mod_ruby which is running in my Linux Redhat 9 but now I
have to use the windows server, I'm stuck --- can't find mod_ruby/eruby
binaries for mswin32 version. Anyone compiled that already? Please share.
Thanks

"Jon A. Lambert" <jlsysinc@al...net> wrote in message
news:001901c3f846$25288ec0$0200000a@agamemnon...
> "Ruby Tuesday" wrote
> > PS: I downloaded Mozilla and test it. It all work out! So, what's the
deal
> > with IE6?
>
> One way around the problem is to change the extension from .rb to
> cgi or remove the extension.  Apache2 will execute the script based on the
> shebang line.
>
> mod_ruby works only on Apache 1.x
>

Kent S. <happy@us...com>

2004-02-23 01:59:49
Ruby Tuesday wrote:

> I'd love to run mod_ruby which is running in my Linux Redhat 9 but now I
> have to use the windows server, I'm stuck --- can't find mod_ruby/eruby
> binaries for mswin32 version. Anyone compiled that already? Please share.
Check out this link: 
http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/

it worked for me in the past.

/kent

This message appeared in a previous month, was never archived, or was lost.

Jon A. Lambert <jlsysinc@al...net>

2004-02-24 00:36:33
"Kent S." wrote:
> Ruby Tuesday wrote:
> 
> > I'd love to run mod_ruby which is running in my Linux Redhat 9 but now I
> > have to use the windows server, I'm stuck --- can't find mod_ruby/eruby
> > binaries for mswin32 version. Anyone compiled that already? Please share.
> 
> Check out this link: 
> http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/
> 
> it worked for me in the past.
Thanks for the link Kent.  It wouldn't work at all for me.  Both ruby-run
and eruby-run crashes the Apache2 child process and causes one to have
to stop and restart Apache.  This is under Windows XP.

So I decided to become an Apache module developer (of sorts) and 
downloaded the Apace2.0.48 source, compiled it in VC++, then
downloaded mod_ruby 1.1.2 source, hand applied the changes from the
above link, compiled that and ended up crashing and burning just as above.
*sniff*

On a whim, well not exactly a whim as I found some related clues in how
mod_php is compiled and linked, I changed the -MD flag passed to the 
compiler to -MT which links in the multi-threaded runtime library staticly
LIBCMT.LIB vs. MSVCRT.DLL, and......

Bingo!  I'm now happily writing Ruby and Eruby code type stuffs.  Whee!

Thanks for the clue. :-)

--
J. Lambert

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-24 00:44:50
Hi Kents, I tried the site you suggested and still give me the error:

Internal Server Error
The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, usenets@ea...net and inform
them of the time the error occurred, and anything you might have done that
may have caused the error.

More information about this error may be available in the server error log.


----------------------------------------------------------------------------
----

Apache/2.0.48 (Win32) DAV/2 mod_ssl/2.0.47 OpenSSL/0.9.7b mod_fastcgi/2.4.2
PHP/4.3.4 mod_ruby/1.1.1 Server at windev Port 80

And this is the error log from the apache:

[Mon Feb 23 18:55:31 2004] [error] mod_ruby: error in ruby
(eval): (eval)uninitialized constant Apache::RubyRun (NameError)
 from (eval):0:in `value'


Below are portion of my httpd.conf for ruby:
LoadModule ruby_module modules/mod_ruby.so

## ClearModuleList
## AddModule mod_ruby.c

<IfModule mod_ruby.c>
  RubyRequire apache/ruby-run
  <Files *.rbx>
   SetHandler ruby-object
   RubyHandler Apache::RubyRun.instance
  </Files>

# Handle *.rhtml files as eRuby files
  RubyRequire apache/eruby-run
  <Files *.rhtml>
   SetHandler ruby-object
   RubyHandler Apache::ERubyRun.instance
  </Files>

  RubySafeLevel 0
</IfModule>

# CGI for ruby
AddType application/x-httpd-ruby .rb
Action application/x-httpd-ruby  /cgi-bin/ruby.exe


"Kent S." <happy@us...com> wrote in message
news:F2d_b.42829$kR3.25049@bi...net...
> Ruby Tuesday wrote:
>
> > I'd love to run mod_ruby which is running in my Linux Redhat 9 but now I
> > have to use the windows server, I'm stuck --- can't find mod_ruby/eruby
> > binaries for mswin32 version. Anyone compiled that already? Please
share.
> Check out this link:
> http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/
>
> it worked for me in the past.
> /kent

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-24 03:49:49
John, would you mind sharing what you did. And if possible, perhaps the
binaries for mod_ruby/eruby and its related static library(if needed). I'd
love to see it working on Apache2/Mod_ruby/Eruby/Ruby-1.8.1

Thanks

"Jon A. Lambert" <jlsysinc@al...net> wrote in message
news:002801c3fa6d$e9b246e0$0200000a@agamemnon...
> "Kent S." wrote:
> > Ruby Tuesday wrote:
> >
> > > I'd love to run mod_ruby which is running in my Linux Redhat 9 but now
I
> > > have to use the windows server, I'm stuck --- can't find
mod_ruby/eruby
> > > binaries for mswin32 version. Anyone compiled that already? Please
share.
> >
> > Check out this link:
> > http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/
> >
> > it worked for me in the past.
> >
>
> Thanks for the link Kent.  It wouldn't work at all for me.  Both ruby-run
> and eruby-run crashes the Apache2 child process and causes one to have
> to stop and restart Apache.  This is under Windows XP.
>
> So I decided to become an Apache module developer (of sorts) and
> downloaded the Apace2.0.48 source, compiled it in VC++, then
> downloaded mod_ruby 1.1.2 source, hand applied the changes from the
> above link, compiled that and ended up crashing and burning just as above.
> *sniff*
>
> On a whim, well not exactly a whim as I found some related clues in how
> mod_php is compiled and linked, I changed the -MD flag passed to the
> compiler to -MT which links in the multi-threaded runtime library staticly
> LIBCMT.LIB vs. MSVCRT.DLL, and......
>
> Bingo!  I'm now happily writing Ruby and Eruby code type stuffs.  Whee!
>
> Thanks for the clue. :-)
>
> --
> J. Lambert
>

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-24 03:49:51
John, would you mind sharing what you did. And if possible, perhaps the
binaries for mod_ruby/eruby and its related static library(if needed). I'd
love to see it working on Apache2/Mod_ruby/Eruby/Ruby-1.8.1

Thanks

"Jon A. Lambert" <jlsysinc@al...net> wrote in message
news:002801c3fa6d$e9b246e0$0200000a@agamemnon...
> "Kent S." wrote:
> > Ruby Tuesday wrote:
> >
> > > I'd love to run mod_ruby which is running in my Linux Redhat 9 but now
I
> > > have to use the windows server, I'm stuck --- can't find
mod_ruby/eruby
> > > binaries for mswin32 version. Anyone compiled that already? Please
share.
> >
> > Check out this link:
> > http://www.moriq.com/ruby/win32-apache2-ruby1.8.1-mod_ruby/
> >
> > it worked for me in the past.
> >
>
> Thanks for the link Kent.  It wouldn't work at all for me.  Both ruby-run
> and eruby-run crashes the Apache2 child process and causes one to have
> to stop and restart Apache.  This is under Windows XP.
>
> So I decided to become an Apache module developer (of sorts) and
> downloaded the Apace2.0.48 source, compiled it in VC++, then
> downloaded mod_ruby 1.1.2 source, hand applied the changes from the
> above link, compiled that and ended up crashing and burning just as above.
> *sniff*
>
> On a whim, well not exactly a whim as I found some related clues in how
> mod_php is compiled and linked, I changed the -MD flag passed to the
> compiler to -MT which links in the multi-threaded runtime library staticly
> LIBCMT.LIB vs. MSVCRT.DLL, and......
>
> Bingo!  I'm now happily writing Ruby and Eruby code type stuffs.  Whee!
>
> Thanks for the clue. :-)
>
> --
> J. Lambert
>

Jon A. Lambert <jlsysinc@al...net>

2004-02-24 04:51:07
----- Original Message ----- 
From: "Ruby Tuesday" <rubytuezdayz@ya...com>
Newsgroups: comp.lang.ruby
To: "ruby-talk ML" <ruby-talk@ru...org>
Sent: Monday, February 23, 2004 10:49 PM
Subject: Re: Puzzling... no longer


> John, would you mind sharing what you did. And if possible, perhaps the
> binaries for mod_ruby/eruby and its related static library(if needed). I'd
> love to see it working on Apache2/Mod_ruby/Eruby/Ruby-1.8.1
> 
> Thanks
I've zipped up my build directory both binaries and the source and put it here:
ftp://wizards.kicks-ass.net

You have to manually copy the mod_ruby.so to your apache modules directory 
and everything in libs/apache to somewhere in your ruby search list.
It was compiled under Windows XP SP1 with VC++ 6.0 using Apache 2.0.48
for ruby-mswin32-1.8.1-11

--
J. Lambert

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-24 05:54:50
Jon, at last! I've been looking for this day and thank you. It works!

Now, I can start learning Ruby web programming. Thanks again

"Jon A. Lambert" <jlsysinc@al...net> wrote in message
news:019201c3fa91$f86f46f0$0200000a@agamemnon...
> ----- Original Message ----- 
> From: "Ruby Tuesday" <rubytuezdayz@ya...com>
> Newsgroups: comp.lang.ruby
> To: "ruby-talk ML" <ruby-talk@ru...org>
> Sent: Monday, February 23, 2004 10:49 PM
> Subject: Re: Puzzling... no longer
>
>
> > John, would you mind sharing what you did. And if possible, perhaps the
> > binaries for mod_ruby/eruby and its related static library(if needed).
I'd
> > love to see it working on Apache2/Mod_ruby/Eruby/Ruby-1.8.1
> >
> > Thanks
>
> I've zipped up my build directory both binaries and the source and put it
here:
> ftp://wizards.kicks-ass.net
>
> You have to manually copy the mod_ruby.so to your apache modules directory
> and everything in libs/apache to somewhere in your ruby search list.
> It was compiled under Windows XP SP1 with VC++ 6.0 using Apache 2.0.48
> for ruby-mswin32-1.8.1-11
>
> --
> J. Lambert
>

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-20 22:09:50
Oops ... I'm using them on the browser. Both of those files is in cgi-bin
directory. I wonder why the text/plain gave me errors.

I'm using Apache2.0.48/Ruby1.8.1. Thanks

The error(s)
First, a pop up windows with the message as follow:
     Some files can harm your computer. If the file information below
     look suspicious, or you do not fully trust the source, do not open or
     save this file.

     File name: ex2.rb
     File type:
     From:       webserver

Would you like to open the file or save it to your computer?

Open     Save   Cancel   More Info

When I click open, a DOS window flashed quickly then dissapear.

Thanks


"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:403698DF.8010307@pr...mx...
> Ruby Tuesday wrote:
> > Hi, I have these 2 files, one work and the other does not.
> >
> > #!c:/apps/ruby/bin/ruby.exe
> > print "Content-type: text/html \n\n\n"
> > print  "1st line "
> > print  "2nd line "
> > print  "3rd line "
> >
> > And this is the other one(DOES NOT WORK!)
> > #!c:/apps/ruby/bin/ruby.exe
> > print "Content-type: text/plain \n\n\n"
> > print  "1st line "
> > print  "2nd line "
> > print  "3rd line "
> >
> > The only difference is that the 2nd file has text/plain in the header
> > instead of text/html. Please advise. Thanks
> Well, both work...what error are you getting?, how are you using those?
> my results:
> Content-type: text/html
>
>
> 1st line 2nd line 3rd line
> and:
> Content-type: text/plain
>
>
> 1st line 2nd line 3rd line
>

Robert <bobx@li...org>

2004-02-20 23:09:51
Ruby Tuesday wrote:

> Oops ... I'm using them on the browser. Both of those files is in cgi-bin
> directory. I wonder why the text/plain gave me errors.
> 
> I'm using Apache2.0.48/Ruby1.8.1. Thanks
> 
> The error(s)
> First, a pop up windows with the message as follow:
>      Some files can harm your computer. If the file information below
>      look suspicious, or you do not fully trust the source, do not open or
>      save this file.
> 
>      File name: ex2.rb
>      File type:
>      From:       webserver
> 
> Would you like to open the file or save it to your computer?
> 
> Open     Save   Cancel   More Info
> 
> When I click open, a DOS window flashed quickly then dissapear.
> 
> Thanks
> 
> 
> "Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
> news:403698DF.8010307@pr...mx...
> 
>>Ruby Tuesday wrote:
>>
>>>Hi, I have these 2 files, one work and the other does not.
>>>
>>>#!c:/apps/ruby/bin/ruby.exe
>>>print "Content-type: text/html \n\n\n"
>>>print  "1st line "
>>>print  "2nd line "
>>>print  "3rd line "
>>>
>>>And this is the other one(DOES NOT WORK!)
>>>#!c:/apps/ruby/bin/ruby.exe
>>>print "Content-type: text/plain \n\n\n"
>>>print  "1st line "
>>>print  "2nd line "
>>>print  "3rd line "
>>>
>>>The only difference is that the 2nd file has text/plain in the header
>>>instead of text/html. Please advise. Thanks
>>
>>Well, both work...what error are you getting?, how are you using those?
>>my results:
>>Content-type: text/html
>>
>>
>>1st line 2nd line 3rd line
>>and:
>>Content-type: text/plain
>>
>>
>>1st line 2nd line 3rd line
>>
>>
Because Apache is interpreting text/html to be HTML and when it sees 
text/plain is looks to the OS for help. My guess is that when you run 
the text/plain one it tries to download the file yes? That is because 
the OS does not have a set MIME type for text/plain.

Or something along those lines...   ; )

HTH

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-20 23:44:51
In my apache configuration, httpd.conf, I have the following:

DefaultType text/plain

I did change it to text/html and restart Apache, it's no go either.

Any advise? Thanks

"Robert" <bobx@li...org> wrote in message
news:romdnbpDFdNNDKvd4p2dnA@ad...com...
> Ruby Tuesday wrote:
>
> > Oops ... I'm using them on the browser. Both of those files is in
cgi-bin
> > directory. I wonder why the text/plain gave me errors.
> >
> > I'm using Apache2.0.48/Ruby1.8.1. Thanks
> >
> > The error(s)
> > First, a pop up windows with the message as follow:
> >      Some files can harm your computer. If the file information below
> >      look suspicious, or you do not fully trust the source, do not open
or
> >      save this file.
> >
> >      File name: ex2.rb
> >      File type:
> >      From:       webserver
> >
> > Would you like to open the file or save it to your computer?
> >
> > Open     Save   Cancel   More Info
> >
> > When I click open, a DOS window flashed quickly then dissapear.
> >
> > Thanks
> >
> >
> > "Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
> > news:403698DF.8010307@pr...mx...
> >
> >>Ruby Tuesday wrote:
> >>
> >>>Hi, I have these 2 files, one work and the other does not.
> >>>
> >>>#!c:/apps/ruby/bin/ruby.exe
> >>>print "Content-type: text/html \n\n\n"
> >>>print  "1st line "
> >>>print  "2nd line "
> >>>print  "3rd line "
> >>>
> >>>And this is the other one(DOES NOT WORK!)
> >>>#!c:/apps/ruby/bin/ruby.exe
> >>>print "Content-type: text/plain \n\n\n"
> >>>print  "1st line "
> >>>print  "2nd line "
> >>>print  "3rd line "
> >>>
> >>>The only difference is that the 2nd file has text/plain in the header
> >>>instead of text/html. Please advise. Thanks
> >>
> >>Well, both work...what error are you getting?, how are you using those?
> >>my results:
> >>Content-type: text/html
> >>
> >>
> >>1st line 2nd line 3rd line
> >>and:
> >>Content-type: text/plain
> >>
> >>
> >>1st line 2nd line 3rd line
> >>
> >>
> >
> >
> >
> Because Apache is interpreting text/html to be HTML and when it sees
> text/plain is looks to the OS for help. My guess is that when you run
> the text/plain one it tries to download the file yes? That is because
> the OS does not have a set MIME type for text/plain.
>
> Or something along those lines...   ; )
> HTH

Jon A. Lambert <jlsysinc@al...net>

2004-02-21 00:02:23
"Ruby Tuesday" wrote:
> The error(s)
> First, a pop up windows with the message as follow:
>      Some files can harm your computer. If the file information below
>      look suspicious, or you do not fully trust the source, do not open or
>      save this file.
Internet Explorer is the problem.  When a content type of text/plain is sent
Internet explorer attempts to open the file using the information in the 
registry based on the file extension.

What Internet Explorer will do is take the output and attempt to run it
through the ruby interpreter.  The same problem happens if you have
ActiveState Perl installed and attempt to view web pages that have *.pl
extensions and content-type text/plain.

BTW this is incorrect.
print "Content-type: text/html \n\n\n"

It should be
print "Content-type: text/html \r\n\r\n"

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-21 00:16:46
Ruby Tuesday wrote:
> Oops ... I'm using them on the browser. Both of those files is in cgi-bin
> directory. I wonder why the text/plain gave me errors.
Thought so ;-)
> I'm using Apache2.0.48/Ruby1.8.1. Thanks
> 
> The error(s)
> First, a pop up windows with the message as follow:
>      Some files can harm your computer. If the file information below
>      look suspicious, or you do not fully trust the source, do not open or
>      save this file.
> 
>      File name: ex2.rb
>      File type:
>      From:       webserver
> 
> Would you like to open the file or save it to your computer?
> 
> Open     Save   Cancel   More Info
> 
> When I click open, a DOS window flashed quickly then dissapear.
> 
>>
And using IE? or I'm wrong?, that behaviour I couldn't recreate it on 
Mozilla(which does the smart thing), IE does the dialog thing, I guess 
this is caused because IE is more intimate with windows and looks up the 
  file types for the .rb extension, either it saves the file or 
downloads it and then executes it(if clicking on open) hence the 
flashing dos window.

Maybe using a .rb extension isn't that good('cos IE will look it up in 
filetypes).

I've to wonder if you're familiar with eruby, I asked how You were using 
it 'cos as normal scripts those run fine and if I paste'em inside a 
.rhtml those also worked as expected(even on IE).

Eruby at http://modruby.net/

look up msg id 92598 to see my setup 2.0.47 + 1.8.1
http://www.ruby-talk.org/ruby/ruby-talk/index.shtml

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-21 03:44:51
Hi Osuka, yes you are right. I'm using IE6.  I'm still puzzled.

Yes, I'm familiar with eruby. I'd rather to use mod_ruby and eruby if I can.
But since I could not find mswin32 binaries for mod_ruby for quite
sometimes, I had to use the CGI method. Perhaps if you can tell me where to
get mswin32 version of the latest eruby/mod_ruby for Ruby 1.8.1 and Apache
2.0.48, I'll take that route.

Much Appreciated.

PS: I downloaded Mozilla and test it. It all work out! So, what's the deal
with IE6?
"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:4036BD4F.1070601@pr...mx...
> Ruby Tuesday wrote:
> > Oops ... I'm using them on the browser. Both of those files is in
cgi-bin
> > directory. I wonder why the text/plain gave me errors.
> Thought so ;-)
> >
> > I'm using Apache2.0.48/Ruby1.8.1. Thanks
> >
> > The error(s)
> > First, a pop up windows with the message as follow:
> >      Some files can harm your computer. If the file information below
> >      look suspicious, or you do not fully trust the source, do not open
or
> >      save this file.
> >
> >      File name: ex2.rb
> >      File type:
> >      From:       webserver
> >
> > Would you like to open the file or save it to your computer?
> >
> > Open     Save   Cancel   More Info
> >
> > When I click open, a DOS window flashed quickly then dissapear.
> >
> >>
> And using IE? or I'm wrong?, that behaviour I couldn't recreate it on
> Mozilla(which does the smart thing), IE does the dialog thing, I guess
> this is caused because IE is more intimate with windows and looks up the
>   file types for the .rb extension, either it saves the file or
> downloads it and then executes it(if clicking on open) hence the
> flashing dos window.
>
> Maybe using a .rb extension isn't that good('cos IE will look it up in
> filetypes).
>
> I've to wonder if you're familiar with eruby, I asked how You were using
> it 'cos as normal scripts those run fine and if I paste'em inside a
> rhtml those also worked as expected(even on IE).
>
> Eruby at http://modruby.net/
>
> look up msg id 92598 to see my setup 2.0.47 + 1.8.1
> http://www.ruby-talk.org/ruby/ruby-talk/index.shtml
>

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-21 06:07:56
Ruby Tuesday wrote:
> Hi Osuka, yes you are right. I'm using IE6.  I'm still puzzled.
> 
> Yes, I'm familiar with eruby. I'd rather to use mod_ruby and eruby if I can.
> But since I could not find mswin32 binaries for mod_ruby for quite
> sometimes, I had to use the CGI method. Perhaps if you can tell me where to
> get mswin32 version of the latest eruby/mod_ruby for Ruby 1.8.1 and Apache
> 2.0.48, I'll take that route.
In the msg 92598 is link to mod_ruby binaries, but I didn't managed to 
make'em work, but eruby is good enough for me.
> Much Appreciated.
> 
> PS: I downloaded Mozilla and test it. It all work out! So, what's the deal
> with IE6?
uh? bad design? not following standards? whatever, I just know that IE 
is a risk so I just don't use it(besides tabbed browsing is addictive).
> "Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
> news:4036BD4F.1070601@pr...mx...
> 
>>
>>Eruby at http://modruby.net/
>>
>>look up msg id 92598 to see my setup 2.0.47 + 1.8.1
>>http://www.ruby-talk.org/ruby/ruby-talk/index.shtml
look there(msg id)
>>
*Hint* always look on Ruby mirrors for binaries, latest eruby is 1.0.5.

second AFAIK(or remember) Mingw32 binaries can be used with 
MSWIN(pragprog) so maybe you want to give it try(is newer and the dl is 
small 59kb)

I guess You're using the pragprog version? then:
http://www.ibiblio.org/pub/languages/ruby/binaries/mswin32/ext/eruby-1.0.4-i386-mswin32-1.8.zip

If you want to try the mingw bins then:
http://www.ibiblio.org/pub/languages/ruby/binaries/mingw/1.8/ext/eruby-1.0.5-i386-mingw32-1.8.tar.gz

have fun ;-)
Adartse

Jon A. Lambert <jlsysinc@al...net>

2004-02-21 06:45:15
"Osuka Adartse" wrote:
> I guess You're using the pragprog version? then:
> http://www.ibiblio.org/pub/languages/ruby/binaries/mswin32/ext/eruby-1.0.4-i386-mswin32-1.8.zip
> 
> If you want to try the mingw bins then:
> http://www.ibiblio.org/pub/languages/ruby/binaries/mingw/1.8/ext/eruby-1.0.5-i386-mingw32-1.8.tar.gz
> 
> have fun ;-)
> Adartse
Do you know what the difference is between erb.rb and eruby.exe?  
Is it just that eruby is compiled or are there additional features?

--
J. Lambert

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-23 01:54:49
Hi Osuka, unfortunately I have no say in what browser to use - I'm stuck
with IE and MS-Windoze.

Reading from the reply, it seems that IE6 has a little bug with header
text/plain. Have anyone encounter that issues? Try to use text/plain and put
some reqular text afterward. It works fine with Mozilla but not with IE.
Thanks

"Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
news:40370FC0.4000608@pr...mx...
> Ruby Tuesday wrote:
> > Hi Osuka, yes you are right. I'm using IE6.  I'm still puzzled.
> >
> > Yes, I'm familiar with eruby. I'd rather to use mod_ruby and eruby if I
can.
> > But since I could not find mswin32 binaries for mod_ruby for quite
> > sometimes, I had to use the CGI method. Perhaps if you can tell me where
to
> > get mswin32 version of the latest eruby/mod_ruby for Ruby 1.8.1 and
Apache
> > 2.0.48, I'll take that route.
> In the msg 92598 is link to mod_ruby binaries, but I didn't managed to
> make'em work, but eruby is good enough for me.
> >
> > Much Appreciated.
> >
> > PS: I downloaded Mozilla and test it. It all work out! So, what's the
deal
> > with IE6?
> uh? bad design? not following standards? whatever, I just know that IE
> is a risk so I just don't use it(besides tabbed browsing is addictive).
> > "Osuka Adartse" <rocioestradacastaneda@pr...mx> wrote in message
> > news:4036BD4F.1070601@pr...mx...
> >
> >>
> >>Eruby at http://modruby.net/
> >>
> >>look up msg id 92598 to see my setup 2.0.47 + 1.8.1
> >>http://www.ruby-talk.org/ruby/ruby-talk/index.shtml
> look there(msg id)
> >>
> *Hint* always look on Ruby mirrors for binaries, latest eruby is 1.0.5.
>
> second AFAIK(or remember) Mingw32 binaries can be used with
> MSWIN(pragprog) so maybe you want to give it try(is newer and the dl is
> small 59kb)
>
> I guess You're using the pragprog version? then:
http://www.ibiblio.org/pub/languages/ruby/binaries/mswin32/ext/eruby-1.0.4-i386-mswin32-1.8.zip
> If you want to try the mingw bins then:
http://www.ibiblio.org/pub/languages/ruby/binaries/mingw/1.8/ext/eruby-1.0.5-i386-mingw32-1.8.tar.gz
> have fun ;-)
> Adartse
>

Osuka Adartse <rocioestradacastaneda@pr...mx>

2004-02-23 03:41:23
Ruby Tuesday wrote:
> Hi Osuka, unfortunately I have no say in what browser to use - I'm stuck
> with IE and MS-Windoze.
> 
> Reading from the reply, it seems that IE6 has a little bug with header
> text/plain. Have anyone encounter that issues? Try to use text/plain and put
> some reqular text afterward. It works fine with Mozilla but not with IE.
> Thanks
Hi!
Others have pointed out that changing the extension would work, so...

added to apache conf

AddType application/x-httpd-ruby .cgi
Action application/x-httpd-ruby "e:/usr/local/bin/ruby.exe"
AddType application/x-httpd-cgi .cgi

changing extensions to "cgi" or anything windows doesn't know about 
should do the trick.

*-*-*-*
Other possibility, is by using an .htaccess(but depends on what a 
.htaccess can override and where), based on Tdiary install instructions, 
*which uses* *.rb and works flawlesly in IE.

#Added this to Apache conf since windows doesn't really
#want to create files with no "filename"
AccessFileName dot.htaccess

#create a dot.access file in the dir where your're using cgi
#and add the lines:

Options +ExecCGI
#notice that Indexes, You might not want that.
Options ExecCGI Indexes
AddHandler cgi-script .ruby
#and renamed the files to *.ruby, I used a ruby ext. but whatever goes
#as long as windows doesn't knows about it(it can't use .rb, IE does the 
dialogs.)

I'm still don't know why Tdiary can use the *.rb files without IE goin' 
dialog mmh, btw all the files keep the shebang.

Sorry to take a time replying, but... is(was) weekend.

Jon A. Lambert <jlsysinc@al...net>

2004-02-24 01:19:01
"Osuka Adartse" wrote:
> 
> I'm still don't know why Tdiary can use the *.rb files without IE goin' 
> dialog mmh, btw all the files keep the shebang.
Doing a scan of the TDiary code, it's because it sets the the content-type to text/html 
for it's webpages.  The only exceptions to setting the content to text/html appear to be 
some pages it would produce for severe errors in exception processing (i.e. traceback
output)

The problem is simple but annoying.  When Internet Explorer encounters a document
with the content-type of text/plain, it searchs for a helper application based on the
documents extension.  

The solution is to change the extension or change the content-type to text/html.

The problem with changing the extension is that if one of the users browsing your
web site has a helper application configured for that extension then IE is going
to use it.  For example changing it *.rbx isn't going to help if the user (say me)
decided to associate *.rbx with their favorite text editor (I have).  So the only
way to be sure the user sees a document with the content-type of text/plain within
the IE browser is to use no extension at all.  That is 'helloworld.rb' becomes
'helloworld'.   This solution is annoying for the developer as maybe their favorite 
editor's syntax highlighting is keyed of the extension.  It's also annoying when trying
to configure your webserver to properly handle files based on their extensions
or having to move these files into special directories or using the location directive.

I've encountered the exact same problems with perl.  I understand how convenient
it is to generate the normal EOL sequence in most languages and use text/plain as
opposed to using html-style EOL sequences and use text/html.  Unfortunately as
most users are using IE, you are left with these choices.

--
J. Lambert

Jon A. Lambert <jlsysinc@al...net>

2004-02-21 06:42:50
"Ruby Tuesday" wrote
> PS: I downloaded Mozilla and test it. It all work out! So, what's the deal
> with IE6?
One way around the problem is to change the extension from .rb to
.cgi or remove the extension.  Apache2 will execute the script based on the
shebang line.  

mod_ruby works only on Apache 1.x

Mark Hubbart <discord@ma...com>

2004-02-22 18:54:28
On Feb 20, 2004, at 7:44 PM, Ruby Tuesday wrote:

> Hi Osuka, yes you are right. I'm using IE6.  I'm still puzzled.
> <snip>
> PS: I downloaded Mozilla and test it. It all work out! So, what's the 
> deal
> with IE6?
If I understand right, when IE gets a text/plain file, It assumes it's 
not really plaintext, and tries to open it as if you had double-clicked 
the file. This would be peculiar to IEWin, I believe.

Now, I don't have anything running windows around here, so I can't test 
this solution, but:

When I installed mod_ruby with my Apace installation, the Apache config 
code that I snipped from a webpage gave ruby executables a ".rbx" 
extension rather than ".rb". Perhaps if you change your httpd.conf to 
accept both extensions... then rename your text/plain example to use 
the ".rbx" extension. I suspect that that would solve the problem.

Good luck!

-Mark

Trey Campbell <drtrey@mi...com>

2004-02-22 15:11:19
Ruby Tuesday wrote:

>I've tried both using \n\n and \r\n\r\n on Perl and Ruby as well. Both
>resulted the same.
>
>When I tried it with Mozilla, the "Content-type: text/plain" works. Do you
>guys think it is the IE things? Thanks
I doubt that it's an IE vs. Mozilla. This is just basic HTTP stuff. The 
RFC specifies that each message header end with a CRLF, with a "line" 
containing only a CRLF separating the headers from the message body. So 
your Content-type header, ending with two (or more) such sequences 
should work; the first to terminate the header the second to separate 
the header and body, and any subsequent ones are treated as part of the 
body.

print "Content-type: text/html\r\n\r\n"
print "Your body goes here..."

Should and, at least in my experience, does work.

The RFC also admonishes applications to be tolerant and accept slightly 
incorrectly formed documents:

"The line terminator for message-header fields is the sequence CRLF. 
However, we recommend that applications, when parsing such headers, 
recognize a single LF as a line terminator and ignore the leading CR."

(from http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.3)

The following works for me:

#!C:/ruby/bin/ruby.exe
print "Content-type: text/html\n\n"
print  "1st line "
print  "2nd line "
print  "3rd line "

I can replace the first line with one ending in \r\n\r\n (what I had 
originally because it's correct, not just tolerated by well-behaved 
applications). I can also replace with \n\n\n (or \r\n\r\n\r\n) which 
generates an extra blank line in the document.

BTW, I'm running on WinXP SP1 with Apache 2.0.47 and Ruby 1.8.0. I 
tested with IE 6.0 and FireFox 0.8. The directory that contains the 
scripts is set up as follows in httpd.conf:

<Directory "C:/Apache2/htdocs/ruby">
    Options Indexes FollowSymLinks ExecCGI
    Order allow,deny
    Allow from all
</Directory>

Bottom line, what you posted *should* work. It seems like something else 
must be going on (that is, the problem's not in your Ruby script itself).

Cheers,
Trey

Ruby Tuesday <rubytuezdayz@ya...com>

2004-02-23 01:54:50
> The following works for me:
>
> #!C:/ruby/bin/ruby.exe
> print "Content-type: text/html\n\n"   <<<<<
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
The above works for me as well on both IE6 and Mozilla. But try to change
the header to the following:

> #!C:/ruby/bin/ruby.exe
> print "Content-type: text/plain\n\n"     <<<<<<<
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
Again, both method works with Mozilla. So, I am begining to think that IE is
mis-behaving! Unfortunately, this is the basic RFC for header.
 Please confirm.

Thanks

"Trey Campbell" <drtrey@mi...com> wrote in message
news:4038C68E.8010805@mi...com...
> Ruby Tuesday wrote:
>
> >I've tried both using \n\n and \r\n\r\n on Perl and Ruby as well. Both
> >resulted the same.
> >
> >When I tried it with Mozilla, the "Content-type: text/plain" works. Do
you
> >guys think it is the IE things? Thanks
> >
> >
> >
> I doubt that it's an IE vs. Mozilla. This is just basic HTTP stuff. The
> RFC specifies that each message header end with a CRLF, with a "line"
> containing only a CRLF separating the headers from the message body. So
> your Content-type header, ending with two (or more) such sequences
> should work; the first to terminate the header the second to separate
> the header and body, and any subsequent ones are treated as part of the
> body.
>
> print "Content-type: text/html\r\n\r\n"
> print "Your body goes here..."
>
> Should and, at least in my experience, does work.
>
> The RFC also admonishes applications to be tolerant and accept slightly
> incorrectly formed documents:
>
> "The line terminator for message-header fields is the sequence CRLF.
> However, we recommend that applications, when parsing such headers,
> recognize a single LF as a line terminator and ignore the leading CR."
>
> (from http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.3)
>
> The following works for me:
>
> #!C:/ruby/bin/ruby.exe
> print "Content-type: text/html\n\n"
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
>
> I can replace the first line with one ending in \r\n\r\n (what I had
> originally because it's correct, not just tolerated by well-behaved
> applications). I can also replace with \n\n\n (or \r\n\r\n\r\n) which
> generates an extra blank line in the document.
>
> BTW, I'm running on WinXP SP1 with Apache 2.0.47 and Ruby 1.8.0. I
> tested with IE 6.0 and FireFox 0.8. The directory that contains the
> scripts is set up as follows in httpd.conf:
>
> <Directory "C:/Apache2/htdocs/ruby">
>     Options Indexes FollowSymLinks ExecCGI
>     Order allow,deny
>     Allow from all
> </Directory>
>
> Bottom line, what you posted *should* work. It seems like something else
> must be going on (that is, the problem's not in your Ruby script itself).
>
> Cheers,
> Trey
>

Trey Campbell <drtrey@mi...com>

2004-02-23 03:25:01
Ruby Tuesday wrote:

>>The following works for me:
>>
>>#!C:/ruby/bin/ruby.exe
>>print "Content-type: text/html\n\n"   <<<<<
>>print  "1st line "
>>print  "2nd line "
>>print  "3rd line "
>>    
>>
>
>The above works for me as well on both IE6 and Mozilla. But try to change
>the header to the following:
>
>  
>
>>#!C:/ruby/bin/ruby.exe
>>print "Content-type: text/plain\n\n"     <<<<<<<
>>print  "1st line "
>>print  "2nd line "
>>print  "3rd line "
>>    
>>
>
>Again, both method works with Mozilla. So, I am begining to think that IE is
>mis-behaving! Unfortunately, this is the basic RFC for header.
> Please confirm.
>
>Thanks
Trying it with the following:

#!C:/ruby/bin/ruby.exe
print "Content-type: text/plain\n\n"
print  "1st line "
print  "2nd line "
print  "3rd line "

Mozilla renders the page (as if it encountered a <pre> tag). IE shows a 
dialog offering to run the associated application (but warning that it 
might not be a good idea to do so). I wouldn't characterize that as 
misbehaving since that's what I'd expect it to do, or at least offer to 
do; it's just doing a better job of recognizing potential helper 
applications than Mozilla is.

Just change the extension to something that's not associated with a 
program (like .rbx) and it works the same as Mozilla. I used the name 
puzzle.rbx and got the same results in both browsers. Shouldn't be a 
problem if you're using the shebang line to run it as a CGI, not via the 
extension.

Cheers,
Trey
On Feb 22, 2004, at 7:25 PM, Trey Campbell wrote:

> Trying it with the following:
>
> #!C:/ruby/bin/ruby.exe
> print "Content-type: text/plain\n\n"
> print  "1st line "
> print  "2nd line "
> print  "3rd line "
>
> Mozilla renders the page (as if it encountered a <pre> tag). IE shows 
> a dialog offering to run the associated application (but warning that 
> it might not be a good idea to do so). I wouldn't characterize that as 
> misbehaving since that's what I'd expect it to do, or at least offer 
> to do; it's just doing a better job of recognizing potential helper 
> applications than Mozilla is.
The mime type is there for a reason. When a file is downloaded, the 
browser is supposed to look at the mime type to figure out what to do. 
If the mime-type is "image/jpeg", that means it's jpeg image, despite 
the fact that it's filename might be "graph.rb" (if it happens to be a 
dynamically created image). A mime type of "text/plain" indicates a 
simple plaintext file, which should be rendered on the screen. The 
browser should NOT try to execute it. If it should be executed, it 
should have a mime type of, I don't know, "executable/ruby" or 
something. If the browser can't recognize the mime type, *then* it 
should feel free to try to figure it out.

A windows pc determines filetypes based on the extension, a mac 
primarily uses the creatorcode and typecode metadata, a unix box uses 
(mostly, i think) magic numbers. All Things Web are supposed to use 
mime types as a bridge. This is to ensure that things like, say, a 
plaintext file, don't get interpreted as, say, an executable ruby 
script.

um.... okay. I'll stop my "standards rant" now.

-Mark

Robert Klemme <bob.news@gm...net>

2004-02-23 19:29:48
"Mark Hubbart" <discord@ma...com> schrieb im Newsbeitrag
news:FE8E6434-65C0-11D8-9977-000502FDD5CC@ma...com...
> On Feb 22, 2004, at 7:25 PM, Trey Campbell wrote:
>
> > Trying it with the following:
> >
> > #!C:/ruby/bin/ruby.exe
> > print "Content-type: text/plain\n\n"
> > print  "1st line "
> > print  "2nd line "
> > print  "3rd line "
> >
> > Mozilla renders the page (as if it encountered a <pre> tag). IE shows
> > a dialog offering to run the associated application (but warning that
> > it might not be a good idea to do so). I wouldn't characterize that as
> > misbehaving since that's what I'd expect it to do, or at least offer
> > to do; it's just doing a better job of recognizing potential helper
> > applications than Mozilla is.
>
> The mime type is there for a reason. When a file is downloaded, the
> browser is supposed to look at the mime type to figure out what to do.
> If the mime-type is "image/jpeg", that means it's jpeg image, despite
> the fact that it's filename might be "graph.rb" (if it happens to be a
> dynamically created image).
Correct so far.

> A mime type of "text/plain" indicates a
> simple plaintext file, which should be rendered on the screen.
I don't subscibe to your relative clause: the fact that data is tagged as
plaintext does not mean it has to be rendered on the screen, especially does
it not mean that the browser should do it.  What happens to a file is
totally client (i.e. browser) dependent, so it might or might not decide to
display it itself or delegate handling to some other entity.  How this
entity is found (via a browser internal mapping or via some OS mechanism) is
again browser and system dependent.

Pragmatically one would expect a text/plain file to appear on the screen,
probably in a browser window or in some text editor.  But it might as well
be saved to disk or whatever, depending on the user's configuration.

> The
> browser should NOT try to execute it. If it should be executed, it
> should have a mime type of, I don't know, "executable/ruby" or
> something.
Well, it need not be named "executable", because there is no inherent
semantics in mime type.  The configuration determines what to do with it.
You could as well configure emacs as handler for a Ruby script.

> If the browser can't recognize the mime type, *then* it
> should feel free to try to figure it out.
Agreed, the mime type should definitely take precedence.

> A windows pc determines filetypes based on the extension,
AFAIK this is not fully correct: I believe that current Windows version are
also capable to identify a file's type via other mechanisms; I believe you
can write handlers and register them with the system that look into files
and determines type etc.  Maybe someone with a bit more Windows insight than
me can comment / correct me.

> a mac
> primarily uses the creatorcode and typecode metadata, a unix box uses
> (mostly, i think) magic numbers. All Things Web are supposed to use
> mime types as a bridge. This is to ensure that things like, say, a
> plaintext file, don't get interpreted as, say, an executable ruby
> script.
Yep.

> um.... okay. I'll stop my "standards rant" now.
:-)

The crucial point with MIME is, that the standard defines a format for
naming file types and a mechanism to register well known types.  But it does
not fix what to do with these files.

Kind regards

    robert

Josef 'Jupp' SCHUGT <jupp@gm...de>

2004-02-24 21:21:22
Hi!

* Mark Hubbart:
> 
> On Feb 22, 2004, at 7:25 PM, Trey Campbell wrote:
> 
> >Trying it with the following:
> >
> >#!C:/ruby/bin/ruby.exe
> >print "Content-type: text/plain\n\n"
> >print  "1st line "
> >print  "2nd line "
> >print  "3rd line "
> >
> >Mozilla renders the page (as if it encountered a <pre> tag). IE
> >shows a dialog offering to run the associated application (but
> >warning that it might not be a good idea to do so). I wouldn't
> >characterize that as misbehaving since that's what I'd expect it
> >to do, or at least offer to do; it's just doing a better job of
> >recognizing potential helper applications than Mozilla is.
> 
> The mime type is there for a reason. When a file is downloaded, the
> browser is supposed to look at the mime type to figure out what to
> do. If the mime-type is "image/jpeg", that means it's jpeg image,
> despite the fact that it's filename might be "graph.rb" (if it
> happens to be a dynamically created image). A mime type of
> "text/plain" indicates a simple plaintext file, which should be
> rendered on the screen. The browser should NOT try to execute it.
The result can be very surprising. Suppose it's some text document 
about a company's division called 'identification division':

print "Content-type: text/plain\n\n"
puts "      *************************"
puts
puts "       IDENTIFICATION DIVISION."
puts
puts "      *************************"
puts
puts "      * identifies new technologies"
puts
puts "      * gives estimates for return rates we expect"
puts
puts "      * finds the optimal portefeuille for you"


It would be quite surprising to see a window pop up asking if the 
browser should run the COBOL program *SCNR*

> If it should be executed, it should have a mime type of, I don't
> know, "executable/ruby" or something. If the browser can't
> recognize the mime type, *then* it should feel free to try to
> figure it out.
Or leave it to the user.

> A windows pc determines filetypes based on the extension, a mac
> primarily uses the creatorcode and typecode metadata, a unix box
> uses (mostly, i think) magic numbers. All Things Web are supposed
> to use mime types as a bridge. This is to ensure that things like,
> say, a plaintext file, don't get interpreted as, say, an executable
> ruby script.
The Unix solution isn't optimal, either. 'English text' can be a
script in a verbose programming language, an elaborated sed script
may be identified as a 'data', etc.

Josef 'Jupp' SCHUGT
-- 
E-Mail: .--- ..- .--. .--. .--.-. --. -- -..- .-.-.- -.. .
http://oss.erdfunkstelle.de/ruby/    -     German comp.lang.ruby FAQ
http://rubyforge.org/users/jupp/     -     Ruby projects at Rubyforge

gabriele renzi <surrender_it@rc...com>

2004-02-24 08:19:51
il Tue, 24 Feb 2004 01:03:06 -0500, "Ruby Tuesday"
<rubytuezdayz@ya...com> ha scritto::

>I'm excited. Thanks to Jon and Kent, now we have mod_ruby/eruby binaries for
>
>> I've zipped up my build directory both binaries and the source and put it
>here:
>> ftp://wizards.kicks-ass.net
>>
wonderful, thanks :)
btw, It would be really cool if there was a one-click installer ;)

dhtapp <dhtapp@co...net>

2004-02-24 22:34:50
My first suggestion would be to
1.  make a to-many relationship to the image records,
2.  to store any IMG attributes parsed from the HTML in the image records
themselves (with maybe an ordering attribute within the to-many set, in case
sliced images are bumped up against each other for positioning), and
3.  To decide whether to store the images themselves on a filesystem with
pathnames in the records, or to store image data as BLOBS within the records
themselves.

If you need to retrieve the images through a non-HTTP pipeline into another
process, then BLOBS may be the way to go.  If I was simply going to generate
dynamic HTML, then I'd probably go ahead and put the images out on a
filesystem where both the database and the Webserver could get to 'em.

- dan




"Ruby Tuesday" <rubytuzdayz@ya...com> wrote in message
news:c1gidb$1j6abi$1@ID...de...
> I'm wondering if anyone ever come across an example on how to parse an
html
> table(with images) using either XSLT or Ruby scripts.
>
> I'd like to be able to extract all the data and put them in the
> database(MySQL, SQLite, etc).
>
> There's a twist though, some of the image cells has 2 or more jpeg images
> instead of one. Since I'm not an expert database designer, how do you do
> that?
>
> Table fields:
> ------------
> xnum    text(40)         unique
> image   jpeg image     (may have none, or 1+ images)
> desc     memo(256)
> loc       memo(256)
>
> Thanks.
>

This message appeared in a previous month, was never archived, or was lost.

Mark Hubbart <discord@ma...com>

2004-02-24 22:57:15
"Ruby Tuesday" <rubytuzdayz@ya...com> wrote in message
news:c1gidb$1j6abi$1@ID...de...
> I'm wondering if anyone ever come across an example on how to parse an 
> html
> table(with images) using either XSLT or Ruby scripts.
>
> I'd like to be able to extract all the data and put them in the
> database(MySQL, SQLite, etc).
>
> There's a twist though, some of the image cells has 2 or more jpeg 
> images
> instead of one. Since I'm not an expert database designer, how do you 
> do
> that?
>
> Table fields:
> ------------
> xnum    text(40)         unique
> image   jpeg image     (may have none, or 1+ images)
> desc     memo(256)
> loc       memo(256)
>
> Thanks.
It's been a while since I worked with databases, but perhaps something 
like this:

table 1: "cells"
- id     int       autoincrement primary_key
- xnum   text(40)	unique
- desc   ...
- loc    ...

table 2: "images"
- id      int  autoincrement primary_key
- cell_id int  index
- image   blob


that way, more than one image could be linked to the same cell_id. then:

SELECT image, xnum FROM images, cells WHERE cell_id = cells.id;

...to select a list of records conating to fields: image data, and cell 
numbers (assuming that's what the xnum is)

Alternatively, you could forgo the ids, and link images via xnums. But 
I understand that using ids is the "right" way, whatever that means. :)

Ara.T.Howard <ahoward@fa...gov>

2004-05-04 04:23:58
On Mon, 3 May 2004, Sarah Tanembaum wrote:

> Pointers, please...
> 
> I have this text in a comma delimited file with the following
> characteristic:
> 
> ccc-123456, <multiline data>,
> 
> Field number:
> 
> 1a - its always begin with 1 to 3 characters followed by
>       a dash, e.g JKL-, A-, NM-, PQ-
> 
> 1b - after the dash, it follows by numbers starting from
>      1 to 99999
> 
> 2 -  a multiline data with either or both newline chars(\n)
>        and/or cariage-return char(\r), or both(\r\n). This field
>        might include special characters such as a
>        single(') or double(") quote, a space, characters
>        with ascii number > 127 - accented character,
>        umlaud, etc ...
> 
> 3 -  this field contain at least 2 line to at most 5 line of
>        data where each line might be
>        Begin with 2-3 chars, e.g GH@OPRJGPF1234
>        followed by an "@", 1-7chars, and followed by
>        1-4 numbers
> 
> My question is :
> 
> 1a. how to parse the first field(field 1a) so I can manipulate/rename it to
> a new label dending on what label they have currently
what exactly do you mean by this?  if you want to parse the fields themselves
out use the 'csv' module included with ruby...

> 1b. in field 1b, instead of just 1 number, I'd like to pad
> them with leading zero so, 1 -> 000001,
> 1494 -> 001494, 560987->560987(no change).
  ~ > ruby -e 'p(sprintf("%06.6d", 42))'
  "000042"

  ~ > man 3 printf

> 2. capture 2nd field and escape the special characters with ascii number
    esc = '\\'[0]
    munged = ''
    field_2.each_byte{|c| munged << esc if c > 127; munged << c} 
    field_2 = munged

  you could also use a regex to do this...

    special = %r/([#{ 127.chr }-#{ 255.chr })]/o
    field_2.gsub!(special){|match| "\\#{ match }"}

> 3. capture 3rd field and parse them as well just as field 1.
> 
> THanks
can you post some sample data?  we could probably say more then...


-a
-- 
===============================================================================
| EMAIL   :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE   :: 303.497.6469
| ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
| URL     :: http://www.ngdc.noaa.gov/stp/
| TRY     :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done 
===============================================================================

Mehr, Assaph (Assaph) <assaph@av...com>

2004-05-04 03:43:17
> I have this text in a comma delimited file with the following
> characteristic:
> 
> ccc-123456, <multiline data>,
> 
> Field number:
> 
> 1a - its always begin with 1 to 3 characters followed by
>       a dash, e.g JKL-, A-, NM-, PQ-
> 
> 1b - after the dash, it follows by numbers starting from
>      1 to 99999
> 
> 2 -  a multiline data with either or both newline chars(\n)
>        and/or cariage-return char(\r), or both(\r\n). This field
>        might include special characters such as a
>        single(') or double(") quote, a space, characters
>        with ascii number > 127 - accented character,
>        umlaud, etc ...
> 
> 3 -  this field contain at least 2 line to at most 5 line of
>        data where each line might be
>        Begin with 2-3 chars, e.g GH@OPRJGPF1234
>        followed by an "@", 1-7chars, and followed by
>        1-4 numbers
> 
> My question is :
> 
> 1a. how to parse the first field(field 1a) so I can manipulate/rename
it to
> a new label dending on what label they have currently
> 
> 1b. in field 1b, instead of just 1 number, I'd like to pad
> them with leading zero so, 1 -> 000001,
> 1494 -> 001494, 560987->560987(no change).
> 
> 2. capture 2nd field and escape the special characters with ascii
number
> 3. capture 3rd field and parse them as well just as field 1.
Untested code:
=============

rex = %r|(\w{1,3})-(\d+),(.*),((\w{2,3}@\w{1,7}\d{1,4}){2,5})|

new_text = old_text.gsub(rex) {
  # rename label
  label = case $1
    when 'JKL' then 'newJKL'
    when 'AN'  then 'newAN'
  end

  # number padding
  num = sprintf("%03d", "1")

  # handle escaping for $3
  ...

  # parse field $4

  # return new construct:
  "#{label}-#{num},#{new_4_field}, #{new_4_field}"
}

Rove Monteux <rove.monteux@fl...com>

2004-05-04 17:30:31
Bit offtopic, but yes, indeed it is. Starting point on that,

http://advocacy.postgresql.org/casestudies/


Cheers

Rove


--
Rove Monteux
Systems Administrator


Sarah Tanembaum wrote:

>Beside its an opensource and supported by community, what's the fundamental
>differences between PostgreSQL and those high-price commercial database (and
>some are bloated such as Oracle) from software giant such as Microsoft SQL
>Server, Oracle, and Sybase?
>
>Is PostgreSQL reliable enough to be used for high-end commercial
>application? Thanks
>

Volker Hetzer <volker.hetzer@ie...org>

2004-05-04 17:38:57
"Sarah Tanembaum" <sarah.tanembaum@ya...com> schrieb im Newsbeitrag news:c78jfi$vomj$1@ID...de...
> Beside its an opensource and supported by community, what's the fundamental
> differences between PostgreSQL and those high-price commercial database (and
> some are bloated such as Oracle) from software giant such as Microsoft SQL
> Server, Oracle, and Sybase?
> 
> Is PostgreSQL reliable enough to be used for high-end commercial
> application? Thanks
No idea. What I like about oracle is the tools, especially rman and the wizards
and also the support. Paying for something gives me power over the guy I pay.
Also, I like to have lots of little screws to tailor my database to the specific hardware
and load profile.

Lots of Greetings!
Volker

Fred Emmott <pcfreak65@ho...com>

2004-05-04 18:23:56
Sarah Tanembaum wrote:

> Beside its an opensource and supported by community, what's the
> fundamental differences between PostgreSQL and those high-price commercial
> database (and some are bloated such as Oracle) from software giant such as
> Microsoft SQL Server, Oracle, and Sybase?
> 
> Is PostgreSQL reliable enough to be used for high-end commercial
> application? Thanks
I would recommend MySQL if you are looking for an alternative. I know
nothing of PostgreSQL, but I know that MySQL is suitable for use as a
high-usage database.

Fred

Tom Copeland <tom@in...com>

2004-05-04 18:31:05
On Tue, 2004-05-04 at 14:23, Fred Emmott wrote:
> > Is PostgreSQL reliable enough to be used for high-end commercial
> > application? Thanks
PostgreSQL runs RubyForge... it's not very high volume - half million
records, 70-80K queries a day - but it does the job.

<shameless>
Good tools for it too!  http://pqa.rubyforge.org/
</shameless>

Yours,

Tom

Armin Roehrl <armin@xs...de>

2004-05-04 18:45:14
Postgresql and MySQL are both very impressive.

The latest Oracle 10g comes with zillions of features that might
be relevant to you or not.

Oracle 10g has many features you might maybe never need,
but mysql cluster does not yet contain.  I do not know much
about the latest DB2 clustering possibilities.

These "monster" Databases like Oracle are more than just
a database. You have tons of platform integration possibilities.

I think the choice really depends on what you are going todo
and there is no simple answer.

Good luck,
  -Armin

mikharakiri_nospaum@ya...com (Mikito Harakiri)

2004-05-05 01:38:58
Fred Emmott <pcfreak65@ho...com> wrote in message news:<1d3lm1-js6.ln1@fr...lan>...
> I would recommend MySQL if you are looking for an alternative. I know
> nothing of PostgreSQL, but I know that MySQL is suitable for use as a
> high-usage database.
You are kidding, right? Out of curiosity I took a look at MySQL
performance tuning manual. It's almost empty. The example where their
engine picks up Cartesian Product due to type mismatch is strikingly
naive. Scanning a single table by index that MySQL seems to emphasize
is not a benchmark.

Daniel Morgan <damorgan@x....edu>

2004-05-04 18:43:56
Sarah Tanembaum wrote:

> Beside its an opensource and supported by community, what's the fundamental
> differences between PostgreSQL and those high-price commercial database (and
> some are bloated such as Oracle) from software giant such as Microsoft SQL
> Server, Oracle, and Sybase?
> 
> Is PostgreSQL reliable enough to be used for high-end commercial
> application? Thanks
PostgreSQL is highly overrated and not suitable for any environment
where little things like crash recovery and security are a priority.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan@x....edu
(replace 'x' with a 'u' to reply)

rkusenet <rkusenet@sy...ca>

2004-05-04 19:33:57
"Daniel Morgan" <damorgan@x....edu> wrote

> > Beside its an opensource and supported by community, what's the fundamental
> > differences between PostgreSQL and those high-price commercial database (and
> > some are bloated such as Oracle) from software giant such as Microsoft SQL
> > Server, Oracle, and Sybase?
> >
> > Is PostgreSQL reliable enough to be used for high-end commercial
> > application? Thanks
>
> PostgreSQL is highly overrated and not suitable for any environment
> where little things like crash recovery and security are a priority.
Why postgresSQL?? Why don't u say that all RDBMS except Oracle is
highly overrated. This way u don't have to fear about ur job for any
foreseeable future.

Your attitude reminds me of the attitude Americans had towards outsourcing
some 4/5 yrs ago. At that time all they could do is to arrogantly dismiss
outsourcing as unsustainable model. We all know what happened to them today.

I see lot of similarity between movement towards outsourcing few yrs
ago and now movement towards open source database. US companies, after
achieving cost savings thru outsourcing will next turn their attention
to money guzzling enterprise software like RDBMS. How long do you think
it will take them to realize that most of them don't deserve the price
tag they pay.

See ya after 3 yrs in Bangalore :-)

This message appeared in a previous month, was never archived, or was lost.

rkusenet wrote:

> "Daniel Morgan" <damorgan@x....edu> wrote
> 
> 
>>>Beside its an opensource and supported by community, what's the fundamental
>>>differences between PostgreSQL and those high-price commercial database (and
>>>some are bloated such as Oracle) from software giant such as Microsoft SQL
>>>Server, Oracle, and Sybase?
>>>
>>>Is PostgreSQL reliable enough to be used for high-end commercial
>>>application? Thanks
>>
>>PostgreSQL is highly overrated and not suitable for any environment
>>where little things like crash recovery and security are a priority.
> 
> 
> Why postgresSQL?? Why don't u say that all RDBMS except Oracle is
> highly overrated
Because saying so wouldn't be true. There are documented security and
recovery practices for all of the commercial RDBMS products. There are
books, case studies, and years of experience from industry professionals
supporting the fact that while they may be different ... they all work.
The same can not be said for PostgreSQL. MySQL, in this regard, has a
far better record.

Care to disagree? Fine. Provide the names of 5 major commercial
installations of PostgreSQL.

I'll do it for the Oracle side.
  1. Amazon.com
  2. Mastercard
  3. Visa
  4. Federal Bureau of Investigation
  5. Boeing Commercial Airplane Group
  6. Bank of America
  7. Washington Mutual Bank
  8. American Express
  9. Starbucks
10. Oracle Corporation

There ... gave you five more for free. If you've got something to
talk about ... name names ... otherwise stop promoting freeware
as though it was worth more than its price.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan@x....edu
(replace 'x' with a 'u' to reply)

Carl Youngblood <carl@yo...org>

2004-05-04 21:47:58
Daniel Morgan wrote:

>> Why postgresSQL?? Why don't u say that all RDBMS except Oracle is
>> highly overrated
>
>
> Because saying so wouldn't be true. There are documented security and
...

> There ... gave you five more for free. If you've got something to
> talk about ... name names ... otherwise stop promoting freeware
> as though it was worth more than its price.
Whoa... why the accusatory tone?  I don't think this is an issue that we 
need to get all worked up about.  And I think that there are many 
freeware products that are worth more than their monetary value.  Take 
Apache webserver for instance.  Your comment is a hasty generalization.  
And your cross-posting of this message has troll written all over it.  
Sorry guys, didn't mean to feed the fire...

Carl

rkusenet <rkusenet@sy...ca>

2004-05-05 01:28:59
"Daniel Morgan" <damorgan@x....edu> wrote

> Because saying so wouldn't be true. There are documented security and
> recovery practices for all of the commercial RDBMS products. There are
> books, case studies, and years of experience from industry professionals
> supporting the fact that while they may be different ... they all work.
> The same can not be said for PostgreSQL. MySQL, in this regard, has a
> far better record.
>
> Care to disagree? Fine. Provide the names of 5 major commercial
> installations of PostgreSQL.
Mine was a comment on ur attitude towards any non oracle product.
I can show examples where you attacked MYSQL also. Just like you
attack DB2/Informix and your pet hate object SQLServer.

You are right that MySQL has a far better record than PostgreSQL
and IMO they will give all commercial RDBMS a run for their money.

I can only spell PostgreSQL. So I can't name any installations
of PostgreSQL.

> There ... gave you five more for free. If you've got something to
> talk about ... name names ... otherwise stop promoting freeware
> as though it was worth more than its price.
Freeware also includes MySQL. (actually they are no longer free
for profit oriented corporations)
"rkusenet" <rkusenet@sy...ca> wrote in message news:<c79fr5$1bi40$1@ID...de>...
> You are right that MySQL has a far better record than PostgreSQL
> and IMO they will give all commercial RDBMS a run for their money.
> 
> I can only spell PostgreSQL. So I can't name any installations
> of PostgreSQL.
> 
> > There ... gave you five more for free. If you've got something to
> > talk about ... name names ... otherwise stop promoting freeware
> > as though it was worth more than its price.
> 
> Freeware also includes MySQL. (actually they are no longer free
> for profit oriented corporations)
Evident you are mislead by the 'Free is better' religion and you don't
care for robustness and stability. Otherwise you wouldn't state MySQL
will give all commercial RDBMS a run for their money. If you would
honestly compare the architecture of Oracle (and most other commercial
RDBMSes) and you would be frank, you would have to admit MySQL is a
toy. Nothing more, nothing less.
Evidently, there are too many people around in the field, who never
*learned* to develop robust applications and databases, and who mainly
deliver software which is hacked together. Of course, this mentality
perfectly suits the Open Source Community. I wouldn't want to be in
anyone shoes if your silly assertion becomes true, because that means
the bean counters have finally won, and are going to ruin their own
employers by trading in robust, stable and scalable software like
Oracle for toys like MySQL.

Also, you are evidently being dishonest, and contradicting yourself.
You both don't know any PostgreSQL, while you hail it as being better
than Oracle, and you label MySQL as free software, and in the same
phrase you have to admit MySQL isn't true.
I would take better care before you start accusing people here.

Sybrand Bakker
Senior Oracle DBA

Rove Monteux <rove.monteux@fl...com>

2004-05-07 10:12:05
Daniel Morgan wrote:

> rkusenet wrote:
>
>> "Daniel Morgan" <damorgan@x....edu> wrote
>>
>>
>>>> Beside its an opensource and supported by community, what's the 
>>>> fundamental
>>>> differences between PostgreSQL and those high-price commercial 
>>>> database (and
>>>> some are bloated such as Oracle) from software giant such as 
>>>> Microsoft SQL
>>>> Server, Oracle, and Sybase?
>>>>
>>>> Is PostgreSQL reliable enough to be used for high-end commercial
>>>> application? Thanks
>>>
>>>
>>> PostgreSQL is highly overrated and not suitable for any environment
>>> where little things like crash recovery and security are a priority.
>>
>>
>>
>> Why postgresSQL?? Why don't u say that all RDBMS except Oracle is
>> highly overrated
>
>
> Because saying so wouldn't be true. There are documented security and
> recovery practices for all of the commercial RDBMS products. There are
> books, case studies, and years of experience from industry professionals
> supporting the fact that while they may be different ... they all work.
> The same can not be said for PostgreSQL. MySQL, in this regard, has a
> far better record.
>
> Care to disagree? Fine. Provide the names of 5 major commercial
> installations of PostgreSQL.
>
> I'll do it for the Oracle side.
>  1. Amazon.com
>  2. Mastercard
>  3. Visa
>  4. Federal Bureau of Investigation
>  5. Boeing Commercial Airplane Group
>  6. Bank of America
>  7. Washington Mutual Bank
>  8. American Express
>  9. Starbucks
> 10. Oracle Corporation
1. BASF
2. Vanten Inc.
3. Shannon Medical Center
4. Mohawk Software
5. Dravis Group

I myself have implemented solutions based on PostgreSQL in clients such 
as Baltimore.

MySQL has a better record because theres people being paid for doing it. 
For documenting, for making propaganda, etc. MySQL isnt really 'Open 
Source' or 'Freeware' as you *have* to buy a license if you happen to be 
using MySQL for a commercial solution.

In that sense PostgreSQL hasnt all the 'commercial' propaganda behind 
it. PostgreSQL IS freeware AND opensource. Isnt GNU either, so gets no 
GNU (eg. Linux community) support.

Not that any of that affects in its functionality at all, its a great 
product, but people like yourself tied to all the commercial and 
burocratic work tend to ignore.

Bit like Ruby. Pretty sure people that develop and use PostgreSQL would 
bother with it at all.

But now saying that ' they all work.  The same can not be said for 
PostgreSQL. MySQL, in this regard, has a far better record.'.

Give me a break.

If commercial value and propaganda were signal of quality, Windows would 
be the better OS in the world by far. OpenBSD/FreeBSD would be muck. And 
anything not used by Warner, or Amazon.com, and less than $2000 in a tag 
price would be muck as well.

Give me a break.


Cheers


Rove


--
Rove Monteux
Systems Administrator

rove.monteux@fl...com

> There ... gave you five more for free. If you've got something to
> talk about ... name names ... otherwise stop promoting freeware
> as though it was worth more than its price.
>

shoad316@ho...com (Dave)

2004-05-07 14:08:57
Daniel Morgan <damorgan@x....edu> wrote in message news:<1083705347.538046@yasure>...
> Care to disagree? Fine. Provide the names of 5 major commercial
> installations of PostgreSQL.
Here's a newsflash for alot of DBA's.   Most applications _do not_
need a database as powerfull as Oracle.   Like it or not I would bet a
few apps could get by with flat files.  (I'm half joking...)

I've been a DBA for about 8 years and its rare for a company to use
the advanced features of Oracle.  Advanced Queueing, Replication (in
all its forms), RAC, flashback query, VPD, etc. etc.   In all honesty
how often are these features used?   I worked in a dev. shop once
where they were prepared to spend 6 months developing a feature that
could easily be handled by Oracle.  Their reasoning was that they
didn't want to get tied into a particular database.

Now, i'm not a big fan of mysql... The gotchas link someone else
posted in this thread says it all but I think postgresql is a good for
small-mid sized apps.  It has alot of features that mysql is missing. 
Now, would I use it for my production financials system?  Ummm no, but
I would use it for the corporate employee timesheet system.   For
critical applications I wouldn't hesitate to recommend Oracle, in some
cases maybe even SQLServer but there is room for opensource databases.

Matt O'Toole <matt@de...com>

2004-05-08 00:28:56
Daniel Morgan wrote:

 ... otherwise stop promoting freeware
> as though it was worth more than its price.
Your true colors are showing, especially when I see all the newsgroups this is
crossposted to.  Shill be gone!

Matt O.

Daniel Morgan <damorgan@x....edu>

2004-05-08 02:13:54
Matt O'Toole wrote:
> Daniel Morgan wrote:
> 
>  ... otherwise stop promoting freeware
> 
>>as though it was worth more than its price.
> 
> 
> Your true colors are showing, especially when I see all the newsgroups this is
> crossposted to.  Shill be gone!
> 
> Matt O.
I didn't start this thread. So if you wish to shoot the source.
Improve your aim.

And ... BTW ... learn the meaning of words before you use them.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan@x....edu
(replace 'x' with a 'u' to reply)
"rkusenet" <rkusenet@sy...ca> wrote in message news:<c78quu$136n3$1@ID...de>...
> Your attitude reminds me of the attitude Americans had towards outsourcing
> some 4/5 yrs ago. At that time all they could do is to arrogantly dismiss
> outsourcing as unsustainable model. We all know what happened to them today.
Yes, you've got the point. Behind both of these models (outsourcing
and free soft) is the idea that the quality is not important, the only
thing that matter are costs and their cuts. And you're also true that
freeware alternatives will earn their place. In the world where CIO is
one year temp job and the best thing on CIO's CV is cutting cost to
10% and sack off 80% of internal staff because of outsourcing to
India, in this world free databases are very tempting way to go. Of
course, the outcome will be lowered availability, higher maintenance
costs, security problems and damaged business reputation, but who gave
a f*ck, we saved 90% of our internal IT budget.

--
Dusan Bolek

Email: spambin@se...cz
Pls add "Not Guilty" to the subject, otherwise your email is going to
be burnt as a SPAM.

rolo <rohitlodha@ho...com>

2004-05-05 08:15:07
Dusan Bolek wrote:

Yes, you've got the point. Behind both of these models (outsourcing
and free soft) is the idea that the quality is not important, the only
thing that matter are costs and their cuts.

rolo writes:

I disagree. Freewares need to be distinguish as any commercial software.
There are good as well as bad ones. Any general comment on freeware quality
is not justified. Compare Apache, Structs....

I agree on outsourcing to some extent. Most of the companies were putting so
much pressure on prices, Quality definitely suffered or perhaps they were
not bothered. But things have been changing in past year. More and more
companies are outsourcing to India for talent. I demand and get paid nearly
equivalent to US wages here in India. This trend I think is here to stay.

Dusan Bolek wrote:

And you're also true that
freeware alternatives will earn their place. In the world where CIO is
one year temp job and the best thing on CIO's CV is cutting cost to
10% and sack off 80% of internal staff because of outsourcing to
India, in this world free databases are very tempting way to go. Of
course, the outcome will be lowered availability, higher maintenance
costs, security problems and damaged business reputation, but who gave
a f*ck, we saved 90% of our internal IT budget.

rolo writes:

I think statements here are biased to say any cheap is of low quality.


rolo

rkusenet <rkusenet@sy...ca>

2004-05-05 10:18:58
"Dusan Bolek" <pagesflames@us...net> wrote in message news:1e8276d6.0405042216.779e50c6@po...com...

> Yes, you've got the point. Behind both of these models (outsourcing
> and free soft) is the idea that the quality is not important, the only
> thing that matter are costs and their cuts.
This isn't about the subject of this thread, but it got me curious.

Are you suggesting that outsourcing to India means reduction in quality.
I am asking this because what is believed is the other way, that is,
outsourcing to India means better quality work. There was an article
in eweek "time to debunk myth that indian programmers are better".
I will post the link later. Don't have it now.

Michael Shigorin <mike@os...ua>

2004-05-05 12:10:46
On Wed, May 05, 2004 at 03:19:08PM +0900, Dusan Bolek wrote:
> Behind both of these models (outsourcing and free soft) is the
> idea that the quality is not important, the only thing that
> matter are costs and their cuts.
BS.  Revisit your Economics lessons.

> in this world free databases are very tempting way to go. Of
> course, the outcome will be lowered availability, higher
> maintenance costs, security problems and damaged business
> reputation, but who gave a ****, we saved 90% of our internal
> IT budget.
YABS.  Or just trolling? :-)

/me returns to Pickaxe and some LiveCD-related stuff to help
people (*shrug*) cut on their IT/win32 budgets.  That is, throw
less money away.

PS: somehow my spamfilter was totally correct on this post...
probably I'd better ignore the troll altogether. :)

-- 
 ---- WBR, Michael Shigorin <mike@al...ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/

rkusenet <rkusenet@sy...ca>

2004-05-05 14:44:02
"rkusenet" <rkusenet@sy...ca> wrote in message
news:c7af0p$1jfmr$1@ID...de...

> Are you suggesting that outsourcing to India means reduction in quality.
> I am asking this because what is believed is the other way, that is,
> outsourcing to India means better quality work. There was an article
> in eweek "time to debunk myth that indian programmers are better".
> I will post the link later. Don't have it now.
http://www.eweek.com/article2/0,1759,1583257,00.asp?kc=EWNWS050304DTX1K0000599

Daniel Morgan <damorgan@x....edu>

2004-05-05 16:09:04
rkusenet wrote:
> "Dusan Bolek" <pagesflames@us...net> wrote in message news:1e8276d6.0405042216.779e50c6@po...com...
> 
> 
>>Yes, you've got the point. Behind both of these models (outsourcing
>>and free soft) is the idea that the quality is not important, the only
>>thing that matter are costs and their cuts.
> 
> 
> This isn't about the subject of this thread, but it got me curious.
> 
> Are you suggesting that outsourcing to India means reduction in quality.
> I am asking this because what is believed is the other way, that is,
> outsourcing to India means better quality work. There was an article
> in eweek "time to debunk myth that indian programmers are better".
> I will post the link later. Don't have it now.
It depends. For somethings outsourcing to India provides both quality
and quantity for a lower cost. For other things ... for example
corporations trying to lower costs by outsourcing internal app
developement it is definitely a case of lower quality and poorer
implementations.

The thing that must be remembered is that many, if not most, IT projects
fail not due to the quality of the developers (though many are marginal)
but rather due to the lack of clear well written specifications. If the
same specs were handed to me as are sent to Bangalore ... I could easily
beat the Indians at their own game: Delivering better quality at the
same cost in less time.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan@x....edu
(replace 'x' with a 'u' to reply)

Brian Peasland <dba@ym...com>

2004-05-05 16:09:05
rkusenet wrote:
> 
> "rkusenet" <rkusenet@sy...ca> wrote in message
> news:c7af0p$1jfmr$1@ID...de...
> 
> > Are you suggesting that outsourcing to India means reduction in quality.
> > I am asking this because what is believed is the other way, that is,
> > outsourcing to India means better quality work. There was an article
> > in eweek "time to debunk myth that indian programmers are better".
> > I will post the link later. Don't have it now.
> 
> http://www.eweek.com/article2/0,1759,1583257,00.asp?kc=EWNWS050304DTX1K0000599
Aren't you contradicting yourself here? You seem to be implying that
outsourcing to India *does not* mean a reduction in quality and then you
post an article which says the quality is not necessarily better. Which
is your viewpoint?

Cheers,
Brian

-- 
===================================================================

Brian Peasland
dba@re...com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"

rkusenet <rkusenet@sy...ca>

2004-05-05 16:34:06
"Brian Peasland" <dba@re...com> wrote in message
news:4099104F.F5CC564B@re...com...
> rkusenet wrote:
> >
> > "rkusenet" <rkusenet@sy...ca> wrote in message
> > news:c7af0p$1jfmr$1@ID...de...
> >
> > > Are you suggesting that outsourcing to India means reduction in quality.
> > > I am asking this because what is believed is the other way, that is,
> > > outsourcing to India means better quality work. There was an article
> > > in eweek "time to debunk myth that indian programmers are better".
> > > I will post the link later. Don't have it now.
> >
> > http://www.eweek.com/article2/0,1759,1583257,00.asp?kc=EWNWS050304DTX1K0000599
>
> Aren't you contradicting yourself here? You seem to be implying that
> outsourcing to India *does not* mean a reduction in quality and then you
> post an article which says the quality is not necessarily better. Which
> is your viewpoint?
No I am not contradicting. I was giving a link to Dusan Bolek
which shows that how some believe that outsourcing increases quality
and how some think it is not.
if everyone believed like Dusan, why would there be a need to debunk
myth, right? Won't it be taken as granted that outsourcing means
poor quality.

Paul Vudmaska <paul@vu...com>

2004-05-05 16:36:04
Brian Peasland wrote:

>rkusenet wrote:
>  
>
>>"rkusenet" <rkusenet@sy...ca> wrote in message
>>news:c7af0p$1jfmr$1@ID...de...
>>
>>    
>>
>>>Are you suggesting that outsourcing to India means reduction in quality.
>>>I am asking this because what is believed is the other way, that is,
>>>outsourcing to India means better quality work. There was an article
>>>in eweek "time to debunk myth that indian programmers are better".
>>>I will post the link later. Don't have it now.
>>>      
>>>
>>http://www.eweek.com/article2/0,1759,1583257,00.asp?kc=EWNWS050304DTX1K0000599
>>    
>>
>
>Aren't you contradicting yourself here? You seem to be implying that
>outsourcing to India *does not* mean a reduction in quality and then you
>post an article which says the quality is not necessarily better. Which
>is your viewpoint?
>
>Cheers,
>Brian
There is no sense belabouring this because in both places they are just 
people both w/better and lesser skills at certain things in certain 
contexts.Certainly 15k for a programmer is better than 75k. If you look, 
you could find a 15k programmer better thatn the 75k programmer here - 
and vice versa.

Back to the topic of the thread. I've not used Oracle much(and when i 
did it thought it was overly complex) but I've used A LOT of MS SQL and 
mysql (and a little postgres). My needs have been quite simple so i 
really do not know enough to know the things that I might be missing. 
Even after facing(and not fully rectifying) the 'Mysql has gone away' 
problem(from both php and ruby:dbi) I still would rather use mysql than 
mssql. I suppose this has more to do with ruby and less to do with the 
db but that's my pennies worth.

'You get what you pay for'.
'Good enough is good enough when good enough is all you need.'

norwoodthree@my...com (NorwoodThree)

2004-05-05 17:53:57
> This isn't about the subject of this thread, but it got me curious.
> 
> Are you suggesting that outsourcing to India means reduction in quality.
> I am asking this because what is believed is the other way, that is,
> outsourcing to India means better quality work. There was an article
> in eweek "time to debunk myth that indian programmers are better".
> I will post the link later. Don't have it now.
I am going to go out on a limb and say worse quality work because I
can't understand them when I talk to them on the phone.

Richard Torkar <richard.torkar@ht...se>

2004-05-05 18:05:08
On Thu, 2004-05-06 at 02:53 +0900, NorwoodThree wrote:
> > This isn't about the subject of this thread, but it got me curious.
> > 
> > Are you suggesting that outsourcing to India means reduction in quality.
> > I am asking this because what is believed is the other way, that is,
> > outsourcing to India means better quality work. There was an article
> > in eweek "time to debunk myth that indian programmers are better".
> > I will post the link later. Don't have it now.
> 
> I am going to go out on a limb and say worse quality work because I
> can't understand them when I talk to them on the phone.
A Global Survey of Software Development Practices

http://ebusiness.mit.edu/research/papers/178_Cusumano_Intl_Comp.pdf

Best,

Richard

joel-garry@ho...com (Joel Garry)

2004-05-05 22:13:57
"rkusenet" <rkusenet@sy...ca> wrote in message news:<c78quu$136n3$1@ID...de>...
> "Daniel Morgan" <damorgan@x....edu> wrote
> 
> > > Beside its an opensource and supported by community, what's the fundamental
> > > differences between PostgreSQL and those high-price commercial database (and
> > > some are bloated such as Oracle) from software giant such as Microsoft SQL
> > > Server, Oracle, and Sybase?
> > >
> > > Is PostgreSQL reliable enough to be used for high-end commercial
> > > application? Thanks
> >
> > PostgreSQL is highly overrated and not suitable for any environment
> > where little things like crash recovery and security are a priority.
> 
> Why postgresSQL?? Why don't u say that all RDBMS except Oracle is
> highly overrated. This way u don't have to fear about ur job for any
> foreseeable future.
> 
> Your attitude reminds me of the attitude Americans had towards outsourcing
> some 4/5 yrs ago. At that time all they could do is to arrogantly dismiss
> outsourcing as unsustainable model. We all know what happened to them today.
> 
> I see lot of similarity between movement towards outsourcing few yrs
> ago and now movement towards open source database. US companies, after
> achieving cost savings thru outsourcing will next turn their attention
> to money guzzling enterprise software like RDBMS. How long do you think
> it will take them to realize that most of them don't deserve the price
> tag they pay.
> 
> See ya after 3 yrs in Bangalore :-)
There is a backlash against outsourcing now.  Some parts are
sustainable and some are not.  Anyone can do bad java code.  For
administrative purposes, the database (well, not really, it's the
managers) requires someone local.  And the definition of
administration is broadening.

I had come to this conclusion myself, then saw a talk on
administration futures by Guy Harrison where he said it, then a
solicited commercial email from Mike Ault where he said it, too.

Deserving has nothing to do with it.  It's the useful application that
gets the money.

And the drudge development that can be outsourced?  Bangalore is
losing it to China and Eastern Europe.

jg
--
@ho...com is bogus.
http://www.time.com/time/archive/preview/from_search/0,10987,1101040419-610085,00.html
Daniel Morgan <damorgan@x....edu> wrote in message news:<1083695957.163784@yasure>...
> Sarah Tanembaum wrote:
> 
> > Beside its an opensource and supported by community, what's the fundamental
> > differences between PostgreSQL and those high-price commercial database (and
> > some are bloated such as Oracle) from software giant such as Microsoft SQL
> > Server, Oracle, and Sybase?
> > 
> > Is PostgreSQL reliable enough to be used for high-end commercial
> > application? Thanks
> 
> PostgreSQL is highly overrated and not suitable for any environment
> where little things like crash recovery and security are a priority.
What database does Google use?

Steve

Geoff Berrow <blthecat@ck...uk>

2004-05-12 11:58:54
I noticed that Message-ID:
<6f8cb8c9.0405120252.6f31f716@po...com> from Steve contained
the following:

>> PostgreSQL is highly overrated and not suitable for any environment
>> where little things like crash recovery and security are a priority.
>
>What database does Google use?
Google's data is stored in data coops.
http://www.google.com/technology/pigeonrank.html

-- 
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Volker Hetzer <volker.hetzer@ie...org>

2004-05-12 12:13:54
"Steve" <stevesusenet@ya...com> schrieb im Newsbeitrag news:6f8cb8c9.0405120252.6f31f716@po...com...
> Daniel Morgan <damorgan@x....edu> wrote in message news:<1083695957.163784@yasure>...
> > Sarah Tanembaum wrote:
> > 
> > > Beside its an opensource and supported by community, what's the fundamental
> > > differences between PostgreSQL and those high-price commercial database (and
> > > some are bloated such as Oracle) from software giant such as Microsoft SQL
> > > Server, Oracle, and Sybase?
> > > 
> > > Is PostgreSQL reliable enough to be used for high-end commercial
> > > application? Thanks
> > 
> > PostgreSQL is highly overrated and not suitable for any environment
> > where little things like crash recovery and security are a priority.
> 
> What database does Google use?
They offer jobs maintaining a "Linux cluster consisting of more than 10,000 servers".
I doubt that any single database scales that far.

Lots of Greetings!
Volker

Aredridel <aredridel@nb...org>

2004-05-12 15:05:24
> What database does Google use?
Random access memory.

Completely custom, too.

Ari

This message appeared in a previous month, was never archived, or was lost.

This message appeared in a previous month, was never archived, or was lost.

This message appeared in a previous month, was never archived, or was lost.

Doug Hutcheson <doug.blot.hutcheson@nr...au>

2004-05-05 05:53:59
"Tony Marston" <tony@NO...uk> wrote in message
news:c6amar$f5l$1$8300dec7@ne...uk...
> "Useko Netsumi" <usenets_remote_this@ea...net> wrote in message
> news:c69j32$9rkga$1@ID...de...
> > Dan, I think that is what I want to convey to Tony that sure any expert
on
> > any programming language can write anything with that programming
> language,
> > but is it the wise thing to do though when other has done it and thought
> > about that particular function for quite sometimes.
> >
> > Tony, I'm sure that you can do almost everything with PHP, but do you
> think
> > it is wise? Just a question from an experience user. Thanks
>
> Yes, it is wise, IMHO, for the reasons I have already stated:
> (a) I like to keep all my code in PHP modules rather than spread them over
> database triggers and stored procedures. This is what "encapsulation" is
all
> about.
> (b) I can often write code faster in PHP than SQL, so I have no incentive
to
> write SQL other than what is contained within my PHP code.
> (c) There are things you can do in PHP that you cannot do in SQL.
> (d) Debugging triggers or procedures is not easy, so if you have a problem
> it can be very difficult to track down which unit it is in. If all the
code
> is within PHP then it is a simple matter of stepping through with your
> interactive debugger.
> (e) Code inside triggers or procedures MAY execute faster than PHP code,
but
> where the most expensive item nowadays is the cost of the developer then
> this is the area where the greatest savings can be made.
>
> Just my tuppence worth.
>
> --
> Tony Marston
>
> http://www.tonymarston.net
>
>
>
> > "Dan Scott" <dan.scott@ca...com> wrote in message
> > news:c68tvh$svp$1@ha...com...
> > > Tony Marston wrote:
> > >
> > > > You do not need stored procedures or database triggers to write
> > successful
> > > > applications. I once had to maintain a system that was built around
> > > > procedures and triggers, and it was a nightmare. The problem was
that
> > one
> > > > trigger/procedure updated several tables, which fired more triggers
> > which
> > > > contained more updates which fired more triggers ..... It was
> impossible
> > to
> > > > keep track of what was being fired where.
> > >
> > > Design of complex systems is, necessarily, complex. One approach is to
> > > consolidate all of the logic at one layer -- but that can result in
> > > significant performance differences for an app that uses stored
> > > procedures / triggers / functions to avoid communications overhead of
> > > the client-server interactions and to take advantage of the built-in
> > > optimizations the SQL engine can use for stored procedures /
functions.
> > >
> > > > Another reason I prefer to put all my business logic into PHP code
> > instead
> > > > of triggers is that PHP code is a lot easier to debug. Have you come
> > across
> > > > an interactive debugger for database procedures and triggers?
> > >
> > > Not quite on topic, because it's not an open source database, but DB2
> > > does includes an interactive debugger for stored procedures in the DB2
> > > Development Center
> > >
> >
(http://publib.boulder.ibm.com/infocenter/db2help/topic/com.ibm.db2.udb.doc/
> > ad/t0007399.htm)
> > >
> > > In some cases I would argue that issuing a couple of CALL and SELECT
> > > statements is a lot easier than trying to figure out whether you've
> > > introduced a problem in your PHP code or in your SQL statements within
> > > the PHP code.
> > >
> > > Dan
> >
> >
Tony,

I find SPs are useful when invoking complex routine queries against the dbms
on machine 'B' from the PHP instance on machine 'A', when the alterantive is
to load gazillions of rows across the wire from 'B' to 'A' in order to
process them locally.

Triggers are more of a problem. I hate using triggers to perform relational
tasks, such as updating table 'C' in response to an update to table 'D'.
However, triggers can be useful when the update to table 'D' needs to
trigger an external event in the environment of the dbms, especially again
when the dbms machine is not the same as the machine running the script. An
example is a change management workflow system I wrote, where a change to
the status of a change request needs to cause an email to be sent to the
next person in the flow. I implemented this using a trigger on the CR table
and had the dbms server figure out who to email and then send the mail
directly, instead of handing the information back over the wire to a remote
client with an (unknown?) breed and version of mailer software and trusting
the client to send the mail.

In general, I agree with your sentiments, but like all tools, I think SPs
and triggers have their place - it just is not good design to use them to
save thinking about relational integrity and cascading effecs.

Just my $0.02
Doug
--
Remove the blots from my address to reply

This message appeared in a previous month, was never archived, or was lost.

This message appeared in a previous month, was never archived, or was lost.

This message appeared in a previous month, was never archived, or was lost.

This message appeared in a previous month, was never archived, or was lost.

Sascha Ebach <se@he...de>

2004-05-05 07:08:51
Replies: Mark Hubbart
Hi Ryan,

Ryan Pavlik wrote:

> It does... I have found that approach to be rather performance-
> inhibited as you seem to be finding as well.  What I did is make the
> CGI very thin, and do all the work in a persistent backend.  The
> benefits are manifold:
Could you elobarate on what you mean by persistent backend and how it 
avoids the syncronization problems?

-- 
Sascha Ebach                       Hexatex Holistic-Webdesign
Hugo-Junkers-Str. 26               50739 Köln
Web: http://www.hexatex.de         mailto:se@he...de
Tel: 0221 / 5994393                Fax: 0221 / 5994394

Mark Hubbart <discord@ma...com>

2004-05-05 16:13:00
On May 5, 2004, at 12:08 AM, Sascha Ebach wrote:

> Hi Ryan,
>
> Ryan Pavlik wrote:
>
>> It does... I have found that approach to be rather performance-
>> inhibited as you seem to be finding as well.  What I did is make the
>> CGI very thin, and do all the work in a persistent backend.  The
>> benefits are manifold:
>
> Could you elobarate on what you mean by persistent backend and how it 
> avoids the syncronization problems?
(I'm not Ryan, but since he hasn't answered (yet))

I think he's talking about a separate server running in the background, 
which handles all logic and data requests, not serving them in html 
format, just data.

If you build an app that serves data, processes logins, etc., it makes 
it easier to deal with cached data, without having to worry about 
keeping things in sync. The thin cgi front-end requests the data for 
the page, and the persistent app determines whether to send cached data 
or not. This allows you to keep everything in sync, and has several 
fringe benefits: easier sessions, simplified logic, better abstraction.

If you have a decent-sized webapp to build, and your host allows 
persistant processes, this might be the way to go. It makes it so you 
are coding two separate projects: the app, and the website frontend. 
This separation can make things much simpler, IMHO.

cheers,
--Mark

Martin Hart <martin@zs...com>

2004-05-05 15:41:31
On Wednesday 05 May 2004 4:28 pm, Sarah Tanembaum wrote:
> Does anyone out there ever find any info on how to manipulate data from
> ACT!6 (or any versin) using the scripting language?
>
> May be I can learn the scripting language as well using the data I have.
>
> I know that Ruby has the WinOLE connector, but how do I use that function
> to access the ACT! Data?
>
> I'm not aware with other language of WIN32 connector.
I don't profess to know much about ACT!, but how i normally tackle problems 
like this is to use an OLE object viewer to inspect the interface of any COM 
components installed on the machine - and then play around with WIN32OLE 
until something happens.

Probably the easiest way to do it is to use VB to add references or components 
depending on what ACT! ships with and use the Object Browser to look at the 
interface - about the only thing that I'd trust VB for :-)

Once you know the Interface, then the Pickaxe has a useful chapter covering 
Win32OLE and how to use it: (http://www.rubycentral.com/book/win32.html)

Martin

kenfar42@ya...com (Ken)

2004-05-05 19:18:57
"Sarah Tanembaum" <sarah.tanembaum@ya...com> wrote in message news:<c78jfi$vomj$1@ID...de>...
> Beside its an opensource and supported by community, what's the fundamental
> differences between PostgreSQL and those high-price commercial database (and
> some are bloated such as Oracle) from software giant such as Microsoft SQL
> Server, Oracle, and Sybase?
> 
> Is PostgreSQL reliable enough to be used for high-end commercial
> application? Thanks
Depends.

How much is your data worth?  
How much will downtime cost?
How much will a commercial database cost?

PostgreSQL is a really nice little database, and has a lot going for
it:
- easy to install, admin, and use
- easy to port databases between PostgreSQL and other commercial
databases
- very high-quality implementation

However, on the other side of the coin:
- missing many of the high-end features needed in large data volumes
like partitioning, clustering, parallelism, materialized views, query
rewrite, etc.
- missing many of the high-availabity features
- missing lots of the various stuff: replication, etc

Personally, when I've got a lot of value in my database I typically
opt for a commercial offering.  But there are those exceptional
situations - like:
- no budget
- just want to prototype
- it's read-only data and you can create a dozen small databases
- the data isn't super-valuable
Then in these cases - PostgreSQL is a nice little product, and I
wouldn't hesitate to use it.  Much better, btw than its primary
competitor - MySQL with its limited, non-ansi sql, and amazing
exception handling irregularities.


kenfar

quirk@sy...net (Quirk)

2004-05-06 15:14:09
Replies: Volker Hetzer
"Sarah Tanembaum" <sarah.tanembaum@ya...com> wrote in message news:<c78jfi$vomj$1@ID...de>...

> Is PostgreSQL reliable enough to be used for high-end commercial
> application? Thanks
Some rules of thumb, A guide to the perplexed:

- If you don't have the source code for a product, and the right to
modify and redistribute it in perpetuity, nothing you develop on top
of it can be relied upon, so therefore the open source applications,
or applications for wich you've been granted such rights via an
non-expiring licence, are much *MORE* suitable for high-end commercial
applications, since you are not locked into any external dependencies.

- Ideally, your Application's data access will be built around a data
abstraction layer that can use alternative database backends, i.e.
PEAR::DB.

- If your data is really important to you, you will use network, not
application or database level security to protect access to it.

- If your data is really important to you, you will only keep a
secondary copy of it in *ANY* SQL server for indexing and querying
purposes, not as the primary datastore.

- Your primary datastore should be self contained, self describing and
human readable, something like a heirarchy of XML files. This is the
best way to ensure the perminancy and portabilty of your important
data.

- Anyone who calls Free Software 'Freeware', implies that believing in
it is a 'religion' or thinks that it is low quality as a rule should
be considered unskilled labour, not a source of real advice.

I'm also in Berlin BTW :) I hope you had a fun May 1st.

Cheers.

Volker Hetzer <volker.hetzer@ie...org>

2004-05-06 16:08:59
"Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405060711.176b495d@po...com...
> "Sarah Tanembaum" <sarah.tanembaum@ya...com> wrote in message news:<c78jfi$vomj$1@ID...de>...
> 
> > Is PostgreSQL reliable enough to be used for high-end commercial
> > application? Thanks
> 
> Some rules of thumb, A guide to the perplexed:
> 
> - If you don't have the source code for a product, and the right to
> modify and redistribute it in perpetuity, nothing you develop on top
> of it can be relied upon, so therefore the open source applications,
> or applications for wich you've been granted such rights via an
> non-expiring licence, are much *MORE* suitable for high-end commercial
> applications, since you are not locked into any external dependencies.
That's not true. The main problem is not the right to the source code
but the right to get maintenance.
An example: How many corporations had UTF8 built into oracle before
the UTF8 enabled distribution came out?
Who implemented ANSI PL/SQL for mysql before the mysql developers did?
The right to modify is a red herring. If I'm prepared to spend man-years on having
a developer work itself into postgresql or mysql (plus set up all the QA stuff)
I can also ask any other db company for the price of a feature. Or, in case
of old versions, buy vintage support.

> - Ideally, your Application's data access will be built around a data
> abstraction layer that can use alternative database backends, i.e.
> PEAR::DB.
Which either gives me the freedom to write nonportable code
("create bitmap index", "where A(+)=B") or loses efficiency
on all but the dumbest platform.

> - If your data is really important to you, you will use network, not
> application or database level security to protect access to it.
Wrong. If it's important it must not matter whether one tries to
access the data from a local or remote machine. A defense in depth
will always include a securely configured database.


> - If your data is really important to you, you will only keep a
> secondary copy of it in *ANY* SQL server for indexing and querying
> purposes, not as the primary datastore.
The primary store is the safe with the tapes of last night. So what?

> - Your primary datastore should be self contained, self describing and
> human readable, something like a heirarchy of XML files. This is the
> best way to ensure the perminancy and portabilty of your important
> data.
Until the next version can't read the old format (or DTD in the XML case).
In any case, permanency across more than two major database or other
software releases is difficult, regardless of the format.

> - Anyone who calls Free Software 'Freeware', implies that believing in
> it is a 'religion' or thinks that it is low quality as a rule should
> be considered unskilled labour, not a source of real advice.
It's not "low quality" as a rule, at least not as long as one reduces product
quality to code quality. The problem is that as soon as the developers feel
they are fed up with the product or get a real job they dump the code
on you and leave you alone with it. They get nothing, so they are not
required to do anything.
So, I'd only trust mysql if I could do a contract detailing response times,
recovery services, a patch process and all that. Since I then have to
pay anyway, I might as well go for the company that's best at it. Oracle
has a reputation for that and after 5 service requests I've never been
disappointed yet. No idea how IBM or M$Soft do in the service area.

Lots of Greetings!
Volker

This message appeared in a previous month, was never archived, or was lost.

> > - If you don't have the source code for a product, and the right to
> > modify and redistribute it in perpetuity, nothing you develop on top
> > of it can be relied upon, so therefore the open source applications,
> > or applications for wich you've been granted such rights via an
> > non-expiring licence, are much *MORE* suitable for high-end commercial
> > applications, since you are not locked into any external dependencies.

> That's not true. 
Yes it is.

> The main problem is not the right to the source code
> but the right to get maintenance.
With out the right to modify the source code you can have no "right to
maintenenence" as all rights are held by one vendor, exactly the sort
of dependency I recomond avoiding.

> The right to modify is a red herring.
Not if your application and the permenancy of your data is important.

> > - Ideally, your Application's data access will be built around a data
> > abstraction layer that can use alternative database backends, i.e.
> > PEAR::DB.

> Which either gives me the freedom to write nonportable code
> ("create bitmap index", "where A(+)=B") or loses efficiency
> on all but the dumbest platform.
You can always write bad code, my point being that if you are using a
commcial SQL server, such as Oracle, you should abstract your data
access so that you can use something else instead down the road, you
can do this with your own wrappers through elegent coding, or use a
class such as PEAR::DB (for PHP), depending on what your application
requirs. Efficiency is very relative, eficiency of what? Code
Executution? Application Extension? Interoperability? Tip: The first
is not always the most important.

> > - If your data is really important to you, you will use network, not
> > application or database level security to protect access to it.

> Wrong.
Famous last word(s).

> If it's important it must not matter whether one tries to
> access the data from a local or remote machine.
Interesting that you believe that this can not be accomblished with
network security.

> A defense in depth
> will always include a securely configured database.
Yes, a securely configured database, protected by a secure network,
the later being far more important!

> > - If your data is really important to you, you will only keep a
> > secondary copy of it in *ANY* SQL server for indexing and querying
> > purposes, not as the primary datastore.

> The primary store is the safe with the tapes of last night. So what?
Not only last night, but also perhaps thirty years later, or maybe a
hundred in the case of public data, which is why some incomprehensible
filesystem blob, accessible only through a deamon for which you do not
even have the source code will not do, rather as I say, self
contained, self describing, human readable files. The filesystem blob
is designed for optimized access not perpetual storage.

> > - Your primary datastore should be self contained, self describing and
> > human readable, something like a heirarchy of XML files. This is the
> > best way to ensure the perminancy and portabilty of your important
> > data.

> Until the next version can't read the old format (or DTD in the XML case).
What is it about "Self Contained, Self Describing, Human Readable"
that you do not understand?

> In any case, permanency across more than two major database or other
> software releases is difficult, regardless of the format.
For unskilled labour, yes. That is why vendor educated developers who
can not see passed their favourite commercial product should not be
asked for advice on this subject.

> > - Anyone who calls Free Software 'Freeware', implies that believing in
> > it is a 'religion' or thinks that it is low quality as a rule should
> > be considered unskilled labour, not a source of real advice.

> It's not "low quality" as a rule, at least not as long as one reduces product
> quality to code quality. The problem is that as soon as the developers feel
> they are fed up with the product or get a real job they dump the code
> on you and leave you alone with it.
If you have the source code, you are the developer, if you contract an
outside developer or licence an existing product, fine, as long as you
have perpetual access to the source code and the *right* to modify it,
or contract someone else to. If you do not, than you can not gaurantee
the permenance of your application.

Cheers.

Volker Hetzer <volker.hetzer@ie...org>

2004-05-07 09:39:01
"Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405070046.50c2d5dd@po...com...
> > > - If you don't have the source code for a product, and the right to
> > > modify and redistribute it in perpetuity, nothing you develop on top
> > > of it can be relied upon, so therefore the open source applications,
> > > or applications for wich you've been granted such rights via an
> > > non-expiring licence, are much *MORE* suitable for high-end commercial
> > > applications, since you are not locked into any external dependencies.
> 
> > That's not true. 
> 
> Yes it is.
What was the value of this reply?

> > The main problem is not the right to the source code
> > but the right to get maintenance.
> 
> With out the right to modify the source code you can have no "right to
> maintenenence" as all rights are held by one vendor, exactly the sort
> of dependency I recomond avoiding.
I do have the right to maintenance, because that's in the contract. Very simple.

> > The right to modify is a red herring.
> 
> Not if your application and the permenancy of your data is important.
You didn't read my posting, right? I don't *want* to create my own development
team competing with the original one. I don't want to merge my change back into
their code with every new release! I don't want to develop code and then have
them decide whether they condescend to incorporate it or not! I want the authors
of the software to do the coding based on what I'm willing to pay for!

> > > - Ideally, your Application's data access will be built around a data
> > > abstraction layer that can use alternative database backends, i.e.
> > > PEAR::DB.
> 
> > Which either gives me the freedom to write nonportable code
> > ("create bitmap index", "where A(+)=B") or loses efficiency
> > on all but the dumbest platform.
> 
> You can always write bad code, my point being that if you are using a
> commcial SQL server, such as Oracle, you should abstract your data
> access so that you can use something else instead down the road, you
> can do this with your own wrappers through elegent coding,
Elegant coding... The holy grail of software engineering. Why am I spontaneusly
reminded of http://www.dilbert.com/comics/dilbert/archive/dilbert-20040417.html ?

> or use a
> class such as PEAR::DB (for PHP), depending on what your application
> requirs. Efficiency is very relative, eficiency of what? Code
> Executution? Application Extension? Interoperability? Tip: The first
> is not always the most important.
For db computing, reducing server load is the important thing. Interoperability
typically means primitive, network/db intensive sql.

> > > - If your data is really important to you, you will use network, not
> > > application or database level security to protect access to it.
> 
> > Wrong.
> 
> Famous last word(s).
[empty reply]

> > If it's important it must not matter whether one tries to
> > access the data from a local or remote machine.
> 
> Interesting that you believe that this can not be accomblished with
> network security.
Yes. Now you figure out why.

> > A defense in depth
> > will always include a securely configured database.
> 
> Yes, a securely configured database, protected by a secure network,
> the later being far more important!
A network will alway have holes, simply because legitimate users
have to get through and legitimacy can change while they are in.
Therefore you protect the data where they are. In the db.

> > > - Your primary datastore should be self contained, self describing and
> > > human readable, something like a heirarchy of XML files. This is the
> > > best way to ensure the perminancy and portabilty of your important
> > > data.
> 
> > Until the next version can't read the old format (or DTD in the XML case).
> 
> What is it about "Self Contained, Self Describing, Human Readable"
> that you do not understand?
The fact that you believe such a thing exists. Unless you mean a printout
of the database contents.

> > In any case, permanency across more than two major database or other
> > software releases is difficult, regardless of the format.
> 
> For unskilled labour, yes.
Right. You show me how do convert VENUS chip designs into Synopsys
without going into a museom for the original hardware and getting all
the versions in between.

> That is why vendor educated developers who
> can not see passed their favourite commercial product should not be
> asked for advice on this subject.
Get some real world experience.

> > > - Anyone who calls Free Software 'Freeware', implies that believing in
> > > it is a 'religion' or thinks that it is low quality as a rule should
> > > be considered unskilled labour, not a source of real advice.
> 
> > It's not "low quality" as a rule, at least not as long as one reduces product
> > quality to code quality. The problem is that as soon as the developers feel
> > they are fed up with the product or get a real job they dump the code
> > on you and leave you alone with it.
> 
> If you have the source code, you are the developer,
Wrong. I am the user, regardless of whether the vendor wants me to do his
development work or not.

> if you contract an
> outside developer or licence an existing product, fine, as long as you
> have perpetual access to the source code and the *right* to modify it,
> or contract someone else to. If you do not, than you can not gaurantee
> the permenance of your application.
When will you get it, I don't *need* the right to modify it as long as I
have the right to have it modified by the guys who wrote it in the first plac
and are competent at it.

Greetings!
Volker

Howard J. Rogers <hjr@di...com>

2004-05-07 11:19:06
Volker Hetzer wrote:


> You didn't read my posting, right? I don't *want* to create my own development
> team competing with the original one. I don't want to merge my change back into
> their code with every new release! I don't want to develop code and then have
> them decide whether they condescend to incorporate it or not! I want the authors
> of the software to do the coding based on what I'm willing to pay for!
Precisely. There's nothing wrong with contracts, or a willingness to pay 
for a willingness to support. This is where open source can indeed 
become the socialist flim-flam that Microsoft spoke about (though in the 
wrong context, and drawing the wrong conclusions). Good software 
requires a bit more than warm hugs and cuddles. It requires a contract.

And I heartily concur with your point about not wanting to create your 
own development team. Was 200 years of division-of-labour theory in 
vain? I think not. I'd quite happily pay for a competent team to do my 
development for me, if that happens to free me up to do the stuff *I* 
happen to be modestly competent at.

Why such trade-offs should be considered the spawn of Beelzebub, I have 
no idea.

Regards
HJR
"Volker Hetzer" <volker.hetzer@ie...org> wrote in message news:<c7fl8s$bjo$1@nn...com>...

> "Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405070046.50c2d5dd@po...com...

> > > That's not true. 

> > Yes it is.

> What was the value of this reply?
What was the value of yours? Or this latest one?

> > > The main problem is not the right to the source code
> > > but the right to get maintenance.
> > 
> > With out the right to modify the source code you can have no "right to
> > maintenenence" as all rights are held by one vendor, exactly the sort
> > of dependency I recomond avoiding.

> I do have the right to maintenance, because that's in the contract. Very 
> simple.
Yes, you have the right to be overcharged for work that may or may not
not suit your needs by only _one_ vendor, and no right to go elsewhere
when they fail, ignore you outright, stop supporting your application
or vanish from the face of the earth. Have you actually read your
contract or software licence? It only protects the vendor, not you.

> > > The right to modify is a red herring.
> > 
> > Not if your application and the permenancy of your data is important.

> You didn't read my posting, right? 
You are one funny guy. Really. I'll bet you're the first guy in usenet
to ever ask this question rhetoricly.

> I don't *want* to create my own development
> team competing with the original one. I don't want to merge my change back 
> into their code with every new release! I don't want to develop code and
> then have them decide whether they condescend to incorporate it or not! I 
> want the authors of the software to do the coding based on what I'm willing 
> to pay for!
You are dependent on their licence because you built your own
application on top of a platform for which you have no source code,
and no right to modify, you then also have no leverage with the vendor
of the orginal software.

You have no rights at all, wether or not you are willing to pay.

> Elegant coding... The holy grail of software engineering. Why am I 
> spontaneusly reminded of http://www.dilbert.com/comics/dilbert/archive/
> dilbert-20040417.html ?
I dunno, because you're culturaly issolated and have a poor
imagination?

> For db computing, reducing server load is the important thing. 
No, it is not, in most cases CPU is not the most limited resource.

> Interoperability
> typically means primitive, network/db intensive sql.
No, interoperability means abilty to integrate applications in a
heterogeneus environment. It means standards and flexibilty.

> > > If it's important it must not matter whether one tries to
> > > access the data from a local or remote machine.

> > Interesting that you believe that this can not be accomblished with
> > network security.

> Yes. Now you figure out why.
Because you don't know what you are doing maybe? Oh wait, you don't
need to, after all, you have decided to pay a vendor to know for you,
I remember now.

> > Yes, a securely configured database, protected by a secure network,
> > the later being far more important!

> A network will alway have holes, simply because legitimate users
> have to get through and legitimacy can change while they are in.
> Therefore you protect the data where they are. In the db.
If your network has holes, then your database is insecure, because I
can get right at the filesystem blobs, the reverse however is not
true.

> > What is it about "Self Contained, Self Describing, Human Readable"
> > that you do not understand?

> The fact that you believe such a thing exists. Unless you mean a printout
> of the database contents.
What is it about "Self Contained, Self Describing, Human Readable"
that you do not understand?

> > > In any case, permanency across more than two major database or other
> > > software releases is difficult, regardless of the format.

> > For unskilled labour, yes.

> Right. You show me how do convert VENUS chip designs into Synopsys
> without going into a museom for the original hardware and getting all
> the versions in between.
What does this have to do with "Self Contained, Self Describing, Human
Readable" files that can be read on any system past or present?
 
> > That is why vendor educated developers who
> > can not see passed their favourite commercial product should not be
> > asked for advice on this subject.

> Get some real world experience.
Wow. Not only a comedian, but also a master logician.
What a compelling argument, tell me, how much do you know about my
experience, and why do you feel that talking about _me_ is a response
to my argument?

> > If you have the source code, you are the developer,

> Wrong. I am the user, t.
Oh, well then I guess we have nothing further to discuss, my comments
here where meant for actual developers.

> > if you contract an
> > outside developer or licence an existing product, fine, as long as you
> > have perpetual access to the source code and the *right* to modify it,
> > or contract someone else to. If you do not, than you can not gaurantee
> > the permenance of your application.

> When will you get it, I don't *need* the right to modify it as long as I
> have the right to have it modified by the guys who wrote it in the first plac
> and are competent at it.
 
You have no such right, ever, the only right you _can_ have is the
right to modify it yourself or contract someone to do it. Please read
your licence.

Cheers.

edwardh@hi...net (Edward Lloyd Hillman)

2004-05-07 23:18:55
In article <4e20d3f.0405070707.96af5a2@po...com>,
	quirk@sy...net (Quirk) writes:
> "Volker Hetzer" <volker.hetzer@ie...org> wrote in message news:<c7fl8s$bjo$1@nn...com>...
> 
>> "Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405070046.50c2d5dd@po...com...
[stuff snipped]

>> > if you contract an
>> > outside developer or licence an existing product, fine, as long as you
>> > have perpetual access to the source code and the *right* to modify it,
>> > or contract someone else to. If you do not, than you can not gaurantee
>> > the permenance of your application.
> 
>> When will you get it, I don't *need* the right to modify it as long as I
>> have the right to have it modified by the guys who wrote it in the first plac
>> and are competent at it.
>  
> You have no such right, ever, the only right you _can_ have is the
> right to modify it yourself or contract someone to do it. Please read
> your licence.
Got a news flash for ya...

If you have a maintenance contract with a vendor and something of
theirs' is broken, they must fix it if you need it.  I know this
because it happend to us recently at work.  We found something broken
it a version of a prticular commercial RDBMS that had been fixed in a
later release, but due to customer requirements we cannot yet upgrade
to that version (i.e., the customer is unwilling to pay for it at this
time).  The vendor didn't want to fix it but because the customer is
paying them beaucoup bucks for a maintance contract we demanded that
they do so.  They did and supplied us with the necessary patch.

The only way you can get that kind of support is with a maintance
contract.  With Open Source we'd have had to spend many extra
man-hours trying to find where the problem was and how to fix it
without breaking anything else.  And we didn't hace the time to fool
with such nonsense as this occurred in a production application that
had to be up 24x7x365.


-- 
Ed. Hillman
Signature?!?  I don't need no stinking signature!!
edwardh@hi...net (Edward Lloyd Hillman) wrote in message news:<109o67992jbs0c1@ne...com>...

> > You have no such right, ever, the only right you _can_ have is the
> > right to modify it yourself or contract someone to do it. Please read
> > your licence.
> 
> 
> Got a news flash for ya...
Oh boy, it's Seseme Street News, OK Kermit, keep talking.

> If you have a maintenance contract with a vendor and something of
> theirs' is broken, they must fix it if you need it.
Perhaps, but when the product in question is proprietary you have no
recourse when they fail, because no one else has any right to modify
the source code.

When you have a right to the source code you can sign such a contarct
with any firm you like, and fire their ass and hire another when they
fail.

>  I know this
> because it happend to us recently at work.  We found something broken
> it a version of a prticular commercial RDBMS that had been fixed in a
> later release, but due to customer requirements we cannot yet upgrade
> to that version (i.e., the customer is unwilling to pay for it at this
> time).  The vendor didn't want to fix it but because the customer is
> paying them beaucoup bucks for a maintance contract we demanded that
> they do so.  They did and supplied us with the necessary patch.
I'm not sure what this example is supposed to illustrate. The vendor
failed to fix the bug originaly and ony did so under dures, which only
shows how vulnerable you where to begin with, if you had the right to
say 'OK, were going to fire you and give someone else the contract'
they would have fixed your bug pronto with no back talk. In anycase,
you were lucky the vendor did decide to support you, other folks in
the same situatuion have not been so lucky.

> The only way you can get that kind of support is with a maintance
> contract.  With Open Source we'd have had to spend many extra
> man-hours trying to find where the problem was and how to fix it
> without breaking anything else.
Why? You could have the exact same contarct with a vendor supporting
an open source product, or negotiate access to source for the vendors
product, the only difference being that you then have leverage. Or
failing that, your application could have been designed to to give you
alternatives,

You programmed yourself into a corner, and are now trying to use your
folly, which nearly cost you a customer, as a positive example.
Interesting.

It is people like you that warm the hearts of confidence men
everywhere.

>  And we didn't hace the time to fool
> with such nonsense as this occurred in a production application that
> had to be up 24x7x365.
But you put yourself in a position were you may have been unable you
support your own customer _AT_ALL_ except for the good graces of your
vendor. I pitty your customers if they really do expect to get
24x7x365 under such an arrangement.

Cheers.

Volker Hetzer <volker.hetzer@ie...org>

2004-05-10 15:39:03
"Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405100025.fd32875@po...com...
> edwardh@hi...net (Edward Lloyd Hillman) wrote in message news:<109o67992jbs0c1@ne...com>...
> 
> > > You have no such right, ever, the only right you _can_ have is the
> > > right to modify it yourself or contract someone to do it. Please read
> > > your licence.
> > 
> > 
> > Got a news flash for ya...
> 
> Oh boy, it's Seseme Street News, OK Kermit, keep talking.
>  
> > If you have a maintenance contract with a vendor and something of
> > theirs' is broken, they must fix it if you need it.
> 
> Perhaps, but when the product in question is proprietary you have no
> recourse when they fail, because no one else has any right to modify
> the source code.
I have, at most,  the right to sue them, at least, the right to cancel the
contract which hurts them way more than if I go to a postgres developer
and tell him I'm not interested any more. So, unlike open source developers,
they actually have an interest in doing something.

> When you have a right to the source code you can sign such a contarct
> with any firm you like, and fire their ass and hire another when they
> fail.
But it doesn't make sense to use any other firm than the guys who wrote it.
See my other postings and the reply about division of labour. You might
also read up on Maos Great Leap Forward and north coreas policy of doing everything
themselves.

> >  I know this
> > because it happend to us recently at work.  We found something broken
> > it a version of a prticular commercial RDBMS that had been fixed in a
> > later release, but due to customer requirements we cannot yet upgrade
> > to that version (i.e., the customer is unwilling to pay for it at this
> > time).  The vendor didn't want to fix it but because the customer is
> > paying them beaucoup bucks for a maintance contract we demanded that
> > they do so.  They did and supplied us with the necessary patch.
> 
> I'm not sure what this example is supposed to illustrate. The vendor
> failed to fix the bug originaly and ony did so under dures,
The point was that contracts work.

> which only
> shows how vulnerable you where to begin with,
Why was he vulnerable if he had a contract that required the vendor to work?

> if you had the right to
> say 'OK, were going to fire you and give someone else the contract'
> they would have fixed your bug pronto with no back talk.
Maybe, but in case of open source software they'd say 'Good luck
working into our source code, see you in two years'.

> > The only way you can get that kind of support is with a maintance
> > contract.  With Open Source we'd have had to spend many extra
> > man-hours trying to find where the problem was and how to fix it
> > without breaking anything else.
> 
> Why? You could have the exact same contarct with a vendor supporting
> an open source product,
Yes, but then it would cost like any other product, right?

> or negotiate access to source for the vendors
> product, the only difference being that you then have leverage.
The access to the source means nothing, see above.

> Or
> failing that, your application could have been designed to to give you
> alternatives,
Right. And the customer throws away years of experience with one db system
and pulls a finished, reliable and maintainable alternative installation out of the hat.
Including people who have been trained on it.
In what way is a change from oracle to db2 easier than a change from
postgresql to mysql?

> You programmed yourself into a corner, and are now trying to use your
> folly, which nearly cost you a customer, as a positive example.
> Interesting.
> 
> It is people like you that warm the hearts of confidence men
> everywhere.
> 
> >  And we didn't hace the time to fool
> > with such nonsense as this occurred in a production application that
> > had to be up 24x7x365.
> 
> But you put yourself in a position were you may have been unable you
> support your own customer _AT_ALL_ except for the good graces of your
> vendor.
Why? He doesn't support the db. The db vendor does that. All he has to do is to
show that it's othe db's fault, at which point his customer's maintenance
contract with the db vendor kicks in. Normal business practice.

> I pitty your customers if they really do expect to get
> 24x7x365 under such an arrangement.
Oh, they do get it. Because it's in the contract, you know?

Greetings!
Volker
"Volker Hetzer" <volker.hetzer@ie...org> wrote in message news:<c7o7il$u0k$1@nn...com>...

> "Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405100025.fd32875@po...com...
> > edwardh@hi...net (Edward Lloyd Hillman) wrote in message news:<109o67992jbs0c1@ne...com>...
> > 
> > > > You have no such right, ever, the only right you _can_ have is the
> > > > right to modify it yourself or contract someone to do it. Please read
> > > > your licence.
> > > 
> > > 
> > > Got a news flash for ya...
> > 
> > Oh boy, it's Seseme Street News, OK Kermit, keep talking.
> >  
> > > If you have a maintenance contract with a vendor and something of
> > > theirs' is broken, they must fix it if you need it.
> > 
> > Perhaps, but when the product in question is proprietary you have no
> > recourse when they fail, because no one else has any right to modify
> > the source code.

> I have, at most,  the right to sue them,
What cold comfort that is. I would prefer the right to make my
aplication work without their good graces.

Before you consider suing them I suggest you reiview your contact with
an actual lawyer. So you can understand exactly how painted into a
corner you really are.

Good luck in your legal adventures. I prefer to solve my problems by
programming. (my users and clients seem to prefer this too)

> at least, the right to cancel the
> contract which hurts them way more
How can you cancel the contract when your entire application is
dependanton there product? Can you afford to throw away your
application too?

> than if I go to a postgres developer
> and tell him I'm not interested any more. So, unlike open source developers,
> they actually have an interest in doing something.
What on earth are you trying to say here? Why is a postgresql
developer any more or less interested in your contarct than one who
pedals proprietary software?

> > When you have a right to the source code you can sign such a contarct
> > with any firm you like, and fire their ass and hire another when they
> > fail.
> But it doesn't make sense to use any other firm than the guys who wrote it.
Why? What magic powers are possesed by the firm that holds the
copyright? Expcet the power to prevent anyone else from touching or
looking at their code?

> See my other postings and the reply about division of labour. You might
> also read up on Maos Great Leap Forward and north coreas policy of doing 
> everything themselves.
You're not seriously trying to draw me into to a discusion on
communist history are you? If so, please go ahead, it may be
intersting. I've been reading the Fabian writing of George Bernard
Shaw recently myself.

By the way, I am _not_ arguing that one must do everything
themeselves, only that one should not get locked into being dependant
on a single provide.

As I'v said, I'm baffled that this is so controversial that you all
expect me to defend my good name merely for saying it.

> > I'm not sure what this example is supposed to illustrate. The vendor
> > failed to fix the bug originaly and ony did so under dures,

> The point was that contracts work.
It was quite a poorly demonstrated point, as they nearly did and could
well have lost their own customer under the arrangement.

> > which only
> > shows how vulnerable you where to begin with,

> Why was he vulnerable if he had a contract that required the vendor to work?
Because there is no such requirement, you can not really force an
unwilling vendor to do work that do not want to do. If you think you
can, you are delusional. If you have enought legal might, you may be
able to get a refund, usualy limited to the whatever you originaly
paid, not compensating you for you own ivestment.

As the old joke goes: "if this fire alarm fails, and your house burns
down, we will refund the entire purchase price (not including the
battaries)."

> > if you had the right to
> > say 'OK, were going to fire you and give someone else the contract'
> > they would have fixed your bug pronto with no back talk.

> Maybe, but in case of open source software they'd say 'Good luck
> working into our source code, see you in two years'.
Were do you get this idea? You can contract many companies, large and
small, to support your open source product, the difference being that
you can hire another when when they fail, because you have a right to
the source code, where as you have no recource when the provider has
all the rights.

> > > The only way you can get that kind of support is with a maintance
> > > contract.  With Open Source we'd have had to spend many extra
> > > man-hours trying to find where the problem was and how to fix it
> > > without breaking anything else.
> > 
> > Why? You could have the exact same contarct with a vendor supporting
> > an open source product,

> Yes, but then it would cost like any other product, right?
Yes, developing applications costs money, it is this investment I am
advising people to protect by not getting locked into third party
dependencies.

> > or negotiate access to source for the vendors
> > product, the only difference being that you then have leverage.

> The access to the source means nothing, see above.
It means everthing. It means the difference being being the master of
your applications and contracts or being a slave to a third party
vendor.

> > Or
> > failing that, your application could have been designed to to give you
> > alternatives,

> Right. And the customer throws away years of experience with one db system
> and pulls a finished, reliable and maintainable alternative installation out
> of the hat.
Maybe not 'out of the hat' but with less expense and retraining that
having to reprogram the entire application which was programmed with
proprietary bindings everwhere instead of properly abstracted code.

> Including people who have been trained on it.
> In what way is a change from oracle to db2 easier than a change from
> postgresql to mysql?
Well, for one, you would never have to change away from the open
source products because of a dispute with the developer. But in
anycase, my argument is not, and never was, oracle and db2 versus
postgresql or mysql. But rather for abstraction when you do not have
source code, or sometimes then too.

> > But you put yourself in a position were you may have been unable you
> > support your own customer _AT_ALL_ except for the good graces of your
> > vendor.

> Why? He doesn't support the db. The db vendor does that. All he has to do is > to show that it's othe db's fault, at which point his customer's maintenance
> contract with the db vendor kicks in. Normal business practice.
Yes, passing the buck is unfortunalty the normal business practice,
however good firms neither do it or put up with it. I certainly would
not expect my clients or users to be satisfied when I told them, I'm
sorry the application I provided for you doesn't work, but you will
have to discuss this with Larry Ellison. Nor would I be satisfied
giving such an excuse.

BTW, this latest response is much better in tone than your last one, I
hope this is a trend.

Cheers.



 

Volker Hetzer <volker.hetzer@ie...org>

2004-05-12 12:04:06
"Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405110143.3fba4756@po...com...
> "Volker Hetzer" <volker.hetzer@ie...org> wrote in message news:<c7o7il$u0k$1@nn...com>...
>
> > "Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405100025.fd32875@po...com...
> > > edwardh@hi...net (Edward Lloyd Hillman) wrote in message news:<109o67992jbs0c1@ne...com>...
> > >
> > > > > You have no such right, ever, the only right you _can_ have is the
> > > > > right to modify it yourself or contract someone to do it. Please read
> > > > > your licence.
> > > >
> > > >
> > > > Got a news flash for ya...
> > >
> > > Oh boy, it's Seseme Street News, OK Kermit, keep talking.
> > >
> > > > If you have a maintenance contract with a vendor and something of
> > > > theirs' is broken, they must fix it if you need it.
> > >
> > > Perhaps, but when the product in question is proprietary you have no
> > > recourse when they fail, because no one else has any right to modify
> > > the source code.
>
> > I have, at most,  the right to sue them,
>
> What cold comfort that is. I would prefer the right to make my
> aplication work without their good graces.
>
> Before you consider suing them I suggest you reiview your contact with
> an actual lawyer. So you can understand exactly how painted into a
> corner you really are.
Look, we've got about 50 people here dealing with
exactly those questions, telling us what contracts to enter and what not.
When we buy support, we *know* what we are in for and when and
what to sue them for and how to deal with them before we sue them.

> > at least, the right to cancel the
> > contract which hurts them way more
>
> How can you cancel the contract when your entire application is
> dependanton there product? Can you afford to throw away your
> application too?
See my other posting. Compared to changing the application (replacing
it with another), changing the underlying database is easy.

> > than if I go to a postgres developer
> > and tell him I'm not interested any more. So, unlike open source developers,
> > they actually have an interest in doing something.
>
> What on earth are you trying to say here? Why is a postgresql
> developer any more or less interested in your contarct than one who
> pedals proprietary software?
A developer who does not earn mony by it is less interested in providing
work than one who does. Therefore, support contracts make sense.
I was talking about the case where I go to the developer and ask him
to do something for free.

> > > When you have a right to the source code you can sign such a contarct
> > > with any firm you like, and fire their ass and hire another when they
> > > fail.
> > But it doesn't make sense to use any other firm than the guys who wrote it.
>
> Why? What magic powers are possesed by the firm that holds the
> copyright? Expcet the power to prevent anyone else from touching or
> looking at their code?
They developed it.

> > See my other postings and the reply about division of labour. You might
> > also read up on Maos Great Leap Forward and north coreas policy of doing
> > everything themselves.
>
> You're not seriously trying to draw me into to a discusion on
> communist history are you? If so, please go ahead, it may be
> intersting. I've been reading the Fabian writing of George Bernard
> Shaw recently myself.
Right. Mao wanted every village to be self-reliant and do everything on
their own. I think the best published example was that more or less
every village had its own steel factory, resulting in a very low efficiency
and crap steel. If you read about north corea you will sooner or later
stumble on something similar, called "Juche". A fierce desire to be
independent, an inability to recognize you can't be a specialist of
everything and, consequently, a desaster.

> By the way, I am _not_ arguing that one must do everything
> themeselves, only that one should not get locked into being dependant
> on a single provide.
>
> As I'v said, I'm baffled that this is so controversial that you all
> expect me to defend my good name merely for saying it.
>
> > > I'm not sure what this example is supposed to illustrate. The vendor
> > > failed to fix the bug originaly and ony did so under dures,
>
> > The point was that contracts work.
>
> It was quite a poorly demonstrated point, as they nearly did and could
> well have lost their own customer under the arrangement.
Not "nearly", the legal opinion was correct and therefore the only ones
to worry were the sued ones.

> >
> > > which only
> > > shows how vulnerable you where to begin with,
>
> > Why was he vulnerable if he had a contract that required the vendor to work?
>
> Because there is no such requirement,
See my other posting.

> As the old joke goes: "if this fire alarm fails, and your house burns
> down, we will refund the entire purchase price (not including the
> battaries)."
OTOH, "if you install this fire alarm, you will pay less insurance on
the house".

> > > if you had the right to
> > > say 'OK, were going to fire you and give someone else the contract'
> > > they would have fixed your bug pronto with no back talk.
No, they wouldn't, because first they would have to understand the code.

> > Maybe, but in case of open source software they'd say 'Good luck
> > working into our source code, see you in two years'.
>
> Were do you get this idea? You can contract many companies, large and
> small, to support your open source product, the difference being that
> you can hire another when when they fail, because you have a right to
> the source code, where as you have no recource when the provider has
> all the rights.
Like, suse and redhat, each doing their own distributions?
Could you provide a link where IBM actually provides support
for mysql? The only thing I have found is them bragging that  MySQL AB
(fully) supports the AIX port, not that IBM supports MySQL.

> > > > The only way you can get that kind of support is with a maintance
> > > > contract.  With Open Source we'd have had to spend many extra
> > > > man-hours trying to find where the problem was and how to fix it
> > > > without breaking anything else.
> > >
> > > Why? You could have the exact same contarct with a vendor supporting
> > > an open source product,
>
> > Yes, but then it would cost like any other product, right?
>
> Yes, developing applications costs money, it is this investment I am
> advising people to protect by not getting locked into third party
> dependencies.
I do get locked into a third party dependency, even if I can change
the third party. I agree, on the plus side, I can change support without
changing code, so who actually owns the code and merges the
fixes from the other guy, provided they don't want to keep them themselves
because they want to keep the customers?

> > > or negotiate access to source for the vendors
> > > product, the only difference being that you then have leverage.
>
> > The access to the source means nothing, see above.
>
> It means everthing.
Why? I can't change it.

> It means the difference being being the master of
> your applications and contracts or being a slave to a third party
> vendor.
He's my slave because I pay him.

> > > Or
> > > failing that, your application could have been designed to to give you
> > > alternatives,
>
> > Right. And the customer throws away years of experience with one db system
> > and pulls a finished, reliable and maintainable alternative installation out
> > of the hat.
>
> Maybe not 'out of the hat' but with less expense and retraining that
> having to reprogram the entire application which was programmed with
> proprietary bindings everwhere instead of properly abstracted code.
Abstraction can make the job easier, you are right here, but then
changing a database is not that hard too, as long as both are relational ones.

> > Including people who have been trained on it.
> > In what way is a change from oracle to db2 easier than a change from
> > postgresql to mysql?
>
> Well, for one, you would never have to change away from the open
> source products because of a dispute with the developer.
Yes, I would. Because I'm not going to maintain my own database
distribution.

> But in
> anycase, my argument is not, and never was, oracle and db2 versus
> postgresql or mysql. But rather for abstraction when you do not have
> source code, or sometimes then too.
If I have abstraction it's even less necessary to mess around with
the db because it's easier to change the db.

> > > But you put yourself in a position were you may have been unable you
> > > support your own customer _AT_ALL_ except for the good graces of your
> > > vendor.
>
> > Why? He doesn't support the db. The db vendor does that. All he has to do is > to show that it's othe db's fault, at which point
his customer's maintenance
> > contract with the db vendor kicks in. Normal business practice.
>
> Yes, passing the buck is unfortunalty the normal business practice,
> however good firms neither do it or put up with it.
And that is why special libraries, databases or servers exist?

> I certainly would
> not expect my clients or users to be satisfied when I told them, I'm
> sorry the application I provided for you doesn't work, but you will
> have to discuss this with Larry Ellison. Nor would I be satisfied
> giving such an excuse.
It's different for databases.
A) the customer quite often already has a database and expertise
     maintaining it. He has an interest not to have another.
B) the customer may  trust Larry ellison, or IBM more than me.
C) the customer may want a database that can do more than I could
     implement or maintain, like incremental backups, logical/physical
    standby databases or security.
Another case where it's different would, for instance be the OS.
How much linux maintenance do you think you can provide,
compared to redhat or suse? Is this really your corebusiness
or area of expertise?

Greetings!
Volker
"Volker Hetzer" <volker.hetzer@ie...org> wrote in message news:<c7t3p2$b15$1@nn...com>...

> > What cold comfort that is. I would prefer the right to make my
> > aplication work without their good graces.
> >
> > Before you consider suing them I suggest you reiview your contact with
> > an actual lawyer. So you can understand exactly how painted into a
> > corner you really are.

> Look, we've got about 50 people here dealing with
> exactly those questions, telling us what contracts to enter and what not.
> When we buy support, we *know* what we are in for and when and
> what to sue them for and how to deal with them before we sue them.
Your argument, as usual, is that I should just believe you, not
because you have explained yourself, but just because you *know*.

Wether you have 50 people or 100 people 'around there', the fact
remains that it is very unlikely that your investment can be saved by
a lawsuit, for every 50 you have, Oracle has more. And if you do have
more legal might than Oracle, you are the exception, not the rule.

For most organisations, sueng Oracle, or anyother major corporation is
simply not an option.

My orignal comments still hold true, the right to sue is cold comfort,
the right to pick up your pieces and try somewhere else, keeping your
application in tact as much as possible, is better.

> > > at least, the right to cancel the
> > > contract which hurts them way more
> >
> > How can you cancel the contract when your entire application is
> > dependanton there product? Can you afford to throw away your
> > application too?

> See my other posting. Compared to changing the application (replacing
> it with another), changing the underlying database is easy.
Even easier if you have abstracted your data access with a simple
function, and then used that function throught your application. I
have no idea why you find this so hard to believe.

And for what purposes are you bringing up changing the application?
How is this comparison relevent? I am trying to explain how to protect
your investment in your application; to change it as little as
possible.

You make so little sence I wonder what is motivating you to carry on.

Abstraction of your database access is a good idea. Why are you so
hell bent to dispute this.

> > > than if I go to a postgres developer
> > > and tell him I'm not interested any more. So, unlike open source developers,
> > > they actually have an interest in doing something.
> >
> > What on earth are you trying to say here? Why is a postgresql
> > developer any more or less interested in your contarct than one who
> > pedals proprietary software?

> A developer who does not earn mony by it is less interested in providing
> work than one who does.
Why would anyone provide work for you without earning money? Geez, I
feel like I should be earning a paycheque just for talking to you.

As I've said, their are many profesional developers who provide
support for open source products, or provide source licences for their
own.

>  Therefore, support contracts make sense.
Of course they do.

They make even more sence if you are not locked in to a single source.

> I was talking about the case where I go to the developer and ask him
> to do something for free.
Why would anybody do work fo you for free? Are you a charity of some
sort?

> > Why? What magic powers are possesed by the firm that holds the
> > copyright? Expcet the power to prevent anyone else from touching or
> > looking at their code?

> They developed it.
Not necessarily, they merely own the copyright. And even so, that
still does not mean that somebody else can't modify it, and do so
well, sometimes even better than the original developers.

> > > See my other postings and the reply about division of labour. You might
> > > also read up on Maos Great Leap Forward and north coreas policy of doing
> > > everything themselves.
> >
> > You're not seriously trying to draw me into to a discusion on
> > communist history are you? If so, please go ahead, it may be
> > intersting. I've been reading the Fabian writing of George Bernard
> > Shaw recently myself.

> Right. Mao wanted every village to be self-reliant and do everything on
> their own. I think the best published example was that more or less
> every village had its own steel factory, resulting in a very low efficiency
> and crap steel. If you read about north corea you will sooner or later
> stumble on something similar, called "Juche". A fierce desire to be
> independent, an inability to recognize you can't be a specialist of
> everything and, consequently, a desaster.
And the relevance of this is....?

> > By the way, I am _not_ arguing that one must do everything
> > themeselves, only that one should not get locked into being dependant
> > on a single provide.
> >
> > As I'v said, I'm baffled that this is so controversial that you all
> > expect me to defend my good name merely for saying it.
> >
> > > > I'm not sure what this example is supposed to illustrate. The vendor
> > > > failed to fix the bug originaly and ony did so under dures,
>  
> > > The point was that contracts work.
> >
> > It was quite a poorly demonstrated point, as they nearly did and could
> > well have lost their own customer under the arrangement.

> Not "nearly", the legal opinion was correct and therefore the only ones
> to worry were the sued ones.
If it did come to a dispute, they could not have supported there own
application, they where exclusively dependendant on an outside firm.

> > > > which only
> > > > shows how vulnerable you where to begin with,

> > > Why was he vulnerable if he had a contract that required the vendor to > > > > work?
Because he had no right to go elsewhere if the vendor failed to
deliver.

> > As the old joke goes: "if this fire alarm fails, and your house burns
> > down, we will refund the entire purchase price (not including the
> > battaries)."

> OTOH, "if you install this fire alarm, you will pay less insurance on
> the house".
Relevence? What insurance is provided in the case here? 
Fire insurance you can buy, I have never heard of application
obsoletion insurance.

The original point being, you can not recoup your own investment, just
the purchace price.

> > > > if you had the right to
> > > > say 'OK, were going to fire you and give someone else the contract'
> > > > they would have fixed your bug pronto with no back talk.

> No, they wouldn't, because first they would have to understand the code.
If they where a credible provider of support and development for this
particular product, they would certainly understand the code.

> > > Maybe, but in case of open source software they'd say 'Good luck
> > > working into our source code, see you in two years'.
> >
> > Were do you get this idea? You can contract many companies, large and
> > small, to support your open source product, the difference being that
> > you can hire another when when they fail, because you have a right to
> > the source code, where as you have no recource when the provider has
> > all the rights.

> Like, suse and redhat, each doing their own distributions?
Huh? No, like a competent development comany providing devlopment
services, exactly like Oracle does, but without trapping you into a
sole source situation.

> Could you provide a link where IBM actually provides support
> for mysql? The only thing I have found is them bragging that  MySQL AB
> (fully) supports the AIX port, not that IBM supports MySQL.
Your question is yet another fallacy, since you are responding to a
general statement, that many large companies, including IBM, support
open source applications or provide source licences for there own
applications,  but if you really want to hire IBM to support your
MySQL implemtation, you can, I would recomend you try MySQL AB first
though.

	IBM Application development and systems integration
	http://www-1.ibm.com/services/us/index.wss/it/bcs/a1000402

> > Yes, developing applications costs money, it is this investment I am
> > advising people to protect by not getting locked into third party
> > dependencies.

> I do get locked into a third party dependency, even if I can change
> the third party.
If you can change it, you are not 'locked in.'

> I agree, on the plus side, I can change support without
> changing code, so who actually owns the code and merges the
> fixes from the other guy, provided they don't want to keep them themselves
> because they want to keep the customers?
All these question depend on the case, and have nothing to do with the
topic, if you have a right to the source you are safer that if you do
not, if you have abstracted your access you are safer still. What is
it you can not understand?

This conversation is becoming surreal.

> > > > or negotiate access to source for the vendors
> > > > product, the only difference being that you then have leverage.
>  
> > > The access to the source means nothing, see above.
> >
> > It means everthing.

> Why? I can't change it.
You have the *right* to use it and have it changed for ever and ever,
not only by the permission of some outside company.

> > It means the difference being being the master of
> > your applications and contracts or being a slave to a third party
> > vendor.

> He's my slave because I pay him.
No, he can simply ignore you if he decides the relationship is no
longer profitable for him. You can do nothing.

> > Maybe not 'out of the hat' but with less expense and retraining that
> > having to reprogram the entire application which was programmed with
> > proprietary bindings everwhere instead of properly abstracted code.

> Abstraction can make the job easier, you are right here, but then
> changing a database is not that hard too, as long as both are relational
> ones.
That's all I'm saying, Abstraction is a good idea. I was giving some
simple, good advice. What are you saying?

> > > Including people who have been trained on it.
> > > In what way is a change from oracle to db2 easier than a change from
> > > postgresql to mysql?
> >
> > Well, for one, you would never have to change away from the open
> > source products because of a dispute with the developer.

> Yes, I would. Because I'm not going to maintain my own database
> distribution.
Nobody asked you to. You have the right to use the product and never
talk to the developer if you like. You don't need to change it to
enjoy the rights that source code gives, that is the right to use the
product for ever, and even have it changed *if you need to*

My advice is to abstract when you have no source code, and perhaps
even then, I have repeated this many times and am not sure what you
are even disputing.

> > But in
> > anycase, my argument is not, and never was, oracle and db2 versus
> > postgresql or mysql. But rather for abstraction when you do not have
> > source code, or sometimes then too.

> If I have abstraction it's even less necessary to mess around with
> the db because it's easier to change the db.
Yes, that's why I am *recomending* abstraction. Are you just typing
compulsively at this point?

> > I certainly would
> > not expect my clients or users to be satisfied when I told them, I'm
> > sorry the application I provided for you doesn't work, but you will
> > have to discuss this with Larry Ellison. Nor would I be satisfied
> > giving such an excuse.

> It's different for databases.
> A) the customer quite often already has a database and expertise
>      maintaining it. He has an interest not to have another.
Abstaction means your application can run for different clients with
different databases then. double plus good.

However if your application is tied to one database, then the very
client you are describing is the very client that you will not get if
they use a different database from yours.

> B) the customer may  trust Larry ellison, or IBM more than me.
But if they only sent there money to Lary because they purchaced your,
unabstracted application, they would be pissed off when it did not
work, and you blamed it on Larry.

> C) the customer may want a database that can do more than I could
>      implement or maintain, like incremental backups, logical/physical
>     standby databases or security.
Exactly, so how are you going to accomplish this with your
unabstracted application? Do you even remember what side of this
debate you are on?

> Another case where it's different would, for instance be the OS.
> How much linux maintenance do you think you can provide,
> compared to redhat or suse? Is this really your corebusiness
> or area of expertise?
Why do I have to? Since I can hire one of a million support providers
for any OS, however for OSes without source, they can't do much when
the problem is with the OS itself. Same with the database.

Again, my argument summerized for the millionth time: If you have no
source Abstract access for sure, and it's also a good idea to abstract
access even if you do. I'm baffled how you've turned this into such a
long conversation.

Volker Hetzer <volker.hetzer@ie...org>

2004-05-17 16:58:54
"Quirk" <quirk@sy...net> schrieb im Newsbeitrag news:4e20d3f.0405121205.4c9ac7e8@po...com...
> "Volker Hetzer" <volker.hetzer@ie...org> wrote in message news:<c7t3p2$b15$1@nn...com>...
>
> > > What cold comfort that is. I would prefer the right to make my
> > > aplication work without their good graces.
> > >
> > > Before you consider suing them I suggest you reiview your contact with
> > > an actual lawyer. So you can understand exactly how painted into a
> > > corner you really are.
>
> > Look, we've got about 50 people here dealing with
> > exactly those questions, telling us what contracts to enter and what not.
> > When we buy support, we *know* what we are in for and when and
> > what to sue them for and how to deal with them before we sue them.
>
> Your argument, as usual, is that I should just believe you, not
> because you have explained yourself, but just because you *know*.
Wrong. My argument is that I've taken your "suggestion" long ago.

> My orignal comments still hold true, the right to sue is cold comfort,
> the right to pick up your pieces and try somewhere else, keeping your
> application in tact as much as possible, is better.
It simply doesn't work. Try it sometime.

> > > > at least, the right to cancel the
> > > > contract which hurts them way more
> > >
> > > How can you cancel the contract when your entire application is
> > > dependanton there product? Can you afford to throw away your
> > > application too?
>
> > See my other posting. Compared to changing the application (replacing
> > it with another), changing the underlying database is easy.
>
> Even easier if you have abstracted your data access with a simple
> function, and then used that function throught your application. I
> have no idea why you find this so hard to believe.
As I said before, "a simple function" doesn't do it because
there are lots of other things specific to a database so that
the porting to another database won't be significantly eased.
And, I'm trying to convey this too, there's no need to ease it
much more because it's not much trouble anyway.

> And for what purposes are you bringing up changing the application?
> How is this comparison relevent? I am trying to explain how to protect
> your investment in your application; to change it as little as
> possible.
I'm trying to tell you that whatever API I'm using, the application
is protected enough against any change.

> You make so little sence I wonder what is motivating you to carry on.
Whatever.

> Abstraction of your database access is a good idea. Why are you so
> hell bent to dispute this.
It depends on how much performance it costs.


> They [support contracts] make even more sence if you are not locked in to a single source.
>
> > I was talking about the case where I go to the developer and ask him
> > to do something for free.
>
> Why would anybody do work fo you for free? Are you a charity of some
> sort?
You started out by saying that maintenance contracts are evil things
devised by the big companies to suck their customers dry. Now suddenly
it's obvious that I pay for changes/fixes and that this is a cost factor when
deciding about an investment.

> > > > See my other postings and the reply about division of labour. You might
> > > > also read up on Maos Great Leap Forward and north coreas policy of doing
> > > > everything themselves.
> > >
> > > You're not seriously trying to draw me into to a discusion on
> > > communist history are you? If so, please go ahead, it may be
> > > intersting. I've been reading the Fabian writing of George Bernard
> > > Shaw recently myself.
>
> > Right. Mao wanted every village to be self-reliant and do everything on
> > their own. I think the best published example was that more or less
> > every village had its own steel factory, resulting in a very low efficiency
> > and crap steel. If you read about north corea you will sooner or later
> > stumble on something similar, called "Juche". A fierce desire to be
> > independent, an inability to recognize you can't be a specialist of
> > everything and, consequently, a desaster.
>
> And the relevance of this is....?
That it doesn't make sense to turn me or our company into database specialists.
That therefore access to the source code doesn't make sense to us.
Even if we hired some other company, the only thing we need is having *them*
accessing the source code. If you've done any work under NDA's you'll know
what a difference this is.

> > > > > I'm not sure what this example is supposed to illustrate. The vendor
> > > > > failed to fix the bug originaly and ony did so under dures,
> >
> > > > The point was that contracts work.
> > >
> > > It was quite a poorly demonstrated point, as they nearly did and could
> > > well have lost their own customer under the arrangement.
>
> > Not "nearly", the legal opinion was correct and therefore the only ones
> > to worry were the sued ones.
>
> If it did come to a dispute, they could not have supported there own
> application, they where exclusively dependendant on an outside firm.
You are talking ifs here. The contract was as it was and they were right.

> > > > > which only
> > > > > shows how vulnerable you where to begin with,
>
> > > > Why was he vulnerable if he had a contract that required the vendor to > > > > work?
>
> Because he had no right to go elsewhere if the vendor failed to
> deliver.
And in what way is that different if mysql AB goes bust and fails to deliver?

> > > As the old joke goes: "if this fire alarm fails, and your house burns
> > > down, we will refund the entire purchase price (not including the
> > > battaries)."
>
> > OTOH, "if you install this fire alarm, you will pay less insurance on
> > the house".
>
> Relevence? What insurance is provided in the case here?
> Fire insurance you can buy, I have never heard of application
> obsoletion insurance.
Maintenance is insurance to the database vendor. For a fixed price (or whatever)
the vendor agrees to do maitenance work. The database vendor obviously
balances maintenance costs and development costs, trying to minimize both.

> The original point being, you can not recoup your own investment, just
> the purchace price.
Yes. The same is with open source software. At least if you place a reasonable
limit on the costs to maintain the open source software yourself. (Reasonable
meaning it should cost less than a migration to another supported product.)

> > > > > if you had the right to
> > > > > say 'OK, were going to fire you and give someone else the contract'
> > > > > they would have fixed your bug pronto with no back talk.
>
> > No, they wouldn't, because first they would have to understand the code.
>
> If they where a credible provider of support and development for this
> particular product, they would certainly understand the code.
Well, looks like the only credible supporter of mysql is mysql ab.

> > > > Maybe, but in case of open source software they'd say 'Good luck
> > > > working into our source code, see you in two years'.
> > >
> > > Were do you get this idea? You can contract many companies, large and
> > > small, to support your open source product, the difference being that
> > > you can hire another when when they fail, because you have a right to
> > > the source code, where as you have no recource when the provider has
> > > all the rights.
>
> > Like, suse and redhat, each doing their own distributions?
>
> Huh? No, like a competent development comany providing devlopment
> services, exactly like Oracle does, but without trapping you into a
> sole source situation.
And right now it works because they all more or less follow redhat.
Nevertheless, each commercial software gets certified for single platforms,
therefore you are still tied to a single distribution, or the supported
subset.

> > Could you provide a link where IBM actually provides support
> > for mysql? The only thing I have found is them bragging that  MySQL AB
> > (fully) supports the AIX port, not that IBM supports MySQL.
>
> Your question is yet another fallacy, since you are responding to a
> general statement,
So, who is the competitor for mysql ab?

> IBM Application development and systems integration
> http://www-1.ibm.com/services/us/index.wss/it/bcs/a1000402
Yes. Doesn't mention support or databases anywhere.
I had a look at the arcadia case:
"Key Components
Software IBM Lotus® Domino(tm)
IBM Lotus Notes®
IBM DB2® Universal Database(tm) for iSeries(tm)
IBM Net.Data®
Servers IBM iSeries
Services IBM Global Services"

> > > Yes, developing applications costs money, it is this investment I am
> > > advising people to protect by not getting locked into third party
> > > dependencies.
>
> > I do get locked into a third party dependency, even if I can change
> > the third party.
>
> If you can change it, you are not 'locked in.'
So, if I can change the db from oracle to db2 I'm not locked in either.

> > I agree, on the plus side, I can change support without
> > changing code, so who actually owns the code and merges the
> > fixes from the other guy, provided they don't want to keep them themselves
> > because they want to keep the customers?
>
> All these question depend on the case, and have nothing to do with the
> topic, if you have a right to the source you are safer that if you do
> not, if you have abstracted your access you are safer still. What is
> it you can not understand?
That I am supposed to be safer with a bunch of code that, in the case
I need it, is obsolete or takes time and expertise to get into.

> This conversation is becoming surreal.
>
> > > > > or negotiate access to source for the vendors
> > > > > product, the only difference being that you then have leverage.
> >
> > > > The access to the source means nothing, see above.
> > >
> > > It means everthing.
>
> > Why? I can't change it.
>
> You have the *right* to use it and have it changed for ever and ever,
> not only by the permission of some outside company.
So what? The right to use it doesn't make me a programmer for that particular
database. It doesn't make anyone else (short of the original maintainers)
a programmer for that particular database on short notice. It doesn't make
the maintenance cheaper than the migration to a still supported database.
And it definitely doesn't make my boss keep a bunch of abandoned code
that we are the sole users of.

> > > It means the difference being being the master of
> > > your applications and contracts or being a slave to a third party
> > > vendor.
>
> > He's my slave because I pay him.
>
> No, he can simply ignore you if he decides the relationship is no
> longer profitable for him. You can do nothing.
I can stop paying maintenance and go somewhere else.

> > > Maybe not 'out of the hat' but with less expense and retraining that
> > > having to reprogram the entire application which was programmed with
> > > proprietary bindings everwhere instead of properly abstracted code.
>
> > Abstraction can make the job easier, you are right here, but then
> > changing a database is not that hard too, as long as both are relational
> > ones.
>
> That's all I'm saying, Abstraction is a good idea. I was giving some
> simple, good advice. What are you saying?
That "elegance" is more than "abstraction" and means different things
to different people. And abstraction doesn't always make sense either
because from a technical point of view one decides for a specific
product because of the specific properties of the product. If you
abstract away from them you won't need it either.

> > > > Including people who have been trained on it.
> > > > In what way is a change from oracle to db2 easier than a change from
> > > > postgresql to mysql?
> > >
> > > Well, for one, you would never have to change away from the open
> > > source products because of a dispute with the developer.
>
> > Yes, I would. Because I'm not going to maintain my own database
> > distribution.
>
> Nobody asked you to.
But you always tell me how good it's supposed to be. Well, it is not.

> You have the right to use the product and never
> talk to the developer if you like. You don't need to change it to
> enjoy the rights
> that source code gives, that is the right to use the
> product for ever, and even have it changed *if you need to*
Oh, I've got the right to use oracle forever too. It's only what I
want updates that I have to talk to them.

> My advice is to abstract when you have no source code, and perhaps
> even then, I have repeated this many times and am not sure what you
> are even disputing.
Your advice. Abstraction means you won't need/use a distinguishing feature.
This might cost you performance, it costs money to implement, if only that
feature makes your app possible you simply can't abstract from it and if the
interface is standardized anyways you don't need to bother either.
Therefore abstraction is to be decided on a case-to-case base just like
any other thing.

> > > But in
> > > anycase, my argument is not, and never was, oracle and db2 versus
> > > postgresql or mysql. But rather for abstraction when you do not have
> > > source code, or sometimes then too.
>
> > If I have abstraction it's even less necessary to mess around with
> > the db because it's easier to change the db.
>
> Yes, that's why I am *recomending* abstraction. Are you just typing
> compulsively at this point?
No, I'm showing you the contradiction of your arguments.
If it's easy to change, the case for code rights disappears. Which way do
you want it?

> > > I certainly would
> > > not expect my clients or users to be satisfied when I told them, I'm
> > > sorry the application I provided for you doesn't work, but you will
> > > have to discuss this with Larry Ellison. Nor would I be satisfied
> > > giving such an excuse.
>
> > It's different for databases.
> > A) the customer quite often already has a database and expertise
> >      maintaining it. He has an interest not to have another.
>
> Abstaction means your application can run for different clients with
> different databases then. double plus good.
But, and that's the point here, if every vendor provided its own patched
mysql database the customer would be even more pissed off.
Believe me, it's easier to say "we require oracle" that "we require you
to run my oen hacked version of MyFavouriteOpenSourceDatabase.
Are you trying to change thread from opensource to abstraction?

> However if your application is tied to one database, then the very
> client you are describing is the very client that you will not get if
> they use a different database from yours.
We do have such an app here. The result is that it doesn't run well
on *any* database.

> > B) the customer may  trust Larry ellison, or IBM more than me.
>
> But if they only sent there money to Lary because they purchaced your,
> unabstracted application, they would be pissed off when it did not
> work, and you blamed it on Larry.
Ah, but I only blame it on larry if it's larrys fault.

> > C) the customer may want a database that can do more than I could
> >      implement or maintain, like incremental backups, logical/physical
> >     standby databases or security.
>
> Exactly, so how are you going to accomplish this with your
> unabstracted application? Do you even remember what side of this
> debate you are on?
I use a database that can do that and tell them to get the discount
version if they don't need it. How do you going to accomplish
that with an open source app where you are the only surviving
supporter? Just to get back to the open source topic here.

> > Another case where it's different would, for instance be the OS.
> > How much linux maintenance do you think you can provide,
> > compared to redhat or suse? Is this really your corebusiness
> > or area of expertise?
>
> Why do I have to?
Why would you have to provide support for a database then?
Remember you disputed that it's a good idea to let larry provide
the oracle support.

> Since I can hire one of a million support providers
> for any OS,
> however for OSes without source, they can't do much when
> the problem is with the OS itself. Same with the database.
So, how many have you under contract and how do your customers
react to the news that they have to run your own linux distribution?


> Again, my argument summerized for the millionth time: If you have no
> source Abstract access for sure, and it's also a good idea to abstract
> access even if you do. I'm baffled how you've turned this into such a
> long conversation.
In case you've already forgotten, the topic was open source, not abstraction.
In your case abstraction wouldn't have made sense because you won't ever
need to change the database because you'd just carry on supporting it or
buy the best (probably original) developers and go on, right?
But the abstraction thingie was a nice diversion.

Greetings!
Volker
[comp.databases.ms-sqlserver removed]

Wow, five days later Volker is still scratching his head about this, I
though this thread was dead long ago.

> > Your argument, as usual, is that I should just believe you, not
> > because you have explained yourself, but just because you *know*.

> Wrong. My argument is that I've taken your "suggestion" long ago.
Huh? If you have taken my suggestion, then why did respond to my
suggestions? Did you imagine, that although I was not responding to
you, somehow It was you I was talking about? As usual, you make no
sence.

> > My orignal comments still hold true, the right to sue is cold comfort,
> > the right to pick up your pieces and try somewhere else, keeping your
> > application in tact as much as possible, is better.

> It simply doesn't work. Try it sometime.
'Simply doesn't work' -- an unsubstantantiated out of hand dismissal,
which is, as anybody with clue knows, a fallacy.

'Try it sometime' -- Another attempt to portray yourself as having
greater experience, another fallacy.

Well, what more can we expect from Volker, the human fallacy?

> > > > > at least, the right to cancel the
> > > > > contract which hurts them way more
> > > >
> > > > How can you cancel the contract when your entire application is
> > > > dependanton there product? Can you afford to throw away your
> > > > application too?
>  
> > > See my other posting. Compared to changing the application (replacing
> > > it with another), changing the underlying database is easy.
> >
> > Even easier if you have abstracted your data access with a simple
> > function, and then used that function throught your application. I
> > have no idea why you find this so hard to believe.

> As I said before, "a simple function" doesn't do it because
> there are lots of other things specific to a database so that
> the porting to another database won't be significantly eased.
The specific proprietary bindings can be wrapped in a simple function.
Additional functions can be used to issolate proprietry features.

> And, I'm trying to convey this too, there's no need to ease it
> much more because it's not much trouble anyway.
Thanks for all your effort Volker, but I will continue putting any
proprietary bindings my own functions, and use those functions through
out my application, rather than have proprietary binding through out
my application, and I will continue to recomend that others do the
same, you do whatever you want though.

> > And for what purposes are you bringing up changing the application?
> > How is this comparison relevent? I am trying to explain how to protect
> > your investment in your application; to change it as little as
> > possible.

> I'm trying to tell you that whatever API I'm using, the application
> is protected enough against any change.
The question was: Why are you bringing up changing the application as
if it was an argument _against_ my suggestions, since my suggestions
help protect your applications. Please try to follow.

> > You make so little sence I wonder what is motivating you to carry on.

> Whatever.
I see. So so simple having nothing better to do? This will be my last
response in this thread then. At least outside the PHP newsgroups.

> > Abstraction of your database access is a good idea. Why are you so
> > hell bent to dispute this.

> It depends on how much performance it costs.
Funny, that's what I said. Usualy however, performance concerns are
not terribly significant and the abstraction can be kept very light
weight.

> > Why would anybody do work fo you for free? Are you a charity of some
> > sort?

> You started out by saying that maintenance contracts are evil things
> devised by the big companies to suck their customers dry.
No, closed source licence agreements are so devised. Maintenence
contracts are perfectly fine.

> Now suddenly
> it's obvious that I pay for changes/fixes and that this is a cost factor when
> deciding about an investment.
You pay for labour, yes, why would this not be obvious?

> That it doesn't make sense to turn me or our company into database 
> specialists.
I don't know what makes sence for your company, but it should be
obvious to you that my advice is not directed at your company
specificaly, and also, my advice is not to become database
specialists, but rather to not make your own application, especially
if it is a 'high end commercial application' as described in the post
I was responding to, exclusively dependend on a third party.

> That therefore access to the source code doesn't make sense to us.
Access to the source code gives you the freedom to swith 'database
specialists' even if you never touch the code yourself.

It also means you never have to stop using the product simply because
the vendor wants to sell you a new one if the product continues to
meet your needs, since with source, you can recompile for for a new
cpu, a new os, or when new security updates are available for the
libraries it depends on.

With source, you have the assurance that the product is yours for
keeps, just like your own code, without source, you have no such
assurance.

> > If it did come to a dispute, they could not have supported there own
> > application, they where exclusively dependendant on an outside firm.

> You are talking ifs here. The contract was as it was and they were right.
Yet my advice is for the future, not the past, I see the example given
as cautionary tale because of the 'ifs'.

> > Because he had no right to go elsewhere if the vendor failed to
> > deliver.

> And in what way is that different if mysql AB goes bust and fails to deliver?
You still have the source code.

> > Relevence? What insurance is provided in the case here?
> > Fire insurance you can buy, I have never heard of application
> > obsoletion insurance.

> Maintenance is insurance to the database vendor. For a fixed price (or 
> whatever) the vendor agrees to do maitenance work.
Yet the vendor gaurantees nothing.

> The database vendor obviously
> balances maintenance costs and development costs, trying to minimize both.
The vendor only tries to maximize profits.

> > The original point being, you can not recoup your own investment, just
> > the purchace price.

> Yes. The same is with open source software. At least if you place a 
> reasonable
> limit on the costs to maintain the open source software yourself. (Reasonable
> meaning it should cost less than a migration to another supported product.)
You do not need to, just like if you design a curcuit with a
proprietary conector or a standard one, the former is expensive and
only comes from one comany, the later is cheap and comes from many.
Unless you really need the former, you would always chose the later.
In neither case are you required to manufacture connectors.

> > > No, they wouldn't, because first they would have to understand the code.
> >
> > If they where a credible provider of support and development for this
> > particular product, they would certainly understand the code.

> Well, looks like the only credible supporter of mysql is mysql ab.
There are as many as the market will bear, since there is no
artificial thing, like closed source, keeping competition away.

Since the Market is growing rather fast, and big names like SAP are
promoting it, I see no reason to worry about a lack of support for
MySQL.

> > > > Were do you get this idea? You can contract many companies, large and
> > > > small, to support your open source product, the difference being that
> > > > you can hire another when when they fail, because you have a right to
> > > > the source code, where as you have no recource when the provider has
> > > > all the rights.
>  
> > > Like, suse and redhat, each doing their own distributions?
> >
> > Huh? No, like a competent development comany providing devlopment
> > services, exactly like Oracle does, but without trapping you into a
> > sole source situation.

> And right now it works because they all more or less follow redhat.
What? Who follows Red Hat? What does this have to do with companies
providing development services? What are you blathering about?

> Nevertheless, each commercial software gets certified for single platforms,
> therefore you are still tied to a single distribution, or the supported
> subset.
Different products have different cross platform stragies, the good
ones try and support the widest number of platforms, almost all
serious database software supports Linux now, including Oracle and
Sybase. But in anycase, I have no idea how this relates to anything we
are actualy discussing. Must be something funny in the drinking water
in your parts.

> > > Could you provide a link where IBM actually provides support
> > > for mysql? The only thing I have found is them bragging that  MySQL AB
> > > (fully) supports the AIX port, not that IBM supports MySQL.
> >
> > Your question is yet another fallacy, since you are responding to a
> > general statement,

> So, who is the competitor for mysql ab?
Anyone who wants to be, as many as the market will bear, each
competeting for customers and compentent labour with each other to the
benifit of the consumer, simple economics.

Oracle has you trapped because no one else can compete with them,
since their source is closed. BUT EVEN STILL, I am not recomending you
never use Oracle, I am only recomending that abstraction is a good
idea, particularliy when you do not have source.

> > IBM Application development and systems integration
> > http://www-1.ibm.com/services/us/index.wss/it/bcs/a1000402

> Yes. Doesn't mention support or databases anywhere.
As I said, your question was a fallacy, since it was in responce to
the statement that many companies, including IBM, support open source
products, the statement did not say that IBM, specificaly, supports
MySQL, specificaly. Yet, if you wanted to, you could hire IBM to
support your MySQL implementation, if you had enough money, they would
be happy to take it. They do not promote themselves as such, and would
frankly be surprised to get such a contract, knowing that there are
cheaper alternatives and that MySQL users are not currently the
typical IBM consulting clients, however, with SAP behind MySQL AB,
this could soon change.

> > > I do get locked into a third party dependency, even if I can change
> > > the third party.
> >
> > If you can change it, you are not 'locked in.'

> So, if I can change the db from oracle to db2 I'm not locked in either.
That's right, you are only 'locked in' if you can not change.

> > All these question depend on the case, and have nothing to do with the
> > topic, if you have a right to the source you are safer that if you do
> > not, if you have abstracted your access you are safer still. What is
> > it you can not understand?

> That I am supposed to be safer with a bunch of code that, in the case
> I need it, is obsolete or takes time and expertise to get into.
If the code is a working part of your application, it is not obsolete,
however a closed source vendor can obsolete it on purpose to force you
to buy a new licence. And you need no expertise in it, since if your
product is popular, like say MySQL, the marker will attract lots of
competition for your business.

> > You have the *right* to use it and have it changed for ever and ever,
> > not only by the permission of some outside company.

> So what? The right to use it doesn't make me a programmer for that particular
> database.
If it's a working part of a production system, you do not need to be,

> It doesn't make anyone else (short of the original maintainers)
> a programmer for that particular database on short notice.
If it is a viable market, there will be programmers for it.

> It doesn't make
> the maintenance cheaper than the migration to a still supported database.
It may make migration uneccessary by allowing new entreprenuers to
support it. Competition among them will even make maintenance cheaper,
and, of course abstraction makes migration, when neccessary, also
cheaper.

All this in perfect line with my adivice, as stated in my original
posting, and as still unrefuted in anyway by you copious blather.

> And it definitely doesn't make my boss keep a bunch of abandoned code
> that we are the sole users of.
First, if the system is widely used the code would not be abandoned,
second, a closed source product is not less likely to be abandoned
that an open source one, third if it is abandoned then you are in
better shape if you do have the code.

> > > He's my slave because I pay him.
> >
> > No, he can simply ignore you if he decides the relationship is no
> > longer profitable for him. You can do nothing.

> I can stop paying maintenance and go somewhere else.
You must also stop using the software then, and bear the costs related
to that.

> > > Abstraction can make the job easier, you are right here, but then
> > > changing a database is not that hard too, as long as both are relational
> > > ones.
> >
> > That's all I'm saying, Abstraction is a good idea. I was giving some
> > simple, good advice. What are you saying?

> That "elegance" is more than "abstraction" and means different things
> to different people.
I have not attempted to define elegence for different people, only
given specific examples.

> And abstraction doesn't always make sense either
I never said anything *always* makes sence, all projects have their
own requirements, I have only given some general advice, good advice.

> > > Yes, I would. Because I'm not going to maintain my own database
> > > distribution.
> >
> > Nobody asked you to.

> But you always tell me how good it's supposed to be. Well, it is not.
No, I tell you that source gives you freedom to chose, but sadely, 
you have trouble understanding simple things. It's probably quite a
good idea for you to pay Oracle to think for you, in your case, I
withdraw my advice, however it still holds true for others, mor
compitent profesionals

> > You have the right to use the product and never
> > talk to the developer if you like. You don't need to change it to
> > enjoy the rights
> > that source code gives, that is the right to use the
> > product for ever, and even have it changed *if you need to*

> Oh, I've got the right to use oracle forever too. It's only what I
> want updates that I have to talk to them.
First of all, you do not have any such right, secondly, without
source, how you will compile it for your new CPU, or new OS, or to
link a security-updated library?

Oh never mind, just call Oracle support, you are obviously unskilled
labour.

Good luck to you.

> > My advice is to abstract when you have no source code, and perhaps
> > even then, I have repeated this many times and am not sure what you
> > are even disputing.

> Your advice. Abstraction means you won't need/use a distinguishing feature.
If you do not need to use it, yes, if you do, then //issolate its
use// in your code with a wrapper function.

> Therefore abstraction is to be decided on a case-to-case base just like
> any other thing.
Funny, that's exactly what I said, many times in this thread. Yet
abstarction is good advice, which is, as I've also said many times,
all I have offered.

> > Yes, that's why I am *recomending* abstraction. Are you just typing
> > compulsively at this point?

> No, I'm showing you the contradiction of your arguments.
No, all your showing is your inability to follow a simple arguments.

> If it's easy to change, the case for code rights disappears. Which way do
> you want it?
The 'case for code rights' does not disapear, but by abstarction,
becomes less important, since abstarction is another layer of
protection. This has been clear from my very first post in this
thread. Keeping your archices in self-contained, self-describing,
human-readable format was my third recomendation. If you have all
three, you are in the best shape if your application and/or data has a
long life span.

> > > It's different for databases.
> > > A) the customer quite often already has a database and expertise
> > >      maintaining it. He has an interest not to have another.
> >
> > Abstaction means your application can run for different clients with
> > different databases then. double plus good.

> But, and that's the point here, if every vendor provided its own patched
> mysql database the customer would be even more pissed off.
No one is recomending this, that is only your own red herring. The
customer prerers abstacation when it means that they can use there own
database, if they only use the database for your application, then
they see the database as a part of your application, and only want it
to work.

> Believe me, it's easier to say "we require oracle" that "we require you
> to run my oen hacked version of MyFavouriteOpenSourceDatabase.
Depends on the costumer and wether or not they want to bear of adding
Oracle to their environement.

> Are you trying to change thread from opensource to abstraction?
I am not trying to change 'the thread' -- I posted my recomendations,
which included abstractions, you are responding to them, therefore in
the discusion between you and I, it is my suggestions that are the
topic and my only intrest is in defending them, I have no other reason
to discuss anything with you.

> > However if your application is tied to one database, then the very
> > client you are describing is the very client that you will not get if
> > they use a different database from yours.

> We do have such an app here. The result is that it doesn't run well
> on *any* database.
As I said, there are bad applications, both abstracted and
unabstracted ones, your argument, is, as usual, a fallacy.

> > > B) the customer may  trust Larry ellison, or IBM more than me.
> >
> > But if they only sent there money to Lary because they purchaced your,
> > unabstracted application, they would be pissed off when it did not
> > work, and you blamed it on Larry.

> Ah, but I only blame it on larry if it's larrys fault.
And, if your forced your customer into Larry's arms, they will blame
you, not Larry.

> > > C) the customer may want a database that can do more than I could
> > >      implement or maintain, like incremental backups, logical/physical
> > >     standby databases or security.
> >
> > Exactly, so how are you going to accomplish this with your
> > unabstracted application? Do you even remember what side of this
> > debate you are on?

> I use a database that can do that and tell them to get the discount
> version if they don't need it. How do you going to accomplish
> that with an open source app where you are the only surviving
> supporter? Just to get back to the open source topic here.
I don't plan on being 'the only surviving supporter', yet another of
your fallacies, as the producs that I use are popular and their
popularity is growing, I also abstract my database access, so that if
this changes, I can change with the dominant trends.

(I wonder if you even know what a fallacy is, you use so so many of
them)

> > > Another case where it's different would, for instance be the OS.
> > > How much linux maintenance do you think you can provide,
> > > compared to redhat or suse? Is this really your corebusiness
> > > or area of expertise?
> >
> > Why do I have to?

> Why would you have to provide support for a database then?
I support my application and all the dependencies that I have forced
on the client by way of it. If my application fails because of a
dependency I have chosen for it, the customer will blame me.

> Remember you disputed that it's a good idea to let larry provide
> the oracle support.
Remember, it was limited to the situatuion where the customers only
dealt with Larry because of me. For the millionth time, please try to
follow.

> > Since I can hire one of a million support providers
> > for any OS,
> > however for OSes without source, they can't do much when
> > the problem is with the OS itself. Same with the database.

> So, how many have you under contract and how do your customers
> react to the news that they have to run your own linux distribution?
What on earth are you talking about? I do not need to run my own linux
distribution. You are a nutcase.

> > Again, my argument summerized for the millionth time: If you have no
> > source Abstract access for sure, and it's also a good idea to abstract
> > access even if you do. I'm baffled how you've turned this into such a
> > long conversation.

> In case you've already forgotten, the topic was open source, not abstraction.
I made a series of suggestions, including open source and abstraction,
you responded to my suggestions, therefore the topic is my suggestions
and your objections to them.

> In your case abstraction wouldn't have made sense because you won't ever
> need to change the database because you'd just carry on supporting it or
> buy the best (probably original) developers and go on, right?
Well, you might have trouble understanding it, but I think I've made
it clear that both source and abstraction have their benefits.

> But the abstraction thingie was a nice diversion.
Yeah, a 'diversion' I cleverly included in my very first post in this
thread.

What kind of idiot are you?

Howard J. Rogers <hjr@di...com>

2004-05-19 10:39:03
Quirk wrote:

[snip to cut to the chase]

> Oracle has you trapped because no one else can compete with them,
> since their source is closed. BUT EVEN STILL, I am not recomending you
> never use Oracle, I am only recomending that abstraction is a good
> idea, particularliy when you do not have source.
[Ditto]

It seems to me that if you are going to abstract because you lack the 
source code, you are likely not going to be making much use of the 
proprietary functionality you've just spent an arm and a leg on. Which 
strikes me as a waste of money.

In other words, if you insist on taking out the abstraction insurance 
policy, don't use Oracle, because it's just money down the drain for 
functionality you're never going to use. Yet you say you would not 
recommend never using Oracle. Stripping out the double negatives, that 
presumably means you might recommend using Oracle *and* abstraction.

Personally, I think my software assurance comes from Oracle's size and 
market share (and my support contract), and I don't need potentially 
crippling abstractions to protect me against their failure at some 
indeterminate and perhaps never-to-arrive point in the future.

I realise I'm butting in late, but that last post was soooo long, I'm 
fairly confident not one person in 1000 is going to know what the hell 
it was saying!

Regards
HJR

This message appeared in a previous month, was never archived, or was lost.

quirk@sy...net (Quirk)

2004-05-19 17:03:47
Replies: Galen Boyer
"Howard J. Rogers" <hjr@di...com> wrote in message news:<40ab3835$0$8990$afc38c87@ne...au>...

> Quirk wrote:
> 
> [snip to cut to the chase]
> 
> > Oracle has you trapped because no one else can compete with them,
> > since their source is closed. BUT EVEN STILL, I am not recomending you
> > never use Oracle, I am only recomending that abstraction is a good
> > idea, particularliy when you do not have source.
> 
> [Ditto]
> 
> It seems to me that if you are going to abstract because you lack the 
> source code, you are likely not going to be making much use of the 
> proprietary functionality you've just spent an arm and a leg on. Which 
> strikes me as a waste of money.

> In other words, if you insist on taking out the abstraction insurance 
> policy, don't use Oracle, because it's just money down the drain for 
> functionality you're never going to use. Yet you say you would not 
> recommend never using Oracle. Stripping out the double negatives, that 
> presumably means you might recommend using Oracle *and* abstraction.
Hmm. Ok, well, first let me say I am in favour of the Open Source
databases, so it's a little awkward that I need to defend Oracle here,
but abstraction does not prevent you from benefiting from Oracle, for
one, Oracle has proven performance (even with standard SQL), security
and scalablity advantages that some applications and environment may
need and secondly, your product may need to run in a customer's
datacenter, where Oracle is the database they use.

Also, with lightweight abstraction, such as simple wrappers around
proprietery bindings, you do not realy lose performance, and when you
must use prorietary features, you can create additional wrappers to
issolate these.

By containing the Oracle bindings to only a few places in your code,
you make your application far easier to maintain and debug, let alone
migrate.

Using a large abstraction object may cause performance issues, but
using wrapper functions is just good coding in any case.

And regarding abstraction objects, as far as PHP goes, PEAR:DB seems
to work well, with not to much lost as far as performance goes,
although I have not done any major benchmarking, and if performance is
critical to your application, you should. Ditto for Perl's DBI.

> Personally, I think my software assurance comes from Oracle's size and 
> market share (and my support contract), and I don't need potentially 
> crippling abstractions to protect me against their failure at some 
> indeterminate and perhaps never-to-arrive point in the future.
And the choice is personal, so you are welcome to yours, however, you
can imagine that not all applications, especialy commercial ones, can
afford to tie themselves to one exclusive database, and many other
applications may not want to force there users into using one
exclusive database.

Also, your data abstraction functions need not be any more crippling
than the rest of the application's code, so if coding these will lead
to crippling the  application, likely the application is well on it's
way to being coded into cripledom already. Also, abstraction will
generaly (i said //generaly//) have less impact on performance than
your data model will.
 
> I realise I'm butting in late, but that last post was soooo long, I'm 
> fairly confident not one person in 1000 is going to know what the hell 
> it was saying!
Yes, I agree. Thanks for the truncation :)



 

Galen Boyer <galenboyer@ho...com>

2004-05-19 18:53:46
On 19 May 2004, quirk@sy...net wrote:

> And the choice is personal, so you are welcome to yours,
> however, you can imagine that not all applications, especialy
> commercial ones, can afford to tie themselves to one exclusive
> database, 
But then, that application vendor needs to have multiple code
bases, one to support each platform, each taking advantage of
that platform's performance characteristics.

-- 
Galen Boyer

quirk@sy...net (Quirk)

2004-05-24 10:18:50
Noons <wizofoz2k@ya...nospam> wrote in message news:<40af7768$0$3038$afc38c87@ne...au>...

> > on discussing these things in this thread, it's pretty clear to me we
> > are dealing with zealots and those looking for genuine answers have

> It's a pity that you have considered my reply as that of a zealot.
> I did concede a few points and debated yours in a civilized fashion.
Sorry if you thought I was refering to you specificly, rather I was
lamenting about the general quality of the responses in this thread,
like those of Volker, moronic zealot extraordinaire, a man so stupid,
that when I suggested he didn't know what a fallacy was, he thought I
was critisising his _english_ instead of his knowledge of logic and
the standards of debate.

However, there is clear zealotry in your post, for example:

You said: "It's with freeware that you need a STACK of wrappers to
protect you from sudden underlying code changes!  Not with commercial
software!"

See: no other reasoning is given why underlying code may suddenly
change other than in one case it is _free_, in the other case it is
_commercial_. This is not a reasoned argument, but rather the faith of
a zealot.

Since neither freeness nor commercialness has a direct impact on code
stability, but rather the release management practices of the
development group has.

There are badly managed free software projects, and badly managed
nonfree ones, your argument is therefore a fallacy, although your
english, like Volker's is great!

> However, thanks for giving me the opportunity of stating this in a less
> civilized language (remember: YOU started the language, not I):
Please, use any language you like, you are quite welcome if my post
has given you a greater since of liberty.

>  none of
> your points is by definition a "world truth".
When I say things like "the readers can make up their own minds, as
they should in any case" and "these are suggestions" (both present in
the post you are responding too) what makes you think I am defining
"world truths?"

>  You don't provide a single
> supporting argument that does not involve your interpretation of what
> software makers would do rather than what they in fact do.
Oh please, I have provided many clear aruments throughout this thread,
in my last message I even posted pseudocode, how much clearer do you
want?

> Your stupid deduction that somehow only your view of the world is worthy
> the title of "developer" defines you as the idiotic and moronic type of
> geek that thinks the world was invented yesterday by your kind and all that
> came before is just amateur effort.  In character, I might say.
You know nothing about my character or world view. Amateur effort is
amateur effort, on it's own it is neither old nor new. None of the
ideas I have suggested are particularily new. The existince of a large
body of free software is fairly new, however the practice of acquiring
source licences for critical dependencies is not, and serves more or
less the same function. Abstraction is not new, good archiving
techniques are not new. A developer who did not understand these
techniques was an amateur in 1976, just as much as today.

> You and your little group can go and drop dead as this thread ends
> here for me: I don't have time to argue ANYTHING with "kewl" people.
I'm sorry the barbs you endured in your primary school still hurt you
so much, perhaps therapy can help.

> Not worth the effort: the worst disasters in IT development I've ever seen
> in 30 years of career have been prompted by your kind and I don't like
> my name associated with that sort of unprofessional reputation.  It
> never pays in the long run.
Let's see, I am suggestion abstracting dependencies, getting source
code when you can and keeping your archives human readable.

What sort of disasters can come of this? The worst that can be said is
that, if implemented poorly, these suggestions may cause performance
degradation, hardly Godzilla crushing Tokyo.

However, It is quite easy to imagine disasters as a consequence of not
following these suggestions; customers lost by not being able to
support their database platform, production applications obsoleted by
obsoleted debendencies, unusable archives and lost permenant records.

> Goodbye and keep developing for a non-existent market.
> It has a brilliant future.
Which market is that? The market for good applications? I agree that
is too small and that too many firms are screwed by bad developers and
protectionist suppliers, however I assure you the marker for
developers who understand good, well designed, open systems is doing
quite well, and growing.

> And yes, I DO have a future and nothing you can
> possibly do will stop it.
Hey, I only want to improve your future with my advise! Here, I'll
give you another tip:

A "binding" is a term used to describe a native function (or method)
that provides access to an external dependency.

For instance, 'MySQL', the database server, is a dependency, in PHP,
the function mysql_query is called a binding. 'libcurl', the URL
handling library, is a dependency, the PHP function 'curl_exec', is a
binding.

An 'API' ("application programming interface") is the interface
provided by the dependency itself for external access, frequently for
C, the 'binding' is your platform's _native_ function or method that
provides access to this API, not the API itself.

Each of these terms, 'Dependency', 'Binding' and 'API' have distinct
meanings, and now, after a 30 year career, you can finaly understand
them!

I hope this helps.

Regards,
Dmytri.

pagesflames@us...net (Dusan Bolek)

2004-05-24 16:53:48
quirk@sy...net (Quirk) wrote in message news:<4e20d3f.0405240218.6eedf26e@po...com>...
> Noons <wizofoz2k@ya...nospam> wrote in message news:<40af7768$0$3038$afc38c87@ne...au>...
> However, there is clear zealotry in your post, for example:
> 
> You said: "It's with freeware that you need a STACK of wrappers to
> protect you from sudden underlying code changes!  Not with commercial
> software!"
> 
> See: no other reasoning is given why underlying code may suddenly
> change other than in one case it is _free_, in the other case it is
> _commercial_. This is not a reasoned argument, but rather the faith of
> a zealot.
> 
> Since neither freeness nor commercialness has a direct impact on code
> stability, but rather the release management practices of the
> development group has.
> 
> There are badly managed free software projects, and badly managed
> nonfree ones, your argument is therefore a fallacy, although your
> english, like Volker's is great!
Sorry for interrupting your flame, but I must step in. This statement
is simply not true. In fact a problematic release management is
probably the biggest single problem of free software projects in
general. Even a big projects like Squid, Apache or even Linux itself
have serious problems in this area and the behaviour of smaller ones
is just unacceptable from a point of view of real production
implementations.
Typical for this is a lack of backward compatibility, a huge (and
often unnecessary) changes in config files (thus the need to rewrite
all configs after upgrade) and releasing unfinished code (too many
hacks used, no documentation ...).
I'm using a lot of both commercial and free softs, but I must admit
that these problems are much more frequent on the free ones.

--
Dusan Bolek

quirk@sy...net (Quirk)

2004-05-25 09:48:44
pagesflames@us...net (Dusan Bolek) wrote in message news:<1e8276d6.0405240850.6528ed09@po...com>...

> quirk@sy...net (Quirk) wrote in message news:<4e20d3f.0405240218.6eedf26e@po...com>...

> > Noons <wizofoz2k@ya...nospam> wrote in message news:<40af7768$0$3038$afc38c87@ne...au>...
> > However, there is clear zealotry in your post, for example:

> > You said: "It's with freeware that you need a STACK of wrappers to
> > protect you from sudden underlying code changes!  Not with commercial
> > software!"

> > See: no other reasoning is given why underlying code may suddenly
> > change other than in one case it is _free_, in the other case it is
> > _commercial_. This is not a reasoned argument, but rather the faith of
> > a zealot.

> > Since neither freeness nor commercialness has a direct impact on code
> > stability, but rather the release management practices of the
> > development group has.

> Sorry for interrupting your flame, but I must step in. This statement
> is simply not true. In fact a problematic release management is
> probably the biggest single problem of free software projects in
> general.
Dusan, phrases like 'simply not true' and 'in fact' must be based on
reasoning, your reasoning is limted to your anecdotal evidence from
your personal experience, which I do not deny, my experience however,
is the exact opposite.

In anycase, neither of us can state that our experience represents the
only possible case. i.e. My neighbour is noisy, ben is your neighbour,
therefore ben is noisy; This is a fallacaious argument.

You must explain *why* what you claim 'simply is true' or is a fact.
What are the forces at work that make it so?

The only _fact_ is that projects, free or nonfree, with good release
management are less likely to cause upgrade difficulties than
projects, free or nonfree, with poor ones, and that this differs on a
project by project basis, and also is not static, but rather also
changes with the maturity and popularity of the project.

So, back to our specific case, MySQL and PostgreSQL, versus Oracle,
Sybase, and MS SQL. As far as I know all of these have a good realease
record, the last, of course, suffers from the bad release record of
it's host OS.

Noon's claim, as I explained, is therefore a fallacy.

Regards,
Dmytri.

wizofoz2k@ya...au (Noons)

2004-05-19 22:48:49
quirk@sy...net (Quirk) wrote in message news:<4e20d3f.0405190205.416ed0ce@po...com>...

> Thanks for all your effort Volker, but I will continue putting any
> proprietary bindings my own functions, and use those functions through
> out my application, rather than have proprietary binding through out
> my application, and I will continue to recomend that others do the
> same, you do whatever you want though.
<nit-picking>
I really wish people would call things by the names they've had for
decades, rather than inventing new ways to say PRECISELY the same thing.
Let me provide the example:
"...but I will continue putting any proprietary dependencies in my
own functions, and use those functions through my applicatin, rather than
have proprietary dependencies through out my application..."

THERE!  I've said it.  "bindings" means exactly squat outside the world
of S&M. The correct term is "dependencies". 
</nit-picking>

> Funny, that's what I said. Usualy however, performance concerns are
> not terribly significant and the abstraction can be kept very light
> weight.
Actually, IME performance is the biggest concern.  I still have
to see ONE application built using these modern "concepts" of
"abstraction" from everything and the kitchen sink that doesn't 
have a serious performance problem outside of demo environments...


> Access to the source code gives you the freedom to swith 'database
> specialists' even if you never touch the code yourself.
Access to the source code of the database lets you do this?
I don't think so...  I mean, isn't that the whole opposite
of abstracting implementation details?  

Do what you recommend:  wrap your application functionality around 
the available API for the base-layer software, be that db or whatever.  
And that's it.   Why the heck would you want to become dependent on 
yet another piece of source code?  What's the point of writing 
wrappers in the first place for something you have the source code of?

> It also means you never have to stop using the product simply because
> the vendor wants to sell you a new one if the product continues to
> meet your needs, since with source, you can recompile for for a new
> cpu, a new os, or when new security updates are available for the
> libraries it depends on.
But, my dear cyber-friend:  no vendor of anything considered
base-layer software like databases has EVER changed the product 
so much that it broke all previous code!  That would be called
"suicide" in market terms.  It's never happened, it will never happen!
There is NO NEED to work around such an eventuality: it won't happen,
it's a wasted effort.  

Now, if you have to interface to freeware, I'd be sick worried: there 
is no guarantee whatsoever that some drongo won't go changing everything 
next month.  It's happened before many times.  It's with freeware that 
you need a STACK of wrappers to protect you from sudden underlying
code changes!  Not with commercial software!

> With source, you have the assurance that the product is yours for
> keeps, just like your own code, without source, you have no such
> assurance.
The question of course being: what the heck do I need that source
for in the first place?

> > And in what way is that different if mysql AB goes bust and fails to deliver?
> 
> You still have the source code.
I don't think Oracle, nor Sybase, nor M$ are about to go bust any day
now...  Why worry about what might happen in 10 years time if
the average lifetime of any IT application nowadays is 3 years tops?
After that it's replacement/upgrade time.  It's a waste of time
and resources to plan any further than that, I'm telling you!

> You do not need to, just like if you design a curcuit with a
> proprietary conector or a standard one, the former is expensive and
> only comes from one comany, the later is cheap and comes from many.
It's the connector!  NOT the entire wiring behind it that you need
to make portable, isn't it?  Like I said: why bother with the 
entire edifice of the source code for a db when all you want
is the API?

> Unless you really need the former, you would always chose the later.
> In neither case are you required to manufacture connectors.
Precisely.  So, why bother with the source code that lets you
manufacture connectors?  See what I mean?

> Since the Market is growing rather fast, and big names like SAP are
> promoting it, I see no reason to worry about a lack of support for
> MySQL.
Now you lost me: ANYTHING that SAP promotes is emminently
objectionable and suspicious, IMHO!  THERE is an example
of a totally proprietary company, if I ever saw one....


> Oracle has you trapped because no one else can compete with them,
> since their source is closed. 
I BEG your pardon?  Care to rephrase that?  Since WHEN is 
availability of source code ANY measure of competitiveness
or existence of competitiveness?  Exactly where have you been 
hiding if you think no one competes with Oracle?  Helloooo????  :)

> typical IBM consulting clients, however, with SAP behind MySQL AB,
> this could soon change.
I'll agree with that.  Put SAP behind anything and it stops
being cheap and competitive...

> If the code is a working part of your application, it is not obsolete,
> however a closed source vendor can obsolete it on purpose to force you
> to buy a new licence.
Don't confuse "making it obsolete" with "making it inoperational".
The two things are worlds apart.  I drove a 15 year old car
for YEARS!

> First of all, you do not have any such right, secondly, without
> source, how you will compile it for your new CPU, or new OS, or to
> link a security-updated library?
No one will, old chap.  It's called upgrade lifecycle.  You are
wasting a lot of resources and work making yourself obsolescence-free
in a society that made obsolescence a way of life about 30 years ago.

All this to say: I understand your motivation and it makes sense
in terms of engineering concerns.  But, there is one thing called
(I hate to use a common place) "real world". 
Wasted effort, in today's real world, to try and make an IT product
obsolescence-free.  

> Funny, that's exactly what I said, many times in this thread. Yet
> abstarction is good advice, which is, as I've also said many times,
> all I have offered.
Yeah sure.  But abstraction doesn't mean over-complicate your work
by taking in even more source code!  Abstraction is used PRECISELY
to reduce the amount of source code you have to worry about.  That
is what an API is for!

> What kind of idiot are you?
Now, that's the spirit!!!!!    :)
Anyways I'm coming in late on this one, so reply only if
you could be bothered.  I just thought I'd throw in a few thoughts
prompted by some things you said that rang a bell.

Cheers
Nuno Souto
wizofoz2k@ya...nospam

Doug Hutcheson <doug.blot.hutcheson@nr...au>

2004-05-20 00:03:49
Guys, Guys....
Calm down.
The propositions put forth by Quirk are becoming lost in a tide of acrimony.

Proposition 1:
There are circumstances under which my client is better protected against
commercial or accidental events, if he possesses source code to the
application and the underlying database management system.

I agree with that proposition.

Proposition 2:
There are circumstances under which my client is better protected against
commercial or accidental events, if I have coded my application in such a
way (by use of a database abstraction layer) that migrating my application
to a different database management system is made very easy.

I agree with that proposition.

Proposition 3:
There are circumstances under which my client is better protected against
commercial or accidental events, if he has a human readable backup of the
database of the type Quirk describes.

I agree with that proposition.

Note that neither Quirk nor I claim that these propositions always apply to
every situation, nor that there are not clear and obvious exceptions.

However, I must take issue with Noons, who states:

> But, my dear cyber-friend:  no vendor of anything considered
> base-layer software like databases has EVER changed the product
> so much that it broke all previous code!  That would be called
> "suicide" in market terms.  It's never happened, it will never happen!
> There is NO NEED to work around such an eventuality: it won't happen,
> it's a wasted effort.
There are large companies in our industry who are famous for implementing
backward-incompatibility in new versions of their software. Further, most
support is time limited: once the software has reached a certain age, the
vendor demands that you upgrade (at your cost) if you want to continue to
receive support and bug fixes. Clearly, that makes good commercial sense and
nobody would dispute their right to drop suport for old products, but it
does lock customers into an "upgrade or else" cost cycle. If a customer
decides not to upgrade, the vendor has effectively broken the code for the
customer as soon as the next bug or insecurity is encountered: no support
means no fix.

The point here is that current commercial practice by many vendors forces
clients into expensive upgrades which have no direct commercial benefit to
the customer. Quirk's propositions present a scenario under which customers
have the freedom to choose what to upgrade and how much to spend, based on
their own business imperatives and not those of a third party on which they
depend.

After 25 years in the industry, I know of many organisations which are
getting heartily sick of spending vast sums of money in knee-jerk upgrades
(which usually involves staff retraining and other ancilliary expenses) at
the whim of a vendor. When I am able to offer my customers an alternative to
this revenue drain, I am happy to do so. It is not always possible or
appropriate, but when it is, the benefits are exactly as Quirk has laid out.

Your mileage may vary.

Kind regards,
Doug Hutcheson

--
Remove the blots from my address to reply

This message appeared in a previous month, was never archived, or was lost.

Niall Litchfield <niall.litchfield@di...com>

2004-05-20 20:13:46
"Doug Hutcheson" <doug.blot.hutcheson@nr...au> wrote
in message news:QySqc.2189$IH5.98940@ne...au...
> Guys, Guys....
> Calm down.
> The propositions put forth by Quirk are becoming lost in a tide of
acrimony.
> Proposition 1:
> There are circumstances under which my client is better protected against
> commercial or accidental events, if he possesses source code to the
> application and the underlying database management system.
>
> I agree with that proposition.
It, and the ones that follow are somewhat lost in the fact that it is
largely meaningless.

Proposition 1a.
There are circumstances under which my client is better protected against
commercial or accidental events, if he possesses a contract with a
financially stable vendor of the application and/or underlying database
management system.

Is exactly as true as Proposition 1. Define the circumstances. then relate
them to the real business world.

> Proposition 2:
> There are circumstances under which my client is better protected against
> commercial or accidental events, if I have coded my application in such a
> way (by use of a database abstraction layer) that migrating my application
> to a different database management system is made very easy.
>
> I agree with that proposition.
Proposition 2a

There are circumstances under which my client is royally screwed if he has
an app that does not take advantage of the platform on which it is running,
even if this means being dependent upon that platform.

> Proposition 3:
> There are circumstances under which my client is better protected against
> commercial or accidental events, if he has a human readable backup of the
> database of the type Quirk describes.
>
> I agree with that proposition.
Why do the words filing cabinet come to mind :(

> Note that neither Quirk nor I claim that these propositions always apply
to
> every situation, nor that there are not clear and obvious exceptions.
Well I don't see anywhere that Quirk makes these assertions - though i do
see him claiming that open Source is a better model that closed source.

> However, I must take issue with Noons, who states:
>
> > But, my dear cyber-friend:  no vendor of anything considered
> > base-layer software like databases has EVER changed the product
> > so much that it broke all previous code!  That would be called
> > "suicide" in market terms.  It's never happened, it will never happen!
> > There is NO NEED to work around such an eventuality: it won't happen,
> > it's a wasted effort.
>
>
> There are large companies in our industry who are famous for implementing
> backward-incompatibility in new versions of their software. Further, most
> support is time limited: once the software has reached a certain age, the
> vendor demands that you upgrade (at your cost) if you want to continue to
> receive support and bug fixes. Clearly, that makes good commercial sense
and
> nobody would dispute their right to drop suport for old products, but it
> does lock customers into an "upgrade or else" cost cycle. If a customer
> decides not to upgrade, the vendor has effectively broken the code for the
> customer as soon as the next bug or insecurity is encountered: no support
> means no fix.
Where can I get the security & performance fixes for linux kernel 1.5 - I
don't want to upgrade?

Your suggestion about backward incompatibility also seems to confuse
Microsoft Office with platform software. Even MS - to whom I assume you
refer - have platform software that is backwardly compatible for the last 5
years or so.

> The point here is that current commercial practice by many vendors forces
> clients into expensive upgrades which have no direct commercial benefit to
> the customer. Quirk's propositions present a scenario under which
customers
> have the freedom to choose what to upgrade and how much to spend, based on
> their own business imperatives and not those of a third party on which
they
> depend.
>
> After 25 years in the industry, I know of many organisations which are
> getting heartily sick of spending vast sums of money in knee-jerk upgrades
> (which usually involves staff retraining and other ancilliary expenses) at
> the whim of a vendor. When I am able to offer my customers an alternative
to
> this revenue drain, I am happy to do so. It is not always possible or
> appropriate, but when it is, the benefits are exactly as Quirk has laid
out.
> Your mileage may vary.
>
> Kind regards,
> Doug Hutcheson
>
> --
> Remove the blots from my address to reply
>

quirk@sy...net (Quirk)

2004-05-22 11:08:47
Replies: Noons
"Doug Hutcheson" <doug.blot.hutcheson@nr...au> wrote in message news:<QySqc.2189$IH5.98940@ne...au>...

> Guys, Guys....
> Calm down.

> The propositions put forth by Quirk are becoming lost in a tide of acrimony.
Thanks Doug, it's nice to know that there are one or two actual
developers in these groups, but anyway, I think it's pointless to go
on discussing these things in this thread, it's pretty clear to me we
are dealing with zealots and those looking for genuine answers have
likely stopped reading long ago, I'll avoid argueing with them and
instead stick to giving good suggestions, the readers can make up
their own minds, as they should in any case.

You summary of  the issues should be enough for those with real
questions, I'll add a few comments and leave it at that.

> Proposition 2:
> There are circumstances under which my client is better protected against
> commercial or accidental events, if I have coded my application in such a
> way (by use of a database abstraction layer) that migrating my application
> to a different database management system is made very easy.
> 
> I agree with that proposition.
And also note that simply issolating database functions in your code
is a easy and light way to abstract data access, just to make this
clear for those that keep insisting that database access abstraction
means automaticaly including a third tier:

For instance, in pseudocode:

    function  myapp_query(query)
        if not connected
            prop_connect
       result = prop_query(query)
       for each result
           data(ii++) = prop_fetch(result)
       if not set cleanup
           set cleanup connection callback
                prop_disconnect
       return data

That is a very simple wrapper, an abstraction object like PEAR::DB is
a lot more complex, but that works for simple issolation assuming
standard SQL, we issolate the use of the proprietry bindings
('prop_*') to one function, and convert our result set into a standard
array, manage openning our db connection and register a callback to
close, all in one place.

Not using SQL as the argument, but rather a more general request
describer is a further abstraction that makes your application
cleaner,  but that is another subject, which if there interest, I
could explain in more detail.

Then you have your application:

    function myintreface()
        global data
        data = myapp_query(<query>) 

    function myview()
        global data
        for each data
             display data (ii++)

    function mydetail(key)
       global data
       display data(key)   

And so on... 

The functions themselves only use the wrapper, 'myapp_query', and a
native array, 'data'. So, if your application has hundreds of
functions that use the wrapper function and/or the native array, and
only a few functions where the proprietary bindings are issolated, you
can migrate much easier, or even take advantage of new features in
your existing platform more quickly, because you have issolated the
data access code.

I even use such a data access wrapper when I do use a data abstraction
object, it keeps my code cleaner, and I can even change the
abstraction object if I like, even, when needed, (*gasp*) intoduce
another tier.

> Proposition 3:
> There are circumstances under which my client is better protected against
> commercial or accidental events, if he has a human readable backup of the
> database of the type Quirk describes.
> 
> I agree with that proposition.
And, of course, a self contained, self describing, human readable file
is also usefull when the data has a long life span, and may in fact
out live the application and the platform, or when the data needs to
be shared with other organisations and their applications.

> Note that neither Quirk nor I claim that these propositions always apply to
> every situation, nor that there are not clear and obvious exceptions.
That's right, these are suggestions, each application has its own
requirements, this is why at first it was confusing to me why the
likes of Volker scream and shout that these suggestions are bad
because it deosn't suite their application (or so they think), but
then it became pretty obvious since Volkers most recent drivel, where
he argues with the subject title of the thread instead of my arguments
and claims that my arguments are an attempt at diversion, even though
I have maintained them form my first post. The likes of Volker are
just rabid scum, and talking to them, and the other zeolots just
distracts from the topic and likely drives away any readers who are
generaly interested in the topic being discussed.

Regards,
Dmytri Kleiner
my initials at trick dot ca will reach me
(I don't live in Canada anymore though)





> However, I must take issue with Noons, who states:
> 
> > But, my dear cyber-friend:  no vendor of anything considered
> > base-layer software like databases has EVER changed the product
> > so much that it broke all previous code!  That would be called
> > "suicide" in market terms.  It's never happened, it will never happen!
> > There is NO NEED to work around such an eventuality: it won't happen,
> > it's a wasted effort.
> 
> 
> There are large companies in our industry who are famous for implementing
> backward-incompatibility in new versions of their software. Further, most
> support is time limited: once the software has reached a certain age, the
> vendor demands that you upgrade (at your cost) if you want to continue to
> receive support and bug fixes. Clearly, that makes good commercial sense and
> nobody would dispute their right to drop suport for old products, but it
> does lock customers into an "upgrade or else" cost cycle. If a customer
> decides not to upgrade, the vendor has effectively broken the code for the
> customer as soon as the next bug or insecurity is encountered: no support
> means no fix.
> 
> The point here is that current commercial practice by many vendors forces
> clients into expensive upgrades which have no direct commercial benefit to
> the customer. Quirk's propositions present a scenario under which customers
> have the freedom to choose what to upgrade and how much to spend, based on
> their own business imperatives and not those of a third party on which they
> depend.
> 
> After 25 years in the industry, I know of many organisations which are
> getting heartily sick of spending vast sums of money in knee-jerk upgrades
> (which usually involves staff retraining and other ancilliary expenses) at
> the whim of a vendor. When I am able to offer my customers an alternative to
> this revenue drain, I am happy to do so. It is not always possible or
> appropriate, but when it is, the benefits are exactly as Quirk has laid out.
> 
> Your mileage may vary.
> 
> Kind regards,
> Doug Hutcheson

Noons <wizofoz2k@ya...nospam>

2004-05-22 15:53:46
Quirk wrote:

> Thanks Doug, it's nice to know that there are one or two actual
> developers in these groups, but anyway, I think it's pointless to go
> on discussing these things in this thread, it's pretty clear to me we
> are dealing with zealots and those looking for genuine answers have
> likely stopped reading long ago, I'll avoid argueing with them and
> instead stick to giving good suggestions, the readers can make up
> their own minds, as they should in any case.
It's a pity that you have considered my reply as that of a zealot.
I did concede a few points and debated yours in a civilized fashion.

However, thanks for giving me the opportunity of stating this in a less
civilized language (remember: YOU started the language, not I):  none of
your points is by definition a "world truth".  You don't provide a single
supporting argument that does not involve your interpretation of what
software makers would do rather than what they in fact do.

Your stupid deduction that somehow only your view of the world is worthy
the title of "developer" defines you as the idiotic and moronic type of
geek that thinks the world was invented yesterday by your kind and all that
came before is just amateur effort.  In character, I might say.

You and your little group can go and drop dead as this thread ends
here for me: I don't have time to argue ANYTHING with "kewl" people.
Not worth the effort: the worst disasters in IT development I've ever seen
in 30 years of career have been prompted by your kind and I don't like
my name associated with that sort of unprofessional reputation.  It
never pays in the long run.

Goodbye and keep developing for a non-existent market.  It has a
brilliant future.  And yes, I DO have a future and nothing you can
possibly do will stop it.

-- 
Cheers
Nuno Souto
wizofoz2k@ya...nospam

This message appeared in a previous month, was never archived, or was lost.

Thanks Nick,  your alternative propositions are much clearer than the
FUD of the other posters. Although, your attitude seems no less
belligerent, so my hopes for a fruitfull discusion are not high.

"Niall Litchfield" <niall.litchfield@di...com> wrote in message news:<40ad113c$0$20509$cc9e4d1f@ne...com>...

> > Proposition 1:
> > There are circumstances under which my client is better protected against
> > commercial or accidental events, if he possesses source code to the
> > application and the underlying database management system.

> Proposition 1a.
> There are circumstances under which my client is better protected against
> commercial or accidental events, if he possesses a contract with a
> financially stable vendor of the application and/or underlying database
> management system.

> Is exactly as true as Proposition 1. Define the circumstances. then relate
> them to the real business world.
In the real business world, outside of major corporations (and
sometimes even  there), closed source software is either used
comepletely illegaly or seriously overdeployed, thus support from the
provider is unavailable or limited to simple telephone support.

The applications are generaly supported by consultants, who are
aquired directly or from
consuting agencies and not development firms.

I'm not saying that this is always the case, or is your case, but it
is the real world you asked about, and that's it.

Having source, and using free software is becoming more and more
common in these cases, and it can be assumed that many of the people
asking questions in this news
group are working in such environements.

So, when the question of Free versus Propietary Databases is asked, I
think it is important to help people understand the advantages of
having source, or using free software, of avoiding dependencies, *as
well* as comparing features.

As I said in my article in the NonProfitTimes, wether or not a
particular peice of free software is better that a particular peice of
nonfree software, free is better than stolen.

If you can guarantee that your legel relationship with your vendor
will never break down, for financial or any other reason,  then yes,
you can get away with not abstracting, and not having source code.
This, however, is not the real business world. Only a tiny, wealthy,
fraction of it.

If you have source code, as you do with free software, you can always
find a way forward, because you are not dependent on a relationship
with any single entity.

> > Proposition 2:
> > There are circumstances under which my client is better protected against
> > commercial or accidental events, if I have coded my application in such a
> > way (by use of a database abstraction layer) that migrating my application
> > to a different database management system is made very easy.

> Proposition 2a

> There are circumstances under which my client is royally screwed if he has
> an app that does not take advantage of the platform on which it is running,
> even if this means being dependent upon that platform.
Issolating your data access code does not mean you can not take
advantage of the platform, it means that all your data access code is
in one place, meaning that you can more easily change your
application, for instance to migrate it, or for instance to *make
better use of the platform you are running*

> > Proposition 3:
> > There are circumstances under which my client is better protected against
> > commercial or accidental events, if he has a human readable backup of the
> > database of the type Quirk describes.
> >
> > I agree with that proposition.
> 
> Why do the words filing cabinet come to mind :(
Because your companies record keepers distrust your closed-source,
unabstraced application's data so much that they insist on keeping
their trusty paper records.

With proper electronic archives as I've described, they will soon
enough be conviced to replace the filing cabinets with datacabinets,
but it will take some convincing, since after years of dealing with
developers like Volker (my new synonym for unskilled labour), and
losing access to their data, they rightfully do not trust the
datasystems.

> > Note that neither Quirk nor I claim that these propositions always apply
>  to
> > every situation, nor that there are not clear and obvious exceptions.

> Well I don't see anywhere that Quirk makes these assertions - though i do
> see him claiming that open Source is a better model that closed source.
Open source is a better model than closed source, but that is not the
subject here, a particular piece of open source software,m such as a
database platform, MAY OR MAY NOT be better than a particular piece of
closed source software. I am not disputing that things like Oracle are
good software, only trying to help those making such a choice
understand there are other things to consider than simply comparing
Oracle against MySQL.

> Where can I get the security & performance fixes for linux kernel 1.5 - I
> don't want to upgrade?
You are equivicating here on the difference between installing more
recent software and paying for a new licence, one is not the same as
the other.

Niall Litchfield <niall.litchfield@di...com>

2004-05-24 20:53:44
"Quirk" <quirk@sy...net> wrote in message
news:4e20d3f.0405220405.57e0a8bf@po...com...
> Thanks Nick,  your alternative propositions are much clearer than the
> FUD of the other posters. Although, your attitude seems no less
> belligerent, so my hopes for a fruitfull discusion are not high.
Last time I looked my name was Niall, but then its only in my email address
and signature and display name so I guess I can forgive you for missing it
:(  I'm afraid you are probably correct about the liklihood of a fruitful
discussion since you seem to have managed to get heated with every single
one of the posters that I am aware of who regularly post well thought out
informative posts.

Never the less


> "Niall Litchfield" <niall.litchfield@di...com> wrote in message
news:<40ad113c$0$20509$cc9e4d1f@ne...com>...
> > > Proposition 1:
> > > There are circumstances under which my client is better protected
against
> > > commercial or accidental events, if he possesses source code to the
> > > application and the underlying database management system.
>
> > Proposition 1a.
> > There are circumstances under which my client is better protected
against
> > commercial or accidental events, if he possesses a contract with a
> > financially stable vendor of the application and/or underlying database
> > management system.
>
> > Is exactly as true as Proposition 1. Define the circumstances. then
relate
> > them to the real business world.
>
> In the real business world, outside of major corporations (and
> sometimes even  there), closed source software is either used
> comepletely illegaly or seriously overdeployed, thus support from the
> provider is unavailable or limited to simple telephone support.
>
> The applications are generaly supported by consultants, who are
> aquired directly or from
> consuting agencies and not development firms.
>
> I'm not saying that this is always the case, or is your case, but it
> is the real world you asked about, and that's it.
If true, and there is some truth to this, I don't see what failing to get
the legalities right has to do with having access to the source. This is
about license management and control of procurement.

> Having source, and using free software is becoming more and more
> common in these cases, and it can be assumed that many of the people
> asking questions in this news
> group are working in such environements.
I'd be careful how you define 'this newsgroup' - it may well be true in
alt.php.sql - it is extremely unlikely to be true in
comp.databases.oracle.server, and I'd guess the sybase group would be
different as well.

> So, when the question of Free versus Propietary Databases is asked, I
> think it is important to help people understand the advantages of
> having source, or using free software, of avoiding dependencies, *as
> well* as comparing features.
No software project, even if you have access to all the source is 'free' of
dependencies, at the very least you are dependent on skill and expertise -
most probably on a whole host of things. FWIW most commercial projects that
fail, fail not because the software is commercial, but because the project
is poorly scoped, poorly managed, inadequately supported by management or
all if the above.

 > As I said in my article in the NonProfitTimes, wether or not a
> particular peice of free software is better that a particular peice of
> nonfree software, free is better than stolen.
Ah a straw man argument. Seen them before.


> > > Proposition 2:
> > > There are circumstances under which my client is better protected
against
> > > commercial or accidental events, if I have coded my application in
such a
> > > way (by use of a database abstraction layer) that migrating my
application
> > > to a different database management system is made very easy.
>
> > Proposition 2a
>
> > There are circumstances under which my client is royally screwed if he
has
> > an app that does not take advantage of the platform on which it is
running,
> > even if this means being dependent upon that platform.
>
> Issolating your data access code does not mean you can not take
> advantage of the platform, it means that all your data access code is
> in one place, meaning that you can more easily change your
> application, for instance to migrate it, or for instance to *make
> better use of the platform you are running*
It almost always does mean you can't take advantage of the platform.

I have 2 databases, both run on clustered hardware, db 1 can resume a select
statement that was issued on a failed node on a second node of the cluster,
db 2 can't. How, precisely, do you 'abstract' this difference in capability
whilst preserving the ability of db 1 to handle failed nodes more gracefully
than db 2. How, precisely, do you abstract differences in datatype between
two db platforms without performing excessive casting..

> > > Proposition 3:
> > > There are circumstances under which my client is better protected
against
> > > commercial or accidental events, if he has a human readable backup of
the
> > > database of the type Quirk describes.
> > >
> > > I agree with that proposition.
> >
> > Why do the words filing cabinet come to mind :(
>
> Because your companies record keepers distrust your closed-source,
> unabstraced application's data so much that they insist on keeping
> their trusty paper records.
And there I was thinking that a proper paper filing system worked just fine
for the purpose for which it was designed.


> With proper electronic archives as I've described, they will soon
> enough be conviced to replace the filing cabinets with datacabinets,
> but it will take some convincing, since after years of dealing with
> developers like Volker (my new synonym for unskilled labour), and
> losing access to their data, they rightfully do not trust the
> datasystems.
The open-paperless office I love the vision.

You snipped what i was referring to, perhaps you misunderstod

referring to

>If a customer
> decides not to upgrade, the vendor has effectively broken the code for the
> customer as soon as the next bug or insecurity is encountered: no support
> means no fix.
I said

> > Where can I get the security & performance fixes for linux kernel 1.5 -
I
> > don't want to upgrade?
>
> You are equivicating here on the difference between installing more
> recent software and paying for a new licence, one is not the same as
> the other.
Not at all. You claimed that if I have access to the source, as I do with
Linux 1.5, then I can always find a way forward without external
dependencies. The only route to what you claim as an advantage would seem to
be rewriting the code in-house, or being dependent on external agencies with
whom I don't have a legal relationship (you don't seem to like legal
relationships much) . Perhaps you suggest that we review  and understand in
house the change log between kernel 1.5 and kernel 2.4 before applying 2.4,
or is there a support contract available that will backport fixes from later
linux to earlier linux. Oracle can and do backport fixes.

Oh and by the way I am perfectly free under my licence to install new
versions of the Oracle software for no change in cost and with the same
support.


-- 
Niall Litchfield
Oracle DBA
http://www.niall.litchfield.dial.pipex.com

Doug Hutcheson <doug.blot.hutcheson@nr...au>

2004-05-24 22:58:44
> > "Niall Litchfield" <niall.litchfield@di...com> wrote in message
> news:<40ad113c$0$20509$cc9e4d1f@ne...com>...
> >
> > > > Proposition 1:
> > > > There are circumstances under which my client is better protected
> against
> > > > commercial or accidental events, if he possesses source code to the
> > > > application and the underlying database management system.
> >
> > > Proposition 1a.
> > > There are circumstances under which my client is better protected
> against
> > > commercial or accidental events, if he possesses a contract with a
> > > financially stable vendor of the application and/or underlying
database
> > > management system.
> >
> > > Is exactly as true as Proposition 1. Define the circumstances. then
> relate
> > > them to the real business world.
Niall,
Exactly !!
  We are both correct - both propositions have merit and neither should be
taken as the justification for believing one way is somehow "right" and the
other "wrong" in every case without exception. The important point is to
define the problem space and fit the solution to it.
  In spite of the highly charged language this thread has suffered from,
this is the nub of what Quirk - and, latterly, I - have been trying to get
across.
  It is not a matter of anyone claiming the high moral ground on some point
of principle. It is not a matter of one side defeating the other on points.
It is just a matter of accepting that there is more than one way to ensure a
customer gets best value for the budget they have available and the task
they need performed.
  Quirk and I both agree that Oracle, for example, is a fine product with
many important features. We both, however, understand that it is not the
only tool in our toolbox and it has drawbacks as well as advantages.
  The circumstances help define the problem space and we propose that
circumstances differ from one project to the next. Your mileage may vary.
Kind regards,
Doug Hutcheson

--
Remove the blots from my address to reply
"Niall Litchfield" <niall.litchfield@di...com> wrote in message news:<40b25fc8$0$20518$cc9e4d1f@ne...com>...

> "Quirk" <quirk@sy...net> wrote in message
> news:4e20d3f.0405220405.57e0a8bf@po...com...

> > Thanks Nick,  your alternative propositions are much clearer than the
> > FUD of the other posters. Although, your attitude seems no less
> > belligerent, so my hopes for a fruitfull discusion are not high.
> 
> Last time I looked my name was Niall,
Sorry Niall.

> I'm afraid you are probably correct about the liklihood of a fruitful
> discussion since you seem to have managed to get heated with every single
> one of the posters that I am aware of who regularly post well thought out
> informative posts.
I guess the new free software movement is such a big threat to the
status quo that it makes them nervous and belligerent to even discuss
it, like many protectionists, they are worried their island is about
to be stormed by barbarians. Well, I guess they are right. The
consumer, however, will benifit. And those amongst you with real
skills will also get on just fine.

> > I'm not saying that this is always the case, or is your case, but it
> > is the real world you asked about, and that's it.
> 
> If true, and there is some truth to this, I don't see what failing to get
> the legalities right has to do with having access to the source. This is
> about license management and control of procurement.
Because with closed source software, 'failng to get the legalities
right' is a financial mater, in many cases companies *chose* not to
get them right, they know perfectly well they are overdeployed.
Sometimes the choice is made by the principals, sometimes the choice
is made further downstream; in the IT department who can't be bothered
going through the procurement cycle again and again and justifing
needing any more licences to the bean counters. They simply install
the software on an another server, or for another user. In larger
organisations the company tends to drift into overdeployment, in
smaller ones, overdeployment or outright piracy is frequently the
starting point.

Free software can not be overdeployed, which is one reason why linux
and bsd boxes are popping up in datacentres around the world, they
started with Webservers, LAN Servers and Firewalls (esp for NAT), then
Mail, now the Database, later the Desktop.

> > So, when the question of Free versus Propietary Databases is asked, I
> > think it is important to help people understand the advantages of
> > having source, or using free software, of avoiding dependencies, *as
> > well* as comparing features.
> 
> No software project, even if you have access to all the source is 'free' of
> dependencies,
Sorry, I meant free of exclusive external dependencies: fixed
dependencies on outside organisations, not just software dependencies.

> > As I said in my article in the NonProfitTimes, wether or not a
> > particular peice of free software is better that a particular peice of
> > nonfree software, free is better than stolen.
> 
> Ah a straw man argument. Seen them before.
No, perhaps a nonsequetor, but not a straw man, a 'straw man'
is refuting a weaker argument instead of the argument you have been
given, the passage you quote is an extension of my own argument 'free
is better than stolen', it is not a weakening of yours. You may
consider my extenstion irrelevant (I do not) but it is not a straw
man.

> > Issolating your data access code does not mean you can not take
> > advantage of the platform, it means that all your data access code is
> > in one place, meaning that you can more easily change your
> > application, for instance to migrate it, or for instance to *make
> > better use of the platform you are running*
> 
> It almost always does mean you can't take advantage of the platform.
> 
> I have 2 databases, both run on clustered hardware, db 1 can resume a select
> statement that was issued on a failed node on a second node of the cluster,
> db 2 can't. How, precisely, do you 'abstract' this difference in capability
> whilst preserving the ability of db 1 to handle failed nodes more gracefully
> than db 2. How, precisely, do you abstract differences in datatype between
> two db platforms without performing excessive casting..
The passage you quote talks about issolating your code to one place:
abstracting access from your application, which is a good coding
practice for reasons I explain, as quoted above, I am not recomending
you try and abstract //the difference between two databases// just
that you issolate the code: abstract the data access for the rest of
your application.

When and if you need to migrate your application to another DB,
presumably you have chosen db 2 based on your requirements and have
already decided on a solution to whatever problem you are facing,
having your code issolated means fewer code changes. Again, this holds
true for migration, it also holds true for simply making better use
(i.e. new features) of the platform you are currently using.

> Not at all. You claimed that if I have access to the source, as I do with
> Linux 1.5, then I can always find a way forward without external
> dependencies.
With out _exclusive_ dependencies on third parties, sorry for the
confusion: without paying for a new licence.

> The only route to what you claim as an advantage would seem to
> be rewriting the code in-house, or being dependent on external agencies with
> whom I don't have a legal relationship (you don't seem to like legal
> relationships much).
You see, *this* is an example of a straw man argument: that I don't
like legal relationships, what I don't like is _bad_ legal
relationships that lock me and my application in to a sole source
situation and other specific restrictions, like limiting the
deployment of my own application to the licenced limits of the
dependency. I have no problem with good legal relationships, like
support contracts, employment contracts, service contracts. All yummy,
with a decent termination clause of course, and my perpetual right to
the source when possible.

> Oh and by the way I am perfectly free under my licence to install new
> versions of the Oracle software for no change in cost and with the same
> support.
As long as you agree to pay whatever Oracle charges for support, a
price fixed not by competition, as it would be if you had source and
could contract who ever you liked, but by David Ricardo's concept of
Economic Rent, meaning that in the long run the price will rise to
what it would cost you to migrate away from Oracle. Interestingly, in
this way users of closed source software do marginaly benefit from
free software, since it lowers this theoretical rent. However, it is
clear that Oracle can benefit from ignorance of free options for quite
a while yet.

Also, your licence likely limits the number of users and severs you
are allowed to deploy, so therefor Oracle's licence has a cost push
effect on your own application as well, potentially killing your own
competitiveness, or forcing you into overdeployment.

Regards,
Dmytri.

Jim Kennedy <kennedy-downwithspammersfamily@at...net>

2004-05-25 12:23:44
"Quirk" <quirk@sy...net> wrote in message
news:4e20d3f.0405250037.4d99dd34@po...com...
> "Niall Litchfield" <niall.litchfield@di...com> wrote in message
news:<40b25fc8$0$20518$cc9e4d1f@ne...com>...
> > "Quirk" <quirk@sy...net> wrote in message
> > news:4e20d3f.0405220405.57e0a8bf@po...com...
>
> > > Thanks Nick,  your alternative propositions are much clearer than the
> > > FUD of the other posters. Although, your attitude seems no less
> > > belligerent, so my hopes for a fruitfull discusion are not high.
> >
> > Last time I looked my name was Niall,
>
> Sorry Niall.
>
> > I'm afraid you are probably correct about the liklihood of a fruitful
> > discussion since you seem to have managed to get heated with every
single
> > one of the posters that I am aware of who regularly post well thought
out
> > informative posts.
>
> I guess the new free software movement is such a big threat to the
> status quo that it makes them nervous and belligerent to even discuss
> it, like many protectionists, they are worried their island is about
> to be stormed by barbarians. Well, I guess they are right. The
> consumer, however, will benifit. And those amongst you with real
> skills will also get on just fine.
>
> > > I'm not saying that this is always the case, or is your case, but it
> > > is the real world you asked about, and that's it.
> >
> > If true, and there is some truth to this, I don't see what failing to
get
> > the legalities right has to do with having access to the source. This is
> > about license management and control of procurement.
>
> Because with closed source software, 'failng to get the legalities
> right' is a financial mater, in many cases companies *chose* not to
> get them right, they know perfectly well they are overdeployed.
> Sometimes the choice is made by the principals, sometimes the choice
> is made further downstream; in the IT department who can't be bothered
> going through the procurement cycle again and again and justifing
> needing any more licences to the bean counters. They simply install
> the software on an another server, or for another user. In larger
> organisations the company tends to drift into overdeployment, in
> smaller ones, overdeployment or outright piracy is frequently the
> starting point.
>
> Free software can not be overdeployed, which is one reason why linux
> and bsd boxes are popping up in datacentres around the world, they
> started with Webservers, LAN Servers and Firewalls (esp for NAT), then
> Mail, now the Database, later the Desktop.
>
> > > So, when the question of Free versus Propietary Databases is asked, I
> > > think it is important to help people understand the advantages of
> > > having source, or using free software, of avoiding dependencies, *as
> > > well* as comparing features.
> >
> > No software project, even if you have access to all the source is 'free'
of
> > dependencies,
>
> Sorry, I meant free of exclusive external dependencies: fixed
> dependencies on outside organisations, not just software dependencies.
>
> > > As I said in my article in the NonProfitTimes, wether or not a
> > > particular peice of free software is better that a particular peice of
> > > nonfree software, free is better than stolen.
> >
> > Ah a straw man argument. Seen them before.
>
> No, perhaps a nonsequetor, but not a straw man, a 'straw man'
> is refuting a weaker argument instead of the argument you have been
> given, the passage you quote is an extension of my own argument 'free
> is better than stolen', it is not a weakening of yours. You may
> consider my extenstion irrelevant (I do not) but it is not a straw
> man.
>
> > > Issolating your data access code does not mean you can not take
> > > advantage of the platform, it means that all your data access code is
> > > in one place, meaning that you can more easily change your
> > > application, for instance to migrate it, or for instance to *make
> > > better use of the platform you are running*
> >
> > It almost always does mean you can't take advantage of the platform.
> >
> > I have 2 databases, both run on clustered hardware, db 1 can resume a
select
> > statement that was issued on a failed node on a second node of the
cluster,
> > db 2 can't. How, precisely, do you 'abstract' this difference in
capability
> > whilst preserving the ability of db 1 to handle failed nodes more
gracefully
> > than db 2. How, precisely, do you abstract differences in datatype
between
> > two db platforms without performing excessive casting..
>
>