392386-393303

392207-395870 subjects 392510-437186

Case problem - program always ignores my Case
392386 [serpentinexc] I am trying to figure out how to use a case to manipulate an objects
392388 [ryand-ruby@z] gets.chomp

Installing PCAP
392394 [cliff.rosson] one of them. I'll admit that my troubleshooting abilities are probably
+ 392399 [jon.forums@g] Looks like you need the Windows version of libpcap headers/lib for this
+ 392404 [cliff.rosson] Thanks Jon. I actually did have the wincap libraries and headers
+ 392405 [cliff.rosson] Weird. It is complaining about the pcap.h file.
| 392417 [jon.forums@g] Sadly my WinPcap experience is limited to what Wireshark hides from me.
| 392423 [jon.forums@g] See if this quick hack will get you up and running. The real solution
| 392474 [cliff.rosson] I ran into a little problem on step 2. Since pcaprub never actually
+ 392475 [cliff.rosson] AWESOME! By chance I noticed our fix was looking in
+ 392476 [cliff.rosson] Yes. Everything appears to work!
  392576 [jon.forums@g] Glad to hear it's working so far and interested on whether it really

Dynamically Calling a Class Method
392398 [ddjolley@gm ] I need to dynamically call a class method (i.e., unless there is some
+ 392400 [jos@ca no k.] class Test1a
| 392427 [ddjolley@gm ] Thanks so much for turning me on to 'send'.
+ 392401 [sean.ohalpin] in

Name directory with a variable
392406 [alexszepes@g] This one should be a quick one for you. I am creating a directory
+ 392407 [c@vi hy t. e] You can interpolate variables into strings using #{}, for example,
| 392409 [echristopher] Except that backslashes inside double quotes need to be either doubled, or
| 392415 [shortcutter@] File.join "Backup", "Test", var1, var2
+ 392428 [alexszepes@g] Thank you so much for the replies, it now works as it is supposed to :).
| 392435 [jeremy@bo p.] While it's probably not important to you at this time, the path you
+ 392437 [alexszepes@g] Thank you for that info Jeremy its definitely going to help in the
| 392438 [jeremy@bo p.] Can you provide some details about the problem?  Are you getting errors, and if so what are they?  Have you tried enabling the verbose option on FileUtils.mv?  What is the content of test_files?
+ 392439 [alexszepes@g] I am not getting any errors, the script runs almost perfect but when i
| + 392448 [jeremy@bo p.] This really isn't enough to go on, for me at least.  My guess is that
| + 392450 [botpena@gm i] if you may be so kind to  provide us the script then, so we can also
| + 392451 [botpena@gm i] note, you are invoking a mv (move), so make sure that every time you
+ 392493 [alexszepes@g] FileUtils.makedirs ("Backup\\test\\#{@yr}\\#{@yr}#{@mont}")
+ 392494 [alexszepes@g] Ok never mind i figured it out! I did it by making a variable to

[Solved] Re: XmlMarkup gives 2 root elements
392410 [velovity@gm ] f.ck. Thanks!!! Yesterday it took me about 2 hours to search in Google.

RCR String#{last, first}
392420 [rogerpack200] I noticed today that it is very easy to get the first few characters of
+ 392424 [rubytalk2dav] If you think you really need it, you can just monkeypatch it in.  Then
+ 392431 [pete@pe er i] # => "ing"
| 392433 [joelvanderwe] => nil
+ 392434 [shevegen@li ] You should add this request to the bug tracker to ruby.
+ 392467 [transfire@gm] ...
+ 392509 [list.push@gm] You could try something like this.

What defines an Error?
392421 [transfire@gm] ...
392436 [shevegen@li ] It seems to be too rigorous to me.
+ 392459 [shortcutter@] It also does not work.  There might be only very few errors where
| 392461 [transfire@gm] ...
+ 392465 [transfire@gm] ...
+ 392486 [b.candler@po] RuntimeError.new() would be a better default, and indeed there is a

