379948-381734 subjects 380361-380752

^ Search files on windows shares
380157 [teedubb gmai] Did some googling and didn't see much on this topic, any ideas?
380159 [teedubb gmai] I feel like I can solve this problem once I figure out how to connect to
380292 [shortcutter ] Depends on your platform.  On cygwin you just do
380293 [hyagni gmail] You can mount your NAS to Z:\ or Y:\ or ...

^ Counting values in an array, storing in a hash then making an array of hashes?
380158 [jen.bottom g] Apologies but i've run in to another problem while attempting to make a
+ 380173 [bbxx789_05ss] totals = Hash.new(0)
+ 380174 [bbxx789_05ss] 3)
+ 380247 [shortcutter ] I'm not 100% positive that this is what you want, but it looks

^ fxri for windows?
380160 [smiley.mikey] I bought a book, Apress Beginning Ruby from Novice to Professional
+ 380168 [albertschlef] I don't have an answer for you (I'm not using Windows), but I thought
+ 380222 [alexandermcm] SCITE does not come with 1.9.2=2C neither does it come with 1.8.7.
  380223 [dheitzman ie] I can't say enough good things about geany, the editor that was forked
  380225 [martindemell] Notepad++ [http://notepad-plus-plus.org/] seems to be a more native

^ [ANN] raindrops 0.6.0 - TCP/UNIX listen queue stats for Linux
380163 [normalperson] Polishing up the last (0.5.0) release
380164 [ben bleythin] Once upon a time (v0.4.1) raindrops would build on osx. At the time I
380166 [normalperson] Oops, looks like I forgot to guard the TCP_INFO stuff properly
380167 [ben bleythin] It does fix it! Thanks for the quick turnaround!
380169 [normalperson] No problem, thanks for the report. I just pushed out 0.6.1

^ Re: using the current method name within current method
380185 [juergen.mang] Reviving thread again: I'd use __method__

^ [ANN] net-ldap 0.2 Released
380186 [halostatue g] net-ldap version 0.2 has been released!

^ Difference between for and someclass.each do |var|
380190 [tyrel cloud-] I come from the low level C land and I am really loving ruby but I am
+ 380191 [sebastian va] Hej Tyrel,
| + 380193 [shortcutter ] a=3D%w{foo bar}
| + 380194 [nobuoka r-de] In a for/in loop, you need not call #each method.
+ 380192 [tyrel cloud-] Thank you its all starting to steep in...I think

^ summing values in a hash?
380196 [jen.bottom g] Is there an inbuilt method to sum all values in a hash and return the
+ 380197 [mentionuse g] You could try
| 380199 [shortcutter ] You should rather use a different idiom because your solution breaks
| 380203 [robert.dober] slightly better, because working ;)
| 380207 [shortcutter ] What do you mean by that?  Where was my solution not working?
| 380212 [robert.dober] jruby -e 'p( {:a=>42}.inject(0){|a,b|a+b})'
| 380218 [shortcutter ] My code explicitly included #values so it would not be affected by the
+ 380198 [andrea andre] hash = { :a => 1, :b => 6, :c => 20 }
+ 380213 [colinb2r goo] 1. it may be quicker than searching for an "inbuilt" method;

^ How could I make the Ruby 1.9 string ignore the invalid utf-8 byte sequence in split?
380205 [wenhao.xu gm] Dear buddies,
+ 380206 [wenhao.xu gm] Sorry, I just mis-sent the half-typed mail by a short-cut in gmail.
| 380208 [shortcutter ] Did you?  I can't seem to find it.
| 380209 [wenhao.xu gm] Anyway, let me resend it again.
+ 380211 [yimutang gma] Maybe you should not encode the data from its external_encoding to
| 380214 [wenhao.xu gm] I don't think that's the problem. It is probably a file with utf-8
+ 380215 [yimutang gma] I am working with Chinese character radicals.
  380226 [ryand-ruby z] This sounds like it might be a legitimate bug. Can you file a ticket on =

^ Re: Win32API- GetForegroundWindows()
380219 [tcblues gmai] Thanks a lot for the code
380254 [rogerpack200] win32api scares me.
380258 [djberg96 gma] Yeah, well, FFI scares me. It's a PITA declaring structs, and it won't

