227691-408485

227475-242829 subjects 227873-235334

Four Fours
227691 [mephis1987@g] ...
227712 [james@gr yp ] Some of the techniques used in solving this Ruby Quiz could be

[ANN] aws/s3 0.1.2 (point release)
227698 [marcel@ve ni] A memory leak was discovered in the parsing code of aws/s3. The culprit was a
227710 [james@gr yp ] Generator was redone to use threads a while back, wasn't it?  Was
227716 [marcel@ve ni] /opt/local/bin/ruby
227717 [brabuhr@gm i] Mac-mini:~ frank$ cd /usr/local/lib/ruby/1.8/

[OT] calculations on lists of numbers
227702 [ara.t.howard] for years i've felt that i should be able to pipe numerical output into some
+ 227704 [cschneid@co ] I wonder if something like bc could do something along those lines.
+ 227706 [matthew.moss] cat list | awk '{ s += $1; n += 1 } END { print s / n }'
| + 227707 [matthew.moss] Oh... my samples assume each number is on its own line...  dunno
| | 227715 [ara.t.howard] easy in ruby ;-)
| + 227714 [ara.t.howard] yup.  that's where i broke into ruby too ;-)
+ 227718 [nospam@no it] It is so easy to create in Ruby, a matter of minutes, that it is not
| 227722 [vjoel@pa h. ] Disagree. I would like to know if a unix version exists, since it will
| + 227723 [nospam@no it] It's a bit too late to disagree, in the face of the evidence that I said it,
| | 227798 [vjoel@pa h. ] I read your statement as
| | 227829 [nospam@no it] / ...
| + 227727 [nospam@no it] I'm not much into golf, but, since we've long since left the clubhouse, and
|   227748 [m.fellinger@] puts [ sum, mean, array.min, array.max ].join(' ')
|   227762 [nospam@no it] / ...
+ 227734 [o.renaud@la ] I'm currently coding a ruby program for processing images. One of the class I
| + 227747 [ara.t.howard] heh, i've got something similar i use to compute stats on binary data all the
| | + 227758 [twifkak@co c] Man, how do you keep all your a.rb's straight?
| | | 227770 [ara.t.howard] nope.  you are note blind ;-)  it used yaml in the past, but it's rolled by
| | + 227768 [o.renaud@la ] I'll take a look to this NArray class, it seems pretty powerful ! I don't
| + 227796 [vjoel@pa h. ] What's the secret to computing stdev in bounded space? The formulas I
|   + 227805 [ dak@gn .o g] That would be strange.
|   | 227809 [twifkak@co c] Mind you, I skirted through numerical analysis in undergrad, so listen
|   | 227812 [ dak@gn .o g] A good on-the-fly method for calculating mean and variance is in "The
|   + 227806 [o.renaud@la ] Yes, to compute the standard deviation I need the mean. I fact, there are
|   + 227808 [twifkak@co c] The right side (comes from applying FOIL to the left side) can be
+ 227797 [shortcutter@] I am by no means an expert in numerical processing but maybe bc or dc
+ 227867 [steven@lu os] Sorry this doesn't really answer your question, but...
+ 228444 [chneukirchen] What about hacking http://rubyforge.org/projects/sss/ ?

Re: [OT] Simple iteration in a function problem
227719 [nospam@no it] / ...
+ 227738 [pit@ca it in] David's post was about your behaviour here on ruby-talk, which is quite
| 227763 [nospam@no it] Yes, but the [OT] can be used to allow filtering posts based on their
+ 227740 [dblack@wo bl] I'll take that as a "No."
  227765 [nospam@no it] Which "No" did you have in mind? In essence my reply, by virtue of existing,

Re: Segmentation fault, proc, eval, long string
227728 [efine145-nos] I get a segfault too on Ubuntu Edgy x86_64.

USB
227731 [javra89@go g] Is there any programme or library in ruby to drive own hardware via
227766 [nospam@no it] Ruby doesn't have the sort of close-to-the-hardware functions to do this
227779 [russellw@jo ] ...

Re: calculations on lists of numbers
227732 [w_a_x_man@ya] Why drag in the cat when it's utterly superfluous?
227760 [nospam@no it] Yes, true, but in a simple example like this, 'cat' is just a stand-in for
227771 [ara.t.howard] the main reason that i use cat in real life in situations like this is because
+ 227773 [nospam@no it] / ...
+ 227865 [steven@lu os] $ <list mean

