150309-155358

150149-154374 subjects 150485-155618

^ IRB and previous commands
150309 [nsmith5 nist] Is there a way to define the arrow keys to traverse the command
150310 [threeve.org ] install the readline extension for ruby and it will just work.

^ Recursive OpenStruct
150311 [listen marcr] Dear list,

^ require each time new
150312 [ulmo valaraa] i´m trying to build a irc-bot in ruby, and i´ve no problem with that so far.
+ 150316 [ruby-talk le] Use load() instead of require
+ 150317 [ruby.brian g] Use load instead of require. Load needs the path to the file, but will
  150391 [dave.m email] charset="iso-8859-1"

^ [OT] Actually vs. Currently (was Re: RegExp question: look-behinds?)
150314 [lukfugl gmai] Just as a clarification[1] for English speakers, the use of the word
150395 [wonado donne] "Jacob Fugal" <lukfugl@gmail.com> schrieb im Newsbeitrag news:507567670508011229776979a7@mail.gmail.com...

^ Using gcc with mswin32 version of Ruby
150318 [brian.takita] I am using the mswin32 version of ruby (One Click installer.
150320 [brian.takita] I must eat my words here. I removed the RUBYOPT = rubygems environment

^ ruby gems/rails
150327 [blackwaterde] I just compiled ruby 1.8.2 on my linux Fedora box which installed
150340 [rwoliver2 gm] rpm -qa | grep "zlib-devel"

^ Selective mixins; who can improve on this?
150334 [khaines enig] So, on #ruby-lang an hour ago, Daniel Berger asked for ideas to make some
+ 150341 [transfire gm] def a; p self; end
| 150348 [Ara.T.Howard] class Module
| 150351 [transfire gm] a,
+ 155205 [pbrannan atd] require 'nodewrap'
  155224 [Daniel.Berge] This doesn't work for me.  There appears to be no UnboundMethod#body
  155358 [pbrannan atd] The latest version of nodewrap is missing. :)

^ module / inheritance question
150335 [joevandyk gm] class Parent
+ 150338 [zdennis mkte] Because you defined boo as a module method on TheModule. Instance
| 150345 [joevandyk gm] Ah, thanks.
+ 150339 [transfire gm] extend self

^ Tk - Ruby/Tk core library design questions
150336 [email55555 g] I forgot which old version is, on that old version, the widget.pack
150388 [nagai ai.kyu] 'tk.rb' on CVS already has the method.
150417 [email55555 g] OK. Thank you. ( I always behind ...  )
+ 150444 [email55555 g] TkScale.new(:form=>10, :to=>100, :value=>40, :variable=>v).pack
| 150473 [nagai ai.kyu] If the order is important, such parameters should not be
+ 150695 [nagai ai.kyu] I've commit that to CVS (HEAD and 1.8 branch).
  150741 [email55555 g] Yes, I tried it. It works.
  150797 [nagai ai.kyu] This method is defined on tkutil.c.
  150798 [nagai ai.kyu] Maybe, you need get and recompile "tcltklib" also.
  150894 [email55555 g] Ok. Thanks for the info.

^ C++ Design Principles for Ruby - Classes of Classes.
150342 [john.carter ] I have just been reading "C++ Coding Standards" 101 Rules, Guidelines, and
150571 [david vallne] Hmm, I thought #clone makes a crude low-level copy, and #dup is the

^ C++ Design Principles for Ruby - Prefer composition to Inheritance.
150344 [john.carter ] Item 34. Of C++ Coding Standards is "Prefer composition to inheritance".

^ C++ Design Principles for Ruby - Some classes don't want kids.
150346 [john.carter ] Avoid inheriting from concrete classes, to add behaviour add non-member

^ C++ Design Principles for Ruby - Prefer Abstract Interfaces.
150349 [john.carter ] Prefer to inherit from abstract classes that have pure virtual functions

^ C++ Design Principles for Ruby - LSP
150350 [john.carter ] Public inheritance _is_ substitutability. (Liskov Substitution Principle)

^ extconf.rb search path
150353 [joevandyk gm] Whenever I run extconf.rb for gnome2, it compiles against the gnome
+ 150354 [matz ruby-la] It's according to your compiler's default priority.  Blame the
+ 150356 [Ara.T.Howard] try this
  150357 [joevandyk gm] Weirdly, if I run /usr/local/bin/ruby (and not /usr/bin/ruby) on
  150358 [Ara.T.Howard] absolutely - you should always be aware of which ruby you are using to compile
  150518 [joevandyk gm] I have new libraries installed in /opt/lib.  LD_LIBRARY_PATH and
  150521 [joevandyk gm] Nevermind!  Somehow, I missed Matz's post.

