305229-316188

305025-323109 subjects 305380-331711

^ Examples/lists of common Ruby bugs
305229 [muzaffar muz] I need some examples or lists of common Ruby bugs (logical bugs). If
305267 [nefigah gmai] Like, official bugs that get reported, or mistakes that beginning Ruby
305269 [zul_haq hotm] I am working on bug tracking and logging tool using Ruby. For that

^ How !isset in Ruby
305230 [alexey goldt] How !isset in Ruby?
+ 305231 [thehcdreamer] What should !isset do? It's not obvious that we know php
| 305232 [alexey goldt] Oscar I need Basic Authenticate! I use Ruby CGI!
| + 305235 [flo andersgr] What Oscar tried to tell you: while some of us know PHP, we are not
| + 305237 [ tel jklm.no] Judging by http://uk2.php.net/isset, !(var.nil? rescue true) will
+ 305238 [boesemar gmx] you can use defined?, however it will also hit on constants (classes), methods
  305241 [shortcutter ] For global variables testing for nil is probably better because they are
  305246 [alexey goldt] THANKS MANS !!!!
  305251 [shevegen lin] you can omit the "then"
  305252 [alexey goldt] Thank you Marc!!!! I rewrite this example :-)))
  + 305254 [dblack rubyp] I haven't looked at your code carefully but those two lines sort of
  | 305258 [alexey goldt] My question for this topic "How !isset in Ruby?"
  | 305260 [dblack rubyp] My point is that since you have set real_password to password in the
  | 305261 [alexey goldt] David, How you be written this code?
  | 305264 [dblack rubyp] You probably mean == rather than =, I think.
  | 305277 [alexey goldt] This code don't work! Please, help...
  | 305280 [stefano.croc] It would be helpful saying what exactly isn't working (that is: what did you
  | 305284 [alexey goldt] Stefano!
  | 305321 [alexey goldt] Ravil - Thank you very much!
  + 305257 [stefano.croc] =B5=D0=BE=D0=B1=D1=85=D0=BE=D0=B4=D0=B8=D0=BC=D0=B0 =D0=B0=D0=B2=D1=82=D0=
    305259 [alexey goldt] Thank you Stefano :-)))

^ [ANN] JtestR 0.3 Released
305244 [ola.bini gma] JtestR allows you to test your Java code with Ruby frameworks.