Getting an Object to Push or Register "Itself" With a Hash During Initialization
392429 [frank.guerin] How do I tell an object to register "itself" with a hash that has been
+ 392432 [pete@pe er i] => {}
+ 392440 [frank.guerin] BTW, I wanted to clarify and make it clear that I want to use the
+ 392441 [frank.guerin] Thanks for the follow up.  For clarification, what exactly is happening
+ 392445 [frank.guerin] This seems to work!
| + 392446 [abinoam@gm i] Try...
| + 392447 [abinoam@gm i] Can you encapsulate this hashObject Hash "inside" the class itself?
+ 392453 [orenshani7@g] This is how I do it and it works fine. Notice that I do not do the
| 392488 [b.candler@po] is there for you to set it up as desired, but 'self' is a completely
+ 392456 [frank.guerin] Thanks for all your help.  I've learned about multiple options from each
+ 392458 [josh.cheek@g] Not really sure what push is supposed to do (I don't know C++, tried to

regexp bug - max quantifier
392430 [straff_walto] regex for matching 1 to 4 caps alpha, followed by 1 to 4 digits seems to
+ 392442 [abinoam@gm i] Regexp is ok on my setup (Ubuntu 11.10 amd-64 + RVM).
| 392443 [abinoam@gm i] (One thing more)...
+ 392444 [kachick1@gm ] I guess, you are using ruby on Windows OS and cmd.exe.(from [i386-mingw32])
+ 392452 [straff_walto] yes, it is Windows, and yes, swapping quotes around (double for the -e

[ANN] TestR 14.3.0
392449 [sunaku@gm il] TestR - Continuous testing tool for Ruby

(Beginner Question) Trying to extract elements from an embeded array
392454 [cyreath@gm i] I've been learning Ruby for about 2 weeks or so and had a go at putting
+ 392455 [c@vi hy t. e] I made a minor change and got it to work. :)
+ 392457 [josh.cheek@g] The numbers are due to codepad using an older version of Ruby (1.8.6). It
  392522 [cyreath@gm i] Thanks for the quick replies. Incredible, so close yet so far away :)

