238503-245556

238252-246803 subjects 238688-240010

^ Ruby Tk: how to make something happen periodically?
238503 [arifsaha gma] In Ruby Tk, how to make something happen periodically, while the user
238505 [m_goldberg a] Go to <http://rubykitchensink.ca/> and search on "tktimer".
238507 [m_goldberg a] Let me recant on that. It's better to go to Google and search "ruby
239730 [arifsaha gma] Works like a charm, once I know the keyword, things went smoothly.
+ 239739 [m_goldberg a] No, I'm sorry, but I don't know where the result of a block passed to
+ 239750 [nagai ai.kyu] Please try this.

^ [ANN] One-Click Ruby Installer for Windows: 185-22 Final
238508 [ml.chibbs gm] The only change since RC3 was to fix rake.bat to use 'gem' instead of

^ ENV['COLUMNS']
238514 [_nospam_seti] in irb I can have access to ENV['COLUMNS'] for the # of columns in the
+ 238516 [B.Candler po] Nothing to do with ruby...
| 238518 [ljz asfast.c] Well, if that were the case, the variable wouldn't be visible within
| 238522 [B.Candler po] brian@mappit:~$ irb1.8
| + 238525 [ljz asfast.c] Yes, it looks like the shell is not exporting those environment
| + 238604 [_nospam_seti] yes Brian, me too. I'm running the script in a terminal shell.
+ 238571 [akbarhome gm] Because when you play with irb, it is clear that you use terminal/
| 238574 [_nospam_seti] sorry but that seems not to be a satisfactory explanation.
| 238578 [_nospam_seti] akbarhome, unless what you mean is: that info is not available because
+ 238607 [ryand-ruby z] COLUMNS isn't exported. You shouldn't be able to see it within your
  239067 [steven lumos] $ echo $COLUMNS

^ Hash into Two Arguments (for REXML)
238527 [keith audiob] Hey,
238610 [shortcutter ] a.add_namespace(*RDF_NS..each {|k,v| break k,v}}

^ Upgrading standard libs in ruby (soap4r)
238533 [jurglic gmai] I'm trying to upgrade my soap4r ruby standard library. I've installed
238562 [halostatue g] require 'rubygems'

^ Do not understand this
238534 [bruparel mer] I am going through Dave Thomas's Programming Ruby Second Edition book.
238536 [wonado donne] Windows waits for an Input!
238537 [rodrigo.berm] As Wolf stated the problem is with the 'date' command on windows.
238541 [bruparel mer] Thank you gents.
238543 [drbrain segm] The syntax `cmd` calls the method #`  You don't need the closing

^ Call a method before a method is called?
238535 [bjohnson med] Does ruby have "hooks". Where I can define, let's say, a method called
+ 238540 [rodrigo.berm] def lady
+ 238549 [bofh softmed] require 'blank' # http://pastie.caboo.se/26558
  238555 [bofh softmed] correction http://pastie.caboo.se/39410 ..

^ tr does not work with non-english chars
238539 [joaomiguel.p] if I do this
+ 238542 [ruby.hardwar] In your second example, the string contains 'a' but after tr....
+ 238548 [robert.dober] This is the idea of a genius , sorry couldn't  resist folks ;)
  238551 [joaomiguel.p] I can't get my answer from your answers, sorry
  + 238553 [ruby.hardwar] ...
  | 238554 [joaomiguel.p] cool but what I want is
  | 238564 [ruby.hardwar] Seriously, I only work with English and Japanese characters so if thatdidn't fix your problem then the only thing I know to try is $KCODE ='u'.If that doesn't help, maybe someone else can help.
  | 238566 [joaomiguel.p] Thanks all, i'm done
  + 238558 [robert.dober] Sorry that I wasted your time!
    238560 [joaomiguel.p] that's ok :) it seem you're not seeing my problem I'm using the char

^ Idiom for dynamic loading of an unknown class from a known file
238552 [rubylearner ] I need to load a class at runtime, whose name I do not know in advance, but
+ 238557 [ara.t.howard] dynaload does __exactly__ this.
+ 238559 [vjoel path.b] # http://redshift.sourceforge.net/script

