343324-381003

343136-344290 subjects 343566-345650

Basic XML to nested Array
343324 [james@ra ph ] Hey,
343340 [phasis@gm il] Your xml file is missing the root element.
343347 [james@ra ph ] Yeah the program outputting this stuff doesn't add a root element so

logging install
343335 [fabio.petruc] is it possible to install logging (the Tim Pease logging library) into
343352 [vjoel@pa h. ] If logging follows anything like the usual dir structure, you can

insertion and removal time for ruby datastructures
343344 [nick@ni k- r] Has anyone ever analyzed the built-in ruby datastructures (array, hash,

Re: 1.9 String and M17N documentation
343358 [b.candler@po] Thanks James.
343366 [james@gr yp ] export LC_CTYPE=en_US.UTF-8
+ 343367 [minilith@gm ] Just out of curiosity. Are there other languages that handle encodings
| 343396 [b.candler@po] Indeed, although we're both having a hard time thinking of an actual
| 343698 [drbrain@se m] This seems to be similar to the reasoning behind two-digit years.
| 343709 [b.candler@po] I don't understand what you're getting at. Obviously the round trip
| + 343710 [b.candler@po] BTW, I find James's writeup of what he had to do to the CSV library (*)
| | 343714 [b.candler@po] "A fixed_encoding?() Regexp is one that will raise an
| | 343737 [james@gr yp ] Thanks for the correction.  I've updated the article you quoted with a  correction.
| + 343730 [gregory.t.br] I'm not sure what binary data you've been having such great problems
| + 343752 [drbrain@se m] "dealing with [non 1:1 conversion round trips] is not an everyday
|   343759 [b.candler@po] It's not so much "can't be bothered", as "don't believe that a U-turn is
|   343763 [gregory.t.br] I think this is a good change that would at least cause mistakes to
|   343805 [b.candler@po] I have put a few ideas in a document 'alternatives.markdown' at the same
|   343813 [gregory.t.br] Yeah, this is also a reasonable behavior, IMO.  However, I think Matz
+ 343397 [b.candler@po] OK, I didn't write my statement clearly enough.

how to read parse data from two file to generate one one file
343359 [vadud3@gm il] #!/usr/bin/ruby

soap4r and java data types
343365 [dhill.novell] Is there any way using soap4r and wsdl2rb to use java Map. I ran wsdl2rb

[ANN] ShinyCocos 0.1.0 - coding iphone games in ruby
343369 [funkaster@gm] 0.1.0 (Birthday Pinata)

Session in Eruby
343370 [brgsousa@gm ] I'm trying to make a simple use of CGI::Session.

[ANN] ri_cal 0.7.7 Released
343375 [rick.denatal] ri_cal version 0.7.7 has been released!

[ANN] unicorn 0.8.4
343377 [normalperson] Unicorn is a Rack HTTP server for Unix, fast clients and nothing else

Push only unique messages with Stomp (ActiveMQ)
343381 [prokhorenko@] Are there any good way how can I push only unique messages into queue

[ANN] markup_validity 1.1.0 Released
343382 [aaron@te de ] markup_validity version 1.1.0 has been released!

we sell all kinds of shoes
343384 [fgfgdfgdf@12] nike,adidas,jordan and so on.We will offer you best goods and
343412 [ilan.berci@g] curses to _why for naming is project "shoes".. I will never forgive him

What is wrong with this program?
343386 [prateek.agwl] 'findarea' undefined local variable or method 'area_of_triangle'
+ 343387 [xenogenesis@] Prateek,
| + 343389 [drbrain@se m] Also, seems to be homework based on the filename.
| + 343394 [ramkrishnanj] Hey,
+ 343390 [sijo@ma xi n] two errors there
  343393 [xenogenesis@] what i have learned from my time at hms both as a tech and as a mentor
  343431 [ilan.berci@g] Ya ya.. I can quit any time .. just give me some more answers please..

(named|keyword) arguments gem
343388 [macarui@gm i] 1.9.1. I think is a good alternative to traditional options hash, usage

terminal residue
343391 [metasoarous@] Something really weird just happened - I just installed Ruby 1.9.1 using
343395 [shortcutter@] I guess that this is related to a change in class String which might
343399 [metasoarous@] Thanks for the help - I forgot that my .bash_login file had some ruby

FFI, sysctl, pointer question
343398 [djberg96@gm ] I'm trying to get better at FFI, but I'm getting stumped on how to
+ 343400 [robert.dober] At first sight you need MemoryPointer, but I could not really get it
+ 343401 [andrea.fazzi] You could explicity instantiate two MemoryPointer objects initialized
  + 343402 [chust@we .d ] size_t in ANSI C is required to be unsigned and is usually defined as
  | 343405 [andrea.fazzi] I didn't check for the sysctl prototype when replied to OP so I was not
  + 343422 [djberg96@gm ] Thank you, that worked.

ruby thread is buggy while using serialport
343404 [ashikali.m@g] I am using following gems .
+ 343464 [jacklang0003] Discount Ed hardy tshirt  (www.ebuyings.com)
+ 343484 [rogerpack200] My guess is that serialport library has no way of knowing if it has any
  343701 [ashikali.m@g] No I am using frok only . It is working fine no problem .
  343713 [geidies@go g] You are passing in the same object to different threads. So the
  343723 [ashikali.m@g] I have to inform you another problem . Al though I am using Thread for
  343724 [rogerdpack@g] Are they both being read from within the same process, in different threads?
  343725 [ashikali.m@g] yes , of course .
  343727 [ashikali.m@g] One port is in same process another one in therad .

R1.9 mixed encoding in file
343406 [v.ondruch@ti] I wonder if it is possible to enforce encoding of string in ruby 1.9.
+ 343407 [james@gr yp ] The problem with an idea like this is that before your String is ever  created the code to create it must be read (correctly) by Ruby's
| 343408 [v.ondruch@ti] Yes, I understand that you have to parse the file. However, if I am
| 343410 [james@gr yp ] $ cat source_encoding.rb
| 343414 [v.ondruch@ti] It is disturbing that this approach will fail as soon as the file is
| 343417 [james@gr yp ] You are not allowed to set the source encoding to a non-ASCII =20
| 343418 [v.ondruch@ti] Where is it documented please?
| 343426 [james@gr yp ] I'm not sure it's officially documented yet.
+ 343427 [vikkous@gm i] You seem to be asking for the ability to have individual string
| 343434 [v.ondruch@ti] Hmmm, that is a good idea!!!
+ 343433 [b.candler@po] It's not pretty, but
+ 343465 [jacklang0003] Discount Ed hardy tshirt  (www.ebuyings.com)

how to "source" a file?
343409 [hkkf1970@ya ] export EDITOR=vi
+ 343411 [ilan.berci@g] `source ~/.myenv`
| 343420 [Rob@Ag le on] Nope! That will set those variables in the child process and any of
+ 343430 [glennj@nc .c] File.foreach("myenv") do |line|
| 343442 [ninja@sl ph ] That's pretty fragile -- it would severely limit what you can put in the file.
| 343583 [glennj@nc .c] I don't understand this comment.  How is it "severely limiting"?
| 343585 [nospam@no pa] export PATH=${HOME}/bin:${PATH}
+ 343462 [jacklang0002] Discount Ed hardy tshirt  (www.ebuyings.com)

How can I copy an array and its elements? (call by value)
343413 [janus@ur an ] I'm failing at something really basic: copying an array and its
+ 343415 [jeanjulien.f] I think the method 'dup' is what you are looking for
| 343419 [janus@ur an ] Thank you both, that's exactly what I'm looking for!
| 343421 [shortcutter@] Just note that #dup and #clone do a shallow copy, so if you modify
+ 343416 [nosp@m. nv l] b=a[0..-1]
+ 343463 [jacklang0002] Discount Ed hardy tshirt  (www.ebuyings.com)

How do I add ?
343423 [chutsu@gm il] I've got a file that is in two columns, how do I add the second column
+ 343424 [chust@we .d ] you read strings from the file, but you want to add numbers. Therefore
+ 343425 [Rob@Ag le on] total = 0 # make the variable have scope outside the block
| 343428 [chust@we .d ] inject is a method of Iterable, so it's unnecessary to read the whole
| + 343432 [Rob@Ag le on] I think you meant Enumerable
| | 343435 [chust@we .d ] you're right, of course. Writing programs in Java and Scheme in
| + 343438 [bbxx789_05ss] Then you would runaway from inject.
+ 343446 [w_a_x_man@ya] awk "{t += $2} END {print t}" some_file.txt
  343447 [w_a_x_man@ya] ruby -ane"BEGIN{$t=0}; $t += $F[1].to_f; END{p $t}" some_file.txt
  343451 [Rob@Ag le on] Just because you can still write your Perl in Ruby, doesn't mean that
  + 343452 [xenogenesis@] just ignore waxman, he's a known troll.
  | 343457 [w_a_x_man@ya] Please ignore this pitiable fellow. He is a well-known
  + 343458 [w_a_x_man@ya] ruby -ne 'print if /Ruby/' /usr/share/dict/words
    343476 [Rob@Ag le on] Well, I have a two-hexdigit IQ ;-)