^ Ruby corrupts after a period of time
380220 [cburke innov] I have recently upgraded from Ruby 1.8.7 to 1.9.2p180 on Fedora. After a
+ 380221 [brabuhr gmai] ...
+ 380227 [ryand-ruby z] What C extensions might you have loaded?
| 380303 [cburke innov] Forgive my ignorance as I am a syadmin and don't delve into those parts.
| 380305 [brabuhr gmai] Can you provide more details of your process?
| 380309 [cburke innov] Install Fedora/CentOS. It has been a mixed bag thus far. Mostly x86_64
| + 380312 [matt technor] You should check to see if you have the auto updates using yum configured.
| | 380313 [cburke innov] Yum is absolutely off. I can't imagine if it were on. Everything would
| + 380314 [brabuhr gmai] Have you looked into something like RVM to help manage multiple
| | 380317 [cburke innov] Correct. 1.8.x installs have been stable for a long while starting with
| | 380320 [brabuhr gmai] I have run 1.9.x on CentOS (PREFIX=3D/usr/local) with no issues, but I
| + 380326 [ryand-ruby z] <cburke@innova-partners.com>
+ 380302 [rogerpack200] run it in gdb to get the backtrace?
+ 380370 [cburke innov] Some more news. I built a clean Fedora 13 x86_64 box last night to test
| 380407 [brabuhr gmai] Thanks for testing that.  Did you also test installing to a different PREFIX?
+ 380373 [adrianperez.] All right,

^ Modal dialog in chinese operation system
380231 [vvvv.spring ] Dear all

^ How to use String.split to split a mixed encoding string(part encoded in gbk, part encoded in utf-8)
380232 [wenhao.xu gm] Dear Buddies,
380239 [shortcutter ] A string with a mixed encoding is difficult to handle.  I think you
380252 [wenhao.xu gm] Thanks a lot, Robert. Your solution really helps.

^ Problem reloading Ruby runtimes
380233 [oscarschnitz] I'm embedding Ruby in a C++ program.  This is working fine when I load
+ 380277 [ryand-ruby z] then
+ 380278 [oscarschnitz] Thanks for the suggestion, yes I'll try ruby-core.

^ ruby debug newbie help
380234 [f.linard fdt] I'm learning Ruby and I got a little problem with my first try at
+ 380235 [f.linard fdt] ruby -rdebug RSU.rb
+ 380253 [rogerpack200] don't do -rdebug
+ 380259 [f.linard fdt] no, I only tried to use the debug version included in ruby, not the
+ 380301 [rogerpack200] probably some bug in the built in debug.rb file
+ 380478 [f.linard fdt] Ok, thank you... I'm beginning with Ruby and can't take much time to

^ Dynamically calling a certain set of methods
380236 [vbosch gmail] I am doing an implementation of a genetic algorithm to resolve a certain =
380238 [shortcutter ] ?("Mutation")}.shuffle![0]) =A0 =A0 #I'm using to_s as the symbol object do=
380240 [vbosch gmail] Great,much better and concise... (I need to improve on my regexp)
380310 [kaczoanoker ] You can save yourself some CPU cycles by pre-compiling the list of
+ 380322 [vbosch gmail] I am actually modifying the mutation methods and creating more on the =
+ 380352 [albertschlef] But if his actual class if derived from Mutating, your code won't work
  380376 [vbosch gmail] If I add the method with instance_eval you are correct, but it works if =

^ Nil can't be coerced into Fixnum (TypeError)
380241 [mayank.kohal] I am trying to execute the following code and it seems like the array is
380243 [jgabrielygal] =3D0 }
380288 [serialhex gm] hey all,
380290 [mayank.kohal] Nice I dint know about the Prime class available in stdlib. Thanks a lot..

^ gem install thrift fails on windows
380242 [saravani20 g] I'm trying to install thrift gem in my local windows machine. It throws
380251 [sutniuq gmx.] You're missing a C build environment. Install the RubyInstaller's
380298 [saravani20 g] Thanks mate... You made my day...

^ Workaround for ActiveSupport::OrderedHash YAML bug
380244 [wever axini.] I'm looking for a workaround for the problem that you can't

^ get text from flash/flex
380245 [tcblues gmai] I'm trying to use win32api to get the displayed text on a flex app popup
380271 [echristopher] I'd be interested in doing that, too; however, I think it's impossible
380272 [brian brianj] Do you have access to modify the flex app?

^ Algorithm for fuzzy string matching
380250 [mail maasha.] Here is an attempt at a naive fuzzy string matching algorithm. I would
380265 [ryand-ruby z] That would generally be slower, depending on use. One thing you might =

^ Re: Modal Dialog - WATIR
380256 [rogerpack200] are you using this for something other than a browser?

^ [ANN] live_ast 1.0, now with transparent integration -- ParseTree for Ruby 1.9
380257 [quixoticsyco] Since its initial announcement, live_ast has acquired the ability to

