269372-270351

269192-292392 subjects 269625-412629

How to put alert messages on changing screen access
269372 [pragati.agar] I have a small application. I have two features for instance, NEW and
269510 [jan.svitok@g] Please specify your app type (web app - rails, standalone - gui gtk,

Re: uniforma-0.0.1 - converter for text formats
269383 [micathom@gm ] of
+ 269386 [micathom@gm ] BTW which makes me wonder, if you could your library into a parser and
| 269470 [vshepelev@im] Internally, it's already here. Any parser creates Uniforma::Dom structures,
+ 269471 [vshepelev@im] I meant, those whose parsers can be defined with some easy common DSL :)

inject method
269387 [shaiguitar@g] can someone explain (verbosely!) the inject method to me, or point me to
+ 269388 [pergesu@gm i] ...
+ 269395 [ycelik@oy ek] From command prompt if you type

Re:
269400 [pie2000@gm i] ...

[ANN] Gosu 0.7.5
269418 [julian@ra ch] for those interested in game/multimedia programming, Gosu 0.7.5 has
269431 [dangerwillro] Excellent news!

Re: Gosu 0.7.5
269437 [julianraschk] Thanks for the praise and feedback!

group array elements in groups of two
269440 [oga_emmanuel] arr= [1, 2, 3, 4, 5, 6, 7, 8]
+ 269442 [stefano.croc] require 'enumerator'
| 269447 [sepp2k@go gl] new = arr.enum_for(:each_slice , 2).to_a
+ 269444 [farrel.lifso] irb(main):012:0> require 'enumerator'
| 269451 [oga_emmanuel] very usefull. Thank you!
+ 269445 [james@gr yp ] => [1, 2, 3, 4, 5, 6, 7, 8]
+ 269446 [w_a_x_man@ya] On Sep 17, 10:18 am, Emmanuel Oga <oga_emmanuel_...@yahoo.com.ar>
+ 269449 [matz@ru y- a] require 'enumerator'
  269459 [w_a_x_man@ya] Nirvana at last!  I won a round of golf with
  + 269461 [phrogz@ma .c] Perhaps, but you both sliced your shots.
  + 269462 [matz@ru y- a] Well done, but your version does not work on 1.8. ;-)
  | 269511 [SimonKroeger] Will the world stop turning or am i just trapped in a parallel universe?
  + 269508 [SimonKroeger] cheers

how to use tuple as hash key
269450 [summercoolne] in Python, a hash key cannot be [1,2,3] but must be (1,2,3), a tuple.
+ 269453 [stefano.croc] ["a", "b"]
| 269469 [summercoolne] wow... this is deep... the reason I thought it uses the ID instead of
| 269566 [stefano.croc] This happens because you don't call h2.rehash after modifying the array you
| 269584 [summercoolne] actually if the code is
| 269587 [summercoolne] actually, i tried running it and watch ruby.exe in Windows or ruby in
| 269588 [stefano.croc] I think it's easier (and more efficient) to create a new array with the
| 269593 [summercoolne] that is already listed in the initial program.  the main requirement is
| 269597 [rick.denatal] But this code does meet this requirement.
| + 269599 [summercoolne] my application is this: i have an array with numbers in it.
| + 269602 [summercoolne] actually, my posting of "The meaning of a = b in object oriented
| + 269639 [summercoolne] fortunately, if the loop "dup" the key 100 million times, but the hash
+ 269463 [rick.denatal] Not sure that this is true, since I don't understand what you mean.

Using user supplied string String#include?
269455 [tobiasreif@p] In a web app that will soon be out there in the vast and partially
269504 [jan.svitok@g] No. Here it's perfectly safe - you have to call eval to evaluate #{},

Creating Arrays....
269465 [JNott@dt .i ] ...

