398673-399563 subjects 399027-411244

Ruby AI and Natural Language suggestions
398887 [phil@pr co .] People,
398889 [sophrinix@gm] What is your use case with natural language processing? What are you

tcl/tk tutorial somwhere?
398892 [lists@ru y- ] is there information or some kind of tutorial on how to use tcl from
398894 [nagai@ai ky ] A pair of '<ruby-source>/ext/tk/sample/tktree.{rb,tcl}' is an example.

Problem to build gem mysql2
398895 [johan.tempel] I have installed OEL 5u8, ruby 1.9.3 p194 and MariaDB 5.5. When I trying to=
398904 [jam@ja an be] ...

how to sum element of array
398896 [lists@ru y- ] dear all
+ 398897 [lists@ru y- ] In newer versions of Ruby (1.9) you can use
+ 398898 [shortcutter@] Open the text editor, start typing...
| 398900 [hmaddocks@me] They want you to do their homework, not teach them something.
| 398901 [shortcutter@] That seems quite apparent.  But what is your point?
+ 398899 [lists@ru y- ] thanks Jan, very cool.
+ 398902 [ivan.bisevac] 2012/9/4 Edward QU <lists@ruby-forum.com>
+ 398921 [sto.mar@we .] If I have no idea how to start, I usually ask Google first...
+ 399425 [lists@ru y- ] You could also use the inject method from the Enumerable module like
| + 399430 [keystonelemu] array.inject(:+)
| | 399431 [josh.cheek@g] You still need to give it an initial value or it will be wrong when there
| | 399435 [keystonelemu] Granted and noted, nice catch
| + 399434 [lists@ru y- ] You think i is a good, descriptive variable name there?
|   399439 [ryand-ruby@z] ...
|   399447 [matthew@ke w] array.inject(0) { |sum, banana_fritter| sum+banana_fritter }
|   399448 [matthew@ke w] Sorry, I meant 7stud is right.
+ 399449 [lists@ru y- ] Or a bit more serious: ;-)
| 399450 [ruby-talk@la] i for item, e for element, a for addend, n for number, w for whatever...
+ 399485 [lists@ru y- ] @Matthew: that was funny :)

Socket Decorator
398906 [lists@ru y- ] (usually a socket) as its argument and then behaves like a socket, but
+ 398916 [jeremy@bo p.] It provides a fairly easy way to emulate the IO interface; however, I
| 398930 [lists@ru y- ] Thanks a lot, that is almost exactly what I was looking for. But there
| 398933 [lists@ru y- ] Ok, I started looking at the code and I noticed that the library is much
| 398934 [lists@ru y- ] Ok, I found out everything I wanted to now is in the comment of the
| 398940 [jeremy@bo p.] Good deal.  The problem with documenting mixins is finding a place to
+ 398917 [shortcutter@] Why?  I'd rather have a clean separation, i.e. you have a class
  398931 [lists@ru y- ] My transformed socket can send arbitrary strings, so a client can send
  398956 [shortcutter@] Ah, I see.  Basically you are defining a different message format

How to get unicode support in ruby
398908 [lists@ru y- ] Please let detail description how to achieve unicode support in
+ 398914 [ivan.bisevac] # encoding: utf-8
+ 398915 [rubytalk2dav] Dave Aronson, Available Secret-Cleared Ruby/Rails Freelancer (VA/DC/Remote)
+ 398935 [lists@ru y- ] It contains links to other documents too.
  398942 [ml@co va es ] #!/usr/bin/env ruby
  398944 [jeremy@bo p.] This is incorrect.  If the first line of the file is a shebang line, the
  398945 [ml@co va es ] #!/usr/bin/env ruby

faster CSV process only one row!
398909 [lists@ru y- ] Suppose I have a string s, which is basically a CSV, how can I get it as
398918 [shortcutter@] How about looking at the documentation?
398926 [lists@ru y- ] I seriously went through that.. but may be I dont have patience or I am
+ 398927 [jgabrielygal] Please go through it once more. There's a section called "From a
| 398928 [zachary@za h] 4th example down: arr_of_arrs = CSV.parse("CSV,data,String")
| 398929 [zachary@za h] Oh, also, there's "Convert a Single Line" which has exactly what
+ 398957 [shortcutter@] If you do not have that much patience then programming is probably not for you.
  399001 [lists@ru y- ] Thank you robert, I'll remember that, I hope I'll never make same