^ rails on osx-says it's installed but isn't
150360 [blackwaterde] After some work, I finally got ruby gems to install on a mac osx
150394 [blackwaterde] Anyone have any ideas on this?
+ 150403 [r_mueller im] You should have a look on your PATH-variable. probably root doesn'not know
| 150410 [blackwaterde] I got it working..thanks.
+ 150434 [ezra yakima-] Is the rails command in you $PATH? What is the result of the

^ algorithm help
150361 [Ara.T.Howard] any of you knuth fans know some slick (read: fast) way to do this
150362 [szymon.rozga] What exactly are you trying to do ?
+ 150363 [Ara.T.Howard] i have a massive (100-500MB) grid of solar elevations and a coresponding data
| 150367 [martindemell] This might work better: binary search for {x | (x - min) == (i_x - i_min)},
| 150376 [pit capitain] def gap?( data, min, max )
| + 150381 [simon.kroege] data = [3, 4, 5, 6, 7, 8, 9, 15, 31, 32, 33, 34, 35, 36,
| | 150393 [simon.kroege] I guess no one cares, but there is an even shorter version
| | 150757 [bob.news gmx] This looks cute.  What makes you sure it's O(log n)?
| | + 150841 [martindemell] Nice :)
| | | 150848 [simon.kroege] in fact I think its O(m * log n) with n equals the size of data and m
| | | + 150850 [simon.kroege] erm, this has to be
| | | | 150877 [Ara.T.Howard] []                                    => bad value for range (bad value for range)
| | | + 150853 [martindemell] Yeah, I can't prove it without handwaving, but I think O(m log n) is the
| | | | 150876 [Ara.T.Howard] [1,2,3]
| | | | 150943 [martindemell] [1,3,5] you mean :)
| | | | 150952 [Ara.T.Howard] details details.  sheesh.
| | | + 150854 [bob.news gmx] Hm, my alogorithm analysis is quite rusty but I believe you would have to
| | |   150857 [martindemell] Yep - the two likely cases are m = O(1) and m = O(n). In the latter
| | |   150858 [simon.kroege] true, this is optimized for the given case (m <= 2).
| | |   150879 [Ara.T.Howard] which was exactly the tast at hand - this is 'always' true for my data.
| | |   151006 [bob.news gmx] format=flowed;
| | |   151027 [SimonKroeger] Nice one,
| | |   151106 [bob.news gmx] format=flowed;
| | |   151146 [SimonKroeger] Maybe there is, but your seek method 'inspired' me to do something else.
| | |   + 151153 [Ara.T.Howard] This message is in MIME format.  The first part should be readable text,
| | |   + 151160 [Ara.T.Howard] This message is in MIME format.  The first part should be readable text,
| | + 150883 [Ara.T.Howard] not bad (and *so* short), but failing for descending ranges and ones with
| |   + 150884 [simon.kroege] ok, this is sorted, but I thought it is sortet
| |   | 150893 [simon.kroege] Yeah, and I hope this is the last message (at least my last
| |   | 150896 [simon.kroege] but than, I'm not sure how the slicing is implemented, so no
| |   + 150939 [dooby d10.ka] Descending ranges don't have much method support in Ruby, though.
| |     150942 [Ara.T.Howard] but
| |     150944 [dooby d10.ka] Fair enough.
| |     150953 [Ara.T.Howard] lol.  i've moved onto satelites - you __really__ don't want any of those
| + 150584 [Ara.T.Howard] sorry it took me so long to respond pit and martin... got sidetracked.  your
|   150585 [Daniel.Berge] No applause please.  Just throw money (at RubyCentral).
|   150588 [Ara.T.Howard] how?  i bought the new book...
+ 150364 [esmiralha gm] He trying to identify all the sequences inside the original array.
  150365 [Ara.T.Howard] This message is in MIME format.  The first part should be readable text,
  + 150366 [daniel.amela] Instead of looking for ranges, why not look for gaps in the sequence
  | 150369 [vjoel path.b] It's already O(n) if you read the array sequentially. I guess we're
  + 150368 [vjoel path.b] How could the array contain zero ranges? Empty array?
    150375 [w_a_x_man ya] [3, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41],

^ Re: Ruby on the mobile
150370 [prakash.diby] Is there any specific reason that Java and BREW are the only languages
150399 [halostatue g] Often because the phones are built to satisfy network providers'
+ 150406 [gene.tani gm] ...
| 150435 [prakash.diby] Any pre Ruby update would be great.
+ 150436 [prakash.diby] Do you mean to some benchmark standards?
  150445 [halostatue g] I wish. I mean "I control the network, therefore I control what goes

^ Style question: when to use underscores
150371 [francisramme] When should you use underscores to
+ 150374 [eduardo.yane] Never, I use capital letters to separate words.
| + 150392 [flori nixe.p] class A
| | + 150603 [mkhan lextra] why not, just A.new.send 'foo bar' ?
| | | 150609 [batkins57 gm] It's generally better practice to use "__send__" to preven name clashes wit=
| | | 150621 [mkhan lextra] Yes,, I agree with you.
| | + 150663 [lists bertra] A nice idea. Using spaces instead of underscores and then
| + 150401 [halostatue g] This is common in Java and C++, but very uncommon in Ruby except in class names.
| + 150418 [ruby.brian g] Convention is, that ClassNames are written in CamelCase while
+ 150378 [daniel themi] Sometimes tradition (read: C function names) overrides any other
+ 150404 [gene.tani gm] (They're not functions, they're methods)
+ 150420 [dblack wobbl] Always or almost always.
+ 150569 [david vallne] I find that to be very rare in the standard libs, and almost exclusively when
  150579 [flori nixe.p] It was a joke, not a serious advice. Come on, laugh, it's funny. Hahaha...

^ Factors to consider for choosing Ruby?
150372 [francisramme] At work I have received an assignment where I have to parse textfiles
+ 150382 [dotnetguy gm] Ruby can be used pretty much anywhere where you'd use C++ today. In my mind=
| 150419 [david vallne] Eww, Gtk ;P My quirk is mainly the fact wxRuby isn't quite up to speed with
| 150421 [lymans gmail] I haven't had any problems with FXRuby... that's about all I do in
+ 150461 [ptkwt aracne] Ahhh, another Ruby-smitten programmer.  Welcome!

^ csv to hash
150380 [walter.kruse] I have a csv file with two fields per line. What would the most
+ 150383 [neoneye gmai] irb(main):008:0> txt = "10000,A\n10001,B\n10002,C"
| 150396 [walter.kruse] Thanks Simon. No matter what I do I get nil.
+ 150384 [martindemell] hash = []
| 150397 [walter.kruse] ...
| 150398 [martindemell] Oops, no, my mistake. I meant hash = {} rather than hash = []. {} is an
| 150402 [walter.kruse] thank you so much. Works exactly as I need.
+ 150386 [kingsley ice] maybe this will help - it uses the first line in the csv as the handle
+ 150469 [mrcode netro] require 'csv'

^ different order of parameters...
150385 [usenet zabie] I'm trying to understand how to call methods in Ruby. Is it possible to
150387 [matz ruby-la] No. Keyword arguments like
+ 150390 [Neville.Burn] def fun(params)
| 150408 [usenet zabie] print a, b, args, kwargs
+ 150400 [halostatue g] Why will they be separated, Matz? Is it because it's easier to
| 150431 [matz ruby-la] Just because I don't prefer rather complex argument application rules
+ 150415 [chneukirchen] To what extend will these be checked?
  150429 [matz ruby-la] It's not settled but I guess nothing will happen, just like we had
  150475 [chneukirchen] Good checking is IMO very important... too many dumb errors can happen
  150478 [matz ruby-la] I guess you would be able to.
  150555 [david vallne] One of the cooler of syntax features making a comeback? Rawr.
  150570 [matz ruby-la] It would, but it takes years for libraries to adopt keyword arguments.
  150587 [chneukirchen] mystring.gsub(/bar/, with: "foo").tr "abc", to: "xyz"
  150604 [ruby.brian g] wouldn't
  150726 [chneukirchen] Except it's called inject:into: in Smalltalk.

^ Module that keeps track of instance count?
150414 [francisramme] I need some of my classes to keep track of their number of instances.
+ 150416 [halostatue g] module InstanceCounter
| 150474 [szymon.rozga] I don't know how this conforms to Ruby programming style, but you can
+ 150515 [dave burt.id] module InstanceCounter
+ 150532 [francisramme] module InstanceCounter

^ my map vs. collect bone
150425 [transfire gm] I have a bone to pick. I tire of accounting for both method terms 'map'
+ 150428 [Daniel.Berge] That's a YP, not an MP.  The same could be said of all aliases.
| 150443 [transfire gm] Perhaps. But this term particularly so b/c of it's frequent usage in
+ 150433 [chneukirchen] I prefer #map because I do more Lisp than Smalltalk. :-)
| + 150441 [dblack wobbl] I prefer to keep both because I do more Ruby than Lisp or Smalltalk
| + 150450 [patrick.fern] Regardless of the fact I like #map more than #collect, here's my
|   + 150484 [transfire gm] He he. It's amazing what Ruby can do, ain't it Patrick?
|   + 150591 [netghost gma] I keep reading these ruby posts and smiling,  I love this stuff.  It
+ 150438 [ruby.brian g] I never use collect, because collect would seem more like select or

^ Re: require each time new [irc::bot]
150426 [ulmo valaraa] Tanks to the two who helped me with load(). it´s working fine, and i can
150430 [dave.m email] charset="utf-8"

^ burn a cd from a ruby script
150427 [webwesen gma] is there a way to burn a cd from a ruby script on Windows?
150432 [james_b neur] Have you tried File.copy?
150467 [rcoder gmail] There is, IIRC, a Cygwin port of the *NIX 'cdrtools' package, which
150481 [webwesen gma] that's what I was lloking for. thanks!

^ enum collection of constant values
150439 [drosihn gmai] I'd like to have a set of constants for a class, where their values
+ 150446 [ jimm io.com] Use symbols. They are similar to strings, but every use of the same symbol
| 150449 [pit capitain] ... and for a set of values use the class Set.
| 150453 [ jimm io.com] I'm not sure I understand why you suggest the use of Set. Am I missing an
| 150464 [pit capitain] I'm sorry that you didn't understand me. I also think that having
| 150466 [ jimm io.com] That makes perfect sense. Thank you.
+ 150452 [phurley gmai] SB_MODA, SB_MODB, SB_MODC = *0..2
| 150457 [phurley gmai] Oops I had not read your whole message. To handle the binary one, I
| 150459 [phurley gmai] Oh yeah you can take out my puts statements too :-)
+ 150454 [Ara.T.Howard] class methods are your friend
| 150480 [phurley gmai] I like the Enum module, but if I include it into the 'main' scope, I need to
| 150482 [Ara.T.Howard] hmm.  this is a bit shorter
| + 150483 [vjoel path.b] Why would you want the mc = self.class option ?
| | 150487 [Ara.T.Howard] isn't this what the op wanted?
| + 150512 [drosihn gmai] Wow.  Very nice.  Works great in my script.  Thanks!
| + 150520 [drosihn gmai] I changed the method names to enum_constants and enum_bit_constants.
+ 150456 [ruby.brian g] bschroed@black:~/svn/projekte/ruby-things$ cat enum.rb
+ 150458 [ysantoso-rub] SB_ENUM = {:none => 0, :good => 1, :bad => 2, :logic_err => 4}.freeze