^ getting warning messages about gem obsolete
238556 [Raeka8 yahoo] I uninstalled my old ruby (v 1.8521 I think it was), and installed
238563 [TimHunter nc] Do you have an .irbrc file? Does it use "require_gem"? If so, edit the
238587 [Raeka8 yahoo] I just did a search on my computer and I didn't find any .irbrc files.

^ [ANN] fastthread now default in ruby_1_8
238561 [knu iDaemons] I have just finished integrating MenTaLguY's fastthread mutex
239224 [mental rydia] The version of fastthread which was merged doesn't handle interrupted

^ validates_confirmation_of not working
238567 [joaomiguel.p] well, here I am again :)
238577 [halostatue g] This is a rails-specific question asked on the general Ruby mailing

^ Generating instance variable for a class
238572 [donn cmscms.] What I am trying to do is use a hash to tie attributes to an input
238576 [gregory.t.br] ri instance_variable_set

^ Re: gem update --system broke rubygems?
238580 [halostatue g] Something has gone bonkers with your source cache. Mine is in

^ Cisco and network products for sales
238583 [smokey_jnr00] S. A. TRADING (UK) LIMITED

^ Windows and Ruby - Not very good friends?
238584 [bruparel mer] I am new to Ruby and RoR, so pardon me if I ask naive questions.
+ 238590 [slamboy gmai] Well... I couldn't duplicate your problem at first.  I copied and pasted
+ 238595 [cmshea gmail] Bharat,
+ 238596 [cmshea gmail] I just saw Jason Mayer's response in ruby-talk-google.  I bet he's
+ 238603 [wonado donne] This is a typical problem when running a program from inside "SciTE" and and an
  238628 [bruparel mer] Gents,
  238637 [wonado donne] It is <CNTL>+Z or <CNTL>+D in a Windows console (I don't know which one, both
  238640 [bruparel mer] Thanks Wolfgang.
  238644 [bruparel mer] Follow-up question for Chris, Wolfgang, and anyone else who has
  + 238665 [wonado donne] Well, I started to build some libraries and techniques for textual analysis. To
  + 238698 [slamboy gmai] I work in a windows world.  I learned ruby to attempt to automate my job,
  + 238764 [richard.conr] It depends on whether the output of your effort is (1) a Ruby application

^ Re: - PathEditor 1.0.0 - A command line utility for managing
238585 [apeiros gmx.] Not sure, but if you wanted the latin one, that's "Nota Bene".

^ fib_example.rb
238588 [Raeka8 yahoo] I am reading the Programming Ruby book by Dave Thomas (2nd edition)
238589 [rubygeekgirl] Not 100% sure, so I apologize in advance if I'm wrong. (It happens quite

^ Firebrigade + hoe?
238593 [schapht gmai] I used newgem to create my 'sparehand' gem.  The rakefile now depends
+ 238599 [hhausman gma] hth,
+ 238624 [cdcarter gma] Hoe automatically injects itself as a dependency.
  238718 [schapht gmai] In the 'newgem' case it doesn't.  Thanks, Harold, for that blog entry.
  238822 [schapht gmai] w00t!  http://firebrigade.seattlerb.org/gem/show/sparehand

^ Randomly Sorting Strings
238600 [wood_yee12 h] string each time it's run from a list of strings.
238601 [phillipsds y] try
238602 [apeiros gmx.] example= %w[one two three cat dog cow table].sort_by { rand }
+ 238608 [robert.dober] this is a Ruby Quiz Spoiler!!!
| + 238609 [apeiros gmx.] I apologize. I didn't read the current quiz.
| | 238615 [robert.dober] No I do not think so, no need to apologize either ;)
| | 238659 [james graypr] Overlap happens.  No big deal.  It just means I chose well for the
| + 238623 [robert.dober] Ok time to clarify.
+ 238614 [dblack wobbl] puts example