openssl error - ubuntu
227739 [carimura@gm ] Help!
+ 227741 [pgonzalez@na] do you have 'openssl' installed? try to install, libssl0.9.8 or highet
| 227787 [carimura@gm ] Absolutely... I'm not a linux expert though, but I have a feeling
| 227822 [carimura@gm ] I finally figured it out.
| + 227910 [robert.dober] ...
| | 247012 [rails@gm il ] I've followed this, and I'm still stuck.
| | 247013 [rails@gm il ] I solved my own problem: the make and make install should be run from
| | 301892 [rodmclaughli] Thanks for all the help. The full story of how I installed Rails can be
| + 304843 [gdprasad@gm ] This information helped me when I was struggling with this problem
| + 305614 [james@is et ] Thanks a lot pal, it worked perfectly for me too. I had the same openssl
| | 305645 [shevegen@li ] So much for distribution's package managers making your life easier,
| | 305709 [lucas@lu as ] I don't think anybody reported a bug about that to Ubuntu or Debian. And
| | 305876 [gdprasad@gm ] ...
| | 313033 [nate@wi er o] 1) Compile SSL from scratch
| | 323402 [lasiksurgery] What does this error message on my blog mean?
| | 331711 [david@se tt ] If you'd rather not build form source, just do this (it worked for me on
| | 354570 [james@jc lf ] Worked for me, libopenssl-ruby was the missing package.
| | 354712 [roberto.fell] I to all.
| | + 354713 [xeno.campano] This may not address your concerns at all, but something we found out last year
| | + 354715 [jonathan@jm ] Recompile and reinstall ruby 1.9.1 with the libssl-dev package
| | + 354727 [lucas@lu as ] Install libopenssl-ruby1.9.1.
| |   354729 [jonathan@jm ] Works on Ubuntu Karmic and better, but this is 8.04 (Hardy), you need
| |   354736 [roberto.fell] Many thanks to all.
| + 375974 [davidsmithd@] I got this error " no such file to load - openssl" when I load my rails
+ 390732 [dhaval.inter] find the correct answer on
+ 408485 [lists@ru y- ] When building from source I do as much as possible as an ordinary user -

Re: Problems with id3lib-ruby
227742 [robin@ni or ] The problem is fixed in SVN. It would be nice if you could try it out

