259656-262663

259397-412690 subjects 259987-281647

[Solution] [Quiz] Maximum Sub-Array (#131)
259656 [email55555@g] Email sender may warp golf code to invalid code, please reference my

CentOS 5 - ruby-1.8.6 - openssl
259657 [pderwael@we ] Frist of all, I'm very sorry if I bother you all with *another* post on
259696 [znmeb@ce ma ] CentOS system administration, like its Red Hat Enterprise Linux parent,

Re: Maximum Sub-Array (#131) [SOLUTION]
259664 [rubytraining] I went for the all-in-one line solution (not including the method

[Solution] [Quiz] Maximum Sub-Array (#131)
259665 [selecter@gm ] Hornestly, it was the hardest quiz I have ever solved. Maybe because I
259687 [selecter@gm ] I fixed a small bug in a 2nd solution. Now, all nearby positive
259692 [selecter@gm ] Fixed another bug...

[QUIZ][SOLUTION] Maximum Sub-Array (#131)
259674 [will.bailey@] ...

[QUIZ][SOLUTION] Maximum Sub-Array (#131)
259675 [jesse.r.brow] ...

[SOLUTION][QUIZ] Maximum Sub-Array (#131)
259677 [jesse.d.merr] ...

Re: Maximum Sub-Array (#131)
259678 [badcarl@gm i] #!/usr/bin/env ruby
259714 [gthiesfeld@g] Here's my solution.  Nothing fancy.  It finds the maximum subarray of

How does Ruby gets bindings?
259694 [CHubas7@gm i] #------------------------------

Fwd: please forward to ruby quiz submission
259699 [james@gr yp ] ...

Fwd: Ruby quiz solution
259700 [james@gr yp ] ...

Check Flock Status on File
259703 [matt@en rg m] I have a daemon that is checking files as they are uploaded by FTP and
260001 [ara.t.howard] fcntl/posix (see posixlock gem) locks export that information but
+ 260034 [ara.t.howard] ...
+ 260079 [barjunk@at g] So the code above modifies the File class so that an instance will
  260088 [ara.t.howard] indeed.
  260096 [barjunk@at g] OK.  I'll keep it lying about then, cause it seems very usefull.
  260110 [ara.t.howard] no - just processes.  it's easy to extend ruby's flock to support

Installation problem with rsruby
259704 [AEtzold@gm .] Dear all,
259707 [TimHunter@nc] I hate this message. It's very confusing. The loader is complaining that
259719 [AEtzold@gm .] Dear Tim,
259721 [TimHunter@nc] ldd rsruby.so
259994 [AEtzold@gm .] Dear Tim,
260093 [TimHunter@nc] I don't know. Probably you're going to need to get in touch with the
260131 [alexg@ku cr ] I'm the developer of RSRuby, sorry to see you've been having trouble.
260138 [znmeb@ce ma ] I just installed it from the Gem repository on Gentoo Linux with no

[Solution][QUIZ] Maximum Sub-Array (#131)
259731 [grzm@se sp t] Here's a solution which iterates over the array just once. Looks like
259841 [jesse.d.merr] irb(main):008:0> arr = [46, -8, 43, -38, -34, -14, 10, -26, -9, -19, -36, -6,
259877 [grzm@se sp t] No problem at all! Thanks for taking a look at my work :)

Creating Output Tables
259780 [ari@ar br wn] HAI,
+ 259784 [gethemant@gm] May be ruport, but i think you already know about it.
+ 259802 [m.fellinger@] require 'ruport'
  259806 [ari@ar br wn] Thanks!

Test::Unit - "exit" exception/command?
259799 [matthewrudyj] I'm writing a suite of tests for an sms application.
260028 [rff_rffREMOV] I was looking for the same thing the other day, I think it would be nice
260038 [matthewrudyj] I think I mis-stated that.
260047 [rff_rffREMOV] Ah, I see, and yes, I do agree with you, too bad TestCase is not named

Blocking IO on windows in IRB
259816 [aquasync@gm ] Is there anyway around the blocking IO on windows? I'm trying to write
259893 [ara.t.howard] basically, if you have to do background io use another process.  my

Spin buffers
259860 [john.carter@] Hmm. Just being reading the Dr. Dobbs.
+ 259891 [shortcutter@] What exactly makes you believe that?  Can you show some code and / or
| 260351 [mental@ry ia] Seconded.  Measure first, then optimize.
| 260354 [john.carter@] And yes... I did, as always, measure before I optimized and my Queue
| + 260360 [mental@ry ia] Hmm, did you just mean sending batches of objects as arrays, rather than
| | 260363 [mental@ry ia] It is worth noting that these are not issues if you're only writing for
| + 260361 [mental@ry ia] At any rate, I think your best option is something like fastthread's
+ 259896 [ara.t.howard] no, but i'd be inclined to try writing one on top of guy's mmap ext -
  260352 [mental@ry ia] What does mmap have to do with communication between Ruby threads?

Nested structures and C extensions
259886 [infamouxxx@g] Hey everybody,
260003 [matz@ru y- a] Show us the code.  Without seeing the actual code, there's little

Technology solutions for Ruby?
259888 [mreiland1978] I'm contemplating writing an application in Ruby but in order to do so I
+ 259889 [snacktime@gm] wxruby is the best that I'm aware of,  and I wouldn't even think of
| + 259916 [znmeb@ce ma ] Yeah ... jRuby has a cross-platform GUI and all the database stuff. I
| | 260177 [charles.nutt] Generally the default Java L&F tries to match the host platform as well
| + 260067 [ari@ar br wn] YES!!!!!!!!! THERE IS rubyscript2exe!
+ 259892 [warlickt@op ] GUI isn't my thing, sorry.
+ 259894 [znmeb@ce ma ] Forget native look and feel -- go for *quality* look and feel. I'd
| + 259899 [dangerwillro] why go to all the trouble of trying to obfuscate anything?
| | + 259901 [sonoflilit@g] The ruby way is to consider building any app with the requirements you
| | | + 259907 [mreiland1978] The project is to replace an existing desktop software solution targeted
| | | | + 259920 [sonoflilit@g] The advantage is that Rails gives a better API for GUI database
| | | | + 259976 [james@gr yp ] Well, without knowing thing one about the problem domain, a midsized
| | | |   + 260017 [dangerwillro] A web-based interface can be clumsy and ugly compared to native GUI
| | | |   + 260050 [vasudevram@g] [ Though the OP posted his message to comp.lang.ruby, I'm cross-
| | | |     + 260068 [vasudevram@g] If you'd really prefer to work in Ruby, but find after investigation,
| | | |     | 260070 [kyosohma@gm ] wxPython uses the native widgets of the platform it is running on in
| | | |     | + 260083 [claird@la rd] Now you have me curious--when you write of "the best user's group
| | | |     | + 260133 [znmeb@ce ma ] I'll have to admit that as much as I like the Qt look and feel, wxGTK on
| | | |     + 260090 [bdesth.quelq] It does - just like wxRuby, since both are language-specific bindings to
| | | |       261577 [vasudevram@g] Thanks for the info. (I don't know much about metaprogramming etc. in
| | | + 259927 [transfire@gm] That's a ridiculous statement.
| | |   259933 [sonoflilit@g] It's based on the fact that in any such thread, the idea comes up and
| | |   259945 [transfire@gm] My point is that there are plenty of other choices: Nitro, Camping,
| | |   + 259952 [sonoflilit@g] Of course - actually, personally I prefer Camping over Rails.
| | |   | + 261146 [kashia.buch@] why do you recommend things you aren't totally 'in sync' with.  :)
| | |   | + 261150 [robert.dober] Aur if you think that Camping is better why do you go mainstream and
| | |   |   261261 [sonoflilit@g] More mature, more documentation, more community, more tools - Rails is
| | |   + 260029 [khaines@en g] To address the original poster's question first, I agree with Ed that QT
| | + 259906 [mreiland1978] At the heart of the issue is the fact that I refuse to use Java for this
| + 259936 [richard.j.da] On Jul 16, 6:43 am, "M. Edward (Ed) Borasky" <zn...@cesmail.net>
+ 259929 [transfire@gm] The best way to handle this is to use SOC (Separation of Concerns)

No Troll Feeding Please.
259898 [dangerwillro] Stop feeding the rude, racist Troll kid.
259900 [sonoflilit@g] Hey, hey, MINASWAN!

Re: CentOS 5 - ruby-1.8.6 - openssl (getting off topic)
259925 [pderwael@we ] Well, to be honest, I have just been through the exercice of choosing
260011 [znmeb@ce ma ] Or stay with CentOS 5 and use the Ruby that ships with it, unless

Re: Tempfile : delete problem (SOLVED)
259926 [ronald.fisch] I found a solution based on an idea posted at

ruby file info and processing module
259934 [voipfc@go gl] ruby file info and processing module
259937 [shortcutter@] You want a combination of File, FileUtils, Find and Dir.

Symbols
259938 [stephen@st p] I'm an xbase (dbase/FoxBase & Pro/Clipper) and cobol programmer from way
259939 [matthewrudyj] symbols are just strings,
259941 [stephen@st p] Thanks.
259942 [matthewrudyj] but with "email = 1" you don't get any reversibility.
259943 [stephen@st p] Ahhh.. I think I got it.
+ 259961 [dangerwillro] Symbols also are a lot slimmer objects.
+ 260607 [hal9000@hy e] Of course, note that you can go back and forth between
  260635 [stephen@st p] yeah I figured out symbols were the actual value. But one question, if a
  + 260638 [gwtmp01@ma .] MRI never garbage collects symbols.  If you create symbols based on
  + 260643 [vjoel@pa h. ] No. Symbols accumulate forever. They cannot be garbage collected in
    261125 [cypher.dp@gm] You're not the first one who's asking...

clean nice way (hash)
259940 [shaiguitar@g] i got a hash
+ 259947 [sonoflilit@g] hash.map{|k, v| {k => {'name' => v}}.to_hash
| 259948 [sonoflilit@g] Wait, no.
| 260012 [robert.dober] Well that is very nice;), but where does #to_hash come from?? (Facets, maybe?)
+ 259949 [gethemant@gm] a.each {|key,value| a[key] = {'name' => value}}
  + 259950 [sonoflilit@g] Are you allowed to do this?
  | 259953 [gethemant@gm] Why not? Seem to work here.
  | 259955 [sonoflilit@g] I was taught not to modify a structure I'm #each ing on...
  | + 259960 [apeiros@gm .] I think that only applies for insert/delete. As e.g. with an array it
  | | 259962 [sonoflilit@g] N = 8
  | + 260075 [martindemell] It doesn't affect the "spine" of the structure, just the values hanging off it.
  + 259986 [james@gr yp ] a.inject(Hash.new) { |h, (k, v)| h.merge(k => v) }
    259996 [cdcarter@gm ] But that doesn't yield what he wanted... You could do
    + 259998 [shortcutter@] Still it's inefficient because of all the small Hashes that are thrown
    | + 260008 [james@gr yp ] If that bothers you, change merge() to merge!().
    | | 260042 [shortcutter@] ... which doesn't help because it does not avoid all those one pair
    | | 260059 [james@gr yp ] I did eliminate some Hashes, those created for each iteration inject
    | | 260092 [shortcutter@] Those were the ones I referred to originally.  And yes, "did not help"
    | + 260019 [florian.assm] I also tested a theory of mine, Hash#update does this ~20% faster than
    |   + 260043 [shortcutter@] I'd guess it's GC.  IMHO for comparing performance Benchmark is a better
    |   | 260089 [florian.assm] Ok, I think GC is the main problem in my setup :D
    |   + 260080 [apeiros@gm .] Hash[foo => bar] is a needless method call. foo => bar is already a hash
    |     260085 [florian.assm] Ahh, ok, till now I thought {} calls Hash[] but I didn't know what
    + 259999 [james@gr yp ] Right, my bad.  Thanks.

Rental/Sale Latest VoipSWITCH 2.0.0.879+All Modules+Training
259946 [imrngee921@y] Want to setup VOIP company, a business under your own brand name? We

Parsing an apache access log line
259954 [dev@lo ix el] a have a line to parse....
+ 259956 [shortcutter@] line.scan %r{
| 259967 [shortcutter@] I think I got the order wrong.  Rather do
+ 259957 [jens.wille@u] <http://topfunky.net/svn/plugins/mint/lib/log_parser.rb>
+ 259959 [sonoflilit@g] /([0-9.]*) (-) (-) (\[.*\]) (\".*\") ([0-9]*) ([0-9]*)/ comes to mind,
+ 260000 [phil.meier@g] star/images/main.gif HTTP/1.1\" 200 334"

stamping my own timestamp
259966 [pbailey@bn .] Is there a way to "touch" a file with a time stamp of my own choosing,
259968 [shortcutter@] e.g. FileUtils.touch("foo", :mtime => Time.now)
259975 [pbailey@bn .] Thanks. But, this is what I get when I try that. Doesn't the "Time.now"
259982 [shortcutter@] irb(main):003:0> FileUtils.touch "f", :mtime => Time.now
259990 [pbailey@bn .] Thanks, Robert. That particular thing just doesn't work for me, but, I'm

rb_load_file crashes when there no bracket is provided
259972 [saravanan@op] When i tried to load the below mentioned code using rb_load_file it
259985 [phil.meier@g] Why do you need to remove brackets?
259992 [saravanan@op] This is basically a set of rules that our client will define.  I am
260009 [saravanan@op] when rb_gv_set("VERBOSE", Qnil)is executed, it works fine.  Basically

The Pebble in the Ruby Shoe
259974 [r.gillett@ra] Ruby aims to be a human friendly programming language that embodies the
+ 259977 [sonoflilit@g] I disagree. Zero based arrays are natural to a mathematician, and
| 260624 [steven@lu os] No! This is a systematic lie used to defend a convention that was
| + 260630 [vjoel@pa h. ] If you're working in set theory, you get in the habit of 0 based
| | 260657 [phlipcpp@ya ] Another way to say this is languages should lead programmers to think in
| | 260664 [sy1234@gm il] I'm a very young programmer, and I've known about this 0 vs 1 issue
| | 260665 [perrin@ap th] irb(main):001:0> foo = %w[zero one two three]
| + 260653 [perrin@ap th] Yes and no.  I wouldn't call it "systematic", but it's certainly a
| | + 260662 [znmeb@ce ma ] In fact, there is a school of thought that says computer scientists
| | + 260794 [wayneeseguin] ...
| | + 260814 [steven@lu os] Not only did I not mean to imply that, but I'm not sure I can even
| |   260842 [perrin@ap th] That would be why I used terms like "seem" and so on in that email -- I
| |   261088 [znmeb@ce ma ] Well ... maybe "Computer Science" students don't need to know
| |   261097 [perrin@ap th] There's a pretty big difference between "electrical engineering" and
| + 260695 [michael.ulm@] I've worked for over 10 years as a mathematician on a university
| + 260793 [wayneeseguin] ...
|   260816 [steven@lu os] I stand by my claim in spite of a pair of anecdotal reports.  Don't
|   + 260818 [dangerwillro] This whole business about 1 or 0 based indexing is not important.
|   + 262500 [WayneESeguin] ...
+ 259978 [lionel-subsc] It's probably a matter of taste: I'm so used to indices starting at 0
| 260010 [AEtzold@gm .] Dear Raphael,
| + 260023 [robert.dober] Both ideas are completely stupid, there is only one err zero err 42 solutions.
| + 260035 [martindemell] Should array indices start at 0 or 1? My compromise of 0.5 was
|   260172 [robert.dober] No I do not believe so, your approach was accepted only that, instead
+ 259979 [sam@po er ou] Well now would be a hell of a time to change it, wouldn't it?  =)
+ 259984 [michael.ulm@] I, for one absolutely hate 1 based arrays in programming languages.
| 260015 [dangerwillro] Every language does things the way the language designer wants to do it.
+ 260005 [lloyd@2l ve ] Well, why don't you make a new class that uses a hash as an array and
+ 260018 [lists@be tr ] To start indexing of arrays from 0 is any good programmers
+ 260049 [ara.t.howard] and we all know how 'natural' *those* languages are do program in
| 260055 [tim.pease@gm] Actually, if Ruby had been implemented in Fortran or Pascal, then most
| + 260060 [xcampanoli@g] I always thought it made more sense to index from zero.  After all, an
| + 260061 [lloyd@2l ve ] Ok, I know that this is not a Ruby point, but I feel compelled to
| | 260233 [adrianh@qu e] Fortran doesn't care much either. There's a convention for starting
| | + 260239 [james@gr yp ] Perl copied that misfeature, though it defaults to zero, in the hopes
| | | + 260248 [adrianh@qu e] Perl's misfeature is pretty different - it's a global rather than a
| | | | 260318 [perrin@ap th] News to me.  Would you point me at more information on the topic, please?
| | | | 260705 [adrianh@qu e] (taken off-list since wandering way OT :-)
| | | | + 260702 [adrianh@qu e] Or it would have been if I'd had more coffee this morning - sigh -
| | | | | 260791 [perrin@ap th] . . . and I replied without checking the address.  Heh.  I guess I helped
| | | | + 260789 [perrin@ap th] Understandable.
| | | + 260251 [ymendel@po o] On Jul 17, 8:27 am, James Edward Gray II <ja...@grayproductions.net>
| | + 260241 [robert.dober] Wait a second are you sure?
| | + 260269 [znmeb@ce ma ] FORTRAN wasn't always that way. The ability to index arrays starting at
| |   260294 [brabuhr@gm i] Both IAL and ALGOL 60 allowed arrays with arbitrary lower and upper
| |   260368 [znmeb@ce ma ] I wonder how C got saddled with a fixed lower limit of 0 then. It must
| |   260376 [giles.alexan] In C the expression array[n] is actually just syntactic sugar for
| |   260395 [ronald.fisch] This indeed works, and consequently funny variations such as
| |   260401 [mental@ry ia] Perl has this too, though it's called $[.
| |   260408 [ronald.fisch] True! It seems that the Perl community (reasonably) assumes
| + 260587 [jgamble@ri c] Well, if one were to blindly follow one's predecessors, yes - at least
|   260613 [msoulier@di ] I believe that Fortran also prevents recursion. Perhaps we should dump that
|   + 260632 [jwkenne@at g] in automatic story prohibitively expensive, so all historic FORTRAN
|   + 260641 [znmeb@ce ma ] Well ... they *are* talking seriously about dumping Call/CC. How many
|     + 260650 [seebs@se bs ] man qsort
|     | 260718 [robert.dober] There is no indication of recursion in the man page.
|     + 260651 [perrin@ap th] Me, for one.  It's not very common, but . . . once in a while, I do.  Not
|     + 260721 [logancapaldo] ...
|     | 260768 [znmeb@ce ma ] There's a big difference between an explicit stack with iterative code
|     | + 260777 [robert.dober] I see recursion as a useful tool of abstraction I remember having
|     | + 260848 [logancapaldo] ...
|     |   + 260953 [robert.dober] I remember a funny use case of explicit stack handling now.
|     |   + 261090 [znmeb@ce ma ] 1. I am the very model of premature optimization. Unless the underlying
|     + 260790 [wayneeseguin] ...
|     + 260870 [jwkenne@at g] I used it just the other day in a Ruby solver for
|     + 262663 [kaldrenon@gm] On Jul 18, 10:44 pm, "M. Edward (Ed) Borasky" <zn...@cesmail.net>
+ 260058 [pawel@kr sz ] I grew up with 0-based arrays. 1-based ones look unnatural to me. That's the
| 260108 [jwkenne@at g] On many disks, there is (or used to be) a sector #0 that is not used for
+ 260064 [matt@ti bi s] But since Ruby lets you reach right in and override everything, couldn't
| + 260069 [sonoflilit@g] Hmm, would probably break the standard library.
| + 260073 [pubsub@ru yi] This seems like a terrible idea. Part of learning a language is learning
+ 260121 [rlp1938@gm i] Anyone who has serious difficulty with 0 based arrays should consider
| + 260125 [seebs@se bs ] I wouldn't go quite that far, but I have to say, I don't think 0-based
| | 260130 [znmeb@ce ma ] Anyone who's been immersed in scientific computing for any reasonable
| + 260205 [Christopher.] As a former bartender, I take umbrage at this remark. We all used zero
|   260209 [robert.dober] Ah please I'd like half a glass #{of_whatever_liquid}, but the upper
+ 260141 [sy1234@gm il] Well.. I do enough testing that I usually catch this oversight.. urr
| 260144 [fwmailinglis] charset="us-ascii"
| 260628 [steven@lu os] When you write formal verification proofs for all your programs before
+ 260163 [botp@de mo t] # Ruby aims to be a human friendly programming language that
| 260164 [list.rb@gm i] Agreed.
+ 260171 [pete@no ah t] Don't feed the trolls.
| 260213 [phelan@tt ec] Now Pete you beat me to the comment ;)
+ 260176 [voipfc@go gl] Is this some kind of troll?
| + 260179 [robert.dober] Possibly, however...
| + 260207 [peter@pe er ] ...
+ 260216 [flori@ni e. ] The avalanche has already started. It is too late for the pebbles to vote.
| 260316 [lloyd@2l ve ] Oh my Kosh!
+ 260392 [kevin.cline@] On Jul 16, 8:22 am, Raphael Gillett <r.gill...@rational.demon.co.uk>
| + 260403 [mental@ry ia] That's been my personal experience, too -- pretty much the only thing
| | + 260456 [robert.dober] I do not like categorical statements, but this one might be the
| | | + 260477 [msoulier@di ] Lets not forget also that doing things for the sake of being different help no
| | | | + 260481 [robert.dober] That is the single best feature of Ruby once you got used to it --
| | | | | 260547 [mental@ry ia] help no
| | | | | 260567 [robert.dober] and one of its biggest dangers too, I wonder how much time has been
| | | | | 260575 [dblack@wo bl] But x ||= 1 is really: x = x || 1.  So you'd end up with,
| | | | | 260580 [robert.dober] David I know that but it could be
| | | | + 260497 [znmeb@ce ma ] I haven't forgiven Scheme for "nil is true" either!! That's just *so*
| | | | | 260520 [robert.dober] Much more difficult to see the benefits of this, but I am listening ;)
| | | | + 260545 [lloyd@2l ve ] but but but...
| | | | + 260983 [kbloom@gm il] But in the shell, zero is the ONLY return code which is true.
| | | + 260572 [perrin@ap th] Actually, that should probably be ++.
| | + 260492 [znmeb@ce ma ] Well ... the reason the first major programming language, FORTRAN, used
| |   260538 [jwkenne@at g] ...all the decimal machines I can recall, too...
| + 260533 [jwkenne@at g] ...unless there is a lot of exposure of nominal index values to the end
|   260573 [perrin@ap th] Not always true.  Think of voting systems, such as on reddit, where the
+ 260570 [w_a_x_man@ya] On Jul 16, 8:22 am, Raphael Gillett <r.gill...@rational.demon.co.uk>
+ 260608 [hal9000@hy e] I sympathize, but if you were more experienced, I believe you would
+ 260858 [kbloom@gm il] If you were going to argue for arbitrarily indexed arrays e.g. those
threads.html
top