Delete a line from a file
398910 [lists@ru y- ] i have a file this
398919 [lists@ru y- ] Read the file into a string, modify the string, overwrite the file with
398920 [lists@ru y- ] For a small file its fine. But if the file is big then
+ 398922 [jgabrielygal] Then read line by line writing to a temporary file, skipping the line
+ 398923 [sto.mar@we .] You could read and write line by line (writing to a new file),
  398924 [wbrisett@at ] I have some massive files (1-3 MB in size) that I have to manipulate and Ruby

how to 2 string from hostname
398912 [lists@ru y- ] hostname
398913 [jgabrielygal] Which bd are you getting: the first one before the dash or the second

[ANN] celluloid 0.12.0: concurrent objects for Ruby (with IO and ZMQ too!)
398925 [tony.arcieri] Celluloid is a concurrent object oriented programming framework for

Mongrel_service and bundler
398932 [lists@ru y- ] I have successfully installed mongrel, mongrel_service, win-32 service

best coding for limiting a value
398936 [lists@ru y- ] A)  result=value<min ? min : (value > max ? max : value)
+ 398937 [ruby-talk@la] I like your option C best.
| 398939 [sduncan@we a] How about
+ 398938 [ml@co va es ] Since all 3 methods do the same, it's a matter of taste.
| 398941 [ryand-ruby@z] On Sep 4, 2012, at 13:24 , Panagiotis Atmatzidis <ml@convalesco.org> =
| 398943 [ml@co va es ] Well to tell you the truth I didn't pay too much attention, but yes you're right. The third solutions is the most easily readable, although I never used it it was absolutely clear what it does. I was arguing about the principle mostly :-)
+ 398954 [shortcutter@] "best" according to what metric?
| + 398960 [elihu5991@gm] haha good one ;)
| | 398961 [shortcutter@] And it wasn't even intended as joke.  I can think of various goals
| | 398963 [peterhickman] Well they all work and return the same result so from that point of
| + 398980 [lists@ru y- ] sorry :)
|   398998 [ml@co va es ] Enough to commit suicide.
|   399034 [elihu5991@gm] Oh I know it wasn't but I turned it into one as a pun could have been
+ 398969 [sylvester.ke] [[lower, value].max, upper].min
| 398975 [lists@ru y- ] or Range#clip
+ 399044 [josh.cheek@g] I like (B) best. Initially I liked (C), b/c it's easiest to parse. But I

[ANN] onebigchatroom.com opensourced.
398948 [beholdthepan] A few months ago Eastmedia, my employeer, had a two day hackathon.
398959 [elihu5991@gm] Thanks! It seems pretty awesome :D

Parsing Newb Help
398949 [lists@ru y- ] Hey guys,
+ 398950 [lists@ru y- ] What have you tried?
| 398951 [lists@ru y- ] require 'open-uri'
+ 398953 [lists@ru y- ] I'm not at all clear what the *specific* things are that you want to
  398958 [shortcutter@] More at

Re: Best coding for limiting a value ?
398955 [lists@ru y- ] You can avoid the temporary variable by using the return value from 'if'

Long calculation & time limit
398962 [lists@ru y- ] I'm working on a programm that is supposed to do really long
+ 398965 [lists@ru y- ] You'll need to let us know what operating system you're using, and what
+ 398966 [lists@ru y- ] Thanks for the reply.
| + 398970 [ruby-talk@la] An exit code of 137 means the program was shut down by a KILL signal,
| + 399135 [lists@ru y- ] It would be helpful to copy-paste the full, exact message you see.
+ 398967 [lists@ru y- ] If it's the file read that's taking a long time, maybe you should go
+ 398968 [lists@ru y- ] I'll look into that and from what I've seen so far it'll certainly help.
+ 398977 [lists@ru y- ] what do I look for in /var/log/messages ?
| 398990 [ruby-talk@la] The name of your script would be a good start, seeing as there's not
+ 398996 [hmaddocks@me] Is it your own machine or is the scripted running on a hosted box?
+ 399109 [lists@ru y- ] Doesn't return anything...
+ 399112 [lists@ru y- ] If you want to know exactly what part of your program is taking a long
+ 399136 [lists@ru y- ] I'm already using a timer. I mentionned earlier that the parts of the
| 399144 [lists@ru y- ] Well it was a long shot, but I just wanted to check that cpu time was
| 399202 [doug@ds if r] Ubuntu (Linux) will definitely kill off processes consuming large amounts
| 399209 [groups@in ox] Yeah, I've used Ubuntu for years and I've never heard of a process being
+ 399140 [lists@ru y- ] How can I change values in the "ulimit -a" btw?