Does parseexcel work on OS X?
227743 [d.david.cart] Anyone using parseexcel on a PowerPC Mac? Any tips as to how to get
+ 227746 [wmwilson01@g] I saw the same thing on Solaris/Sparc.  The size limitations of the
+ 227892 [has.temp3@vi] Not familiar with parseexcel, but FWIW if you've a copy of Excel
  228005 [scott@bu le ] Works fine for reading in text data from Excel files (which is all I

PDF::Writer and unicode
227744 [SimonKroeger] If all of the conditions are correct, the following code
+ 227745 [halostatue@g] Yes. You won't, either. The PDF::Writer document is incorrect; I
| 227820 [SimonKroeger] In other words: "no way" ?
| 227853 [halostatue@g] No, "not yet."
+ 227890 [kou@co mi ng] You can do the thing if you use Pango and cairo (Ruby/Pango

Re: [OT] calculations on lists of numbers (back OT apparently)
227751 [ara.t.howard] i agree that it's easy to emulate awk, but shouldn't we do something better in

On Modules and require in general  / on ActiveSupport in particular
227753 [nicolas.roll] -> I require_gem ActiveSupport and it's not loading any ActiveSupport
227975 [george.ogata] Hmmm, I'm not sure where you got #constant from...  it's usually #constants .

search and replace
227769 [ishamid@co o] [total novice here]
+ 227772 [nospam@no it] / ...
| 227782 [ishamid@co o] If you will post a short, complete data example, even just one record
| + 227833 [nospam@no it] Okay, thanks for the data example. Now to move forward, could you please
| + 227850 [w_a_x_man@ya] puts DATA.read.gsub( %r{<(text:sequence)\s[^>]*>(.*?)</\1>}i,
+ 227776 [david@va ln ] Urght. *ducks*
  227786 [ishamid@co o] Thank you, David, for your pointers. I'm still very much a novice (at

more search and replace
227781 [ishamid@co o] [Total novice]
227783 [jeremymcanal] Are you using OOo 2.0.4?  I know it has a TeX/BibTeX export feature now...
227789 [ishamid@co o] On Dec 2, 11:57 am, "Jeremy McAnally" <jeremymcana...@gmail.com>
227792 [ishamid@co o] I checked it out; the source is way too messy for my purposes; it will

convert binary array to floating point decimal
227784 [Nebiru@gm il] new to ruby here, looking for a little help
227793 [martindemell] (int length)
+ 227799 [Nebiru@gm il] Wow, so much learned in one post...thank you
+ 227803 [martindemell] that should be

gem requires not working
227788 [cwdinfo@gm i] I feel stupid about this, but I just did a fresh install of 1.8.5 from
227800 [twifkak@co c] require 'rubygems'
227825 [cwdinfo@gm i] require 'rubygems'
+ 227846 [drbrain@se m] You are misremembering.
+ 227896 [mgreenly@gm ] It's not a standard part of Ruby, it's an external library, so it should

Re: calculations on lists of numbers (back OT apparently)
227790 [w_a_x_man@ya] This is elegance?
+ 227874 [david@va ln ] I can trace ara's code in my head, and could probably find out what it's
| 227931 [w_a_x_man@ya] Here's another short version.  This can handle very large files.
+ 227993 [gregory.t.br] William, are you intentionally being confrontational and rude?

comma separating output from array.to_s
227801 [henning.jans] what is the ruby-way of comma separating the output from array.to_s?
+ 227802 [twifkak@co c] ri Array#join
+ 227804 [w_a_x_man@ya] => "2,4,6,8"
| 227828 [henning.jans] That's it! :-)  Thanx to all of you.
+ 227807 [gregory.t.br] some_array.join(",")
| + 227817 [w_a_x_man@ya] 22,"He said, ""No!"""
| | 227830 [gregory.t.br] Yeah, now deal with edge cases, and try to run that on 100k rows :)
| | 227848 [w_a_x_man@ya] It's easy to handle all cases since CSV is a simple format;
| | + 227851 [kbloom@gm il] Most of use like pompous proxility as it helps us understand what the heck
| | + 227852 [james@gr yp ] What is that regex doing?  Quoting any field with a quote or a
| | + 227856 [gregory.t.br] It is indeed faster by a long shot, but it doesn't conform to the CSV
| |   + 227919 [w_a_x_man@ya] Easily remedied.
| |   | 227921 [james@gr yp ] Please show me where the CSV RFC states this.  If you need a link to
| |   + 227926 [james@gr yp ] Writing CSV is very easy (unlike reading it correctly).  FasterCSV
| |     227932 [gregory.t.br] I read through the other CSV related thread that seemed that way... I
| + 227818 [w_a_x_man@ya] puts [22,'He said, "No!"'].map{|x| x=x.to_s
+ 227810 [matt@ti bi s] You might be looking for Array#join. In fact, I believe Array#to_s *is*
+ 227854 [ramalho@gm i] A quick way to generate CSV file from an array of arrays is to take

LDAP library in Ruby
227813 [michael_perl] Looking for an LDAP module, I found so far
227814 [wilsonb@gm i] Yep. Pure Ruby, and very nice.
+ 227947 [garbagecat10] Also available on Rubyforge and as a gem.
+ 229573 [michael_perl] This is *fantastic*.
+ 231376 [michael_perl] Tried it. Fantastic!

rexexp question
227816 [ishamid@co o] [total novice again ;-)]
+ 227831 [nospam@no it] / ...
| 227843 [ishamid@co o] Ok, I was trying to avoid typing too much :-) but I will post more
+ 227834 [dblack@wo bl] replacements = { '"T10"' => "bf", '"Style2"' => "it", '"Style3"' => "sl" }

Factory pattern, abstract base class
227819 [djberg96@gm ] I'm trying to setup an abstract base class as a factory for its
+ 227821 [TimHunter@nc] The return value from initialize has nothing to do with the object
+ 227823 [james@gr yp ] module Foo
| 227863 [robert.dober] ...
| 227882 [pergesu@gm i] Of course every rule has exceptions.  For example, in Beck's
| + 227888 [pergesu@gm i] btw, check out "Encapsulate Classes with Factory" (p80) in
| + 227908 [robert.dober] ...
| + 227929 [james@gr yp ] In Ruby you can even handle this dynamically.  Using the inherited()
+ 227832 [vjoel@pa h. ] module Foo
| 227845 [james@gr yp ] I don't believe that line does what you intend.  Try using your code
| 227855 [vjoel@pa h. ] It's a little funny to say "baz" twice, is your point?
| 227928 [james@gr yp ] No.  My point was that the original code forces the call to be made
| 227954 [vjoel@pa h. ] module Foo
| + 227955 [vjoel@pa h. ] One more suggestion that allows handling of other arguments besides the
| + 227968 [james@gr yp ] Yes, I see that now.  Took me a surprising amount of time to actually
+ 227893 [shortcutter@] I am more inclined to question your approach than not.  After all, if

Strange error when loading a shared library
227824 [steviedizzle] I am porting Ruby/SDL to SkyOS (which has Ruby 1.8.5 installed) and I can compile it fine, no errors or warnings, but when I try to execute "require 'sdl'" it bums out with

Development hpricot breaks code
227835 [lrlebron@gm ] I was using this simple script to parse some links from a web page
+ 227836 [chrispearl@g] Be sure to include more information, for example the exact error
+ 227837 [transfire@gm] Are sure you want to use 'include?' and not 'index' ?
| 227838 [lrlebron@gm ] Positive. The script works correctly with include? Does not work with
+ 227861 [why@ru y- an] Hey, thanks, this was a problem with script tags found inside javascript blocks.
  227918 [lrlebron@gm ] After I figured out how to get the svn code in my windows box I ran the

Why does a test fail when I predicted it's exception class?
227839 [RichardDummy] I have a test suite that invokes on test set that specifies
+ 227840 [robert.feldt] You are using assert_raise in the wrong way. The call you want to test
+ 227841 [louis.j.scor] You need to run the code that raises the exception in a block.
+ 227849 [RichardDummy] You guys were right on!  Below is one of my actual test sets, the one
  227868 [drbrain@se m] require 'test/unit'
  227963 [RichardDummy] Thanks for weighing in on my question.
  228006 [drbrain@se m] Numbering tests is not typical behavior (I've seen it very rarely).
  228335 [RichardDummy] Thanks for mentioning them.
  228337 [rsanheim@gm ] Why do you want to number your tests?  Your tests should be written in
  228532 [RichardDummy] Thanks for adding your views to this discussion.

Serializing Ruby code
227842 [vshepelev@im] A bit of philosophy.
+ 227844 [chrispearl@g] If I understand your question correctly, what you're looking for is
+ 227847 [drbrain@se m] You'd need more than that to get a full image to work (like recording

File.size() returning negative for large files ????
227857 [greg.hauptma] ...
+ 227858 [nobu@ru y- a] 1.8 series on MS-Windows doesn't contain large file support.
+ 227859 [d_rems@ya oo] It is not yours, but Windows fault.
| 227862 [greg.hauptma] ...
| 227869 [drbrain@se m] [-1001581].pack('l').unpack('L').first # => 4293965715
| + 227881 [greg.hauptma] ...
| | 227885 [ mfp@ac .o g] Are all your files under 4GB?
| + 227884 [pfortuny@gm ] ...
|   227904 [djberg96@gm ] Try 'Q' instead.  Or, just use win32-file. :)
|   227957 [greg.hauptma] ...
|   + 227958 [TimHunter@nc] ...
|   + 228342 [david@va ln ] Is
+ 227903 [djberg96@gm ] It's a bug in Ruby, not Windows.  You can use win32-file, which

I'm a new member
227860 [quynh_khanh2] I'm a new member of forum ruby .
+ 227864 [nospam@no it] Certainly. Please state the problem.
+ 227870 [drbrain@se m] I don't know about C++ strings, what are they like?
  227875 [nospam@no it] That depends. If the OP is describing ordinary C++ strings (not the string

I'm searching for a ruby-programming penfriend
227866 [anselmthecra] I know this post doesn't really fit into here,
+ 227973 [total_sc@ya ] you can use this forum ,as penfriend
+ 228073 [coder68@ya o] Anselm,
  228079 [anselmthecra] ilan, thanks for worrying about me

can't sort an array
227871 [chen_li3@ya ] I want to print all the methods in excel OLE object
+ 227872 [quynh_khanh2] sorry
+ 227877 [nospam@no it] One solution is to convert the entire OLE data array into an equivalent Ruby
+ 227886 [martindemell] sort_by is your friend. I don't have a windows machine handy to
  227906 [chen_li3@ya ] Thanks and all of them work. But I just don't
  227907 [dblack@wo bl] sort and sort_by work by comparing pairs of objects using the <=>
threads.html
top