CGI::Session just don't work
343429 [brgsousa@gm ] I got this file to a apache/mod-ruby server and nothing is being set to
+ 343437 [bbxx789_05ss] A first access cannot have a lastaccess?
| 343439 [b.candler@po] No, the OP is correct. In the CGI library, cgi['foo'] is an array. This
| 343441 [bbxx789_05ss] I'm not seeing that.  It's my understanding that cgi handles multiple,
+ 343461 [jacklang0002] Discount Ed hardy tshirt  (www.ebuyings.com)

%w[RTF DOC PDF] converter to TXT
343436 [prokhorenko@] Are there any good RTF, DOC and PDF converters to plain text available
+ 343440 [gregory.t.br] With some limitations, you could use PDF::Reader to extract text from
+ 343459 [jacklang0002] Discount Ed hardy tshirt  (www.ebuyings.com)

what is "stack level too deep (SystemStackError)" error
343444 [mrsolarlife@] I've created a binary search using code from wiki and when i run it i
+ 343449 [xenogenesis@] When coding recursively, you *always* need to test for the exit
| 343454 [mrsolarlife@] When I use 6 it gave me the answer but when I tried 20 as the target i
| 343456 [xenogenesis@] Well, what does "didn't find it" mean? Think about what a binary
+ 343460 [jacklang0002] Discount Ed hardy tshirt  (www.ebuyings.com)
+ 343474 [josh.cheek@g] would do http://pastie.org/576485 it explains what the two issues are, shows
| 343570 [kbloom@gm il] You can't write this all in your message so that it can be permenantly
+ 343538 [rubfor@re it] It looks like when the search gets to the right edge, there is nothing
  343540 [mrsolarlife@] Thank you all for the clarification on the code. I can't believe I

