275539-284407 subjects 275997-411113

Starting Threads
275818 [mcse@pa st k] I've many different threads to run parallel. Some of these have a
+ 275827 [globyy3000@h] Thread.new # Look up some uses for it based on what your doing.
| 275855 [vjoel@pa h. ] It does: ruby's #sleep calls select() in that case.
+ 275844 [bbxx789_05ss] x = 1
+ 275878 [ara.t.howard] threads aren't quite that deterministic - you may find some without

how to use javascript in rhtml
275819 [advait.bellu] I needed to know a javascript function which I can use for focusing my
+ 275833 [scott@sp tt ] If you are loading the prototype javascript library, you add the
| 275967 [advait.bellu] Thank you for looking into by problem, however the problem still
+ 275985 [bbxx789_05ss] Learn javascript, then write the code to do that.  Or, hire someone to
  275993 [advait.bellu] Thanks For the suggestion , But I better learn.......thank you once

[SUMMARY] Time Window (#144)
275820 [james@gr yp ] I've said it before, and I'll say it again this time:  I love the easy problems.

read write integer in binary into a file
275821 [acemtp@gm il] I have some big files with lot of "unsigned int" (4 bytes) numbers and I
+ 275823 [phasis68@ho ] How about Marshal?
| 275824 [acemtp@gm il] fwrite(fp, 4, myint);
| 275825 [globyy3000@h] What file format? I dont see any problem with using Marshal, it doesnt
| 275826 [acemtp@gm il] irb(main):036:0> mynum
+ 275832 [preble@gm il] def pack_int32(n)
| 275836 [phrogz@ma .c] Using only the number 2_000_000 seems to skew the results. I see your
+ 275834 [yermej@gm il] Do you have to deal with each number individually? Maybe you could
+ 283346 [wujunchen@gm] irb(main):001:0> f=open('test','w')
  283348 [rmagick@gm i] irb(main):001:0> x = [720850].pack('i')

Is this a Ruby bug in Dir on Windows?
275838 [wemagor2@gm ] This was discussed on another thread, but I thought I'd ask the question
275918 [globyy3000@h] This is an educated guess, but i suspect it has to do with the way

Change a string to an integer, report an error if the string does not represent an integer?
275839 [rhkramer@gm ] Can anybody point me to a way to check if a string represents a valid integer
+ 275843 [stefano.croc] Kernel.Integer can convert a string to a number raising an exception if it =
| 275908 [shortcutter@] it has=20
+ 275845 [dblack@ru yp] There's a method called Integer (uppercase I and all). It blows up if
+ 275858 [bbxx789_05ss] Integers can also have leading '+' signs.  :)
  275859 [bbxx789_05ss] invalid int
  275863 [bbxx789_05ss] strings = ['0013abc', '0025', '-0030', '+051', '00-1', '-abc72']
  275868 [dblack@ru yp] Although....

Re: Change a string to an integer, report an error if the st
275840 [rabbitblue@g] match = '000345'.match(/^\d+$/) # MatchData
+ 275842 [rmagick@gm i] Check out Kernel#Integer
+ 275848 [diegoslice@g] Integers can also be negative. Not sure if this applies to your case but
  275860 [rhkramer@gm ] Thanks to all who replied!
  275862 [lloyd@2l ve ] One caveat is that integers can have alpha characters in the string,
  276171 [soren.anders] ...

Advice sought on Installing Ruby 1.9 on OSX
275841 [rick.denatal] I gave in and got a macbook about a month ago, and I'm getting around

Need help understanding metaclassing
275853 [chris.czub@g] I've been reading lots of Ruby tutorials trying to figure out
+ 275856 [dblack@ru yp] The do/end sequence is a code block. Have a look at some of the
+ 275865 [rick.denatal] Wrong!
| 275874 [rabbitblue@g] Hold on, now I'm confused. Given this...
| 275875 [rabbitblue@g] cs.instance_eval do
| 275879 [chris.czub@g] The method is put into the Creature class and is inaccessible in the
| 275881 [rabbitblue@g] That's the same code as above. Still doesn't work though. =)
| 275882 [chris.czub@g] Nope, it's c.eat instead of cs.eat... works for me! :)
| + 275894 [rabbitblue@g] Hehe, I feel sheepish. (Yes, works for me, too.)
| | + 275900 [rick.denatal] No, your code did exactly that.
| | + 275903 [chris.czub@g] user = DefaultUser.new
| |   275910 [chris.czub@g] I don't really want to define it in the User class, because it might not
| |   275912 [olsonas@gm i] class User
| |   275919 [chris.czub@g] "You added a singleton method email and an accessor pair email/email= to
| |   276007 [olsonas@gm i] Not really sure what you're asking here, but I can tell you what my code
| + 275898 [rick.denatal] Right.
+ 275871 [dblack@ru yp] s/{/do/ :-)