^ setting up ruby on os x 10.2
150451 [julian coret] I just downloaded ruby and did the configure, make, make test and
150460 [ jimm io.com] Julian,
+ 150465 [rcoder gmail] Actually, if I remember correctly, /usr/local/bin *is* in the default
+ 150472 [peloke.ruby ] What was the error?
+ 150511 [julian coret] /usr/local/bin appears to be in my path.
  150526 [discordantus] There is no reason to delete Apple's 1.6.x Ruby at all. Just make sure
  150546 [julian coret] /sw/bin /sw/sbin /usr/local/bin /bin /sbin /usr/bin /usr/sbin /usr/
  + 150552 [r_mueller im] I'm still not sure, if gem has install rails or not. The Non-existence of
  | 150553 [julian coret] I haven't installed rails yet.
  + 150558 [threeve.org ] the /sw/bin and /sw/sbin concern me.  Do you use fink?  Did you ever
    150560 [julian coret] Yes, I use fink. No I never installed ruby with fink (unless it was a
    151576 [bg-rubytalk ] You might have better luck using DarwinPorts.  Once it's installed

^ Ruby Kerberos libs?
150470 [rcoder gmail] It's been such a long time since we had a thread like this on c.l.r.,
+ 150471 [jfh cise.ufl] I've been too lazy to actually make a library, so I just use the pty and
+ 150522 [prakash.diby] Sounds a good idea.I mite be interested to write something like this.
  150605 [rcoder gmail] We use Kerberos for authentication to a number of services, (printing,
  150673 [prakash.diby] Good idea to start with.I got introduced to Kerberos thru a a mobile

^ Strange behavior with constants
150476 [batkins57 gm] class X
150479 [matz ruby-la] Constant assignment is done in the context determined at compile time,
threads.html
top