[ANN] hoe 2.3.3 Released
343448 [ryand-ruby@z] hoe version 2.3.3 has been released!

[ANN] hoe-seattlerb 1.2.1 Released
343450 [ryand-ruby@z] hoe-seattlerb version 1.2.1 has been released!

[ANN] ZenTest 4.1.4 Released
343453 [ryand-ruby@z] ZenTest version 4.1.4 has been released!

[ANN] RubyInline 3.8.3 Released
343455 [ryand-ruby@z] RubyInline version 3.8.3 has been released!

I want a script can do this
343466 [jackycheung.] a directory aa , under aa has many files. i want batch rename all files.
+ 343467 [brabuhr@gm i] irb(main):001:0> a = %w{ test01 test02 test03 test09 test10 test11 }
+ 343468 [ryand-ruby@z] Below is an equivalent perl script that I've used for years and years.
+ 343469 [phasis@gm il] Dir.glob("aa/*").each{|f|File.rename(f,f.gsub(/test0+(?=\d)/,"test"))}

[ANN] nfc 2.0.0 Released
343470 [aaron@te de ] nfc version 2.0.0 has been released!
343528 [aaron@te de ] Go innernet!  This is truly the future (minus the jetpacks etc).

Soft realtime with EventMachine and timer resolution
343472 [macarui@gm i] with event scheduling, I shold have known before.
+ 343486 [billk@ct .c ] Hehe, i thought that looked familiar... it appears to be from an email
| 343488 [macarui@gm i] Thanks for your reply, it was useful!
+ 343578 [larschbelunk] o_f >=3D @next