[ANN] Ruby Changes in Leopard
275866 [laurent.sans] Leopard, Mac OS X 10.5, will very soon be available to everyone!
+ 275869 [fxrubyguy@gm] Thanks for all the work that you've put into this, Laurent. Looks
| 275872 [lpackham@gm ] I didn't notice Apple had integrated the DTrace stuff as is. The only
+ 275904 [tim.pease@gm] The wiki page says that "The gem_server utility is not part of the
| 275929 [marcel@ve ni] As a side note, the latest RubyGems code moves the gem_server functionality
| + 275965 [rick.denatal] Apple's decision to restrict gem_server to the server version of
| + 275992 [laurent.sans] gem_server wasn't packaged in the client because it was decided at the
+ 275936 [rsanheim@gm ] Looks good, except I didn't see anything about how to upgrade ruby or
| + 275955 [dangerwillro] Uh, no.
| + 275996 [laurent.sans] Unfortunately no, sorry, but you should still be able to manually
|   276001 [ara.t.howard] i would humbling suggest that mac not follow the path tread but
|   + 276025 [tim.pease@gm] Hmmm, why not provide the XCode project files so that we can create
|   | 276044 [dangerwillro] Arguably it should all be part of  software management system.
|   + 276132 [rich@in oe h] ...
|     276139 [dangerwillro] boy you nailed that one on the head. They did it for them.
|     276143 [Bil.Kleb@NA ] +1
+ 276675 [laurent.sans] We received many valuable feedback during the past days, thank you

What's in YOUR Ruby???  Could Ruby ever be a g.p. dev language?
275888 [TheOldCodeTo] I just finished my first 40+ hours with plain old Ruby (without rails
+ 275946 [znmeb@ce ma ] Pretty much anything I can. At the moment I'm seeing how tightly I can
| + 275991 [Joerg.Mittag] GemStone is going to port their kick-ass distributed, clustered,
| + 276901 [TheOldCodeTo] On Oct 25, 10:17 pm, "M. Edward (Ed) Borasky" <zn...@cesmail.net>
|   277026 [znmeb@ce ma ] Part of it is going to be on the RubyConf 2007 agenda -- to be
+ 275966 [dblack@ru yp] Welcome!
+ 276364 [john.carter@] As one Old Fart to an Old Code Toad...
| + 276365 [znmeb@ce ma ] I haven't found that to be the case for the kind of data mining I do.
| + 276370 [bigboss64@ip] Having fun :-)
|   276420 [shevegen@li ] Everything. Its my language for all tasks and I just laugh into the face
+ 276596 [dido.sevilla] Web stuff, with Rails, distributed programming, 9P2000/Styx work

ruby gems on ubuntu
275889 [MistryMan400] ...
275914 [globyy3000@h] instead of using setup.rb i would just do the following since u have
275926 [globyy3000@h] I apologize i also forgot to include that you need to run this before

cant seem to get system() & pipe to work together
275891 [dtown22@gm i] I am trying to run a command line utility which converts a wma file to
+ 275923 [globyy3000@h] I have no idea if this was intentional or not but...
| 275994 [dtown22@gm i] That commented line was a previous attempt at formatting the 'cmd'
+ 275999 [globyy3000@h] Alright lets approach this from a different perspective. First, the
| 276017 [dtown22@gm i] Thanks for taking the time to help me on this. I wasnt aware that
+ 276031 [yermej@gm il] As far as I can tell, this is due to the way the Windows command
  276055 [dtown22@gm i] I don't like the idea of relocating variables, as I would like this
  276066 [globyy3000@h] Alright lets start this program over and build up from the basics using
  276456 [dtown22@gm i] I wasnt aware of a wma to mp3 converter in ruby...i don't have time
  276476 [yermej@gm il] Just so you know, r2mp3 uses temp files for conversion so if that's an
  276985 [dtown22@gm i] Just as an update, I ended up splitting the commands up into 2