^ Re: [QUIZ][SOLUTION] Circle Drawing (#166)
305249 [boesemar gmx] Here's my solution, it creates a buffer to draw into, once done it puts it on
305286 [billk cts.co] My solution follows....

^ Re: why can't an instance instantiated within a class method
305262 [nefigah gmai] The whole point of the private/protected method deal is to prevent what

^ Timeout lengthy external executable
305263 [emanuelef ti] I'm new to Ruby, I'm trying to use it to create a script where I launch
305265 [ara.t.howard] if you're on windows try using 'systemu', which will allow you to
305270 [emanuelef ti] I'm new to ruby and RubyGems, it seemed that the installation was
305273 [ara.t.howard] require 'rubygems'
305276 [emanuelef ti] Thanks, with that it worked perfectly!
305292 [ara.t.howard] i'm 99% positive that trying to read from the pipe will conflict with
305303 [emanuelef ti] Ok, I thought I was doing something wrong, or not using the right
305342 [ara.t.howard] it's not ruby per-se, but the interaction of select on windows.  you
305344 [emanuelef ti] I'm under Windows but I would like to use the same script on Linux.
305346 [ara.t.howard] it's nearly impossible to do this on windows reliably.  this are just
305397 [emanuelef ti] Thanks for the very detailed explanation.

^ little problem (google hiring puzzle)
305268 [exeQtor gmai] ################################################################################
+ 305271 [dave pragpro] How about a little cheat...
| + 305272 [ tel jklm.no] vals = [4, 3, 2, 1, 2]
| + 305274 [rick.denatal] Quite nice, and I'm more convinced that this is actually O(n) than the
|   305281 [dave pragpro] - one more iteration to the sum loop,
|   305285 [micathom gma] There appears to be another minor complication. If one increases the
|   305288 [dave pragpro] Well, to be fair,
+ 305275 [rubytraining] You can certainly do things in a more Rubyish way, but since you're
| 305376 [exeQtor gmai] I wasn't aware of the unshift overload, here I think I got O(n),
| + 305383 [gm.vlkv gmai] # How this looks?
| + 305385 [rubytraining] Yeah, the challenge is that to insure O(n) you have to use just the
|   305388 [simojenki gm] its ugly, could be written in any language, but it works and should be
+ 305278 [robert.dober] vals = ARGV.map{|x| Integer x}
| 305283 [rick.denatal] #    Note: Solve it without the division operator and in O(n).
| 305313 [robert.dober] Right Rick but the array did not have n elements but N :).
+ 305279 [micathom gma] ...
+ 305530 [lerno dragon] This works
+ 305549 [ragunathan.p] ################################################################################
| + 305555 [ray warmroom] This is O(n^2).
| + 305556 [ray.baxter g] This is O(n^2).
|   305607 [ragunathan.p] I think eval I used in this case is constant time. Any other views?
|   + 305610 [srijayanth g] input[0...index] + input[index+1..-1]
|   | 305649 [ragunathan.p] each_index is iterating over and yielding, there we have the first loop.
|   | 305655 [ragunathan.p] I checked Ruby 1.8.7 source code and Array[range] is done at constant
|   | + 305657 [micathom gma] IMHO you'd also look at join (iterates over the array) and eval
|   | | 305659 [ragunathan.p] I saw the array#join source which seems to involve a loop. Apparantly
|   | | + 305692 [martindemell] There's a very simple solution (which I think someone has posted
|   | | | + 305698 [klcompt gmai] how bad is this?
|   | | | | 305699 [ pm ubit.com] O(n^2).  You are iterating through inp within inp (inject will iterate
|   | | | + 305700 [ragunathan.p] I agree. Pretty neat!
|   | | | + 305703 [jborer gmail] I believe this works in O(n). (I believe reverse, and zip are O(n)) It
|   | | + 305712 [pjb informat] Not in general (try to apply that tool to itself!).  But for normal
|   | + 305658 [rick.denatal] True enough, since Array uses copy on write, so it can take a slice which
|   + 305682 [Ray.Baxter g] On Jun 19, 2:15=A0am, Ragunathan Pattabiraman
|     305713 [pjb informat] Of course there is a way: factorize them!
+ 305711 [botp delmont] # ##################
| + 305717 [srijayanth g] This inject still iterates over n-1 elements for n iterations. That is
| + 305729 [ttmrichter g] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
|   305746 [botpena gmai] ok, no more fun :)
|   305793 [calamitates ] Your solution looks fine. But your benchmarking will yield some weird results.
|   305902 [botp delmont] # But you are likely to see widely varying results. The puzzle assumes
+ 305715 [pjb informat] def google(a)
+ 305738 [krusty.ar gm] #######

^ extracting mail from outlook express dbx files
305282 [jdmills88 co] does anyone know of a library that can extract mail from outlook express dbx

^ ruby string format kicks in when doign wild card in activerecord
305289 [junkone1 gma] when i was doing a LIKE statement in my wild card query. Ruby thinks
305290 [ssmoot gmail] b/
+ 305293 [junkone1 gma] lib/
| 305297 [dblack rubyp] You've opened it, so try closing it yourself.
+ 305298 [drbrain segm] Or, escape it with another %.

^ Ruby to convert US to UK punctuation/spelling?
305295 [michael.lomm] I have about a thousand multipage documents which I need to convert from
305319 [AEtzold gmx.] Dear Michael,

^ array addressing problem
305299 [tomcloyd com] I know this is a simple problem - to 'most everyone but me, but I cannot
305301 [dblack rubyp] ?>    ["</p>", ''],
305302 [tomcloyd com] Nice. Thanks much, on both points. I never "saw" i get to 2, and so

^ encrypt data from the user
305300 [philcooperki] is there an effective way to encrypt data from the user?
+ 305325 [eleanor game] Ruby ships with OpenSSL support as part of the Standard Library. Good
+ 305335 [rubytraining] * you want to prevent the user from seeing the raw data being sent, or