[ANN] Rudy 0.9 Released
343473 [delano@so ut] Rudy 0.9.1 BETA - Not your grandparents' EC2 development and

[QUIZ] Adaptive Text Editor (#217)
343481 [yahivin@gm i] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
343715 [boesemar@gm ] Below my basic solution. It must first 'learn' from a text and store the

[QUIZ][SUMMARY] Dwarf Name Generator (#216)
343482 [yahivin@gm i] Again no solutions... Here's a pretty cool dwarf name generator to

is this a unit/test bug?
343485 [rogerpack200] -ntest_gives_single_discount
+ 343487 [vikkous@gm i] As far as I know, the -n (or --name) parameter to test/unit gives the
+ 343501 [ryand-ruby@z] no, --testcase MAY take a pattern, and you didn't provide one

How do I upload an image with Sinatra (like Paperclip)?
343490 [slythic@gm i] I need to upload an image from my local computer to a web server and
+ 343493 [marcosvanett] If you use datamapper, there is an paperclip for datamapper!
| 343494 [slythic@gm i] Thanks for the reply! I'm using ActiveRecord and wouldn't want to change
+ 343545 [b.candler@po] I don't know Paperclip or attachment_fu, but getting the attachment in
  + 343548 [dkonetwork@g] That is helpful.Thank u so much
  + 343564 [slythic@gm i] Thank you Brian! I will give it a shot when I have some time and reply
  + 366423 [ya@al az m. ] post '/upload' do
    366801 [b.candler@po] OK. Beware that f.write(tmpfile.read) will use as much RAM as the size
    381003 [alfuken@gm i] "f.write(tmpfile.read)"?? Why so complex?...

[ANN] August Phoenix Ruby User Group Meeting (this Monday)
343491 [james.britt@] August Phoenix Ruby User Group Meeting

convert time from 12 horus to 24 hours
343496 [junkone1@gm ] irb(main):010:0> time=arr[1][1]
343502 [vjoel@pa h. ] require 'time'

Basic iteration through text
343498 [keynesiandre] Howdy!
343500 [keynesiandre] Okay solved my problem, it was something stupid, like the period I

FFI, getutxent question
343499 [djberg96@gm ] According to the man page, the prototypes for getutxent(), setutxent()
343505 [andrea.fazzi] Your script runs smoothly on my system (Ubuntu Linux) returning a proper
343506 [djberg96@gm ] Ah, yes. I was on OS X. I tried again on Linux.
343508 [andrea.fazzi] Yeah, the docs on the Kenai wiki are pretty out of date at the moment.

Free C Language eBook
343503 [jaggubn@gm i] A Brief History of C

Imagemagick, Rmagick hsla problem
343509 [janthonyb1@h] For any imagemagick users out there, I'm having trouble getting
343510 [TimHunter@nc] I don't think the problem is with the from_hsla method. This produces a
343513 [janthonyb1@h] Tim,
343514 [TimHunter@nc] @canvas = Magick::Image.new(@width, @height) do
343515 [janthonyb1@h] Tim,

How to define doubles: Array-to-hash
343511 [tom999@gm .n] original = [1, 2, 3, 3, 3, 3, 4, 4, 5]
+ 343512 [TimHunter@nc] I won't argue that it's the most "efficient" but the following both
+ 343517 [lists@be tr ] original.inject({}) { |h,e| h[e] ||= 0 ; h[e] += 1 ; h }
  + 343518 [tom999@gm .n] Great!
  + 343531 [bbxx789_05ss] Your code doesn't produce the desired result, the op wanted an efficient
    + 343533 [lists@be tr ] Arrgh. Of course.
    | 343537 [dblack@ru yp] Actually they're not equivalent.
    | 343541 [lists@be tr ] Arrgh. Of course.
    + 343653 [larschbelunk] Actually, he wanted the "most efficient".

[ANN] tkar
343516 [vjoel@pa h. ] Tkar aims to be the gnuplot of animation ? a quick and dirty way to get

Generate binary sequences of length n?
343519 [thomas.j.bes] I'm rather new to Ruby.  I feel this should be very simple, but I'm
343520 [dblack@ru yp] def binary_seq_generator(n)
343521 [robert.dober] Well 1.9 has to offer some elegance here
+ 343522 [thomas.j.bes] They worked!  Thank you both very much - having a comprehensive
+ 343523 [robert.dober] Oh I just forgot, maybe you need the "combinatoric" method ;)
+ 343544 [b.candler@po] Perhaps safer to avoid the interpolation in the format string, using '*'
| 343559 [robert.dober] Well safer, you mean regarding to my typo, well spotted ;).
+ 343581 [dblack@ru yp] ...