^ isNaN() ruby equivalent?
238605 [vincent-fran] what is the equivalent to isNaN in ruby?
238606 [sander.land ] Float#nan?

^ Inter process semaphore
238611 [stonkajr gma] Is there a way in ruby to use global system's semaphore. I am using
238622 [ara.t.howard] -a

^ Inter process semaphore
238612 [stonkajr gma] Is there a way in ruby to use global system's semaphore? I am using
238618 [kashia.buch ] Simple C ext + normal semaphores?  AFAIK when calling a C ext, Ruby

^ Getting my sister to learn programming
238613 [sonoflilit g] I've just come back from a trip home* and was surprised to find my sister
+ 238619 [mushfeq.khan] I've leafed through it a little and it looked very cool. Professor Ducasse
| 238620 [sonoflilit g] Yes, but I want to teach her an environment where if she comes to me and
| + 238621 [sonoflilit g] It's... It's like TryRuby with graphics!
| | 238675 [benjohn fysh] That's really cool! I can't see how it works. Doesn't seem to be SVG.
| | + 238712 [ilmari.heikk] It's using the canvas[1] tag, a vector graphics canvas built into
| | | + 238769 [benjohn fysh] Oooh, wonderful! That's kind of what I've been looking about for.
| | | + 238876 [botp delmont] # You can do fun stuff like
| | |   238982 [ilmari.heikk] Canvas works pretty nicely for making flashy HTML GUIs, here'sa small proof-of-concept http://www.cs.helsinki.fi/u/irkheikk/login2.html
| | + 238751 [sonoflilit g] It is done with Canvas (so it might not work in IE).
| + 238672 [benjohn fysh] Do you have to pick one language? When people decide to write a game,
+ 238702 [m_goldberg a] I think Logo is great as a first computer language. There are some
| 238732 [B.Candler po] How about sticking it up on rubyforge?
| + 238737 [B.Candler po] $ irb1.8 -rtkturtle
| | 238830 [m_goldberg a] The Ruby Quiz turtle graphics kit is more Logo-like. One can write in
| + 238829 [m_goldberg a] 1. It's already available (except for some of my Logo translations)
+ 238744 [v.konrad lse] the reason being that the "syntax" of scheme is so regular and easy to
+ 238754 [sonoflilit g] I was talking about the Lisp FAMILY, of course, so scheme is included.
| + 238786 [v.konrad lse] maybe it is not used much (meaning being popular), but my very good
| + 238836 [sonoflilit g] More important is "CAN it be used?". I think it can. Am I wrong?
| | 238838 [martindemell] With PLT scheme, almost certainly. It ships with a very nice
| | 238856 [sonoflilit g] Then, out of curiosity, why don't people USE it for real world apps?
| | + 238861 [martindemell] Hard to say. I speculate that it's because there are more attractive
| | | 238863 [sonoflilit g] Any advantage to Euphoria over Ruby?
| | | 238865 [martindemell] None that I can see - it looks like a less powerful language, overall,
| | | + 238866 [sonoflilit g] Could you show examples of things quicker to do in Eu... than in Ruby?
| | | | 238868 [martindemell] You misunderstand - you can almost certainly do anything quicker in
| | | + 238922 [GGarramuno a] Best Basic clone I have found is Blitz Max.  It is the new generation
| | + 238910 [sonoflilit g] Wow, you got a strong point there!
| |   238915 [richard.conr] serious argument against Ruby you have raised is the English factor,
| |   238917 [sonoflilit g] The two strong arguments I have against Ruby are that the syntax is more
| + 238916 [GGarramuno a] On Feb 12, 11:56 am, "M. Edward (Ed) Borasky" <z...@cesmail.net>
|   238918 [sonoflilit g] Is there a cheap way to get myself one of those oh-so-limited machines, and
+ 239006 [ snk gna.org] How about Loro?
  239008 [sonoflilit g] Seems like exactly something to KILL the spark that I am so trying to
  239262 [mushfeq.khan] You should teach her Javascript. I'm serious.
  + 239287 [sonoflilit g] But, although JS is a very powerful language, it is an ugly one syntax-wise,
  + 239288 [martindemell] javascript itself is a beautiful language, but trying to do anything
    239290 [sonoflilit g] Javascript syntax is scary.