Microrant on Ruy's Math Skills
392460 [transfire@gm] ...
+ 392462 [sophrinix@gm] Yeah it's lame.
+ 392463 [su.comp.lang] ...
+ 392464 [gwtmp01@ma .] => "1.1000000000000000888178419700125232338905"
| + 392469 [ymendel@po o] This problem comes up from time to time, sometimes from people I'd expect
| | + 392471 [su.comp.lang] Native floating point operations are usually hardware accelerated by the
| | | + 392473 [tony.arcieri] For all those people doing high performance math in Ruby...
| | | + 392499 [transfire@gm] ...
| | |   + 392545 [jlambert@oh ] True.
| | |   + 392547 [shortcutter@] Floating point math with binary representation of numbers is more
| | |     392550 [peter@va de ] Based on this discussion, it would actually be useful to me if I could
| | |     + 392551 [peter@va de ] Maybe
| | |     | 392552 [shortcutter@] com
| | |     | + 392554 [josh.cheek@g] But this forces it to go through a float which is where the inaccuracies
| | |     | + 392555 [peter@va de ] When writing 15.4 ... and then calling a method on it,
| | |     | | 392558 [shortcutter@] Darn, right you and Josh are.  Well, then these methods should also be
| | |     | + 392557 [peter@va de ] Thanks for the idea.
| | |     |   392578 [code@ap th o] Is there any reason this would not be better done with symbols than with
| | |     |   392582 [peter@va de ] For an initial test without format checking or accessing
| | |     |   392618 [alexch@gm il] "Standard is better than better." -Anon.
| | |     |   392643 [gsinclair@gm] I'm really impressed with that Wrong library; well done!
| | |     |   + 392668 [alex@st nk .] Glad you like it! It would work even better if MRI attached ASTs
| | |     |   | 392707 [gsinclair@gm] I don't think so.  Floats are implemented using a coefficient and an
| | |     |   | 392726 [transfire@gm] ...
| | |     |   | + 392728 [adam@ap es o] a, b, and x are fixed in this case, so let y = x/b, and you have a new
| | |     |   | + 392729 [transfire@gm] ...
| | |     |   + 392673 [transfire@gm] ...
| | |     |   | + 392675 [matma.rex@gm] Generally, you should use ratio instead of difference when comparing
| | |     |   | | 392700 [gsinclair@gm] I doubt that difference is a better idea "in many cases" and I don't
| | |     |   | + 392703 [gsinclair@gm] This isn't a problem.  The aim here is to test float equality.  The
| | |     |   |   392715 [ymendel@po o] Yes, this is exactly the thing to care about. Thank you.
| | |     |   |   392718 [transfire@gm] ...
| | |     |   |   + 392722 [gsinclair@gm] th
| | |     |   |   | + 392724 [shortcutter@] ith
| | |     |   |   | + 392727 [e148759@bs o] Well... You lost me here.
| | |     |   |   + 392732 [ymendel@po o] I remember reading a complaint about how programmers think of all
| | |     |   + 392683 [joelvanderwe] Agreed. I'm only using it on a few experimental projects, so far.
| | |     |     392701 [gsinclair@gm] Having spent untold hours creating my own testing library
| | |     + 392579 [code@ap th o] Even that and the '1.1'.to_dec option mentioned elsewhere seem pretty
| | |     | 392581 [steve@st ve ] be
| | |     | 392585 [code@ap th o] . . .
| | |     | 392587 [steve@st ve ] No, it's not a terminology difference. That's why it won't work. You
| | |     | 392590 [code@ap th o] Ruby is pretty dynamic.  It seems entirely reasonable to consider whether
| | |     | 392591 [ryand-ruby@z] whether
| | |     | + 392592 [gsinclair@gm] ther
| | |     | + 392593 [code@ap th o] Are you telling me that 1.1 is automatically lossy, regardless of how you
| | |     |   + 392595 [ryand-ruby@z] you
| | |     |   | 392597 [code@ap th o] I don't get it.  I've been polite and reasonable -- and evidently
| | |     |   | + 392605 [gsinclair@gm] I think it's come to the point where a forum is better than a mailing
| | |     |   | | 392608 [flo@an er gr] about.
| | |     |   | | + 392611 [peter@va de ] Ha, just discovering the 'to_d' function in 'bigdecimal/util'
| | |     |   | | | 392633 [gwtmp01@ma .] Be careful with these last two.  The Float =3D> BigDecimal
| | |     |   | | + 392662 [darkintent@g] Aren't Statistical calculations where the current behavior would be
| | |     |   | |   392664 [shortcutter@] It's not some statistical calculations only.  Just think of statics
| | |     |   | + 392616 [benjohn@fy h] Typed by clumsy thumbs on tiny keys.
| | |     |   + 392603 [shortcutter@] 1.1 is a decimal floating point literal.  This is translated into a
| | |     + 392646 [matthias@wa ] Im curious to see whats gonna happen once Desktop CPUs start to
| | |       392659 [botpena@gm i] port
| | |       392753 [matthias@wa ] Well, there is at least float-formats
| | |       392798 [peter@va de ] If I understand correctly, the IEEE 754-2008 decimal formats are fixed size,
| | |       392801 [tony.arcieri] I don't think it'd be very Ruby like to have a separate literal syntax
| | |       392803 [josh.cheek@g] Yeah, but Fixnum and Bignum have different behaviour. I am pretty sure they
| | + 392472 [tony.arcieri] If I were designing a language today 1.1 would be a decimal type ala
| | + 392500 [transfire@gm] ...
| |   392501 [adam@ap es o] Since you mentioned POLS, the standard thing to remember is that it's
| + 393297 [joiningisffr] 1.1 + -1.to_f = 1.0, with a radix of |Q|
+ 392504 [botpena@gm i] look at the bright side, trans.  you could possibly include one (soln)
| 392680 [transfire@gm] ...
+ 392505 [josh.cheek@g] require 'mathn'
+ 392543 [e148759@bs o] Real programmers do not compare floats for equality.
+ 392588 [pete@pe er i] FWIW, ruby-core member Kenta Murata has a proposal to replace Float with
| 392589 [sophrinix@gm] This is very encouraging. I haven't been able to find the time, but maybe
+ 392733 [rogerpack200] Agree.
| 392739 [alex@st nk .] (1) I love this thread! Though every time I open it, I think some poor
+ 392743 [garthy_lmklt] Such a large discussion from a simple initial post that was, in all
| + 392745 [josh.cheek@g] I don't think it was intended to troll, and Trans definitely understands
| | 392766 [adam@ap es o] I think I understand what you're getting at here, but it's potentially
| | 392776 [code@ap th o] No . . . the abstraction is "1.1", and the literal reality is the ever so
| | + 392778 [tony.arcieri] I think the real path forward here would be to propose that BigDecimal is
| | | + 392779 [code@ap th o] Use BigDecimal#to_s('F') to get something that looks like "1.1" (instead
| | | + 392796 [josh.cheek@g] lol, reminds me of http://twitter.com/#!/tpope/status/160389717244915712
| | |   392797 [peter@va de ] +1 , assuming that is 100% backwards compatible with the current code.
| | + 392781 [gwtmp01@ma .] abstraction
| |   + 392782 [code@ap th o] There's always the matter of limited room for precision in memory.  The
| |   | 392784 [gwtmp01@ma .] clear,
| |   | 392785 [code@ap th o] That may be the case, but the problem here is that we lack a succinct,
| |   + 392805 [jlambert@oh ] Decimal math operations need use a default rounding context or require one
| |     392831 [gwtmp01@ma .] one to set a
| |     392835 [code@ap th o] The point of offering something other than "all you get is floats and
| |     392837 [shortcutter@] one to set a
| |     + 392838 [tony.arcieri] Floating points are a great choice for approximating continuous values and
| |     | + 392840 [flo@an er gr] and
| |     | | + 392845 [tony.arcieri] Having worked on these sorts of systems, I really hate them. Having to
| |     | | | 392846 [shortcutter@] Well, you only convert during reading from and writing to the
| |     | | + 392850 [code@ap th o] It's easy to focus on a single tree and ignore the forest.
| |     | + 392842 [gsinclair@gm] That's right, lots of use cases.  And I bet that in these use cases
| |     + 392847 [code@ap th o] "Many" is a relative term -- and "without major issues" is even more
| |       + 392863 [gilbertly@gm] With all due respect to your suggestion, it is good, but we do need
| |       | 392871 [code@ap th o] What exactly are you arguing here -- that there's no such thing as a
| |       | + 392880 [gilbertly@gm] ds
| |       | | 392904 [code@ap th o] Yeah, basically.  Of course, "a lot" is relative -- but the upshot is
| |       | | 392925 [gilbertly@gm] are
| |       | | 392929 [code@ap th o] I understood that part.
| |       | | 392931 [gilbertly@gm] Then, just ignore it. I admit that this comment give no real value and
| |       | + 392881 [gilbertly@gm] Good Chad,
| |       + 392875 [shortcutter@] Most popular programming languages have that smell.  It is also not
| |         392907 [code@ap th o] The fact remains that using it properly consists of having to write
| |         392932 [gsinclair@gm] Excellent points, well written.
| + 392750 [gsinclair@gm] Regardless of the problems and advantages of the underlying
| | + 392751 [botpena@gm i] not bad.
| | + 392755 [garthy_lmklt] Indeed. The remainder of my text immediately following the excerpt above
| + 392794 [transfire@gm] ...
+ 392749 [shevegen@li ] Well. I have always been bad in Math.
| 392763 [adam@ap es o] It's a direct consequence of trying to fit certain numbers into a binary
| 392768 [shortcutter@] No smiley here?  I think the expectation of perfection in a human
+ 392787 [e148759@bs o] Does Rails scale?
+ 393303 [joiningisffr] it's stuff like this that suggest that our interpreter needs to suggest

