Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #2123
| From | "Kyle X." <haebooty@yahoo.com> |
|---|---|
| Newsgroups | comp.lang.ruby |
| Subject | Re: Simple array.each do |x| question |
| Date | Fri, 1 Apr 2011 14:29:13 -0500 |
| Organization | Service de news de lacave.net |
| Lines | 35 |
| Message-ID | <6f6bb08b25ceb72409f83615448a82b6@ruby-forum.com> (permalink) |
| References | <bfa8a96c7e42c61220c2d0d954eca93c@ruby-forum.com> <AANLkTimQUjNP75z30+-zYYXD15BZNou6PvEDcic_eFn2@mail.gmail.com> <9d19e7d38f2f3b6ab99b3150717a307c@ruby-forum.com> <AANLkTinUfc7WfoXosbPVFG5P7YBgCF8RVAzhVUN9FAAm@mail.gmail.com> |
| NNTP-Posting-Host | bristol.highgroove.com |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | talisker.lacave.net 1301686173 57823 65.111.164.187 (1 Apr 2011 19:29:33 GMT) |
| X-Complaints-To | abuse@lacave.net |
| NNTP-Posting-Date | Fri, 1 Apr 2011 19:29:33 +0000 (UTC) |
| In-Reply-To | <AANLkTinUfc7WfoXosbPVFG5P7YBgCF8RVAzhVUN9FAAm@mail.gmail.com> |
| X-Received-From | This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway |
| X-Mail-Count | 380764 |
| X-Ml-Name | ruby-talk |
| X-Rubymirror | Yes |
| X-Ruby-Talk | <6f6bb08b25ceb72409f83615448a82b6@ruby-forum.com> |
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.stben.net!talisker.lacave.net!lacave.net!not-for-mail |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.ruby:2123 |
Show key headers only | View raw
Thank you all for your responses. I have a second part question. I
still cannot get the array.each do || correct, so I have been having to
use these long and unsophisticated while loops:
-------------------------------------
n = 0
elements = []
while n != reference1.length
x =
REXML::XPath.match(doc,"//*[@id='#{reference2[n]}']/Coordinates/IfcLengthMeasure").map
{|element| element.text}
elements << x
n=n+1
end
n = 0
result = []
while n != elements.length
a = 0
while a != elements[n].length
x = elements[n][a].to_f
result << x
a = a+1
end
n=n+1
end
------------------------------------
Any ideas on how to make these more concise by using .each? I have been
trying many different things but cannot make it work. Thank you for
your time.
--
Posted via http://www.ruby-forum.com/.
Back to comp.lang.ruby | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-03-31 17:26 -0500
Re: Simple array.each do |x| question Roger Braun <roger@rogerbraun.net> - 2011-03-31 17:35 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-03-31 17:59 -0500
Re: Simple array.each do |x| question Gunther Diemant <g.diemant@gmx.net> - 2011-03-31 18:06 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-03-31 18:30 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-04-01 14:29 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-04-01 15:31 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-04-02 01:39 -0500
Re: Simple array.each do |x| question 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-02 13:32 -0500
Re: Simple array.each do |x| question 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-02 13:58 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-04-04 13:55 -0500
Re: Simple array.each do |x| question "Kyle X." <haebooty@yahoo.com> - 2011-04-06 00:57 -0500
csiph-web