|
First
|
Prev |
Next
|
Last
Pages: 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
Arithmetic oddity >> l = [1.0, 1.0, 2.0**0.5] => [1.0, 1.0, 1.4142135623731] s = l.map {|e| e**2} => [1.0, 1.0, 2.0] puts 'foo' if s[2] == s[1] + s[0] => nil puts 'foo' if 2.0 == 1.0 + 1.0 foo => nil Does anyone know why s[2] == s[1] + s[0] is false ? -- Posted via http://www.ruby-forum.com/. ... 2 Jul 2008 10:51
Late binding Method [Note: parts of this message were removed to make it a legal post.] Hello all, I was just wondering whether it's at all useful to have a late-binding version of Object#method? I'm more concerned about this in the context of JS.Class, my JavaScript implementation of Ruby's object system -- I tend to use functi... 2 Jul 2008 07:47
Taint mechanism Hi everyone, I would like to ask a few question about the taint mechanism of ruby. It seems that ruby taint mechanism doesn't care about indirect dataflow to propagate the taint. For instance, if you got : myVar1 = ARGV[0] <-- tainted if myVar1 == "alice" myVar2 = "Bob" else myVar2 = "Eve" end m... 3 Jul 2008 06:20
help compiling shoes Due to recent concerns I took the (perhaps rash) step of purging my apt installed version of Ruby and installed it from source to achieve patch level 22 before it was available through the repository. All is well with my system now, except that I cannot re-compile Shoes correctly. When I try to make it, I get: C... 2 Jul 2008 07:47
[ANN] test/spec 0.9, a BDD interface for Test::Unit Hello, today I'm releasing test/spec 0.9, a library to do BDD with Test::Unit. == News in 0.9: * July 2nd, 2008: Fifth public release 0.9. * Allow should.<predicate>? as well as should.<predicate>. * Add shared contexts. * Nested contexts now run the setups/teardowns/before(:all)/after(:all) of t... 2 Jul 2008 06:45
Ruby Idiom for dynamic programming? (request for comments) Random idea i had... I sometimes make custom classes/method for caching output of functions, i.e. for dynamic programming. To generalise this, i though it would be possible to implement it like this: class A def func(a, b, *c) puts "Computing... #{[a,b,c].inspect}" return [a,b,c].hash end cac... 2 Jul 2008 08:48
Ruby Exponents Hi, I'm trying to calculate using exponential operator **. However, I get a crash with the following message wrong argument type Float (expected Fixnum) The values I am using are 0.713 ** 0.5555555 => THIS CRASHES But when I try this on a ruby command prompt, it works fine. Is there a way I can calculate... 2 Jul 2008 13:57
Missing zlib on latest ruby version You all know the error. missing require, blah blah. Seriously, nothing new here. here's the scoop But I found that zlib was missing from the latest ruby version on my Ubuntu. I download and install from source the latest version, and while installing rubygems, it complains of missing zlib! Has anyone e... 2 Jul 2008 22:11
RegEx version: 1. abc 600-qwer 2. abc600-qwer 3. abc 6.0.0-pedfs 4. abc 6.12.23-45 5. abc 5.0.6.0 etc... I want to be able to identify which version is version 6, version 5, etc.. I'm not sure if a regex is the best way. I need to be able to say that #1-4 are version 6 and #5 is version 5. But I need to be able... 2 Jul 2008 01:40 |