^ Problems moving and renaming pictures with this code, what wrong?
380260 [fs_tigre hot] I have been reading the book called =E2=80=9CLearning to Program=E2=80=9D=
+ 380261 [anurag08priy] my
+ 380267 [fs_tigre hot] I know, shame on me I should know that :(
+ 380336 [albertschlef] You can do this in one step.
+ 380356 [fs_tigre hot] Thank you for the simplified version.

^ Converting PHP to Ruby
380262 [jack.whitman] Just started looking at Ruby the last couple of days, so as a starter I
+ 380263 [steve stevek] ord exists in 1.9, but not in 1.8.
+ 380264 [jack.whitman] Oh, and I am programming in 1.8?
| 380266 [steve stevek] Is 1.9 a big release compared to 1.8?
+ 380268 [jack.whitman] Oh, u just found out what I did wrong, and the rest of the script seems
| 380279 [rimantas gma] I just had to do
+ 380269 [jack.whitman] But that actually did get me the ASCII code which I tried to recieve
| 380273 [jeremy bopp.] If you have a number between 0 and 255, that method should return you
+ 380270 [jack.whitman] If you'd like, here's an updated code with real variable names and some
| + 380274 [jeremy bopp.] animal = "cat"
| | 380282 [code apotheo] That's not strictly equivalent.  The original PHP version didn't have any
| + 380275 [code apotheo] The same thing works in Ruby.  You don't need the dollar signs unless you
+ 380280 [pmckibbin gm] nicest code I've ever written and there's probably a better way, but try

^ iteration question
380276 [funal.zhang ] data = Array.new(5,[])
+ 380281 [rimantas gma] data = Array.new(5,[])
| 380284 [renard nc.rr] data =3D []
| 380291 [shortcutter ] Even simpler
+ 380286 [bbxx789_05ss] Array.new(size=0, obj=nil)
+ 380287 [funal.zhang ] Thanks for your kindly reply.

^ [ANN] MacRuby 0.10
380283 [laurent.sans] After just a couple weeks of development since the last release,

^ [ANN] net-ldap 0.2.1 Released
380285 [halostatue g] net-ldap version 0.2.1 has been released!

^ joining me
380289 [kalpana91020] ms.kalpana2011@rediffmail.com

^ Class names in arrays
380294 [b.fowl87 gma] Is it a bad idea to use class names in a hash?
+ 380295 [jgabrielygal] Not per se, depends on what you are going to do with them. By the way,
+ 380296 [ruby urgewal] generally speaking, there is no correct answer for that question. It
+ 380297 [shortcutter ] Where's the Hash?  Or did you mean [EcoCalendar,MarketForecast].hash ?

^ Can I use MacRuby without knowing Objective-C
380299 [fs_tigre hot] Do I need to know Objective-C to use MacRuby?
+ 380304 [mjohann rail] What would you do with Objective-C?
+ 380307 [fs_tigre hot] Thanks a lot for your comments!
| 380316 [cmdjackryan ] IIRC, it's similar to how JRuby and IronRuby would work: Access to the
+ 380318 [fs_tigre hot] Thanks a lot for the clarification.

^ [ANN] logging 1.5.0
380300 [tim.pease gm] logging version 1.5.0

^ shortcut for add unless nil ?
380306 [iainspeed gm] Is was wondering if there's a Ruby idiom for adding variables that =
+ 380308 [fxn hashref.] [a, b, c, d].compact.reduce(:+)
| 380339 [iainspeed gm] you're fluent.
| 380347 [shortcutter ] ou're fluent.
| 380369 [colinb2r goo] I'd also wondered whether Iain Barnett really needed array + array2
| 380382 [iainspeed gm] I really appreciate the responses, but if I apply them to the code that =
| + 380385 [shortcutter ] rovoked the question for me, and my dislike of wrapping things in an array =
| | 380389 [iainspeed gm] this one? :)
| | 380394 [serialhex gm] ...personally i think it would be nice to be able to define new operators
| | + 380406 [iainspeed gm] operators
| | | + 380408 [ryand-ruby z] I can almost guarantee you that this proposal would get rejected by =
| | | + 380436 [shortcutter ] But that's something different than defining a new operator.  It's just
| | + 380437 [shortcutter ] Because that would completely break parsing.  Whenever an operator
| |   + 380444 [astounding g] An alternative for the original poster's ENV variables potentially
| |   | 380445 [astounding g] %w{FOO BAR BAZ}.map{|x| ENV[x].to_s.split(/:+/) || []}.flatten.uniq
| |   | 380446 [astounding g] I've found that whenever I have a variable that may be nil, doing
| |   | 380467 [iainspeed gm] Nice tip, thanks!
| |   + 380449 [code apotheo] I'm not so sure about that.  If it were just possible to specify that a
| |     380456 [shortcutter ] That's a different story because that is a fixed syntax for method
| |     380468 [code apotheo] or)
| + 380398 [code apotheo] e? :)
+ 380327 [ryand-ruby z] know I could use a fold or something similar, but I was wondering if =
  380337 [iainspeed gm] situation arise in the first place. Nil checks everywhere is generally a =
  380400 [ryand-ruby z] situation arise in the first place. Nil checks everywhere is generally a =