^ how to stop gsub from returning nil
305306 [tomcloyd com] I'm trying to use gsub to do a number of transformations in an array of
+ 305307 [botp delmont] #     x.gsub!(y[0], y[1])
+ 305309 [mikael hoilu] If you want to fall-back on something when something returns nil (or
+ 305312 [shortcutter ] You first need to decide whether you want to do all your
| 305314 [tomcloyd com] Thank you all for your kind help. Very much appreciated!
+ 305317 [robert.dober] Why not write a simple wrapper?
  305318 [tomcloyd com] Simple answer: I don't know the idiom. I have no idea what you just
  + 305322 [robert.dober] wrapper means the same as with candy, leave gsub! to do the task and
  + 305323 [pjb informat] It's the same as with candy.  If you don't like the color of your
    305350 [mikeisgreat ] #{row.foo ? row.foo.gsub(%r{[',()\\\/]},"") : "Dont Be Nil, be somthing else"}

^ Simple memoization module
305320 [mailing.mr g] If you ewer wanted to easilly cache memoizable functions (ones that

^ Re: Is there a difference between load "file" and eval content
305327 [m.s.meindert] Yes, there IS a difference, and yes, there ARE gotchas.
305336 [m.s.meindert] 1. http://redshift.sourceforge.net/script/doc/index.html

^ Backgroundrb Problem in linux.
305331 [varun.rajesh] I wanna implement backgroundrb in my project but what happened
305338 [gethemant gm] has enough information.

^ One-Click Installer for Ruby 1.8.7?
305332 [andreas.warb] When do you expect to release a one-click installer for ruby 1.8.7 for
305360 [luislavena g] there is still just a one-click
305801 [luislavena g] Slower? Maybe you're confusing MinGW with Cygwin. MinGW is not a *nix
306084 [chessmess gm] Any progress on this? We have corporate developers and Ruby is just
+ 306116 [rogerpack200] You could roll your own with mingw if you want the latest build.  Oh,
+ 306127 [luislavena g] Hmn, we are still removing the dust that the security vulnerabilities

^ haif riends how do you
305333 [raja.sathya1] COMMON DO YOU SEE THE DIFFERNT PICTURE AND INFORMATION

^ How to Authenticate against the Windows NT Domain via Ruby
305334 [chessmess gm] We are running a Rails application on Linux RedHat with a requirement
+ 305339 [kyleaschmitt] Windows NT domain?  I dunno what libraries are available, but I'd
+ 305348 [miles.sterre] # Require authentication via LDAP
+ 305352 [       x y.z] I'm using kerberos to do this, with mod_auth_kerb. If you have any specific
+ 305455 [vk dsl.pipex] I am able to do this at the work-place using ruby net/ldap library. If
  305458 [kyleaschmitt] Vladimir,
  305550 [vk dsl.pipex] Aha, well, I do not know much about NT4 domains (or AD), but I thought
  + 305559 [kyleaschmitt] You're right, AD is basically LDAP+Kerberos and a whole lotta
  | 305586 [no spam.plea] NT4 authenticates using NTLM, a fairly straight-forward password-based
  | 305633 [kyleaschmitt] Humm, I've never thought about it in that respect before.  But
  | 305695 [no spam.plea] That requires my 2nd alternative, for each service to check group membership
  + 307904 [andypflueger] Hey guys,

^ ruby 1.8.7-p17 compile fails with MacPorts readline?
305345 [s0nspark gma] I am trying to compile ruby 1.8.7-p17 on my Macbook where I have
305349 [s0nspark gma] Never mind... sorted it out by adding --with-readline-dir=/usr/local to

^ Serialport script hangs during sp.gets
305347 [jordan.apple] I'm using the ruby serialport library. The OS is windows.
305393 [phil.meier g] in my experience Ruby serialport library for Windows is in most cases
305418 [jordan.apple] Someone was telling me the same thing yesterday in #ruby-lang.  He was

^ Re: watir gem update error
305353 [natschluter ] I am also trying to update for watir (I just installed Ruby) and I am
+ 305356 [bret pettich] I don't think you've done anything wrong. This error seems to indicate that
+ 305361 [tom infoethe] Hm, shouldn't that be "gem install watir -v=1.5.4" ?
  305403 [natschluter ] Thanks for the suggestions Bret and Tom.  I tried those modifications
  305422 [bret pettich] What happens if you just type "gem install watir"?
  305441 [natschluter ] I get exactly the same error.
  + 305456 [bret pettich] Are you able to install any other gems?
  + 305466 [tom infoethe] What if you browse to this URL?
    305514 [natschluter ] HTTP Response 404
    305581 [tom infoethe] Put the file in any directory - e.g., your home directory - and then
    305621 [natschluter ] OK, I'll try that.

^ Simple file upload example wanted.
305354 [lynnlobash y] Can anyone point me to a simple file upload example. I wan to grab a
305355 [       x y.z] in rails?

^ Fine-grained rdoc control with hoe
305357 [tony.strauss] Is there any way to specify the options to be passed to rdoc for hoe's
316188 [tony.strauss] I actually fixed this myself by adding the RDOCOPT environment variable

^ Can Ruby compare IPv6 ?
305362 [ibc aliax.ne] ry=20
305363 [botp delmont] RnJvbTogScOxYWtpIEJheiBDYXN0aWxsbyBbbWFpbHRvOmliY0BhbGlheC5uZXRdIA0KIyBIaSwg
305411 [ibc aliax.ne] MjAwOC82LzE3LCBQZcOxYSwgQm90cCA8Ym90cEBkZWxtb250ZS1waGlsLmNvbT46Cj4gRnJvbTog

^ How to capture a keypress
305364 [cowkiller123] I'm making an interface for a console program that should react whenever
+ 305369 [fedzor gmail] Check out rawline, and learn to use that!
+ 305370 [list.push gm] I have not tried it, but you may want to take a look at this.
| 305583 [cowkiller123] Sorry for the delay firstly. I've been busy lately :D
| + 305591 [botp delmont] RnJvbTogY293a2lsbGVyMTIzQGdtYWlsLmNvbSBbbWFpbHRvOmNvd2tpbGxlcjEyM0BnbWFpbC5j
| + 305681 [h3rald gmail] Glad to hear you found my example of use!
+ 305696 [cowkiller123] woah, I'll save this post in case I need to remind about getting ascii

^ Question about Ruby syntax
305365 [chanceusc gm] Hey guys, I'm just getting my feet wet with Ruby (trying to learn the
+ 305366 [chanceusc gm] Apparently I have to end the if [condition] ? [true] : [false] with an
+ 305367 [twscannell g] I guess if I read the code I would see the {
| 305372 [fedzor gmail] requests.each do |item|
+ 305368 [twscannell g] Get rid of the } between the end and end. It has no starting {
| 305457 [fedzor gmail] BUt there is! Look very carefully on the first line of the code.
| 305499 [shevegen lin] Also, I think instead of
+ 305371 [fedzor gmail] As you accurately spotted, it's with your if-statements.
  305373 [botp delmont] # > def parse_Requests(requests)
  305431 [chanceusc gm] Going to make a general response, thanks! I love knowing that there are

^ Ym4r + jQuery possible?
305374 [arthur pixop] I have used ym4r many times in my rails application. however, i wanna

^ ogrerb doesn't work well...
305375 [jh07133 hotm] Is there any ogre rb user? I need help.

^ print(true and true) #=> the parenthesis issue
305377 [madfancier g] The parenthesis have been discussed before, but maybe this is another
+ 305378 [justincollin] print (true and true) is not incorrect, it is just using parentheses for
| + 305379 [madfancier g] That makes sense, and yes, that I realized. In print() parenthesis are
| | 305387 [shortcutter ] There are no nature laws in IT.
| | + 305389 [tomcloyd com] Absolute nonsense.
| | | + 305390 [shortcutter ] Thanks for your kind reply.
| | | | + 305394 [tomcloyd com] I was, of course, referring to your proposition, and not to you. My
| | | | + 305410 [madfancier g] I wouldn't say that this is unused.  I came across this issue when
| | | |   + 305412 [madfancier g] Certainly I could do only( a(:guest) && !the(@user) ) but you can see
| | | |   + 305413 [shortcutter ] Not sure how this can work since obviously you want to evaluate the
| | | |     305416 [madfancier g] I don't want to go too off-topic, as I just wanted to show a usage
| | | |     305417 [madfancier g] It will make more sense if I mentioned this is used by designer in
| | | + 305409 [caduceass gm] <snip/>
| | |   305415 [tomcloyd com] Actually, I have, at the graduate level...and I do. It's a principle
| | + 305399 [botp delmont] #..
| |   305402 [shevegen lin] Dear Tom Cloyd,
| |   305406 [tomcloyd com] Interest assertions...or rather they might be if there were an argument
| + 305391 [michael.ulm ] This one really puzzles me. I know of the operator precedence
|   + 305392 [leslieviljoe] 1. print (true and true)
|   + 305395 [calamitates ] The parser doesn't get confused; this is in there totally
+ 305421 [davebass mus] I've always used "&&" rather than "and". I know the two operators have
  + 305426 [botpena gmai] hacker :)
  + 305427 [shortcutter ] I use "&&" in expressions (because of the precedence) and "and" when I
    + 305429 [madfancier g] The way 'and' differs from &&, and || differs from 'or' is pretty
    | 305432 [botpena gmai] someone to submit a patch and that others may test.
    + 305518 [davebass mus] Isn't that the same as this?
      305525 [shortcutter ] If you're in favour of clarity, why not
      305536 [davebass mus] I carefully set my little trap... and it caught someone! :-D
      + 305537 [dblack rubyp] Your version only tests for false, not both false and nil, so it's not
      + 305602 [shortcutter ] Yes, I can see you struggling in it. :-)
        305608 [davebass mus] But my double negation is completely and absolutely clear! The whole
threads.html
top