Problem with attribute name
275893 [bakanon@ya o] table named "translations".  Translations has "id",  "message" and
275895 [rabbitblue@g] Did you design the model? When you see something like Message:0x4851f70,
275899 [bakanon@ya o] "messages" and it's related with translations. Translations
275921 [bakanon@ya o] definitely the problem is with the name, because if i put something

Garbled Email
275901 [shortcutter@] I seem to receive messages with garbled headers. Does anybode else
+ 275907 [aredridel@nb] Seems to be me -- but I'm not sure what's up.
+ 276090 [stefan@ma li] Empty subject line and body starting with

Skip the first invocation e.g. skip_first { foo }
275911 [lojicdotcom@] first = true
+ 275913 [gwtmp01@ma .] 3.times do |i|
| 275920 [lojicdotcom@] I guess I wasn't clear enough. This should work in any type of
| 275956 [shortcutter@] Of course there is also a solution with #inject. It can be abused when
+ 275916 [m_goldberg@a] It's not entirely clear to me what you are trying to accomplish, so
| 275922 [lojicdotcom@] What I'm trying to accomplish is a convenient way to execute a block
| + 275927 [sean.ohalpin] ...
| + 275940 [m_goldberg@a] Well, I'm pretty simple minded, so I would use a simple class to
|   275970 [lojicdotcom@] I think it's the least objectionable at this point :) It's just not as
+ 275925 [ara.t.howard] as others have mentioned you can use the block counter that's passed
| + 275938 [ari@ar br wn] Whoa! That's pretty intense! Can you please explain how that works?
| | 275939 [james@gr yp ] It changes what the local variable block holds on the first call.  So
| | 275963 [ari@ar br wn] Hm. I didn't know blocks could do that!
| + 275971 [lojicdotcom@] Clever :) I've used a similar technique in JavaScript, but I don't
|   275998 [ara.t.howard] it's just a building block...  to generalize your idea, now that you
+ 275928 [list.push@gm] arr = %w[foo bar bat foo]
| 275972 [lojicdotcom@] Correct.
+ 275935 [mortee.lists] # sets up a binding with a local variable _iteration = 0, and then
| + 275937 [ara.t.howard] that makes for a quite interesting syntax option if you chained a few
| + 275941 [botp@de mo t] # def skip_first(_skip_count =3D 1)
| | 275945 [mortee.lists] In the meantime I just realized that the binding of the block which does
| + 275974 [lojicdotcom@] So how do you pass the "real" block to the iterator then? The main
|   275980 [mortee.lists] Sorry, it wasn't clear to me by this whole thread but this last post
|   275984 [shortcutter@] Oh, that eluded me as well.  In that case it's certainly best to just
|   275986 [mortee.lists] Thanks, this is nice - I haven't known it existed. However,
|   275995 [shortcutter@] Obviously tastes differ. :-)  Personally I find the effort you have to
+ 275969 [lojicdotcom@] Thanks for all the feedback. My apologies for confusing many people
  276447 [pit.capitain] module SkipN
  + 276463 [rick.denatal] Bravo!
  + 276530 [lojicdotcom@] Very imaginative - thanks for the post :) It has a problem that will
    276795 [pit.capitain] Ah, but you didn't show us this use case yet, didn't you?

275931 [bob.yang.dev] ...

Ruby TK
275934 [wiz_pendases] i know im doing alot wrong, but i need all the help i can
276015 [williams.jay] Wow... You wern't jokin'
276018 [williams.jay] My mistake. I had never seen the attribures in the curley brackets the