^ command line arguments in unit/test
380311 [bellcolt hot] How do I get to the command line arguments in test/unit. In the
380315 [alex blackke] Does this help?
380386 [bellcolt hot] Yes, it does.

^ Rewrite data to a file
380319 [jojosl hotma] rewrite data to a file.
+ 380321 [brabuhr gmai] Are you able to write a (new) file with the correct data?
+ 380323 [stu rubyprog] look at gsub.
+ 380330 [ekampp gmail] File.open('/path/to/file').write{ |f| f.write('some data') }
  380334 [cmdjackryan ] File.open "c:/path with spaces to/file.name"

^ Regexp, matching only the content within parentheses
380325 [ekampp gmail] I'm hoping that someone can give me some pointers. I need to match the
+ 380328 [g.diemant gm] I think /\(([^)]+)\)/ should work.
+ 380329 [ekampp gmail] Thank you, that pointed me in the right direction. But now I'm facing
+ 380331 [bbxx789_05ss] Regexes are "greedy" by default.  Don't look for [^)] characters,
+ 380332 [ekampp gmail] I have upgraded the regular expression somewhat, to enclose other
+ 380335 [bbxx789_05ss] perl's regexes have a recursive feature, which can solve your problem.
| 380348 [shortcutter ] Not necessary: Ruby has it, too.
| + 380349 [shortcutter ] irb(main):054:0> %r{\( (?<ne> [^()] | \( \g<ne> \) )* // \g<ne>* \)}x.match s
| | 380350 [shortcutter ] ... and if you want to extract the content of the outer bracket
| + 380428 [bbxx789_05ss] How come the perl regex uses the non-backtracking ++, and yours doesn't
|   380438 [shortcutter ] "_the_ perl regexp"?  What do you mean exactly?
+ 380358 [ekampp gmail] Thank you people. I will try and work with this stuff. It has given an

^ mkmf have_func usage
380338 [iainspeed gm] I'm wondering if I'm using the have_func from lib mkmf correctly, as I =
380340 [djberg96 gma] n't seem to get a `true` out of it?
380375 [iainspeed gm] This is the mkmf.log generated, and I don't really understand what I'm =
380393 [ryand-ruby z] =80=99
+ 380405 [iainspeed gm] </Library/Frameworks/Libiconv.framework/Versions/1.13.1/include/iconv.h>
| 380409 [ryand-ruby z] </Library/Frameworks/Libiconv.framework/Versions/1.13.1/include/iconv.h>
| 380417 [iainspeed gm] Mine fails on this check, and I suspect it's due to this set of =
+ 380486 [albertschlef] That's not a very good answer. have_func() is supposed to tell you if a
  380529 [djberg96 gma] Indeed, I tested this on my Linux box and it works fine with
  380543 [iainspeed gm] require "mkmf"

^ break from select
380341 [surabhiamar.] I have an array like a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14]
+ 380342 [mayank.kohal] a = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
+ 380343 [saravani20 g] Quick Solution,
  380344 [surabhiamar.] Thanks Saravanan for your reply. I thought of doing this .
  380345 [saravani20 g] Here is the better solution,
  380346 [shortcutter ] You are still iterating the whole input Array.  This is better
  380351 [saravani20 g] Yes Robert you are right... I've used "next" instead of "break"...

^ Pid of the other end of a popen3?
380353 [alex blackke] Is it possible to get the pid of a process at the other end of an IO
+ 380354 [shortcutter ] irb(main):021:0> Open3.popen3("sleep", "5") {|a,b,c,t| p a.pid, t[:pid]}
| 380355 [alex blackke] Sorry, I missed a vital bit of information, that being which Ruby
+ 380519 [rogerpack200] might help (for me it said something at the top).

^ How to get the value of a singleton class?
380359 [yimutang gma] str = "ABC"
+ 380360 [robert.dober] your problem is that class << x...end  is *not* a closure
| + 380365 [yimutang gma] Thank you for explanation.
| | 380371 [robert.dober] Than I am confident that
| + 380410 [mentionuse g] => ""
| + 380416 [bbxx789_05ss] ...but that is a ridiculous construct.  You are creating a block for
|   380440 [robert.dober] What bothers us, is this
|   380442 [astounding g] such.
|   + 380443 [astounding g] irb(main):001:0> foo = "FOO"
|   + 380448 [robert.dober] I do not really have a problem with this. However I feel that it is
|     380498 [b.candler po] I think it *is* a design choice, because of the local variable/method
|     380506 [robert.dober] That is a very good point, I have used closure based programming, and
+ 380418 [bbxx789_05ss] str = "ABC"
+ 380422 [bbxx789_05ss] Also, you should know that in ruby the keyword 'class' starts a new