'Access is denied.' on windows 7
392466 [umpierre.fel] following a video, and when I install and try to access by prompt, the

Interfacing with a C static library ?
392470 [dunric29a@gm] just curious what is a simplest way to use C functions compiled into a
392497 [su.comp.lang] Without touching Ruby's runtime library, I don't think there is any easy

[ANN] Freightrain 0.8.0 released
392477 [andrea@an re] ...

What's wrong with this?
392478 [paetilium@li] Hey everyone, I'm very new to Ruby and I'm starting to do a bit more
+ 392479 [peterhickman] Well the only class being initialise in the Initialization class, you
+ 392480 [stefano.croc] You create an object of class Initialization and assign it to the constant
  392481 [paetilium@li] Thank you both so much!! But could you please give me a very basic
  392483 [stefano.croc] Because the only methods which print something on the screen are

DIfferent outputs?
392482 [use_this_123] So im a newb to ruby. Just started learning today morning.
+ 392484 [c@vi hy t. e] The .include? method on an array and the one on a string have differentfunctions.
| 392489 [use_this_123] thanks :)
+ 392487 [stefano.croc] The first line asks the array ["recycler"] whether it includes the element
  392490 [use_this_123] It does. Thank alot!
  392562 [shortcutter@] Maybe you want to check whether there is any string which contains the

Newb question. Undefined Method error
392495 [tswbyaj@gm i] So I'm trying to run this script
392496 [rubytalk2dav] Assuming that what you've posted is indeed seleniumtest_script.rb, and

define_method with block_given?
392503 [matematika.a] class A
+ 392506 [josh.cheek@g] block_given? gets confused about what context it should be looking in. To
+ 392507 [matematika.a] Thanks, that solve the problem.
threads.html
top