275942 [john.carter@] Hmm. Ooh yuck.
+ 275943 [alexg@ku cr ] You can use YAML if you only want Time.
+ 275983 [o.renaud@la ] It seems that Time objects are precise to the microsecond, but to_s (and
+ 275989 [ara.t.howard] though i prefer #iso8601 to #xmlschema because even typing the word

Ruby Radius Dictionary
275944 [aby_azid@ya ] Im trying to communicate with radius server using example file from
276037 [dusty.doris@] I'm using that library, I just ran a test and that file worked fine
276067 [aby_azid@ya ] may i know which dictionary you are using?
+ 276069 [aby_azid@ya ] I'm still new with radius protocol. Does the dictionary in radius client
| + 276105 [fwmailinglis] charset="us-ascii"
| + 276700 [dusty.doris@] The dictionary is there to map the code in the packet to a friendly
+ 276699 [dusty.doris@] I'm using the one that comes with the program, but I just have the

libxml-ruby namespace problem
275948 [mortee.lists] I'm trying to use libxml-ruby on cygwin. The XML I want to parse
275949 [mortee.lists] Actually, libxml-ruby won't find what I'm looking for if either a

Re: State of the art in setup.rb land?
275952 [aaron@te de ] Check out hoe!  It lets you create rake files which will build your

find all member in a class
275953 [bad_good_lio] how to find all members list(member functions & member variables for all
+ 275959 [shortcutter@] Do
+ 275960 [Paul.McArdle] irb(main):002:0> puts String.methods.sort
+ 275964 [rick.denatal] Note that unlike some languages with which you might be familiar,
  276098 [hawat.thufir] the def is to define a method?
  276100 [mrobert@tr b] Yeap "def" is to define a method
  276118 [rick.denatal] Correct, it's an attribute reader with lazy initialization of the

whole class into a text file...
275954 [bad_good_lio] Is there any method or idea to get whole class into a text file ?
+ 275957 [AEtzold@gm .] Dear Pokkai,
+ 275958 [alexg@ku cr ] alexg@alexgdell:~/Desktop$ cat r2r.rb

[QUIZ] Editing Text (#145)
275968 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 276426 [eric.mahurin] class StringCaret
| 276484 [gattster@gm ] Now that you've submitted a reference implementation, it looks much
| 276489 [eric.mahurin] Yes, I probably should have put something like this in the quiz to begin with.
+ 276582 [eric.mahurin] Since I haven't seen any solutions yet, I'd thought I'd elaborate on
| 276655 [james@gr yp ] I'm willing to extend this quiz a week if that's what people want.
| + 276664 [eric.mahurin] I'm in favor.  Another quiz during rubyconf may not be a good idea
| | 276673 [james@gr yp ] Three votes is good enough for me.  We'll add a week for this quiz.
| | 276692 [robert.dober] s/here/hear/
| | 276758 [bigboss64@ip] One Quiz I would love to participate in... If onyl I had the time.
| + 277056 [jgabrielygal] I'm sorry, I won't have time this week anyway (my second baby was born
|   277057 [james@gr yp ] Congratulations on the new child!
|   + 277427 [bigboss64@ip] Aye congratulations !
|   + 277428 [bigboss64@ip] Aye congratulations !
+ 276731 [hmack.gm@go ] ...
| 277308 [eric.mahurin] Thanks for the solution.  One comment though.  This solution is not
| 277344 [hmack.gm@go ] ...
+ 276856 [eric.mahurin] Here is a strange solution of mine.
+ 277640 [matthew.moss] My solution is a deque... The text before the cursor is kept
| 277749 [eric.mahurin] I'm glad to see someone try an Arrays instead of a Strings.  You'd
| 277792 [matthew.moss] Ten minutes after I posted my solution, I asked myself the same thing.  =)
+ 277747 [eric.mahurin] In addition to the minimal functionality, I implemented a method that

Re: Editing Text (#145)
275973 [promos@bu ch] James, thanks for putting all these challenges together, and thanks to
+ 275975 [james@gr yp ] While I probably would have called it a caret as well, the term
| + 275977 [promos@bu ch] Not out of line in the least.  Without resorting to cheesey emoticons
| | 275978 [james@gr yp ] Just to be clear, I didn't write that quiz.  Eric Mahurin did.
| + 275979 [rick.denatal] Actually, I'd say that caret is a UI/View related term (its the name
|   276167 [eric.mahurin] Correct.  I've also seen the term cursor being used with databases
+ 276000 [vjoel@pa h. ] When the Macintosh first came out, the little blinking vertical bar in

Version of Ruby for Palm OS?
275976 [John.Joyce@d] Does anyone know if a version of Ruby has ever been written to run on =
275987 [dangerwillro] Wow, another John Joyce here.
277235 [John.Joyce@d] John,
277271 [dangerwillro] John Joyce,
277272 [mo_mail@on h] The Java for Palm is actually an implementation of J2ME - I'm not sure
277281 [dangerwillro] Yes, it seems we are a programmer's puzzle...

Getting namespaces from rake
275981 [christopher.] I am trying to automate the process of running all of the rake tasks

Overriding private methods
275990 [snacktime@gm] So I'm hacking on rails and in activerecord there are two methods that
276041 [evan.moseman] If I understand what you are trying to do, this is typically how I do