178305-328495 subjects 178712-187864
^ [QUIZ][SOLUTION] Splitting the Loot (#65)
178502 [pdeuster gmx] Ok, the 48 hours passed just now and as I have to leave for a day or two
178515 [luke blansha] I don't believe that this problem is equivalent to the subset sum
+ 178520 [kasten.m gmx] [QUIZ][SOLUTION] Splitting the Loot (#65)
| 178565 [groups grand] I'll just note that the original posting never said anything about
| + 178567 [james graypr] The submission message you quoted explained the change. :)
| + 178612 [chneukirchen] But pirates are the chosen ones!
+ 178589 [pdeuster gmx] ...
+ 178595 [rosco roscop] (Total non-mathematician about to butt in)
| 178628 [james graypr] That's pretty much how I handled it. Mine is really just an unrolled
| 178676 [SimonKroeger] this is my solution. It first creates every possible combination of gems
+ 178755 [luke blansha] Why yes, I did read it, thank you very much. And of course you're
178766 [pdeuster gmx] Yes, you're right.
^ Help with "rubyizing" script
178504 [ttt resource] I haven't gotten around to do some serious programming with Ruby, but
178630 [matthew.moss] (0..x) forms a range object which can be rather useful. If you don't
^ [/QUIZ] #65: Splitting the Loot
178512 [luke blansha] ...
+ 178530 [levin grunde] ...
| 178598 [levin grunde] ...
+ 178551 [adam.shelly ] I thought I had a similar speedy solution, but then I found a few
| 178553 [luke blansha] Rats, you're right. I came upon an example too. Oh well.
| 178564 [groups grand] Can you share any of these special cases??
| 178584 [adam.shelly ] Try splitting [4, 6, 8, 9, 18, 26, 34, 36, 39, 40, 43, 50, 55, 66, 67,
+ 178597 [luke blansha] ...
178625 [james graypr] $ ruby loot.rb 5 4 6 8 9 18 26 34 36 39 40 43 50 55 66 67 76 82 83 86
178627 [pdeuster gmx] My one produces a similar solution
^ encoding problem?
178518 [jroncero us.] Trying to learn ruby, I am writing a script to migrate from a pybloxsom
178521 [james_b neur] It may be that you need to tell MySQL to use a particular character set
178525 [jroncero us.] Umm, but I would like to do it from within ruby. I mean, all the new
^ Cookbook2 tutorial error: The error occured while evaluating nil.name
178522 [thunderclees] I am following the Cookbook2 tutorial on the InstantRails website (
178523 [thunderclees] I forgot to mention I am getting the error when I attempt to "add a
178540 [thunderclees] Well I figured it out in case anyone searches for this same problem...
178587 [ml.chibbs gm] Thanks, I'll see if we can get something added to the tutorial about this.
^ [Job] Personalized content filtering & collaborative moderation
178526 [don.sawtelle] Peerworks.org has interesting work for an experienced independent
^ Is the SQLite3 gem known to have memory corruption?
178527 [tjw omnigrou] Running the following produces bizarre results (trimmed down from
178531 [sylvain.joye] See
+ 178535 [tjw omnigrou] Thanks; I've applied this patch in my /opt/local/lib/ruby/gems/1.8/
+ 178645 [tjw omnigrou] Thanks; this patch did in fact fix my issue. Of course, it took
^ Adding properties to a method?
178528 [j Tippell.co] class Method; attr_accessor :foo; end
+ 178529 [james_b neur] A String, in your example. Do you want the string to respond to the
| 178533 [j Tippell.co] method(:bar)
+ 178532 [transfire gm] You can check out Facets' kernel/method.
| 178538 [j Tippell.co] Thanks, method! from
+ 178663 [drbrain segm] Of course! It may not be the same method. Another thread may
^ [ANN] DevLists :: Mailing lists made easy
178534 [devlists-rub] I posted this message on the Rails list a few weeks ago, and now that
^ FXRuby question
178545 [Nuralanur ao] ...
178552 [lopexx autog] lopex
^ regex trick
178546 [alain.feler ] I want to replace all ' by \' ? (I need it to do inserts in mysql).
+ 178547 [devlists-rub] s.gsub!("'", "\\\\'")
+ 178548 [mike stok.co] s.gsub!(/'/, "\\\\'")
+ 178549 [cyclists nc.] irb(main):011:0> s = "j'ai"
+ 178550 [mike stok.co] What interface to MySQL are you using? I know that the Ruby DBI
178858 [alain.feler ] Thank you very much for these four answers, but curiously none works on
+ 178862 [drbrain segm] Incorrect. They all work.
+ 178866 [alain.feler ] so every four methods work if the result is properly printed
^ Re: Splitting the Loot (#65)
178561 [chrisgparker] Here is my solution. It is short and simple. I take advantage of the
+ 178600 [avi.bryant g] Unfortunately there are cases where the greedy algorithm fails. Try
+ 178970 [kasten.m gmx] It doesn't split
^ Weird bug in SQLite3
178562 [david vallne] I was trying to do some remote bugsquashing by SSHing on a Windows computer
178583 [david vallne] forgetting to edit out the control characters from the tee output. (Does IRB
^ Re: Hardcore Ruby kurser i Danmark (Ruby courses in Demark) ?
178566 [rcs bgoark.n] Hvis du kjenner allerede C++/Java etc, s? skulle Ruby v?re enkelt ? l?re
^ Ruby jargon and slang
178579 [hal9000 hype] I'm assembling a list of Ruby community "usages" and I want to make
+ 178581 [ruby-ml magi] 'threequal' == ===? I call it the sort-of-matches-operator but
+ 178596 [zdennis mkte] um... the push operator <<
| + 178599 [bob.news gmx] Isn't that the bit shift operator? :-)
| + 178604 [hal9000 hype] Noted. I usually call it the append operator.
| 178619 [jeff schwabc] In C++, it's often called the insertion operator. I have been thinking
| 178697 [M.B.Smillie ] So, if it operates like a duck...
| + 178704 [jeff schwabc] Exactly.
| + 178836 [david vallne] So, from duck typing, we've come to duck surgery? *shudder*
| 178838 [Daniel.Berge] They don't call those doctors "quacks" for nothing.
+ 178641 [mental rydia] You've neglected chunky bacon.
| 178677 [nugend gmail] Chunky Bacon isn't jargon, it's a battle cry.
| 178678 [hawkman.gelo] ...
| 178680 [james_b neur] What is it?
| 178718 [hal9000 hype] Nothing more, I'd guess.
| + 178721 [james_b neur] Good catch!
| + 178740 [martindemell] ...
| 178818 [logancapaldo] ...
| 178888 [hal9000 hype] Haha! No doubt HPL was influenced by real languages and words.
+ 178833 [dharple gene] Bang methods, like Array#reject!.
+ 178837 [M.B.Smillie ] Which reminds me, the #-notation for methods would make a good
| 178895 [mszpak gmail] Can someone point me to the page in the Pickaxe book where #-notation
| 179024 [david vallne] That notation is defined in Pickaxe? Now this I want to see.
| 179031 [r.mark.volkm] See the "Notation Conventions" section in the Preface. In my copy ofPickaxe 2 it's on page xxix.
| 179079 [david vallne] See? Found it :P
| + 179082 [logancapaldo] Does ri count as canonical? It comes with ruby correct? And it uses
| | 179089 [david vallne] Well, ri might just be following a convention that's been in use before the
| + 179097 [billk cts.co] I first encountered the Class#instance_method notation in Smalltalk,
+ 178889 [hal9000 hype] True. But I'm tired of adding stuff, so this one will probably
^ ruby, GTK and iconv.dll
178580 [newshoundat ] ...
181499 [stevemessamo] It worked like a charm, Thanks!!!
^ I need some help with browser output in ruby cgi - cgi.rb
178590 [mydejamail y] Whenever I try to send out some output in CGI my scripts generates an
^ Looking for shared, extendable Whiteboard plugin in browser
178591 [bafna.sapna ] I am building a network application which will enable peer to peer
+ 178707 [david vallne] With Great Difficulty (tm). As far as I know, the only way of deploying native
+ 178711 [john.carter ] Firefox SVG support is slowly (almost) becoming usable. I wouldn't call it
^ Ann: FarPy GUIE v0.4.2
178592 [dberlin gmai] About
^ odd http header corruption
178594 [sam neurogri] I can't tell if this is a problem with the ruby cgi library or with
+ 178805 [sam neurogri] So more information on the header corruption.
| 178894 [rubyzbibd ub] This looks like you have a "puts someobj.inspect" in your code.
| 178929 [sam neurogri] Indeed I have suspected as much.
| 178977 [logancapaldo] use breakpoint to let you jump in after you produce the headers. Go
+ 178852 [drbrain segm] You're adding a metaclass thingy to your headers.
178931 [sam neurogri] Indeed - not intentionally I assure you :-)
179114 [drbrain segm] They are generated by Apache. What do you get when you run
179171 [sam neurogri] Ah that makes sense.
+ 179175 [james_b neur] I think you need to preload the PATH_INFO environment variable
+ 179477 [drbrain segm] It is part of the CGI "spec".
^ Adding user input to a hash
178601 [info jayeola] Chaps,
+ 178602 [levin grunde] How could it, you are trying to assign to a method.
| 178605 [info jayeola] whoa! Thanks. It works but asa novice to this language I would never
+ 178603 [mike stok.co] Do you mean
+ 178608 [bob.news gmx] I'd choose a completely different design: I'd have questions in a list
178753 [info jayeola] Thanks for that reply. I think that I will go for the two array
178754 [bob.news gmx] Better put questions in a global constant. Otherwise you'll always
^ Torn in two - Pythonist
178606 [doug.bromley] You probably get this question all the time or some version of it.
+ 178607 [billk cts.co] Welcome,
+ 178610 [gregory.t.br] I came from Perl so it was a different transition. Still, there is no
+ 178614 [chneukirchen] I'm a Rubyist and I must admit Python is still a little unusual in its
| 178644 [julesjacobs ] Ruby and Python are very similar. There are some minor differences
| 178648 [tsumeruby ts] A few particular items Ruby has which Python nor Perl don't have is decent
| 178650 [james_b neur] James Britt
+ 178655 [uval rz.uni-] no need to bind yourself to one, use both
+ 178666 [ptkwt aracne] ...
^ Rails: has_many issue
178609 [stephen.hill] I'm trying to work out how to tackle a particular problem in rails.
178664 [drbrain segm] You should use the Rails mailing list then.
^ Merging regular expressions
178611 [anthony.duri] I've got a tricky puzzle.
178622 [dave burt.id] ...
178623 [bob.news gmx] I guess you rather meant
178636 [anthony.duri] Thanks Robert, thanks Dave,
+ 178639 [bob.news gmx] Didn't you originally state that you wanted to ensure that not two regexps
| 178642 [anthony.duri] Yes!
+ 178643 [lukfugl gmai] class Regexp
178646 [anthony.duri] Jacob, Brilliant!
+ 178651 [lukfugl gmai] Ah. Well in that case, I don't think you're gonna be able to play in
+ 178661 [ruby-ml magi] re = ['foo', 'bar', 'baz', 'quux']
178662 [ruby-ml magi] Bah.
^ Re: [ot] lol
178613 [snowzone5 ho] lol
+ 178691 [david vallne] However, your spelling checker doesn't seem to work :P
+ 178920 [hramrach gma] Do not use `never'. Never. Ever :)
^ [QUIZ][SOLUTION] Splitting the Loot (#65) (My second attempt)
178621 [pdeuster gmx] ...
178656 [adam.shelly ] My turn to say 'Doh!'
178926 [kasten.m gmx] Yet again. Your new version doesn't split
179085 [adam.shelly ] Aargh.
179135 [kasten.m gmx] 1: 88 119 242 396
^ [ANN] New Ruby on Rails Powered Job Site
178624 [michael.gors] Hey everyone - I'm excited to announce that I've just released my
+ 178713 [willshattuck] This is cool, great job! The site is quick and fairly easy to navigate.
+ 178717 [cballowe gma] ??? that's a ton of locations and categories for 5 resumes.
^ [SOLUTION] Re: Splitting the Loot (#65)
178626 [0x002A gmail] =begin
^ Webrick, ldap segfault on Linux
178653 [Daniel.Berge] Although this is happening in a Rails app, this is mainly a Ruby issue.
^ Nitro + Og 0.28.0: Cacheable, Ruby Query Language, Mongrel, Og cloning
178654 [george.mosch] Dear devs,
^ Problems building binaries on OS X 10.4
178658 [eric.promisl] This is with the Ruby that ships with 10.4 (Tiger). We haven't tried
+ 178660 [rmagick gmai] When you (or Apple, in this case) configure and build Ruby, Ruby
| + 178827 [eric.promisl] The weird part of this, btw, is that this problem doesn't show up with
| + 178832 [eric.promisl] Thanks, rm
| | 178839 [Gennady.Byst] You can build it once to install, say, in /usr/local/ruby-1.8, install
| + 179116 [james.herdma] Where are the header files located generally?
+ 179117 [akulbe gmail] during the ./configure stage, specify --prefix=/usr and it willinstall in /usr/bin/ruby and replace the stock ruby.
^ Quality cURL bindings for Ruby
178659 [eastcoastcod] I'm overseeing porting a large PHP app to Ruby. The app uses cURL for
+ 178671 [logancapaldo] ...
| 178693 [eastcoastcod] Logan,
+ 178908 [aglarond gma] ...
^ inheritence of aliases methods - suprise!
178668 [ara.t.howard] class A
+ 178672 [drbrain segm] $ parse_tree_show -
+ 178673 [logancapaldo] This makes sense, If you consider the common idiom of alias'ing a
178679 [ara.t.howard] yeah - this is pretty much what i did. for some reason i had always assume
^ [RANDOM] Attention, all YAML fans
178669 [david vallne] Attention, all YAML fans! You might want to know I couldn't bear this shameful
^ Ruby MySQL help
178674 [mtscolony gm] ...
178708 [mtscolony gm] ...
^ Intros to Python for Rubyists?
178675 [nugend gmail] Don't worry, I'm not jumping ship, I'm just going to have to do a
178690 [gene.tani gm] For a while last year, everybody was blogging python vs. ruby: graham,
+ 178701 [nugend gmail] Thanks Gene, there's a lot of really good info in there.
+ 178709 [UrsusMaximus] About 300 tutorials on Python now...at www.awaretek.com/tutorials.html
^ Korean Code Page Support for REXML
178681 [robert.wilde] I am working with localized information for several languages (German,
^ Method Definitions: &block vs. yield()
178682 [james.herdma] # First method
+ 178683 [james graypr] Well, once it's bundled up in an object you can tuck it away (assign
+ 178684 [ara.t.howard] class C
+ 178685 [vjoel path.b] def my_second_method(b, &block)
| 179183 [gwtmp01 mac.] You can pass an implicit block to another method by wrapping it in
+ 178688 [lopexx autog] Generally yield is much faster than converting block to a Proc. But
178731 [bob.news gmx] More generally all situations where you do not want to invoke the block
178789 [lukfugl gmai] (or both)
^ Re: FXRuby question
178687 [Nuralanur ao] ...
^ Ruby on Rails -- WEBrick OK, Apache isn't
178689 [vf5qd1j02 sn] I'm trying to get a Ruby on Rails application to work under Apache. It
^ Creating classes only when needed?
178692 [BPaatsch act] ...
+ 178694 [david vallne] Well, your example is fairly generic, so I'll be guessing what you really want
+ 178699 [sean.ohalpin] Class names are constants. To get a reference to a class from a name
^ Ruby design patterns and idioms
178700 [jack jncsoft] I've read Design Patterns and similar material. While I've certainly
+ 178702 [james graypr] James Edward Gray II
+ 178716 [gene.tani gm] the facets and extensions libs, ruby tricks-R-us
| 178719 [james_b neur] James Britt
+ 178722 [dido.sevilla] I have an old issue of Dr. Dobb's Journal (August 1997), that has an
+ 178723 [henrik.marte] There is another, "Replace Mixin With Class", but I haven't made a
^ Excel spreadsheet
178703 [BPaatsch act] ...
+ 178705 [info jayeola] I've seen something in the source code...
+ 178706 [david vallne] If the machine in question is a Windows box with Excel already installed, your
+ 178720 [gene.tani gm] I once counted 5 ways to get at Excel data: CSV, OLE, XML, ADO and i
+ 178728 [jes luretank] There are lots you can do, some pointers have already been posted. Please
+ 178770 [jeff schwabc] ...
^ reasons to use else inside rescue
178710 [r.mark.volkm] I understand that the code in the else part of a begin block is only
178714 [david vallne] There's an else part in a begin / end block?! Oh dear. Heavens protect us...
+ 178715 [ruby-ml magi] irb helps a lot for trying stuff out.
+ 178734 [bob.news gmx] Why?
178752 [r.mark.volkm] Thanks! All this makes sense now.
+ 178819 [logancapaldo] I feel like this is one of those features that I'll need to use maybe
| 178823 [nugend gmail] I think that sort of control structure would see a lot of use when
+ 178853 [chneukirchen] What if the "else code" raises an exception to (not) to be cought?
178865 [r.mark.volkm] In that case the exception would go to the method that called the