265509-374549

265273-280424 subjects 265664-274970

blogger widgets
265509 [thilankaster] ...

foxGUIB_win32 crashes without any indication why
265510 [w3gat@nw ag ] I've started to use foxGUIb_win32.  I am quite impressed with the program.
270412 [meinrad.rech] ...

How to implement a hash whose key is another hash?
265512 [acmeman1@ya ] I understand that the key of a hash can be any object. Therefore,
+ 265513 [phrogz@ma .c] irb(main):001:0> h1 = {}
+ 265514 [tim.pease@gm] The problem is that you are not using the same key ...
+ 265529 [iw1junk@co c] Perhaps studying this will explain your confusion.
+ 265584 [code@je em e] It's a bad idea to do what you are doing.  However, if you really want

starting another programs from inside.
265518 [ja_bowen@ya ] I searched ruby-talk but I could not find the answer.
+ 265519 [grzm@se sp t] I think you need to make test.rb executable, which is what
| 265520 [stefano.croc] Or you can use
+ 265538 [ari@ar br wn] load "test.rb"

Assignment as a reference?
265527 [morgan.grubb] ...
+ 265528 [dblack@ru yp] It is.
+ 265530 [dougal.s@gm ] What you have experienced is reference assignment. If you wish to
  265531 [morgan.grubb] ...