Making Hash a first-class citizen
343524 [sferik@gm il] I've noticed a couple inconsistencies in the way Ruby hashes are treated
343525 [vjoel@pa h. ] Hash is a very flexible citizen, though. It plays many roles. So how
343527 [sferik@gm il] I do look at Hash as a set of pairs and I would consider the other uses you
343529 [shortcutter@] You omit a very important additional property: no key can occur twice in
343534 [minilith@gm ] There are also the merge and delete methods. Should + be simply
343587 [nick@ni k- r] Erik, when I've needed set-like behavior in ruby, I just used the Set

Re: Welcome to our (ruby-talk ML)         You are added automatically
343530 [joshillian@h] ...

[ANN] Lone Star Ruby Conference 2009 - 18 More Days till Showdown
343532 [jimfreeze@gm] Greetings from Austin - Home of the Lone Star Ruby Conference.

Font selector using radio button
343536 [bobcatlax07@] I have looked all around to try and find an answer to this. I have the
+ 343543 [b.candler@po] In your copy of the Agile book, look at the section entitled "working
+ 343547 [bbxx789_05ss] First, this isn't a forum for rails questions.  This is a general ruby

[ANN] rdoc_chm 2.4.0 Released
343539 [gthiesfeld@g] rdoc_chm version 2.4.0 has been released!

loops vs blocks
343542 [kookjr@gm il] It seems like the convention is to use blocks instead of more
343549 [b.candler@po] Breaking out of a block *is* the right thing to do. You can either use

RJB and Null: Fail: unknown method name
343550 [wolfram.scho] I'm in trouble with the Ruby-Java-Bridge.

Flush HTML head
343552 [arthur@pi op] What command I should use to flush html head to client in my
343557 [b.candler@po] If this is a problem with Ruby On Rails (the web application framework),
343558 [arthur@pi op] Thanks Brian! I've reposted the question to Rails.

Calling another Ruby script
343553 [pbailey@bn .] Can someone please tell me how you can can call out another Ruby script?
+ 343554 [TimHunter@nc] system("ruby myscript.rb")
| 343555 [pbailey@bn .] Hmmm. Simple as that, eh? I though there was some internal thing, but,
| 343565 [lists@be tr ] If you do not want to reload the Ruby interpreter, you may fork
+ 343556 [shortcutter@] I am not sure I understand the requirement from this.  Why do you need
| 343563 [pbailey@bn .] This second script is the one that's doing the check. The first script
| 343567 [shortcutter@] What about preventing that?  I mean, you could make sure that it does
+ 343612 [matt_neuburg] Just load the other script in the usual way and call something in it.
threads.html
top