Compiling ruby from source on windows
398964 [peterpan1051] uby version installed (ruby 1.9.2p180).=0A=0AI download the source from git=
+ 399279 [lists@ru y- ] you already have visual studio installed?
| 399299 [elihu5991@gm] Why do we need Visual Studios if we got Ruby? Is it a compiler issue? Will
| 399383 [peterpan1051] ...
| 399394 [echristopher] Gianluca, Ruby doesn't build with VS (that I know of). You'll have to
| + 399414 [lists@ru y- ] While you can build part of the core of ruby with VS (I do it with
| | 399445 [peterpan1051] =0A=0A=0A=0A> Da: Jon Forums <lists@ruby-forum.com>=0A> Inviato: Luned=EC 1=
| + 399444 [peterpan1051] =0A=0A=0A=0A> Gianluca, Ruby doesn't build with VS (that I know of). You'll=
+ 399395 [lists@ru y- ] Why do you want to compile Ruby on Windows, when you can just download
+ 408345 [lists@ru y- ] Searching for a prebuilt visual studio SDK - or - building ruby with

get a string from lines of output
398971 [lists@ru y- ] get Disk Name  from bellow text
398972 [ruby-talk@la] Have you tried implementing that? Did it work? If not, what happened?
398983 [lists@ru y- ] Thats great thanks

398973 [lydianblues@] ...

Newbie needs help
398974 [lists@ru y- ] I'm new to Ruby and am encountering a problem with an error message that
+ 398978 [lists@ru y- ] Where are your tests?
| 398979 [lists@ru y- ] require 'test/unit'
+ 398993 [ryand-ruby@z] test/unit processes options on the command line so you can do things =
| 398995 [lists@ru y- ] ruby ~/Ruby_code/Align_against_reference.rb -- temp.fastq temp.alignment
| 399000 [ryand-ruby@z] your
+ 399013 [lists@ru y- ] Thanks Ryan, I'll try that out.

Cygwin now switched to 1.9
398976 [shortcutter@] Folks,

Transparency not working on my Mac. Help!
398981 [lists@ru y- ] Here's some code to overlay a transparent square over a blue background
+ 398982 [matma.rex@gm] It works correctly for me on Windows XP, ruby 1.9.3p0 (2011-10-30)
+ 398986 [lists@ru y- ] I realized that sq.alpha was turned off. I turned it on with

awk equivalent in ruby
398984 [lists@ru y- ] how to use awk equivalent in ruby
+ 398985 [sto.mar@we .] how?
| 398987 [lists@ru y- ] i just need 1 thats it
| 398988 [sto.mar@we .] ???
| 398989 [sto.mar@we .] title = 'Snow White and the 7 Dwarfs'
+ 399024 [lists@ru y- ] RFC1155-SMI::enterprises.2636.
+ 399046 [josh.cheek@g] This question was asked in a very confusing way, I didn't realize `=
  399058 [lists@ru y- ] FC1155-SMI::enterprises.2636.
  399105 [josh.cheek@g] Oh, you're probably right. This was submitted via Ruby Forum, which does
  399107 [matma.rex@gm] People should just learn to use pastebins.
  399120 [josh.cheek@g] What happens when the pastebin goes down?

Ruby's Mark mechanism
398991 [lists@ru y- ] After doing one mark cycle how GC determines which slots are reachable?.
398994 [drbrain@se m] On Sep 5, 2012, at 2:41 PM, Tridib Bandopadhyay <lists@ruby-forum.com> =
399014 [lists@ru y- ] Yes I have a literature stating exactly what you said. But can anyone
399017 [whitequark@w] WBR, Peter Zotov.
399028 [drbrain@se m] gc_marks() is probably a better starting point since it lists all the roots.

[ANN] minitest 3.4.0 Released
398992 [ryand-ruby@z] minitest version 3.4.0 has been released!

OpenURI open method problem
398997 [lists@ru y- ] def open_url(url)
+ 398999 [lists@ru y- ] Who says those pages are doing redirects?  What if the first web page
+ 399019 [lists@ru y- ] If that's the case, is there a way I can follow the link all the way
| 399023 [marvans@gm i] If the first page is redirecting using Javascript client side perhaps you
| 399026 [lists@ru y- ] Or good old curl.
| 399035 [marvans@gm i] +1 for curl obviously ... sorry was in overkill mode .. :)
+ 399033 [lists@ru y- ] Neat.
+ 399037 [lists@ru y- ] Still, the op's question remains unanswered: why doesn't open-uri follow
| 399099 [ryand-ruby@z] The true means redirections between http and ftp is permitted.
+ 399098 [lists@ru y- ] Thanks guys,
+ 399102 [lists@ru y- ] According to the docs, open-uri follows redirects by default.   So
  399103 [ryand-ruby@z] follow

