315250-346109

315113-315825 subjects 315472-316803

^ why one array continues to grow after repeated call
315250 [chen_li3 yah] create a new array(b1) based on an existing one (a1).
+ 315257 [b.candler po] I'm not sure why you expect that.
| 315271 [chen_li3 yah] How come this loop happan? I don't want a loop here.
| 315284 [rick.denatal] irb(main):008:1*  def method2
| 315543 [chen_li3 yah] The script in the OP is a simple version of another more lenghy one.
| 315589 [b.candler po] So if the idea is for method1 to initialize @a1, and for method2 to
+ 315259 [rick.denatal] You seem to have a common misperception that assigning a value to a ruby
  315311 [rhkramer gma] I'm not the OP but I took a quick glance at the article.  Sometime when
  315326 [b.candler po] It's crucial.  x[y] = z "looks" very much like some sort of an
  + 315329 [b.candler po] Oh I forgot to add - while playing about with this in irb, the method
  + 315342 [rhkramer gma] charset="utf-8"
  | + 315347 [sepp2k googl] know
  | | 315419 [rhkramer gma] []=
  | | 315431 [b.candler po] However, you can't in Ruby. "x = y" cannot be made to mean anything
  | | 315463 [rhkramer gma] object
  | + 315348 [b.candler po] It just so happens that the semantics of the []= method on an Array
  |   315415 [rhkramer gma] 3,
  |   315432 [b.candler po] []= is *never* an assignment.
  |   + 315435 [b.candler po] Just one other thing. All this talk about []= has overlooked the much
  |   + 315464 [rhkramer gma] Wow!  That's either amazing or frightening (or both).
  + 315519 [rick.denatal] They are also called references (actually MRI uses the term value, but

^ Dbi Timeout expired Sql server 2005 using ADO
315260 [paqs140482 g] Execute OLE error code:80040E31 in Microsoft OLE DB Provider for SQL Server

^ eventmachine client server problem
315269 [bm2967 redif] My Server code is
315350 [justincollin] Maybe try using close_connection(true) or close_connection_after_writing.
315370 [bm2967 redif] No use.it is same even after using close_connection_after_writing or

^ why does this prog still stop after exception
315275 [junkone1 gma] i thought i put enough exception handlers for the prog to continue
315278 [stefano.croc] If no exception class is specified, rescue only rescues exceptions derived

^ [ANN] Ruby Manor, now with confirmed venue and dates
315285 [james lazyat] Firstly, apologies if you've already got this information, or aren't

^ short regexp question
315287 [fritz.thiele] short question how to use regexp the right way
+ 315289 [dblack rubyp] b = a.delete("[b]")
| 315292 [fritz.thiele] thanks for quick answer. your code just works, if you know "b". I only
+ 315294 [b.candler po] b = a.gsub(/\[b\]/,' ')
| 315296 [b.candler po] a = "aaa[b]bbb[b]ccc"
| 315299 [fritz.thiele] thanks for your answer. as I stated to David, I just know about the
+ 315300 [sepp2k googl] "a[b]c".gsub(/\[.*?\]/, " ")
  315301 [fritz.thiele] thanks for the solution. works perfect.
  315334 [shortcutter ] Not sure whether it makes a difference performance wise but I am always
  315398 [fritz.thiele] thanks for your objection, but could you shortly explain the
  315401 [shortcutter ] Ideally you read "Mastering Regular Expressions" which explains such
  315402 [fritz.thiele] thanks for explanation and book hint. will search for it.
  315406 [todb planb-s] certainly influence your results.
  315488 [shortcutter ] Hm, it seems line 13 and 18 are identical.  Where's the lazy quantifier?
  315697 [todb planb-s] grr curse my copy paste skills. fixed. thanks for paying attention,
  315698 [todb planb-s] Anyway, I think the moral of this particular long-missing story is, if
  315704 [shortcutter ] I am not sure.  This approach is likely slower than a single fast RX -
  315738 [ezmobius gma] Also keep in mind that =~ is generally a lot faster then .match since
  315754 [b.candler po] With =~ the MatchData can still be obtained from $~

^ cannot access gems
315288 [tomcloyd com] I seem to have run right into my ignorance again.
315310 [stefano.croc] This is the issue. The ruby you compiled is in a different location than the
315319 [tomcloyd com] Arrrgh! THIS makes tons of sense.
315328 [shevegen lin] Because UNIX tradition means that often things grow chaotically up to
315353 [tomcloyd com] Marc -
315514 [rick.denatal] The biggest secret is knowing how to do good google searches. <G>

^ Ruby developer Position @ Midtown , Atlanta - US
315314 [nick.asap01 ] Please Send resumes to nick.asap01@yahoo.com;

^ Remove
315318 [gregory.t.br] ruby-talk@ruby-lang.org

^ good deadline to register to rubyconf08
315321 [paqs140482 g] Does anyone know when it's a good deadline to register to rubyconf08?
315366 [Bil.Kleb-use] ASAP (As Soon As Possible)

^ Reliable ping method from Windows?
315335 [damnbigman g] Is there a reliable "Ruby" method for pinging/checking whether hosts are up?
315340 [damnbigman g] # Lets find MAC addresses for the machines in the list
315367 [jcmoore pres] NMap is very fast and comes in a WinDoze flavor.
315860 [damnbigman g] Thanks Jeff,

^ variable name
315341 [bellcolt hot] Is there a way in Ruby to use the content of a variable as the name of a
+ 315345 [TimHunter nc] In general, no. Most of the time this problem can be solved by using a
+ 315346 [rubytraining] =3D=3D=3D=3D
+ 315376 [b.candler po] If you're talking about "myVar" being the name of a *local* variable,

^ Array Count Issu
315343 [bornemann1 n] irb
+ 315344 [TimHunter nc] String#count counts characters, not strings. You're asking how many c's,
| 315349 [bornemann1 n] I dont want to know how many characters are in a word i want to find the
| 315354 [adam.shelly ] => "cat cat fox"
| 315358 [bornemann1 n] This was the simplest for me to understand since I am very new to using
| 315361 [bornemann1 n] OMG
| 315365 [bornemann1 n] ok well now i got a bunch of repetitive arrays and repetitive counts how
| + 315368 [botp delmont] RnJvbTogTmljayBCbyBbbWFpbHRvOmJvcm5lbWFubjFAbmt1LmVkdV0gDQojIG9rIHdlbGwgbm93
| + 315404 [list.push gm] str ="cat cat hat fox hat hat foo bar bar hat test bar hat fox"
+ 315357 [w_a_x_man ya] count = 0
+ 315359 [caduceass gm] a = "duck","duck","goose"
  315405 [lloyd 2live4] Todd, that is just wonderful!  I have been playing with variations from

^ How can I setup a Rails-like task directory
315362 [ethergraphic] I looking for a way to create a centralized library of rake files and
315364 [stephen.celi] Best,

^ Getting a constant inside a class
315369 [bjohnson bin] How do you grab the value of a constant if it is inside a class << self?
315381 [b.candler po] You've explicitly defined the constant inside the metaclass (singleton

^ Absolute Beginner help
315377 [grant mrit.c] charset="us-ascii"
315389 [fox nscl.msu] You'll probably need to supply more information about how your web

^ rubygems won't install - don't understand why
315378 [tomcloyd com] I can't get rubygems to install, and I don't understand what the problem
315379 [b.candler po] I run Ubuntu 8.04.1 with my own compiled ruby 1.8.6p114, which is very

^ "warning: peer certificate won't be verified in this SSL session"
315384 [andydevale g] Some time ago I started playing around with Soap4R on a vista (groans)

^ rb_include_module() doesn't call Module#included
315385 [ddungum gmai] I'm writing a c extension and I want to create a class called "World"
315386 [TimHunter nc] You could use rb_funcall instead.
315388 [hyoonjae nav] Thanks for your reply, Tim.
315390 [rmagick gmai] The argument to include is a module, not a string, so you'll need to
315391 [hyoonjae nav] Thanks for you detailed explanation, Tim.

^ pagination
315387 [gani_chinta ] Is there any plugin for pagination which will display the page

^ cheap dunk shoes and air force one in ( www.cncircle.cn)
315392 [sourcesoso2 ] (www.cncircle.cn) cheap sale

^ IRB + C Extension = Memory Loss
315407 [ryan railsca] I'm having difficult making a simple C extension. The struct's memory
315411 [rmagick gmai] GC is collecting the greeting string because it thinks there are no
315413 [ryan railsca] Thanks! That makes sense. Calling rb_gc_mark(*hello->greeting) in the
315422 [rmagick gmai] Let's back up a bit. I assume you're storing the VALUE passed into

^ How to provide variable to irb session
315409 [btrichardson] Can anyone tell me how I would go about providing a variable to an irb
+ 315416 [tpreal gmail] You can run your script at Ruby startup by specifying env variables
| 315426 [todb planb-s] todb@planb-security.net | ICQ: 335082155 | Note: Due to Google's
| 315434 [btricha gmai] Sweet... thanks!
+ 315436 [b.candler po] Is it definitely a variable, not a method?

^ That was unexpected -- strange scoping behavior
315412 [wpdster gmai] #!/usr/bin/env ruby
+ 315417 [tpreal gmail] Yes, it is a small gotcha. In Ruby 1.9 this is going to work like
+ 315418 [dido.sevilla] SW50ZXJlc3RpbmcuIFNvIEkgc3VwcG9zZSB0aGF0IG1lYW5zIHRoYXQgdGhlcmUncyBhIGhvbGUg
  315423 [tpreal gmail] I guess, it's rather not a hole in the implementation, but sort of a

^ Hash default value question
315420 [glenn_ritz y] ut hash_of_index2 doesn't?=A0 (I got the first method as a response to a pr=
+ 315429 [caduceass gm] snip
+ 315430 [Rob AgileCon] The Hash.new([]) causes a single array to be used (shared) for the

^ Using Rails App (Models) in my Ruby script.
315424 [nick.gorbiko] I'm writing a script that's going to run on schedule to pull some info
+ 315425 [caduceass gm] You might be able to simple load them (load '/dir_path/my_model.rb').
+ 315437 [b.candler po] script/runner
| 315440 [nick.gorbiko] script/console  would load an interactive console - that's waiting for
| 315445 [nick.gorbiko] Ok I just did a search on Ruby Forums and I think I found what I needed.
| 315446 [nick.gorbiko] Also this method works cool for scheduled PDF printing - just printed my
+ 315443 [       m t.u] just require boot.rb and environment.rb (don't forget to set rails_env to
  + 315447 [james graypr] environment.rb required boot.rb for you, so it's all you need.
  + 315449 [nick.gorbiko] James & matu

^ Question about multi-demension hash initialization
315427 [ruby.student] Team,
315503 [shortcutter ] Err, what?  You know how to create nine hashes but you do not know how
315526 [ruby.student] First, thank you for your help and sample code.
315586 [shortcutter ] You're welcome.
315593 [ruby.student] Again, thanks a bunch.

^ Question about REXML
315428 [bradaskins g] I'm trying to follow this tutorial: http://www.germane-software.com/software/rexml/docs/tutorial.html
+ 315438 [matt tidbits] It isn't. :) Say
+ 315501 [shortcutter ] As Matt said, it isn't.  But you should make it a habit to properly

^ Confused regarding text example
315433 [davidinanhui] Hey,
+ 315439 [shawn42 gmai] class WordIndex
+ 315451 [jgabrielygal] What it seems to me is that the code is a way to classify objects based on each
  315491 [davidinanhui] Alright, I think I got it.

^ [JOB] Softwareentwickler/-in, prometheus-Bildarchiv, UniversitÁ’ zu Kn
315441 [jens.wille u] We, the prometheus image archive at the University of Cologne
315678 [shortcutter ] First of all this is an English group so placing a job offer in German
+ 315685 [Rob AgileCon] I think this is fine.  It had a "[JOB]" tag in the subject, an English
+ 316330 [jens.wille u] Sorry for replying so late, but I've been on vacation.

^ How to read drive label
315442 [tpreal gmail] machine from within a program. Is there any universal Ruby command to do
315450 [s.korteling ] require 'ruby-wmi'

^ ruby2exe
315444 [junkone1 gma] i get a error i dont understand. pl help
315479 [jdinkel gmai] rubyscript2exe has problems with rubygems 1.2.0.  You'll need to
315484 [erikveen gma] gegroet,
315509 [junkone1 gma] i tried this
315588 [a99.googlegr] I had the same problem two weeks ago and managed to solve it with the
315642 [rpminihan gm] One little change.  ruby  C:\ruby\lib\ruby\gems\1.8\gems
315646 [a99.googlegr] You're right. Thank you!
345691 [jazzezravi g] I am getting this error
+ 345694 [wujunchen gm] Maybe you should try ocra instead of rubyscript2exe,it's excellent°™
| 345715 [jdinkel gmai] I've pretty much given up on r2exe.  I don't want to be stuck using an
| 345957 [jazzezravi g] Yes. Ocra Rocks.
+ 346042 [leslieviljoe] I have fixed this in my own local copy of RubyScript2Exe because I
  346101 [jazzezravi g] Error when i run the last command.
  346109 [i8igmac aim.] rubyscript2exe.rb

^ how to manage passwords
315448 [junkone1 gma] many of my ruby apps have the password hard coded. i am looking for a
+ 315455 [keeperotphon] ...
+ 315511 [yu.ching.tie] could use String#crypt
| 315587 [perrin apoth] I don't recommend relying on crypt if you want "real" security.  The
+ 315641 [justincollin] Do you need to know what the stored password is, or do you just need to
  315700 [junkone1 gma] i just store passwords in text files. i am looking for a secure way of
  + 315719 [todb planb-s] Hmm, that'd be quite the trick. Not even the professional-grade IM
  + 318083 [sandor.szuec] It's a month ago but maybe it helps anyway.

^ overwriting hash key
315453 [jhavero gmai] How can get Ruby to tell me when I'm overwriting an existing key in my
+ 315456 [Rob AgileCon] h = Hash.new {|h,k| h[k] = []}
+ 315457 [s.korteling ] class SafeHash <Hash

^ [ANN] RDoc 2.2.0 released
315458 [tony.strauss] RDoc 2.2.0 now is available!
+ 315459 [tony.strauss] The formatting of the change list got messed up a little.  The changes
+ 315468 [james graypr] Wow, this sounds really great.  Thanks!
| 315480 [drbrain segm] That's the plan.
+ 315538 [matt tidbits] That's great news, because I downloaded the previous version of RDoc and
| 315748 [drbrain segm] $ ruby -ve 'p File.superclass'
| 315876 [george.ogata] Does CAST cut it?
| 315897 [drbrain segm] I think it might.  I'll keep it in the back of my mind until I have
+ 315607 [james graypr] I found two issues when working with RDoc 2.1.0 yesterday.  I haven't

^ [QUIZ] One-Liners Mashup (#177 again)
315460 [matthew.moss] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+ 315466 [yahivin gmai] def repeat(i)
| 315469 [wpdster gmai] def repeat(i)
| 315473 [yahivin gmai] . I couldn't use flatten because it would destroy nested arrays.
+ 315470 [james graypr] class Array; def repeat(n) zip(*([self] * (n - 1))).flatten end end
| 315471 [wpdster gmai] How about
| 315475 [ninja slapha] class Data2D
| 315477 [james graypr] class Data2D; def [](x) lambda { |y| @data[y][x] } end
| 315560 [ninja slapha] Nice! That's definitely an improvement over mine.
+ 315474 [billk cts.co] # Partial solution, we would need a flatten(1) to prevent it from
| 315478 [james graypr] ruby -e 'p ARGF.read.scan(/\d{1,3}(\.\d{1,3}){3}/).uniq.size'
| + 315482 [sepp2k googl] Wasn't that a question in the old one liner quiz?
| | + 315485 [hmack.gm goo] 2008/9/20 Sebastian Hungerecker <sepp2k@googlemail.com>
| | + 315486 [billk cts.co] Indeed, I recall this from a previous ruby-talk thread... my
| | | 315490 [billk cts.co] ... and the solution therein appears to have the same single-word
| | + 315528 [james graypr] Ouch, it was.  Your memory is better than mine!  :)
| + 315498 [jcoglan goog] A first guess... this destroys all original whitespace in the string,
| | 315544 [hmack.gm goo] wrap text with single regexp and strict maximum length
| + 315583 [kbloom gmail] Hey, you posed that one already in Ruby Quiz 113
|   315605 [james graypr] Yeah, this was pointed out earlier.  I must me losing my mind.  Sorry!
+ 315493 [jcoglan goog] module Enumerable
+ 315715 [chneukirchen] class Array
+ 315745 [caduceass gm] Technically not one line, but it's under 80 chars and is recursive...

^ Extending Erubis
315461 [axyd80 gmail] <tr>

^ Re: One-Liners Mashup (#177 again)
315465 [matthew.moss] And if it wasn't clear from the very top... no no-spoiler period this
315492 [matthew.moss] I think you're going to have to explain what periodicity is, or
+ 315494 [matthew.moss] []=3D
| 315502 [matthew.moss] Oops... I forgot to put up a new one-liner question! (Don't forget you
| + 315505 [matthew.moss] Here ya go. Non-negative parameter to the function is recursion depth,
| | 315540 [hmack.gm goo] def carpet(n)
| + 315506 [jcoglan goog] Really sorry, just can't think of anything immediately... if something pops
|   315517 [pit.capitain] I don't think that your method rolls the dice s times.
|   + 315518 [pit.capitain] ...and I got n and s reversed :-(
|   + 315638 [kbloom gmail] Here's a ruby 1.9 version that doesn't use semicolons or mutable data
|     315713 [matthew.moss] I was tempted to port the C++ next_permutation code, but then I
|     + 315733 [matthew.moss] I'm not sure that providing your succinct solution right alongside the
|     | 315734 [matthew.moss] Too many solvers not providing additional problems!
|     | 315735 [martindemell] def prog_sum(ary)
|     | + 315736 [eduard llull] And what about
|     | + 315803 [hmack.gm goo] class Array
|     + 316367 [kbloom gmail] I've done it, and posted it here, but It's not one line. I'm not sure
+ 315530 [hmack.gm goo] Periodicity of 1/n -> length of the recurring sequence of the decimal
  315571 [jcoglan goog] 2008/9/20 Holger Mack <hmack.gm@googlemail.com>
  315590 [sepp2k googl] It produces 0 for 6 though (because printf rounds instead of truncating so =
  315591 [jcoglan goog] 2008/9/21 Sebastian Hungerecker <sepp2k@googlemail.com>
  315592 [sepp2k googl] =2Dh[x]):h[x]=3Di;
threads.html
top