How +:symbol is parsed
265532 [vshepelev@im] I wanted to be evil and add my own custom semantics to +:some_symbol
+ 265571 [aledonne.lis] Well, I haven't looked at parse.y, but I'll wager that the difference
+ 265790 [matz@ru y- a] For historical reason, + before literals works as "identity" (the
  + 265792 [vshepelev@im] OK. It wasn't "bug report" (as incorporating +:symbol semantics is mostly
  + 265864 [dan-ml@da 42] If you have time, would you care to enlighten us on what the historial

Adding aspects that modify return values?
265535 [mlanza@co ca] I am trying to use 'aspectr' to add aspects to Rails FormHelpers like
266331 [deanwampler@] ...
266357 [mlanza@co ca] I could only find :before and :after points in AspectR.  I am new to

output to the screen?
265537 [schmode93@ya] I was wonder if its possible to print the command to the screen so you

[ANN] god 0.3.0 released
265539 [pubsub@ru yi] Plenty of big changes and improvements in this release of god. Most

Regexp: named captures
265543 [ari@ar br wn] irb(main):001:0> if /(?<name>.+)/ =~ /ari/
+ 265547 [ssmoot@gm il] Ruby doesn't have named-captures.
| + 265551 [dblack@ru yp] The new regex engine, Oniguruma, does. You can install it in 1.8, and
| | 265567 [ari@ar br wn] I've read about Oniguruma - is it just a different engine behind
| | 265569 [phrogz@ma .c] What do you mean by "change the syntax"?
| | 265577 [ari@ar br wn] I mean change the basic regexp syntax.
| | 265593 [phrogz@ma .c] I believe that under 1.8 it comes as its own class, but in 1.9 on it
| + 374549 [steveausten5] I really enjoyed the article. It proved to be Very helpful to me and I
+ 265561 [lopx@ga et .] if match = /(?<name>blah)/.match("blah")
+ 265564 [w_a_x_man@ya] md = "foo bar".match( /(\w+) (\w+)/ )
  265566 [phrogz@ma .c] _, name, surname = /(\w+) (\w+)/.match("foo bar").to_a
  265586 [w_a_x_man@ya] name, surname = /(\w+) (\w+)/.match("foo bar").captures
  265588 [dblack@ru yp] That has the disadvantage that it will blow up if the match fails (no

Rake question: How to call a task from a different namespace.
265544 [wayneeseguin] ...
265554 [drbrain@se m] #invoke will only run a task once.  If you want to force it to run
265558 [wayneeseguin] ...

Date and DateTime on the Mac
265546 [ro.naldfi.sc] I have installed ruby for Mac OS/X. Strangely, the classes Date and
+ 265548 [gwtmp01@ma .] did you do a
| 265627 [ronald.fisch] OK, that solves it - but interestingly, a require 'date' is
| 265681 [dangerwillro] That may mean it's loading all those libraries on windows even if you
| 265758 [ronald.fisch] I wonder whether this is really the "official" definition of Ruby that
+ 265549 [fwmailinglis] charset="us-ascii"
  265557 [dangerwillro] It is part of the Ruby 'standard library' but you do still need to
  265560 [hassan.schro] Is this platform dependent? 'require' doesn't seem to be, er, required
  265563 [gwtmp01@ma .] Be careful with irb.  It has its own set of startup rules and
  + 265565 [hassan.schro] Aha, that fails. Good to know -- thanks for the clarification.
  + 265576 [dangerwillro] Good call, that's true, irb does require some things automatically.

openssl and windows
265550 [supersaurus@] one-click installer, 1.8.6-25, XP.
265552 [gthiesfeld@g] The false just means that openssl has already been required, probably
265555 [supersaurus@] thanks!

[QUIZ][SOLUTION] Process Rings (#135)
265559 [jamesbkoppel] Here's my solution. Its "processes" are just plain threads. It works pretty well, but it hangs on rings of size 1.

ruby-debug vs. breakpoint
265562 [tom@th mo eh] Okay, so it looks like getting the ole "breakpoint" working isn't
+ 265638 [martin.kraus] Just require 'ruby-debug' and you have the same functionality as you had
| 265662 [thomas.mackl] One thing that I've found is that you can't use rdebug in a test/unit
+ 265660 [james@gr yp ] You can type irb at a ruby-debug prompt to drop into a breakpoint

system() doesn't work but %x does
265568 [ruby-forums@] I'm trying to issue an "svn add" command from a script to add everything
265570 [jan.svitok@g] I guess '*' is handled by the shell. `` invokes the command via shell,
+ 265578 [nobu@ru y- a] To be accurate, system with multiple arguments bypasses shell,
+ 265579 [ruby-forums@] I'm using i386-cygwin and system() seemed to be better behaved when some

# of lines in a file
265572 [blufur@gm il] is there built-in method to determine the number of lines in a file?
+ 265573 [marcel@ve ni] Here are a few alternatives that use less memory than File.readlines (which
| 265977 [ara.t.howard] words.txt
+ 265574 [jan.svitok@g] `wc -l #{filename}` or similar (I don't remember the exact syntax for wc)
  + 265575 [jan.svitok@g] ...
  + 265975 [perrin@ap th] Your use of syntax is correct, there.  The -l option tells wc to only
    266055 [ronald.fisch] Nearly correct. It also prints out the filename. A better approach
    266058 [botp@de mo t] #   linecount=`wc -l <#{filename}`.chomp.to_i

WIN32OLE & SAPI
265582 [eder.sq@gm i] [code]
265648 [kyleaschmitt] Head on over to the MSDN pages for SAPI, whatever object method you

get a class from its name
265583 [funkaster@gm] charset=US-ASCII;
+ 265585 [ssmoot@gm il] I've seen little helper methods for this, but never so elegant. Nice!
+ 265587 [dblack@ru yp] I think it's usually done the way you've got it there. It's one of
| 265591 [tim.pease@gm] "A::B::C::D".to_class
| 265632 [dblack@ru yp] It's a more general-purpose thing, though; it's for any constant, not
| 265653 [shortcutter@] Definitively.
| 265665 [funkaster@gm] charset=US-ASCII;
+ 265654 [wayneeseguin] ...

[ANN] VimMate 0.6.3
265589 [guillaume.be] A new version of VimMate is now available: Version 0.6.3

Dear Lazyweb: Gem Platforms
265592 [drbrain@se m] As you may or may not have heard, RubyGems will be merged into Ruby
+ 265595 [nicksieger@g] ...
| 265599 [drbrain@se m] def match(arch)
| 265711 [nicksieger@g] ...
+ 265650 [ara.t.howard] you will be a hero if this happens: honestly!
+ 265703 [djberg96@gm ] I wasn't able to use tattle (because I couldn't get rubygems to
| 265708 [drbrain@se m] Beautiful, awesome, thanks!
+ 265728 [andre@di ir ] NetBSD and DragonFly seem to be missing. Unfortunately I don't have any
| 265939 [andre@di ir ] Sent one for NetBSD. It's "netbsdelf" actually.
| 266012 [drbrain@se m] Thanks!
+ 265797 [kinpoco@gm i] I'm not sure if there were any AIX-aware gems ;-), but
| 265816 [drbrain@se m] There aren't any platform-aware gems for much more than win32.  I
+ 265800 [jeremymcanal] Can you hack in developer/user dependencies while you're in there? ;)
  265813 [drbrain@se m] There's no such feature request in the tracker, so nobody actually

Test if file is binary ?
265596 [Gilbert.Rebh] how to test if a file is binary or not ?
+ 265602 [dejan.dimic@] On Aug 21, 8:04 am, "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
| 265604 [Gilbert.Rebh] On Aug 21, 8:04 am, "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
| + 265609 [alexg@ku cr ] class File
| | 265610 [alexg@ku cr ] Sorry for the duplicate! Robert is too fast for me.
| | 265612 [shortcutter@] It's always good to see more solutions.  I like the conciseness of
| | 265618 [Gilbert.Rebh] /*
| | + 265622 [fxn@ha hr f.] What's the heuristic in Subversion?
| | | 265623 [Gilbert.Rebh] /*
| | + 265625 [botp@de mo t] # Is there an exisiting standard what is considered as a binary file,
| | + 265628 [shortcutter@] Yep. But I'd leave the "is_" out - that's handled by the "?" already.
| + 265629 [lists@be tr ] I'm impressed by the solutions of Alex and Robert. Anyway I
|   265667 [lists@be tr ] def File.binary? name
+ 265607 [shortcutter@] If I'd really need it I'd probably do a heuristic based on
| + 265608 [Gilbert.Rebh] /*
| + 265706 [overlord@gm ] That only shows how many non-ascii-characters are used. It won't
| | 265714 [stefan@ma li] That's why clearcase (on windows) claimed my pure-ascii xml-file was
| | 265730 [overlord@gm ] You can't seriously treat a file with lines longer than 8000 characters
| | 265754 [stefan@ma li] Maybe this was a bad example. You are right, the xml-file would be best
| | 265772 [overlord@gm ] Note that Subversion would just treat the file as binary and process it
| | + 265788 [fxn@ha hr f.] It also disables newline normalization (which may or may not be an
| | | 265847 [overlord@gm ] Which is configurable for text files, too.
| | + 265817 [stefan@ma li] I didn't know this. Thanks for the info.
| |   265879 [overlord@gm ] Well, there is lot of XML files that I find readable. Including many I
| + 271056 [ed.odanow@wo] Don't forget the possibility, that a file ist encoded in UTF-16 or
+ 265647 [djberg96@gm ] On Aug 21, 12:04 am, "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>

(String * Fixnum) and (Fixnum * String)
265597 [ruby@gm il c] ...
+ 265598 [alexg@ku cr ] You've got it I think. In the first instance you call the String#*
+ 265605 [alexg@ku cr ] To clarify my previous answer, the important thing is to realise that
+ 265606 [mo_mail@on h] As I read it in Chris Pine's excellent 'How to Program', when you do
+ 265613 [sepp2k@go gl] 4*3 = 4+4+4 (4 added 3 times) = 12

.gemrc problem, installing Slave and Daemon on Railsmachine server
265600 [wilco.vandui] While trying to install gems on my Railsmachine (hosted) server. The
265601 [drbrain@se m] was caught.

[ANN] RubyInline 3.6.4 Released
265603 [ryand-ruby@z] RubyInline version 3.6.4 has been released!

[ANN] ParseTree 2.0.1 Released
265611 [ryand-ruby@z] ParseTree version 2.0.1 has been released!

Re: Detecting duplicates in an array, anything in the standa
265614 [koflerjim@ma] class Array
+ 265617 [botp@de mo t] #     uniq.map {|v| (self - [v]).size < (self.size - 1) ? v : nil}.compact
| + 265619 [botp@de mo t] # irb(main):015:0> a.select{|e| (a-[e]).size < a.size - 1}.uniq
| + 265620 [shortcutter@] irb(main):001:0> a = [1, 1, 2, 2, 2, 4, 3]
|   265626 [botp@de mo t] # irb(main):002:0> a.uniq.select{|e| (a-[e]).size < a.size - 1}
|   + 265630 [ryand-ruby@z] class Array
|   | 265634 [dblack@ru yp] ...
|   + 265669 [ari@ar br wn] I still think it's easier just to union itself...
|     265672 [phrogz@ma .c] ...but that's not what the OP wanted. What you've written is the same
|     265674 [dblack@ru yp] ...
|     265685 [jeremywoerti] I just thought I would put in my 2 cents. I actually had to create a
|     265707 [koflerjim@ma] A much less verbose 'nil' fix of the original version would be to use
|     265765 [koflerjim@ma] This fix does not work for a = [nil,1,2,[7],2,[7],3,nil], but the
+ 265633 [dblack@ru yp] => [2]
  265646 [koflerjim@ma] Sure.

[ANN] flog 1.1.0 Released
265615 [ryand-ruby@z] flog version 1.1.0 has been released!
265987 [perrin@ap th] So . . . is that a good result, or a bad result?  How do you define
265990 [tom@ac id nt] good point... flog looks like a great tool, but what is a "good" score
265991 [tom@ac id nt] never mind... i think i'm catching on (at last)... this is extremely
266008 [drbrain@se m] Total score = 9491.3018782491
266106 [sam@om wa co] To normalize the "final score" shouldn't it be divided by the number of
+ 266108 [tom@ac id nt] I initially thought about that too, but such a final score would potentially
+ 266184 [ryand-ruby@z] the flog total score is an overall complexity metric.
  + 266185 [ryand-ruby@z] % flog
  + 266346 [h.wickham@gm] I don't think that invalidates the usefulness of an complexity per LOC
    266506 [ryand-ruby@z] Which tells you what? In what way is that useful?
    266509 [perrin@ap th] It tells you that you aren't trying to cram too many things into a single

Re: VimMate 0.6.3
265616 [vasudevram@g] On Aug 21, 7:21 am, "Guillaume Benny" <guillaume.be...@sympatico.ca>
265656 [ jupp@gm .d ] gVim is not "Vim for Windows". gvim is a graphical version of vim that

(none)
265624 [vcuirassier@] ...

sensing keyboard and mouse?
265631 [arun.mehta@g] I want to interrupt something, when the user presses a key, or clicks
265671 [ari@ar br wn] Check out the termios library - and the HighLine gem.

How to "cast" in Ruby
265635 [m.tyman@in e] I need to know how to "cast" ruby objects on another i.e.
+ 265636 [dblack@ru yp] If temp is a string, then it does have a to_i method, and you can call
| 265639 [m.tyman@in e] David,
| + 265641 [dblack@ru yp] I think text (rather than get_text) will give you a string. In any
| + 265643 [kaldrenon@gm] How about: arr << "#{el.elements["id"].get_text}".to_i ?
|   + 265649 [shortcutter@] Then I'd still prefer arr << el.elements["id"].get_text.to_s.to_i
|   + 265661 [phrogz@ma .c] you should realize that it's functionally equivalent to
|     + 265687 [dangerwillro] True, but for some (myself included) it definitely stands out more,
|     + 265692 [kaldrenon@gm] It is. But "#{foo}" was more in keeping with the OP's original code,
|       265740 [logancapaldo] I had to count to be sure, but you are indeed correct. :) I just think
|       265782 [kaldrenon@gm] By itself, I happen to agree, but I tend to dislike long method call
|       265783 [james@gr yp ] #!/usr/bin/env ruby -wKU
|       265786 [kaldrenon@gm] On Aug 22, 8:35 am, James Edward Gray II <ja...@grayproductions.net>
|       265794 [Rob@Ag le on] Look at it this way, you're doing (1.4/.82)-1 ~ .707 or 70.7% more
+ 265637 [fwmailinglis] charset="us-ascii"

TkTimer and calling own methods from handler
265640 [rugowski@nh ] I'm experimenting with Ruby Tcl/Tk and I've got stuck with timers. I
265697 [m_goldberg@a] Both variables (button and global_variable) are local to the advance

ruby-activedirectoryy authentication with SASL
265642 [macinux@gm i] ...

Gallery application in RoR
265645 [marcin.gil@N] Are there any fine (I mean more/less similar to Gallery2
+ 265680 [dangerwillro] The thing is, you should be able to build that in RoR.
| + 265684 [marcin.gil@N] I am not up to that speed in RoR to make it. I would just
| | 265691 [dangerwillro] You can make spaghetti in Ruby and in RoR as well, but it never quite
| + 265686 [kyleaschmitt] Ohh comeon.
|   265688 [yudi.xue@gm ] ...
+ 265701 [jeremy@hi eg] enjoy,
  265750 [marcin.gil@N] That's *the* resource!
  265757 [koflerjim@ma] Maybe also take a look at http://pantherfotos.com !

rails forum software?
265651 [beingthexemp] um. I saw this forum software a while back that was ruby on rails.. and
265652 [beingthexemp] got it nevermind.. was called beast

Firebrigade status?
265655 [Bil.Kleb@NA ] *On Fire!*
265885 [Bil.Kleb@NA ] Grabbed drbrain on #ruby-lang; says its just the home

Ruby off the Rails
265657 [celldee@gm i] I did a quick search on jobserve.com for 'ruby'. I got 60 hits, most
+ 265658 [dougal.s@gm ] From my searches on Jobserve over the last few months, it would seem
+ 265659 [byte8bits@gm] Just my observations. I don't encounter it as an official
| 265663 [mo_mail@on h] At my company, we use Ruby for a lot of general scripting (and this is
| 265673 [shortcutter@] Did you consider that this might be due to the AV engine your shop uses?
| 265677 [mo_mail@on h] The point regarding the AV is interesting.  We're using Symantec Norton
| 265682 [cyrus_dev@ho] ...
+ 265666 [JAMES.T.MCLA] [mailto:ruby-talk-admin@ruby-lang.org] >On Behalf Of celldee
+ 265675 [shortcutter@] Maybe productivity with Ruby is so high that only few developer
+ 265812 [lloyd@2l ve ] Well, there are other things to consider.  Even though the number of PHP
threads.html
top