206750-241699

206573-208303 subjects 206979-209723

Few questions from a newbye
206750 [bzamfir@gm i] I'm an experienced developer and I just fond out about Ruby.
+ 206757 [heimdall@un ] I use GNU Emacs with ruby-mode.el, ruby-electric.el (both included in
+ 241634 [andexer@gm i] I have been working on a project utilizing Ruby as a front-end for a
  241647 [boesemar@gm ] You want to access MySQL from your ruby program?!
  241699 [david@va ln ] Neither of which is relevant to the OP's problem.

Re: Setting precision in Ruby-GSL calculations ?
206754 [Nuralanur@ao] ...

writing native ObjC extension to ruby ??
206755 [yvonthoraval] i'd like to write a natine objc ext to ruby.
206758 [pbattley@gm ] Have a look at RubyCocoa[1][2]. You probably don't need to write an
206762 [yvonthoraval] ...
206764 [logancapaldo] That shouldn't matter assuming its like
206767 [pere.noel@la] OK fine, however Tim Burks at the page
206771 [logancapaldo] Sure you can, Carbon is a C api (and a relatively sane one at that,
206807 [pere.noel@la] ok, thanxs, i did a first test following "Extending Ruby"
206817 [logancapaldo] Are you using mkmf? It'll make your life much easier and produce the
+ 206823 [yvonthoraval] ...
+ 206837 [pere.noel@la] not before, but right now, i'm following the page "How to create a Ruby

AW: Few questions from a newbye
206761 [marinho.tobo] Well there is freeRIDE http://rubyforge.org/projects/freeride/

FreeBSD specific issue with gems and ports
206763 [rugowski@nh ] This is FreeBSD specific issue. Maybe someone who uses FreeBSD could
206917 [fred@la av .] It should work if you put a require 'rubygems' before the require for

ruby-a-day: admin tip: sharing files/folder
206765 [botp@de mo t] many times, we share files across different platforms (unix, windows, mac) and accross the net. no probs; w just ruby, you can publish your folder in a few seconds. try it like this,
206766 [botp@de mo t] arrggh, pls ignore!

Off the wall question
206769 [rick.denatal] I found myself wondering if anyone has written any kind of rubyinline
206884 [drbrain@se m] There's a lot of pure-C-ness in the Ruby stdlib that this isn't

FireRuby 0.4.1 and blob data
206770 [dodecaphonic] ...
207073 [dodecaphonic] ...
207095 [pjagielski@g] Try the author, who can be found at

clickable ajax sitemap
206780 [_remove_it__] I'm new to RoR and just wondering if there is a plugin/component (ajax
206791 [pollak@gm il] It doesn't have AJAX bindings (although it'd be great if you wanted to

nextPowerOf2(n)
206781 [ruby@sk lb c] Can someone tell me if there's a better way to do this? It takes a
+ 206784 [h.wickham@gm] def log2(x)
+ 206786 [simon.kroege] def nextPowerOf2(n)
+ 206787 [farrel.lifso] # Finds the log base 2 of a number
| 206788 [farrel.lifso] Gah! I don't even need that Math.log2 function
| 206789 [farrel.lifso] Sorry for the repeated typos, it shoud be '2**Math.sqrt(n).to_i.succ'
+ 206795 [daniel.schie] Your question has already been answered by Simon, but I'd like to show
| + 206800 [rick.denatal] Here's another take
| | + 206808 [daniel.schie] Very nice. Better add it to Integer instead, though -- otherwise Bignums
| | | 206835 [rick.denatal] Fair enough, and while I'm at it why not handle Floats as well
| | + 206813 [h.wickham@gm] When the alternatives are O(1), that's not that great!
| |   206827 [lukfugl@gm i] Except that the implementation of Math.log itself is most likely
| |   206947 [michael.ulm@] I really doubt, that the implementation of Math.log (or any serious
| |   + 206961 [benjohn@fy h] The following integer implementation runs in log(log(n)) time (in non
| |   + 207071 [lukfugl@gm i] I stand corrected.
| + 206804 [james@gr yp ] 0.upto(n.size * 8 - 2) do |b|
+ 206802 [shortcutter@] Did we have this solution already?
| 206811 [alex@bl ck e] Neat, but hits an infinite loop for negative x.  Then again, that wasn't
| 206816 [ara.t.howard] class Integer
+ 206815 [martin@sn wp] Others have already given you floating point solutions to this, but
| + 206841 [SimonKroeger] def nextPowerOf2(n)
| | 206853 [rick.denatal] I hope that this doesn't offend anyone, but in the spirit of test infection...
| | 206859 [SimonKroeger] def next_power_of_2(n)
| | 206871 [rick.denatal] Ahh, but the following is both quicker and more economical of source code
| | 206879 [SimonKroeger] would you dare to explain?
| | 207401 [rick.denatal] You had to go a bit further back in the thread.  All of the versions
| + 206866 [martin@sn wp] (code snipped)
+ 206870 [skurapat@uc ] def nextPowerOf2(n); n.to_s(2).length; end
| 206874 [skurapat@uc ] Ah, well this doesn't actually produce your desired output.
+ 206887 [ruby@sk lb c] Thankyou all - very helpful indeed. In my eagerness to use Ruby features

Strange NoMethodError
206782 [holger.biebi] require 'net/http'
206792 [ara.t.howard] this is not a uri.
206839 [holger.biebi] Oh my god ... thank you vey much. You are right. I was a it confused

create directory on a remote machine
206783 [marciaalmeid] Does anybody know how can I create folders and files on a remote machine

Can't install rubygems - but getting closer
206785 [michael@we l] I'm runniing Ubuntu Breezy. The distributed version of ruby is 1.8.3
206810 [mgreenly@gm ] Gems for some reason on Debian/Ubuntu seems to want to install in

Ruby-Perl IPC messaging API (idea from SOAP)
206790 [ rsm@ho e. e] I want to something like SOAP but with local IPC (dont want to use HTTP
206793 [ara.t.howard] perl and ruby both speak yaml - why not use it - it will be far less pain.
+ 206799 [ rsm@ho e. e] Thanks a lot! That's probably what I'm looking for and you've probably
+ 206848 [rforum@gm il] Just a note that if you do this you may want to use the Perl YAML::Syck

FxRuby FxChoiceBox segfault
206794 [leslieviljoe] puts FXChoiceBox.ask(@app, 0, "Export to database?",
206801 [lyle.johnson] Looks like a bug, but I can reproduce it on Windows only (not on Mac
206803 [leslieviljoe] Thanks! In the meantime I duplicated what I wanted with a MessageBox.
206806 [lyle.johnson] A lot of people say that, but very few of them do anything about it.

cgi.rb HTML construction tools - from within Webrick servlet?
206805 [BreadWithSpa] Folks, I'm just playing with webrick and writing a servlet
206847 [jan.svitok@g] well, there are many web frameworks from large to small ones (rails,
208854 [BreadWithSpa] I haven't had a chance to try out your suggestion yet, but I

Dispatching requests in SOAP
206809 [ rsm@ho e. e] 1. I have built a small SOAP server and wonders and have a few
206924 [nakahiro@sa ] Standalone server creates threads for each request.  Your sample ar

Using Test::Unit to automate reporting of failures
206812 [BenWMills@gm] I'm using Test::Unit along with the Watir framework to run tests
206843 [jan.svitok@g] Without knowing your test, watir and without looking into Test::Unit

[ANN][SoC] Ruby Reports 0.4.21 Released
206819 [gregory.t.br] = Ruby Reports 0.4.21 : The "Probably Broken" Edition =

Re: RubyScript2Exe 0.5.1
206821 [erikveen@gm ] It creates an application_darwin. What's an application.app?
+ 206822 [logancapaldo] It's a folder with with some metadata files for mac gui applications.
| 206826 [erikveen@gm ] In that case, the answer is "no"... ;]
+ 206824 [yvonthoraval] ...

How to recognize which child process has just ended?
206825 [wookie2@o2 p] The piece of software I'm working on now needs to fork child processes
+ 206834 [garbagecat10] Look at Process#wait2 and Process#waitpid2.
| 206838 [ara.t.howard] i don't think that's sufficient - one would still need a sig handler,
| 206875 [garbagecat10] That's a surprise, what made you think so? Is that true on Windows,
| 206880 [ara.t.howard] sorry i wasn't more explicit - it's this that i interpreted the OP had wanted
+ 207649 [wookie2@o2 p] Thank you both.

Simple question: combine a quoted string into a single token
206829 [squeamz@ho m] I have a program which separates each line of a text file into tokens,
+ 206830 [devlists-rub] You could pull out all the quoted strings into an array and then delete
+ 206836 [shortcutter@] Something along the lines of

select box question
206832 [shanan187@as] Yet another newbie here... I'm writing an appliction in Rails, and I've
+ 206844 [jan.svitok@g] If you ask directly on rails forum (http://rubyonrails.com/community)
+ 206845 [ezmobius@gm ] Here is how you can use the onchange event which is much nicer to

Re: For performance... the conclusion
206842 [tbray@te tu ] The conclusion of this lengthy and interesting thread is obvious: the
206897 [igouy@ya oo ] I'll accept your *real* lesson, and add one more ;-)

mysql gem installation
206851 [michael@we l] Thanking everyone for all the help I've been given to this point, I'm
206896 [rick.denatal] It should be complaining about one or more specific files, and these

mechanize iframes
206854 [punkracy@gm ] could anyone give me an idea how can I get any element inside iframe
206919 [aaron_patter] Hey,

ANN: ruby-snarl
206855 [phurley@gm i] Envious of autotest/growl integration, but stuck in Win32 land? Well
206939 [scoopr@ik .f] Ah, excellent, didn't know about snarl, with ruby bindings it might be
206987 [phurley@gm i] My thoughts exactly -- it (snarl), is poorly publicized, but seems

Codegolf - Writing a Brainf*ck interpreter
206856 [rubytalk@sp ] I stumbled over this funny site called CodeGolf.com and tried my luck
+ 207024 [michael.ulm@] Using the idea by Daniel Martin on your site, I managed to come up with a
| 207052 [martin@sn wp] I've found I can do even better by switching d to a huge (32K) string
| 207235 [michael.ulm@] Very nice. If you accept a more fragile version (but still conforming
| 207273 [martin@sn wp] I managed to squeeze out a few more characters by replacing the hash
| 207342 [neoneye@gm i] I have just given it a shot.. 146 bytes
| 207371 [neoneye@gm i] I saw at the codegolf page that one had a record of 142 bytes..
| 207394 [martin@sn wp] Note that both this and the earlier one you posted don't conform to
| 207403 [neoneye@gm i] aha.. I did'nt really use the rules from codegolf. I looked it
| 207559 [rubytalk@sp ] Thanks for the feedback, BTW the next challenge is out: Pascal's Triangle
| 207562 [farrel.lifso] That was also a past ruby quiz (#84)
| 207569 [rubytalk@sp ] it is easier than then ruby quiz because there is no need to align the cells
+ 207577 [mberrow1@pa ] Can anyone vouch for the authenticity of this 'codegolf.com' site?
  207580 [ben@bl yt in] What do you mean by "authenticity?"  Are you afraid they're going to

Standard dataset for Database performance testing
206861 [jes@lu et nk] Greetings
206930 [znmeb@ce ma ] There is indeed a "standard" database test suite. I believe the base
206951 [shortcutter@] Hm, didn't know that.  Thanks for that link!

[ANN] Dr Nic”Ēs Magic Models
206862 [drnicwilliam] [Cross-posted on Ruby on Rails forum]
206888 [Bil.Kleb@NA ] Who is this guy?!
206913 [dave@bu t. d] He's Dr. Nic! (http://drnicwilliams.com)

=?WINDOWS-1252?Q?Re:_[ANN]_Dr_Nic=92s_Magic_Models?=
206864 [sambient@gm ] There's got to be some gotcha :)
206867 [joshknowles@] =?WINDOWS-1252?Q?Re:_[ANN]_Dr_Nic=92s_Magic_Models?=
206914 [foamdino@gm ] =?WINDOWS-1252?Q?Re:_[ANN]_Dr_Nic=92s_Magic_Models?=

Re: Dr Nic”Ēs Magic Models
206865 [drnicwilliam] Ha. Nope, just an amusing way of releasing code :)
206868 [drnicwilliam] You have a sharp eye. I like that.
206928 [drnicwilliam] Not yet. Currently the Composite Primary Keys solution requires an

An integer's life span?
206878 [sam.s.kong@g] Here's my code.
+ 206882 [drbrain@se m] IIRC an Integer's instance variables are eternal due to various
| 206889 [gregory.t.br] Specifically due to the fact that integers are immediate values in ruby.
| + 206891 [gregory.t.br] err, typo there, and here is an example of what i mean.
| + 206895 [sam.s.kong@g] Thank you for the answer.
|   + 206899 [gregory.t.br] Looks like in this case, they are garbage collected?
|   + 206906 [jeremy@ch os] No there aren't.  Immediate values don't allocate anything in memory.
|     + 206910 [drbrain@se m] Also, since a Fixnum is immediate, it doesn't "have" instance
|     | 207087 [jeremy@ch os] Thanks for pointing that out.  I had never thought to wonder where
|     | 207402 [rick.denatal] I hadn't either, and it once again impressed me with Ruby.
|     + 206912 [sam.s.kong@g] I understand what you said.
|       206926 [drbrain@se m] It will work.  The instance variables are stored elsewhere.
+ 206904 [rick.denatal] I'm pretty sure that your concern about GC is moot, but just as long

[ANN] open4-0.5.0
206893 [ara.t.howard] URIS

application structure
206894 [carljenkins@] I am attempting to learn ruby and I can not seem to find how I would
+ 206905 [drbrain@se m] $ find ar_mailer -type f | grep -v svn
+ 206949 [erikveen@gm ] internal and external.
+ 206963 [transfire@gm] T.
| 207050 [richard.conr] The Ruby equivalent of java packages (i.e. namespaces)
| 207058 [shortcutter@] Agreed.
+ 207121 [jmg3000@gm i] I think the way it often goes, in the simple case, is: you put one
  207129 [transfire@gm] Not so. You should be thoughtful about what you put in the toplevel.
  207142 [jmg3000@gm i] own app's lib  directory.
  207171 [transfire@gm] gemstones/
  207206 [jmg3000@gm i] Ah! Right. That layout makes much more sense. Thanks!
  208463 [carljenkins@] Thank you all very much for the replies!

[SOLUTION] Proper Case (#89)
206898 [curi@cu i. s] here's what i have. it does a few abbreviations, proper nouns, and

Extracting instance variables from a block?
206916 [chriseskow@g] I am writing a tiny custom web framework, similar in nature to web.py
206922 [ezmobius@gm ] ...
206925 [chriseskow@g] Thanks for the suggestion (and the compliment), but the problem with
206927 [chriseskow@g] Wait! I got it!

European Rubyists: Thank You!
206918 [halostatue@g] Well, I'm back from Europe -- I have been for the last six days or so,
206923 [james.britt@] Shame you missed the M?nchen.rb meeting.  I was lucky enough to go to

RUBY ROUC   it is for real ........  and will happen in October 2006
206929 [gsc@om ga og] ...

rake aborted! -- Help
206936 [kublaikhan55] I posted this problem on the rails forum, but got no reply. Hoping
+ 207018 [masukomi@gm ] the error says it all. It can't find a file named rake, Rakefile, or
+ 207030 [u.alberton@g] The rakefile should be in the directory you are executing the command
  207145 [kublaikhan55] Bira,

How to make objects that can set $1 when obj =~ /(.)/ is called ?
206938 [tomasz.wegrz] class Foo
+ 206952 [shortcutter@] class Foo
+ 206955 [ mfp@ac .o g] [ruby-talk:202600]
  207364 [tomasz.wegrz] I finally got a working solution, using Binding.of_caller.

[ANN] Ruby-VPI 0.9
206940 [skurapat@uc ] Ruby-VPI is a Ruby interface to Verilog VPI. It lets you create

[MacOS X] writing a C ext to Ruby and dyld: NSLinkModule() error
206943 [pere.noel@la] iu'ev to write a C ext to Ruby (i've allready an ObjC one) and, for that

value of $1is retained
206953 [anders1@ve d] I am using regexp in a loop to extract a value from a
+ 206968 [has.sox@gm i] ...
+ 207013 [doodpants@ma] I know this doesn't answer your question as to why it works that way,
+ 207019 [dblack@wo bl] If you're calling =~ on nil, no match operation takes place.

AMD Dual Core and Ruby
206959 [Meino.Cramer] does the ruby interpreter use both cores automagically or do I have
+ 206985 [rasputnik@gm] The ruby interpreter isn't multithreaded, so it won't take advantage of
| 207000 [drnicwilliam] But you can read your email at the same time :)
| 207004 [garbagecat10] Actually, most second cores on desktop machines (and Windows servers)
+ 206988 [matthias@kl ] The interpreter doesn't support multithreading itself, so all
+ 207085 [ptkwt@ar cn ] You have to do something special.
  207094 [headius@he d] ...

Automatic instantiation of subclasses
206964 [kilivor@ho m] First sorry I am a beginner ;-( What I want to do is: automatically
+ 206966 [ mfp@ac .o g] class A
| + 206969 [kilivor@ho m] Thanks / gracias!!!!
| + 207007 [rubyzbibd@ub] I am sure Mauricio knows this, but just in case others don't.  If you
+ 206967 [rubyzbibd@ub] This is a fun pattern that I use a lot.
+ 206980 [daniel.schie] class Class
| 207002 [daniel.schie] class Class
+ 208263 [pit@ca it in] Sorry for answering late, I've been away for a week.

min, max for Fixnum?
206970 [ronaldf@em .] Did I understand it right that there are no operators/functions
+ 206973 [sam.s.kong@g] I think that min and max are very general, so they don't have to be
+ 206974 [farrel.lifso] There is Enumerable#min.  [10,5,3,7].min will return 3.

[ANN] 0.3.13.4 Pre-Release -- Almost Ready
206972 [zedshaw@ze s] I just put a pre-release of Mongrel up for people to try.  You can
206983 [drnicwilliam] Sorry to ignore the Mongrel release and focus on RFuzz - but that looks

File.join : can't convert Fixnum into String ?
206978 [transfire@gm] Where's the Fixnum?
+ 206981 [farrel.lifso] Works for me
+ 206982 [toalett@gm i] irb(main):001:0> File.join %w(a b), "c"
  206984 [jan.svitok@g] Seems like
  207003 [transfire@gm] It does type conversion, which is why it says it can't convert Fixnum
threads.html
top