Parsing through downloaded html
399002 [lists@ru y- ] I've collected a number of thousands of .hmtl documents and I need to
+ 399003 [ivan.bisevac] 2012/9/6 Sybren Kooistra <lists@ruby-forum.com>
+ 399004 [lists@ru y- ] Thank you Ivan.
| 399005 [jgabrielygal] Dir['*.html'].each do |file|
+ 399006 [lists@ru y- ] Thanks Jesus.
| 399007 [ivan.bisevac] It's ok if you are a new to Ruby but don't be so passive.
+ 399008 [lists@ru y- ] I'm doing my best here, and I do search before I post. I was just
| 399009 [ivan.bisevac] I've done similar job recently. I've copied part of code so look at it
| 399038 [lists@ru y- ] Good stuff! This ran nicely with the exception of "content" element generating a nil exception but my XML file was not compliant to XML rules.
| 399049 [ruby-talk@la] As someone commenting on other people's lack of social skills, you could
| + 399067 [lists@ru y- ] In my approach for help on this forum, I tried to be as detailed as possible to get help. I even explained that I am a beginner and the reply that I received contained false accusations. If the user was expecting a snippet, I would have sent it. Otherwise, why did he even reply if he didn°«t know how to reply? A logical reply would have been, °»Will you send the code you have so far?°…
| | 399070 [ivan.bisevac] Since I am directly called for word "passive" I have to answer :)
| + 399076 [sto.mar@we .] I'll second that wholeheartedly!
|   399079 [matma.rex@gm] Okay guys, as helpful as Ryan can be in a good mood, and as awesome a
|   399091 [ryand-ruby@z] ...
|   + 399097 [matma.rex@gm] Interesting talk, haven't seen it before. Maybe I judged you too
|   + 400492 [jlambert@oh ] I watched the talk and was led to read the article on "help vampires" by Amy
+ 399119 [lists@ru y- ] Well, this topic took an interesting turn =)
| 399128 [ivan.bisevac] require 'nokogiri'
| 399152 [jgabrielygal] Another possibility would be to use each_with_index.
+ 399153 [lists@ru y- ] I get the error 'block in irb_binding' 'in 'each'' ?
| 399154 [ivan.bisevac] Copy here full error.
+ 399155 [lists@ru y- ] 035 > Dir.glob('*.html').each do |document|
| 399156 [ivan.bisevac] Please read tutorial I've gave you and copy code exactly as I gave you.
+ 399179 [lists@ru y- ] Alright, perfect. It works.
| 399181 [ivan.bisevac] unless searchablefile.at_xpath("//h1[contains(text(), 'pvda')]").nil?
+ 399182 [lists@ru y- ] Works like a charm :)
  399183 [ivan.bisevac] 2012/9/11 Sybren Kooistra <lists@ruby-forum.com>

Bonus talk for MagicRuby 2012! Register now!
399011 [jeremymcanal] Good news everyone!

"Hiding" pictures(and source code if it's possible)
399012 [lists@ru y- ] Ey guys, how are you?
+ 399015 [peterhickman] Well you can use steganography to hide text (and thus source) in
| 399040 [lists@ru y- ] Yep... well thank's for your answer! anymore advices? will appreciate
+ 399052 [lists@ru y- ] I haven't actually tried this, but couldn't you unpack all your pictures
| 399062 [lists@ru y- ] That's a very good idea, it can be done, I just need to learn how can i
+ 399064 [lists@ru y- ] system("attrib +h file.txt")
| 399069 [lists@ru y- ] Ho ho ho! you are amazing Joel, thank you very much!!
+ 399071 [lists@ru y- ] If you find working with hidden files difficult, since Ruby sometimes
| 399101 [lists@ru y- ] I'll consider that, but I wonder: that's not what rubyscript2exe does?
+ 399104 [lists@ru y- ] Ocra does that, I use it :)
+ 399113 [lists@ru y- ] Yes! That was, thank you Joel.

Passing Sockets (or other FDs) to target of Exec()
399016 [lists@ru y- ] I've been playing around with an issue that is giving me a bit of a
+ 399018 [normalperson] $nCS.close_on_exec = false if $nCS.respond_to?(:close_on_exec=)
+ 399021 [lists@ru y- ] That's actually exactly what I was originally trying to do;

Subtraction, union and intersection of arrays in Ruby
399020 [lists@ru y- ] In the exercise I'm trying to solve I have 2 arrays of names and what I
+ 399022 [lists@ru y- ] So you're not even allowed to use basic methods like Array#include? In
+ 399025 [lists@ru y- ] $ ruby ert.rb