^ [SOLUTION] One-Liners (#113)
238616 [gavin refine] Here are my solutions to Quiz #113. For some of them I just couldn't
+ 238652 [kbloom gmail] Good answer. you helped me golf mine down a little bit by getting rid of
| 238666 [kbloom gmail] Another answer, based on yours, this one is exactly one expression (no
+ 238693 [james graypr] When I built the quiz, I used the following solutions to reality-
  + 238739 [robert.dober] This quiz - as I tried to say with the wrong verb in my solution - is a
  + 238755 [robert.dober] quiz.inject(Array.new) { |arr, a| arr.push(*a) }

^ Re: One-Liners (#113)
238617 [gavin refine] Bah, of course the 80-char lines wrapped and got confusing with my
238642 [cmshea gmail] I wasn't able to get down to less than 80 chars on two of the items.
238650 [kbloom gmail] Too long: 96 characters (but I couldn't get it under 80 either)
238679 [gavin refine] Argh! #select is exactly what I should have used. Nice.
238724 [gavin refine] On Feb 11, 4:40 pm, James Edward Gray II <j...@grayproductions.net>
+ 238726 [gavin refine] Elegantly small!
| 238760 [rubytraining] When I saw that, I thought that it could definitely be shortened by
| 238762 [robert.dober] Comparing this with James' solution we can it down to
| + 238763 [robert.dober] please kindly insert the string "get" on the appropriate place in my last
| + 238798 [alex blackke] Given the equal lengths, I prefer this - the r=[];...;r idiom strikes me
+ 238803 [james graypr] Thank you.
  + 238810 [gavin refine] On Feb 12, 10:29 am, James Edward Gray II <j...@grayproductions.net>
  + 238812 [robert.dober] Now I just could benchmark this and be smart afterwards, but I love to take
  | 238815 [robert.dober] here goes the benchmark ( I was right, too bad you'll never know if I
  | 238823 [james graypr] How does this code work?  You pass arguments to methods we don't
  | 238850 [robert.dober] I am a magician ;)
  + 238972 [kbloom gmail] (h=lambda {|n| n==1 ? [1] : [n] + h[n%2 == 0 ? n/2 : n*3+1] })[23]
    238975 [james graypr] Exactly.
    238977 [robert.dober] That really puts the spotlight on it,  this will go away  in  2.0 though if
    238979 [james graypr] Hmm, I wasn't aware of this.  What makes you say that?

^ remove element from array
238629 [joaomiguel.p] how can I do to rtemove an elemnt from an array,
238630 [joaomiguel.p] sorry for making loosing your time. I'm a looser :)
238631 [dblack wobbl] See the docs for Hash#delete, Hash#delete_if, and Hash#reject!  (That
238632 [joaomiguel.p] I'm done!

^ Very interesting paper about future programming models
238635 [garbagecat10] Note the mention of Rails at the end of Section 2.0.
238638 [keith audiob] It is striking, however, that research from
+ 238648 [garbagecat10] Are you expecting another round (or more) of massive improvements in
| + 238654 [webcontrol h] 1)  Multivalue Logic (Nasty)
| | 238667 [benjohn fysh] Seeing as it makes use of a Tuneable Flux Transformer, I'm pretty
| + 238670 [benjohn fysh] Quite so :)
+ 238658 [halostatue g] I'd rather have an EE-CS department than a Math-CS department. I'd
+ 239092 [timx nospam.] I'd rather that than what has happened to my old department, which has become
+ 239567 [Tim.Bray Sun] Let me rephrase that.... general purpose computers always beat

^ editing environment.rb files
238636 [Raeka8 yahoo] I did a search on the internet to try to find a way to get rid of
+ 238649 [cdcarter gma] The environment.rb suggestion is only if you use Ruby on Rails.  The
| 238664 [Raeka8 yahoo] Thanks for the reply.
| 239037 [ml.chibbs gm] It won't have any affect other than being annoying. An update to Instant
+ 238733 [B.Candler po] As usual, the best way to do anything in Windows is to do it in DOS :-)

^ Creating an object the hard way, made easy with lambda
238639 [grettke gmai] #!/usr/bin/env ruby

^ [ANN] AWS Presentation at the Feb. Phoenix Ruby User Group Meeting
238645 [james.britt ] See http://www.rubyaz.org/groups/prug for address and map

^ Socket Problem
238653 [M1-TIC-ISC r] I've a problem with socket using in ruby.

^ What's the correct and fast way to determine if a (gig) number is a perfect square?
238655 [sam.s.kong g] I'm solving a math problem in Ruby.
+ 238656 [vjoel path.b] x = 123456789123456789
| 238831 [sam.s.kong g] Yes. Your approach is better than mine.
| 238834 [vjoel path.b] Wrong how?
| 238840 [sam.s.kong g] I think even if you use #round, the problem won't go away.
| + 238845 [gavin refine] irb(main):004:0>
| + 238847 [vjoel path.b] I agree, but I don't think the problem shows up until you have much
|   238942 [neleai sezna] Best is use GMP. Other methods are binary search. Or bigdecimal with
+ 238671 [fxn hashref.] There are faster algorithms based on the fact that most non-squares
  238816 [fxn hashref.] I've been able to consult the book today. There is a specialised
  238833 [sam.s.kong g] I really appreciate your kind help.

^ [ANN] Dhaka-2.0.1 housecleaning
238660 [mushfeq.khan] * Cleaning up the code - I'm grateful to Marcel Molina, Jr for submitting a

^ Generator implementation
238663 [godfat gmail] I was reading the Generator implementation a few hours ago,

^ How do I put empty directories into a gem package?
238669 [lbayes gmail] I feel like an idiot for being unable to get this working...
238697 [halostatue g] Um. I'm not sure that's what you want to do. Why not consider
238703 [lbayes gmail] I definitely considered that direction, and even got it mostly-
244973 [lbayes gmail] Does anyone else have any ideas about how to solve this problem?
245556 [drbrain segm] Please give some code that shows how this is broken.

^ creating/accessing class vars from modules being used as mixins?
238680 [cjbottaro gm] I'm writing a module that is to be used as a mixin for classes.  I
238684 [james graypr] Class variables have confusing inheritance rules, that I don't think
238687 [cjbottaro gm] Wow, thanks for the fast response.  Your solution worked perfectly.

^ Regular expressions
238681 [joaomiguel.p] I'm burning my head because i don't understand how regular expressions
+ 238682 [TimHunter nc] I think more details are necessary. What characters are allowed in
+ 238683 [vincent.four] /[a-z]+(\.[a-z]+)?/
  238685 [joaomiguel.p] First of all, thanks for the attention.
  + 238694 [TimHunter nc] /\A[[:alpha:]][-_.[:alpha:]]{3,28}[[:alpha:]]\z/
  | + 238696 [joaomiguel.p] It works well.
  | + 238734 [B.Candler po] And if you are being pedantic, RFC2822 doesn't allow E-mail addresses to
  |   238749 [joaomiguel.p] Ok, thanks all, I need a reg expr do what I described before without the
  + 238725 [gavin refine] /\A[a-z][a-z.-]{3,28}[a-z]\Z/i
    238745 [joaomiguel.p] Oh damm!! the first should  be allowed but second and the third should
    + 238752 [martindemell] The regexp could be extended to allow this, but it gets ever more
    + 238775 [gavin refine] OK, but *why* aren't they allowed. You haven't described exactly what
      238777 [joaomiguel.p] It's a business requirement. The user name will be used before the
      238794 [gavin refine] You didn't answer these questions.
      238800 [joaomiguel.p] So, Gavin your last regex allows only valid host names on an URI? I'm
      238824 [gavin refine] I think so. I haven't tested it. Actually, I see one minor mistake -
threads.html
top