Creating Arrays
269466 [JNott@dt .i ] ...
269575 [ronald.fisch] Since you want to mimic the spreadsheet idiom (a table of rows
+ 269581 [shortcutter@] Plus the reading / parsing could be done by a CSV library.
+ 269585 [w_a_x_man@ya] On Sep 18, 2:39 am, "Ronald Fischer" <ronald.fisc...@venyon.com>

Re: launchy 0.3.1 Released
269468 [transfire@gm] Thanks,

OpenGL?
269472 [fer.obbee@gm] programming with Ruby...
269474 [ruby@an hr p] It depends on your purpose. If you just want straight OpenGL, the

3D-gfx + snd programming (like demoscene)
269473 [fer.obbee@gm] Sorry, i've decided that i need any help in subj for Ruby...

Screen Scraping Advice
269475 [chuckdawit@g] I work for Cisco Systems in San Jose Ca. I proposed a project to perform
+ 269489 [dangerwillro] Doesn't sound like much scraping, just searching text for a string.
| 269492 [chuckdawit@g] Well, I disagree. Once I have all the websites with Cisco in its domain
| + 269498 [konrad@ty er] charset="utf-8"
| + 269502 [dangerwillro] What I mean is, scraping usually relies on the document's structure
+ 269506 [brabuhr@gm i] If someone knows of a super library that can recognize and interact
+ 269547 [flazzarino@g] Hpricot
+ 269997 [glenn.gillen] I'm slightly biased, but scrubyt should be able to do most of the
  270083 [brabuhr@gm i] require "rubygems"
  270228 [glenn.gillen] It's by no means a silver bullet, but could very well get you 80%

How do I parse a string to find a URL?
269479 [williams.jay] Is there a command in Ruby that will accept a string, and spit out a
269490 [jan.svitok@g] ...
+ 269496 [williams.jay] Outstanding!
+ 269539 [dan-ml@da 42] => ["behold:", "http://www.xyz.com."]
  + 269545 [flazzarino@g] not a weakness, in that string 'behold:' is a valid uri, it has a
  | 269551 [dan-ml@da 42] Is it a valid uri if nothing is present after the scheme? Anyway, I know
  | 269606 [flazzarino@g] you could just select the ones with a scheme scpecific part? or screen
  + 269546 [flazzarino@g] also the period is legal,

Cropping text strings
269493 [Cryptographi] This statement here can return a very long paragraph
+ 269495 [damnbigman@g] ...
| + 269499 [fwmailinglis] charset="us-ascii"
| + 269501 [m_goldberg@a] openjob.ProblemDesc.first(50)
| | + 269519 [Cryptographi] Thank you it worked great!
| | + 269836 [lists@be tr ] openjob.ProblemDesc[ 0, 50]
| + 269538 [dan-ml@da 42] Hate to be anal, but that would return the first 50 *bytes*, not characters.
|   + 269561 [Rob@Ag le on] ...
|   + 269600 [damnbigman@g] ...
|     269730 [botp@de mo t] # > Hate to be anal, but that would return the first 50 *bytes*, not
|     269826 [damnbigman@g] ...
+ 269500 [Rob@Ag le on] ...

[?] problem using set with hash objects
269509 [stephen.bann] I'm using set in the ruby standard library to produce collections of
+ 269516 [jan.svitok@g] Your problem is in hash comparison. Set is internally using hash as
| 269525 [shortcutter@] This is only true for Strings - and even then only if the key is not frozen.
| 269548 [stephen.bann] Ribert, Stefano, and Jano, thanks for the pointers.
+ 269517 [stefano.croc] According to the ri documentation, Set internally stores items in a hash.

Re: IP to Country (#139)
269521 [erikveen@gm ] Class OrderedLinesFile implements method find_line, which is
269523 [erikveen@gm ] $ ruby quiz139.rb 0.1.1.1 1.1.1.1 2.1.1.1 3.1.1.1 4.1.1.1 5.1.1.1

Defining a Method
269528 [mac@ma kr ck] I am new to Ruby from basic.  I am having a hard time getting my head
269530 [rick.denatal] buttonC.signal_connect("clicked") {
269531 [mac@ma kr ck] Thank you, that did it for this one.  I thought something like this had

Is there a select and map for hashes instead of arrays?
269529 [cohen.jeff@g] Hash#select and Hash#map return arrays.  In some cases I want to get
+ 269544 [flazzarino@g] # use two vars in an map/select block (or use the index if one var)
| 269556 [cohen.jeff@g] That was exactly my point - why doesn't Hash#select and Hash#map
| 269557 [james.herdma] ...
| 269603 [rick.denatal] There's no problem enumerating over a Hash.  Hash#each is implemented
+ 269559 [botp@de mo t] # I can take the returned arrays and transform them back into hashes,
  269711 [cohen.jeff@g] Thanks for the info.
  269832 [james.herdma] ...

Re: [QUIZ] IP to Country (#139)
269533 [oksteev@ya o] Yea it seems that mine will loop forever if you give an invalid ip address that evalutes to less than 0.  Changing to 'low < high' seems to fix that.  Also it incorrectly reports nil instead of no country on 0.0.0.0.  This is all running on the stock csv file (with comments), haven't tried it at all on a modified file.

retrieving yahoo! mail ?
269537 [dolgun@ex it] As an exercise, I'm trying to use Net::HTTP to retrieve my yahoo mail.
269540 [dolgun@ex it] response = http.post("/config/login?",

Fwd: Please Forward: Ruby Quiz Submission
269542 [james@gr yp ] ...

jruby pre-beginner's question (or should I use C)
269553 [progcat@co c] My understanding is that Jruby is slower than regular ruby.   I take
269598 [rick.denatal] So as I understand it your problem is IO bound.

Thread deadlock
269558 [castillo.bry] I wanted to create a thread pool.  I know I could have used a
269644 [castillo.bry] I've tried using some different version of ruby to see if the code
269655 [mental@ry ia] 1.8.6-p0 is broken, but it is not the most recent stable release.
+ 269663 [castillo.bry] I received the error with the stable recommended version from
| 269673 [mental@ry ia] Try the -p36 tarball and see if it makes a difference (it should, based
| 269703 [castillo.bry] Yes, p36 works fine. I should have done a search for deadlocks on this
| 269741 [castillo.bry] I sent an email to the webmaster at www.ruby-lang.org about having p0
+ 269745 [castillo.bry] Even though 1.8.6-p0 was not working with Mutex/ConditionVariable, I
  270157 [mental@ry ia] I'd strongly recommend against using Monitor -- it is slow and has some

The meaning of  a = b  in object oriented languages
269562 [Summercoolne] The meaning of  a = b  in object oriented languages.
+ 269563 [russell.no.s] Yes, your understanding is exactly correct; C++ will assign by value
| + 269672 [gwtmp01@ma .] I don't think you can generalize assignment semantics.  You have
| | 269742 [rick.denatal] True. In the case of immediate value objects (i.e. fixnums,
| | 269922 [gwtmp01@ma .] Perhaps 'special' was not the right term.  I didn't mean to
| + 270141 [jwkenne@at g] Ada also assigns by value absent explicit use of access variables
+ 269564 [hates-spam@b] Whether the language is OO or not has no bearing on this question. The
| 269811 [gonesail@gm ] true enough.  the copy mechanism of a language that uses garbage
| 269831 [ttmrichter@g] Not all garbage collectors are copying collectors.  Mark/sweep is the
| 269851 [rick.denatal] ...
+ 269565 [lloyd@2l ve ] That and it adds a counter.
| + 269571 [Summercoolne] i think the line
| | + 269607 [rick.denatal] Yes!
| | | 270142 [caduceass@gm] +1
| | | 270144 [caduceass@gm] I feel I should add, also, that another big stumbling block for people
| | + 269709 [lew@lw c. ho] You can't do both in Java.  Is a an array or a String?  If a is a String and b
| |   269856 [kbloom@gm il] In this Java example, a and b are statically typed to be of type Object.
| |   269929 [lew@lw c. ho] That doesn't make Strings and arrays assignment compatible, and besides, it
| + 269574 [phil.meier@g] I do not see the evidence of a counter.
+ 269577 [laurent.poin] <zip>
| 269579 [rschroev_nos] me too ...
| 269710 [lew@lw c. ho] Nah, this dude's all right, so far.  As if my opinion mattered.
| 269756 [rschroev_nos] I fully agree and I didn't in any way mean to compare Summercool to Xah
| 269912 [dolgun@ex it] Since Summercoool is most likely Xah Lee, the comparison is fair.  The
+ 269743 [fakeaddress@] There's the "self-assignment" bug. See the popular C++ FAQ.

file encryption/decryption needed
269567 [bagam_venkat] Yesterday, in my ruby application, I was needed to
+ 269594 [m_goldberg@a] I think puts is adding a "\n" at the end of the file you write out as
+ 269624 [AEtzold@gm .] Dear Venkat,
  269754 [bagam_venkat] Dear Axel,

jEdit can run code like TextMate does?
269576 [summercoolne] I am using jEdit on windows for Ruby, and it seems to lack a function to
+ 269883 [rf.oodanaw@s] Sure you can, You need to configure the Console plugin to dislay the
| + 270011 [Summercoolne] that's weird... do I just go to jEdit -> Plugins -> Plugin Manager ->
| | 270012 [ronald.fisch] Hmmmm.... For me (jEdit 4.3pre9), the plugin manager *does* list the
| + 270175 [summercoolne] finally it installed after getting the "errorlist" plug-in...
|   + 270197 [a99.googlegr] helps.
|   + 270318 [a99.googlegr] My previous post seems to be lost :(.
+ 270344 [phrogz@ma .c] On Sep 18, 1:51 am, SpringFlowers AutumnMoon
  270351 [summercoolne] wow, it really is good.

adding extra option to date_select
269583 [daniel.van.d] I am trying to add an extra option to a date_select.

Faster Alternatives for Recursion in Ruby -Assignment
269586 [yeshvanthni.] I have the following assignment to be done.I have written the recursive
+ 269590 [peter@se an ] Whats a "recursive API"? You are talking nonsense here. All you have
| 269749 [yeshvanthni@] First of all its not function its a method in ruby terms. If you care
| + 269791 [victor.reyes] ...
| + 269795 [peter@se an ] Well at least you know that much, that does not however excuse the
+ 269614 [mailing.mr@g] I think there was nice acronym for "do your homework yourself" or
  269619 [mailing.mr@g] hmm i mistook Funkonacci with Fibonacci numbers and i guess you study on

[ANN] Tagxplode 0.1
269591 [ilmari.heikk] Description-----------

finding string matches, in order, in a file
269596 [pbailey@bn .] I've got files I want to parse. I'm using a string scan routine that
269601 [w_a_x_man@ya] The file may have multiple copies of some entries, and
269605 [pbailey@bn .] Thanks, William. I tried your regex, but, I'm still getting the first
+ 269608 [shortcutter@] Still William's regexp is significantly better than the original one.
| 269612 [pbailey@bn .] Same old output. I'll look into REXML. I downloaded it. But, it's enough
| 269629 [shortcutter@] It's part of the standard distribution.
+ 269627 [w_a_x_man@ya] Don't give up yet.  A regular expression is a very concentrated
  269631 [pbailey@bn .] Believe me, I haven't given up. I need this to work! I really appreciate
  269637 [w_a_x_man@ya] During the posting process, your regexp was broken into
  269664 [pbailey@bn .] Still no go, William. I tried your last phrase there, too.
  269718 [w_a_x_man@ya] You've got to track down what's going on.
  269806 [pbailey@bn .] I'm getting exactly what you predict. And, . . ., perhaps I haven't made
  269841 [w_a_x_man@ya] Very odd.  "scan" will return the strings in the order that
  269863 [pbailey@bn .] Yes, as I said yesterday, the word "Immigration" is on line 300+, and,
  269880 [w_a_x_man@ya] "Health Issues" appears twice in your output.  Returning to my
  269885 [w_a_x_man@ya] A way to see if the reg.ex. is matching all entries.
  269915 [pbailey@bn .] Yes, when I grep my original xml file, I see 229 entries. But, with my
  270014 [pbailey@bn .] William,
  270045 [w_a_x_man@ya] Good to hear.  I hate to see bugs like this unsquashed.

scope questions
269611 [pigdog@gm il] ...
+ 269618 [pbrannan@at ] If the variables really are different, then use a different variable
+ 269636 [botpena@gm i] is def method good enough for you?
  270033 [pbrannan@at ] irb(main):020:0> $VERBOSE = true
  270158 [botp@de mo t] # > irb(main):008:0> def m2

RMagick - very, very strange
269613 [ news@ja .f ] I installed ImageMagick and RMagick on several platforms, including cygwin.
269626 [AEtzold@gm .] Dear Jay,
+ 269670 [konrad@ty er] charset="iso-8859-1"
+ 269692 [TimHunter@nc] Speaking for RMagick, you're welcome! Best regards to you, too.

CPU Usage not near 100% when running code
269616 [summercoolne] I tested some computation intensive Ruby code.  When running, the CPU
+ 269620 [mailing.mr@g] becouse ruby VM uses only one processor - always
+ 269622 [dangerwillro] your cpu is smarter than you.
| 269641 [cmdjackryan@] Close. It's the OS that usually handles thread scheduling, and it reserves
+ 269628 [shortcutter@] Maybe your process is IO bound - probably without you being aware of
  269635 [summercoolne] require 'benchmark'
  269638 [shortcutter@] Probably because the OS moves the process between cores.  See whether
  + 269643 [phrexianreap] Might be a stupid question, but could it be that there is a latency
  + 269652 [peter@pe er ] ...
  + 269688 [jan.svitok@g] Exactly. I have used Process Explorer for setting affinity, but now
    269722 [summercoolne] the increase from both cores... such as from 20% to 70% in both cores,

converting text
269617 [analogy47@ao] I have a general question, but I can't locate the answer anywhere else;
269621 [dangerwillro] ...
269623 [matthewrudyj] I believe String#to_f lops off any trailing characters.
269632 [analogy47@ao] Sorry about that, true they are strings
269633 [sepp2k@go gl] ["1.80%", "14.50%", "ruby", "3.10%"].map do |string|
269657 [analogy47@ao] I tried cutting and pasting this in SciTE to see if it works...it
269662 [sepp2k@go gl] => ["1.8%", "14.5%", "ruby", "3.1%"]
+ 269682 [analogy47@ao] My fault, I stand corrected. Thank you sir!
+ 269683 [ ssbm2@o2 pl] Imo it is only moderately close to perfection ;)
  269700 [analogy47@ao] Also, ["391", "2", "0.10%]
  269721 [ ssbm2@o2 pl] test = ["391", "2", "0.10%", "10.001%", "#x80C and #x670"]
threads.html
top