400537-401243 subjects 400994-406991

REXML & HTMLentities incorrectly map to UTF-8
400784 [lists@ru y- ] I have some XML data (UTF 8) that I'm trying to convert into another XML
+ 400793 [fluido@fl id] I am not really sure about what happens within rexml there, but when
+ 400798 [hutch-lists@] XML
| 400799 [hutch-lists@] On 2012-10-31, at 8:19 AM, Bob Hutchison <hutch-lists@recursive.ca> =
+ 400814 [lists@ru y- ] I'm pretty sure that REXML converts with UTF-8. That's what the tutorial
| 400840 [hutch-lists@] I think nokogiri is probably your best bet, sorry to tell you that. But =
+ 400854 [kou@co mi ng] Could you show me a sample Ruby code?
  400932 [lists@ru y- ] Here is some code to produce the problem, plus the input xml and the
  + 400942 [hutch-lists@] It doesn't look, to me, as though there's any CDATA section in the input =
  | 400958 [lists@ru y- ] There's no CDATA in the input because it was refusing to put out ANY
  + 400947 [kou@co mi ng] Thanks for providing sample code.
    + 400949 [matthew@ke w] U+0092 (apparently called "PRIVATE USE TWO" but usually a rounded
    + 400959 [lists@ru y- ] I'm not sure what you're saying.

newline conversion on reading?
400785 [fxn@ha hr f.] File.write('foo.txt', "foo\r\nbar\r\n")
400787 [lists@ru y- ] If you are on a Window operating system, ruby will convert any "\n" in
400792 [fxn@ha hr f.] That test ran on a Mac.
400800 [fxn@ha hr f.] Looking at the test suite for 1.9.3 I see you need to explicitly

Capturing output from external application results in Errno::EMFILE: Too many open files
400788 [lists@ru y- ] I'm after some help diagnosing a problem with capturing the output from

Nokogiri Xpath: need to write "\n" for every table element
400789 [lists@ru y- ] Rails 1.9.3
400794 [shortcutter@] First of all the XPath looks suspicious: you certainly want only "td"

A doubt about the Dir::[] class method
400790 [lists@ru y- ] I am learning Ruby from the poignant guide and in chapter 4 I came
400791 [quintus@qu n] This is invalid syntax and will cause a SyntaxError. :: must be

Error 193: %1 is not a valid win32 application
400796 [lists@ru y- ] I'm trying to launch Webdriver via an Ocra exe which works on all the

[ANN] test-page 0.0.1 has been released
400797 [lists@ru y- ] test-page helps you to write easily maintainable integration tests by

Uniq! array of arrays based on one element?
400801 [lists@ru y- ] There might be a simple way to do this, but it's been confusing me a
+ 400802 [lists@ru y- ] array.uniq! {|x|x[0]}
+ 400803 [lists@ru y- ] Magic indeed! I suspected there would be some Ruby method that would
+ 400806 [lists@ru y- ] array.uniq! &:first
+ 400812 [lists@ru y- ] Thanks Jan; although I'm looking at the seventh field in my actual data,

need regex to check for consonants and put number after each consonant
400817 [lists@ru y- ] im working on code to check if a character is a consonant or not and if
+ 400818 [lists@ru y- ] this cannot work. First of all, to_num() is an instance method and not a
+ 400819 [stefano.croc] That's because to_num is an instance method (that is, a method defined on
| 400821 [lists@ru y- ] This matches *any* character that's not a vowel, for example digits or
+ 400822 [lists@ru y- ] Thank you so much for your help guys! That part worked like a charm!
+ 400824 [lists@ru y- ] I think you misunderstand how methods and blocks work. You continue to

Problems installing nokogiri on xlr/powerpc
400826 [lists@ru y- ] I need to install and use nokogiri on xlr/powerpc platform but running
400927 [mike.dalessi] You should ask this question on nokogiri-talk, and provide the contents of

ANN: Sequel 3.41.0 Released
400827 [lists@ru y- ] Sequel is a lightweight database access toolkit for Ruby.

failure to parse multiple (procs with do end blocks) as method arguments
400828 [lists@ru y- ] foo proc do
+ 400829 [matma.rex@gm] foo proc do end is being interpreted as foo(proc) do end, so you get a
+ 400871 [lists@ru y- ] thanks, good to know about different binding precedence of do end and {}

streaming stdout with open4 to prevent parent/child buffer lock
400830 [lists@ru y- ] i have to fork a process and read a large amount of stdout; however, the
+ 400831 [fluido@fl id] I am not very sure I understand what you want to do. But of one thing
+ 401008 [lists@ru y- ] okay, sorry; i wasnt very clear.
+ 401031 [shortcutter@] $ ruby x.rb

[URGENT] Need someone to do assessment - will pay $10!
400832 [lists@ru y- ] I've got an assessment/assignment for tomorrow. It's just basic Ruby
400833 [jarrodhenry@] Really?  You're asking us to cheat?
400835 [whitequark@w] Well, cheating is bad for him, not us. Answering questions like this is

Re: Need someone to do assessment - will pay $10!
400834 [lists@ru y- ] Just see it as me asking  for help.
400836 [rubytalk2dav] We'll give you much better help long-term, by NOT doing as you ask.

command prompt problem with windows 7
400838 [lists@ru y- ] I'm new to this, so forgive me noobishness(is that a word?) and have a
400839 [sto.mar@we .] Are you really sure that the file `argv.rb' is in your current
400888 [lists@ru y- ] here's what i get every time i try his. thanks again!
400890 [jam@ja an be] The file argv.rb does not exist in the directory you're running ruby from. c=
400891 [lists@ru y- ] tried that. it didn't work
400895 [sto.mar@we .] $ cd Documents\Programming\RuBy

[ANN] ruby_parser 3.0.0 Released
400842 [ryand-ruby@z] ruby_parser version 3.0.0 has been released!
400848 [whitequark@w] Thank you for your work!
400855 [ryand-ruby@z] Thank YOU for your contributions!

Simple question
400843 [lists@ru y- ] I have just picked up ruby and am trying to teach my self.  so this
+ 400844 [fluido@fl id] If you want to refer to your global variable, you must always use the
+ 400845 [lists@ru y- ] This might help
+ 400952 [lists@ru y- ] this block
  + 400953 [fluido@fl id] ^ is the exclusive-or operator. It returns a boolean value. Which
  | 400955 [sto.mar@we .] depends on $radus, which is probably nil.
  + 400954 [sto.mar@we .] You are trying to multiply with `true' in line 20 of your program.

exception: can't convert nil into String
400846 [lists@ru y- ] I'm going nuts trying to figure out what's wrong with this script.
400847 [matma.rex@gm] You don't set the pdffile variable anywhere.
400849 [lists@ru y- ] He sets it to ARGV[0]. Perhaps he ran the script without providing an argument?
400850 [matma.rex@gm] Ugh, that's right, sorry. I don't know why I missed it; perhaps I
400948 [lists@ru y- ] Thanks for your responses. I defined the variable with the ARGV, correct. I'm globbing PDFs just to see if there are any PDFs. If there aren't any, then, I exit the script. This script only works on PDFs, in that folder. I run this script, along with many, many other scripts like it, with a scheduling utility called ActiveBatch. I've told that scheduling utility to fire this script when there's one PDF, at least, in the folder. So, yes, the ARGV[0] stands for the one file at a time way of executing against one or more PDF files. Thanks.
400950 [alexg@ru ge ] As Brian says it looks like ARGV[0] is not getting set (i.e.
400951 [lists@ru y- ] OK. Well, I've discovered that this script actually runs just fine in

[ANN] flog 3.0.0 Released
400851 [ryand-ruby@z] flog version 3.0.0 has been released!

[ANN] flay 2.0.0 Released
400852 [ryand-ruby@z] flay version 2.0.0 has been released!

[ANN] minitest 4.2.0 Released
400853 [ryand-ruby@z] minitest version 4.2.0 has been released!

[ANN] ruby_parser 3.0.1 Released
400856 [ryand-ruby@z] ruby_parser version 3.0.1 has been released!

[ANN] ruby2ruby 2.0.1 Released
400857 [ryand-ruby@z] ruby2ruby version 2.0.1 has been released!

Support for multiple Inheritance by classes
400858 [lists@ru y- ] Will Ruby ever support multiple inheritance through classes instead of
+ 400859 [   ar@le .m ] I think I can say "no" with a fair amount of confidence.
| + 400860 [sancozz@gm i] unsubscrev please
| + 400902 [lists@ru y- ] Thanks for the reply. The information is adequate. It's quite
|   + 400904 [peterhickman] Even though other languages handle multiple inheritance without any
|   | 400905 [lists@ru y- ] Good points but think they're really not that essential, especially if
|   | 400907 [peterhickman] Well the example you gave at the head of this thread is pretty meaningless.
|   | 400908 [lists@ru y- ] Depends on one's principles. Also, perhaps it's all because I just
|   | 400909 [peterhickman] Ok then lets return to your puzzle problem. Given the first example that
|   | 400910 [lists@ru y- ] Yeah I noticed that I didn't place them in methods and directly used
|   | 400911 [peterhickman] Provide working code in the language of your choice that demonstrates a
|   | 400913 [lists@ru y- ] I believe I had explained enough. If it's about examples there are many
|   | + 400915 [peterhickman] I have googled and cannot find an example of a problem that is better
|   | + 400916 [matz@ru y. r] As a general principles, multiple inheritance can be replaced by
|   + 400919 [tony.arcieri] What you're basically saying here is we can get most of the properties of
|   | 400934 [lists@ru y- ] I haven't used Python for quite a while now.  Python supports multiple
|   | 400939 [stu@ru yp og] Multiple Inheritance is the GOTO statement of object oriented
|   + 400945 [shortcutter@] If you notice you do this regularly you are probably doing something wrong
|     400961 [hutch-lists@] ...
+ 400941 [lists@ru y- ] Thank you everyone for giving their attention and thoughts to the
+ 400965 [lists@ru y- ] What I do not understand is why people suggest other languages.
  400993 [shortcutter@] The difference between class and module in Ruby is
  401017 [Mohammed-Yas] ...

ruby -r debug -> "Emacs support available"
400861 [listgj-ruby@] Forgive my ignorance, but what does that "Emacs support available" message mean? I can't find anything about it anywhere (possibly because the search terms are so common). What kind of support?
+ 400870 [quintus@qu n] Emacs is a code editor[1] that can also run from the commandline. See
+ 400872 [ryand-ruby@z] message mean? I can't find anything about it anywhere (possibly because =
  400975 [   ar@le .m ] Very wise words!  Thank youˇ˝I feel enriched now. :)

400862 [sancozz@gm i] ...
400863 [echristopher] Yelling at us won't get you unsubscribed. Please follow the directions
400867 [sancozz@gm i] MUITO OBRIGADO AMIGO, TANK YOU
400869 [sancozz@gm i] ok?

[ANN] zenweb 3.0.0 Released
400864 [ryand-ruby@z] zenweb version 3.0.0 has been released!

why does UnboundMethod need to remember the class it was retrieved from (not merely owner)?
400865 [lists@ru y- ] class Base; def foo; end end
+ 400866 [lists@ru y- ] An unbound method can be called only after it is bound to an object
| 400868 [lists@ru y- ] This does not answer the question.
| 400874 [lists@ru y- ] How comes? It is the rule, that you can not bind a method to anything
| 400879 [lists@ru y- ] Because "it's the rule" is a not a meaningful answer to why?
| 400880 [ryand-ruby@z] need=20
| 400881 [lists@ru y- ] I am not following this logic.  Binding a method to an object that is_a?
+ 400882 [lists@ru y- ] {{ Base.new.is_a?(sub_foo.owner) }} does not give you the right answer
| 400883 [lists@ru y- ] Since you neither know nor care to know, it would have been sensible to
| 400884 [lists@ru y- ] Perhaps you should have noticed that only after a few posts we figured
| 400885 [lists@ru y- ] I see, I now understand your malfunction.  When you encounter a question
| + 400886 [jam@ja an be] Stop being arseholes, folks. It's only a ruby forum. Chill.
| + 400887 [lists@ru y- ] Because, the UnboundMethod can not be bound to an object that is not
|   400889 [lists@ru y- ] I thought you at least understood the rule as it is, since you kept
+ 400892 [lists@ru y- ] Cancelling the double negation below is what I said originally when I
  400894 [lists@ru y- ] "owner of the unbound method" were your words. And there is no ambiguity
  400900 [matma.rex@gm] I suggest you ignore Igor, as he has already proven he is a troll in

image hexcode
400873 [lists@ru y- ] how can I display an image as hexcode? I want to have the same Hex-Code,
+ 400875 [jgabrielygal] If you can read the file as strings, you can show each byte of the
| 400877 [lists@ru y- ] thank you very much!
+ 400878 [lists@ru y- ] bin = File.read("foo.jpg")
  400898 [lists@ru y- ] Thank you very much too...this seems to be even easier.

[ANN] hoe 3.1.1 Released
400876 [ryand-ruby@z] hoe version 3.1.1 has been released!

Display Text as Image
400912 [lists@ru y- ] I have a String, which I want to display as a bitmap image. What is the
400917 [fluido@fl id] I am not sure I understand what you would like to obtain.
+ 400918 [lists@ru y- ] Thank you very much for the detailled description and the code!!!it was
+ 400972 [lists@ru y- ] your code worked fine for me, just one little problem occured.
  400978 [fluido@fl id] From what I know, no. Note that, for fonts that are not monospaced, it

login web page using mechanize
400914 [lists@ru y- ] new to ruby, love the language. read programmatic programmers guide to
+ 400922 [ivan.bisevac] Your problem is that username and password fields are not inside form.
+ 400923 [lists@ru y- ] thank you. i am going to try your suggestion. is copybara a gem? i will
| 400937 [ivan.bisevac] Yes, Capybara is a gem. Google for: ruby capybara.
| 400956 [lists@ru y- ] Do you mind if i just e-mail you if i need further help?
| 400957 [ivan.bisevac] It's ok, but I prefer google groups or better stackoverflow.com, because
+ 400960 [dave.baldwin] mechanize.
+ 400962 [lists@ru y- ] the "action" in the form = {action
| 400963 [ivan.bisevac] By the way, it's not copybara but capybara :)
| 400964 [lists@ru y- ] haha google auto corrected it for me. thank you though!
+ 400973 [lists@ru y- ] ok i need help with capybara. i keep finding pages with info about using
| 400974 [ivan.bisevac] Start with http://stackoverflow.com/a/4172101/507018 and look at
| 400982 [lists@ru y- ] wow I've heard of git hub, even have an account, never used it but that capybara page is full of information
+ 400976 [lists@ru y- ] I've always found Watir-Webdriver to be a very powerful tool if you want
+ 400981 [lists@ru y- ] looks like i have a lot of reading to do awesome. might take me a day or
+ 401071 [lists@ru y- ] i followed the outline from the github capybara page and here is what i
+ 401072 [lists@ru y- ] oh and i know
| 401073 [ivan.bisevac] No, you have to set driver first. Also you have to set run_server to false.
+ 401074 [lists@ru y- ] oh man that is cool!!!! i can actually see it bring up the page and fill
| 401075 [ivan.bisevac] Just keep in mind, for efficiently parsing data from web you have to learn
+ 401099 [lists@ru y- ] ive been trying to look up xpath and css selectors. i have my program
| 401100 [ivan.bisevac] find(:xpath, "//*[@id="sImage1"]").click
| 401101 [lists@ru y- ] "id=sImage1" is the button to log into the webpage. i have already gotten past that to the email page, it fills out all the fields and all i need to do is click the send button on the email page. but when i look at it with firebug its completely different than the log on button. i put the code in my previous response for the new button.
+ 401104 [lists@ru y- ] GOT IT!!!
  401105 [ivan.bisevac] find(:css, ".CLiKStdleft").click

undefined method `map'
400920 [marcelolaia@] A biostar user helped me with a code to help me download fasta files
400921 [hmaddocks@me] It's telling you what the problem is.
400925 [ryand-ruby@z] Array.

Finding Files recursively on Mac?
400924 [lists@ru y- ] Using recursive file searches on a Mac results in Ruby digging into
400926 [ryand-ruby@z] into
400933 [lists@ru y- ] I just dabble with Ruby and I have been striving to pay more attention

one-liner program example
400928 [lists@ru y- ] Ruby 1.9.3
+ 400929 [jonanscheffl] Dir.glob("*.csv").each { |f| `eliminate_duplication.rb #{f}` }
+ 400930 [   ar@le .m ] find . -name \*.csv -exec ruby eliminate_duplication.rb '{}' \;
  400931 [lists@ru y- ] Thank you so much!

installing Ruby on mac os x lion
400935 [lists@ru y- ] ruby 1.9.3 on mac os x lion, because i've been trying to install it but
+ 400936 [aleiphoenix@] Have you tried rvm ?
+ 400938 [t.yao426@gm ] I strongly recommend you use rbenv to manage your ruby versions on
+ 400940 [lists@ru y- ] yes, i'v tried rvm, but i'll try rbenv with it.

Yield question
400943 [lists@ru y- ] Ruby beginner here.
+ 400944 [shortcutter@] The yield is inside #each.  It invokes the block passed to method #each.
+ 400967 [lists@ru y- ] 'yield' calls a block.  Which block?  yield always calls the block that
+ 400970 [lists@ru y- ] Got it. Thanks a lot guys for the quick response and succinct

Ruby under Valgrind shows a ton of memory errors -- normal?
400946 [lists@ru y- ] I'm hoping someone who knows MRI internals very well can answer this
400966 [lists@ru y- ] I believe so. This is "conservative garbage collection" - anything on
400968 [lists@ru y- ] Thanks for the response. I don't think this is relevant to the errors
400969 [matz@ru y. r] ...
400971 [lists@ru y- ] Thanks!!!

[ANN] clogger 1.2.0 - configurable request logging for Rack
400977 [normalperson] Clogger is Rack middleware for logging HTTP requests.  The log format

Watir-Webdriver working with huge select lists.
400979 [lists@ru y- ] I'm having trouble understanding the most efficient way to work with a
+ 400980 [lists@ru y- ] I just realised I'm an idiot... it took laying out my problem like that
+ 400984 [lists@ru y- ] Apparently "select_value" is a method in webdriver. Oops.

400983 [sfindak2@ma ] ...

How to merge two or more hashes in to one?
400985 [lists@ru y- ] I would like to merge two (or more) hashes in to one single hash.
+ 400986 [lists@ru y- ] this is a very special form of "merging", so I don't think there's a
| 400988 [lists@ru y- ] Thanks, that worked out, but I'm wondering how this applies when I have
| 400989 [lists@ru y- ] So what? Simply merge the hashes one by one (in a loop, with
| 400990 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
| 400991 [lists@ru y- ] I suppose you have an array of hashes. Define a variable for the
| 400992 [lists@ru y- ] Just what I need. Many thanks for this, works great. Appreciate it!
| 400995 [shortcutter@] require 'set'
| 401015 [lists@ru y- ] Interesting, didn't knew about 'set'. Thanks.
+ 400987 [lists@ru y- ] foo.each do |one,two|
+ 401016 [lists@ru y- ] Well, in this case I don't really see the advantage of using sets. The
  401018 [lists@ru y- ] Got the work done and stuck with the merge block approach.
  401024 [shortcutter@] Yeah.  I just tend to use Set in situations where the content is supposed
  401025 [lists@ru y- ] No :) I meant that I sticked with the approach of using the block form