## 288916-358831

288639-367235 subjects 289132-289808

Final Two Quizzes
288916 [james@gr yp ] As most of you know, we have two Ruby Quiz problems left (http://groups.google.com/group/comp.lang.ruby/msg/6f46393932c22e49
288978 [fedzor@gm il] Once again, thank you for such an enjoyable time in Ruby Quiz :-) I'm
288980 [james@gr yp ] You want the job?  :)
+ 288984 [dangerwillro] I don't know if I want the job, but I have already registered the
+ 289016 [fedzor@gm il] No thank you :-) School hogs my time, and besides, I can't do half of
| 289026 [james@gr yp ] If you knew Ruby backwards and forwards, the quiz would be a lot less
| 289048 [wieczo.yo@go] Thank you for the many quizzes. I came to Ruby through a blog entry
| 289051 [james@gr yp ] That almost exactly where I was when I started.  :)
| 289057 [dominikho@gm] I really don't want to be pessimistic nor do I want to put somebody off,
| + 289065 [dangerwillro] Agreed on the potential difficulties/workload...
| | 289080 [james@gr yp ] I'm interested to see how a team would work in this instance.  I
| + 289071 [wieczo.yo@go] I agree. It is a great responsibility to take over. That's why I am
| | 289083 [james@gr yp ] That's 98% of what it takes.  Trust me.  This is the hardest part.  If
| + 289079 [james@gr yp ] Oh yeah, it's a lot of work.  I'm sure you can search the archives and
|   289086 [wieczo.yo@go] I'd like to see the summary in the end. It describes interesting
|   289106 [caduceass@gm] I agree that the summary is usually pretty good.  James is very insightful.
|   + 289124 [ljjarvis@go ] ul.
|   | 289365 [martindemell] I don't have the time to be a quizmaster, but I enjoy coming up with
|   + 289228 [robert.dober] Hey all summaries are not from him LOL, no but that is an important
|     289267 [dangerwillro] all right Robert, you're in as well.
|     + 289268 [dan@da fi ni] ...
|     | 289295 [dangerwillro] This has already been covered previously. James even covered this
|     | 289296 [james@gr yp ] Yeah, I feel it's just better to move it to a new site.  My scripts
|     | 289409 [qbproger@gm ] Speaking of scripts, it'd be cool for an automated checking system
|     | 289412 [james@gr yp ] The minus of a system like that though is how much you have to tied it
|     | 289427 [micathom@gm ] It would be cool though if some specs/tests were available (maybe even
|     | 289459 [james@gr yp ] Then you will like this week's problem.  :)
|     + 289297 [james@gr yp ] I have a #rubyquiz channel on Freenode.  You all are welcome to use it
+ 289176 [matthew.moss] I'd be willing to take over for James, with a little caveat. I'm
289181 [james@gr yp ] Matthew, Ari, Thomas, and John all need to put their heads together.  =20=
289266 [dangerwillro] Indeed, 3 heads are better than none. (I'm not counting mine)
289363 [fedzor@gm il] Why do we have to leave everything James did behind?

swiftiply configuration for rails application
288917 [anusha54@gm ] Im trying to  configure swiftiply and mongrel for my rails application.
289030 [khaines@en g] ...

lining up delimiter separated text
288920 [scooterm@ho ] fname ;; lname ;; age ;; sex ;;
+ 288923 [james@gr yp ] #!/usr/bin/env ruby -wKU
+ 288924 [fxn@ha hr f.] Modulus whitespace, here's a solution
+ 288925 [bbxx789_05ss] str =<<STR
288926 [bbxx789_05ss] str.each("\n") do |line|

Assistance dynamically building a nested hash
288931 [matthew.d.wi] I've done some searching and have found some nested hash references but
288934 [bbxx789_05ss] arr = [
+ 288937 [gwtmp01@ma .] This works for a two-level hash, which is what the OP needed.
| 288946 [jens.wille@u] h = Hash.new { |l, k| l[k] = Hash.new(&l.default_proc) }
| 288952 [gwtmp01@ma .] slick
+ 288949 [matthew.d.wi] I'm trying to work with this code as we speak, I'm still a bit of a Ruby
288959 [matthew.d.wi] sub_arr was being treated as an actual object data type... So a few
358831 [net.sqa@gm i] Can you please post the solutions if you have resolved this? I am kind

Fwd: Please Forward - Ruby Quiz Submission
288938 [james@gr yp ] ...

288940 [kmarplecarte] I'm having issues loading a YAML file. Here is the YAML file (named
+ 288942 [coder68@ya o] The "t" you are loading is a String.. always check the types for a
| 288948 [kmarplecarte] It definitely helped! Thank you sir.
+ 288944 [phrogz@ma .c] WARNING! Right here, you see that the result of loading "test.yml" is
+ 289007 [andrea.fazzi] require 'yaml'
289008 [george@nu ru] Or

Rubyforge APT repository
288950 [devi.webmast] I've setup a APT repository for Ruby projects at
288955 [gdonald@gm i] There's a horizontal scrollbar present in Firefox on Ubuntu Gutsy.

make test-all fails on digest/sha1
288951 [warrens@ac c] autoconf
288957 [warrens@ac c] I installed it in my home directory anyway and ran irb.  It can find

Line breaks in YAML
288956 [kmarplecarte] Sorry for all the YAML questions today!
288969 [kmarplecarte] Shameless bumb. Stuck at work.
288971 [wieczo.yo@go] require 'yaml'
288975 [kmarplecarte] No, that's not quite it.
288977 [nyarly@gm il] I think what Thomas was meaning to point out is that you probably want

Ruby is Running Slow on Mac OS X
288962 [nonstickglue] I'm just wondering if anyone else is having problems, or did have
+ 288972 [ara.t.howard] post the code.  if it's on leoTard (leopard) you will need to tweak

Treetop Email Parser
288973 [phrogz@ma .c] (I would post this to the treetop mailing list...except there doesn't
+ 288982 [no@sp m. le ] It's fine here. A lot of folk here could benefit from using Treetop,
| 288988 [phrogz@ma .c] Sure. I'd also like a place to send bug reports, however. So far, I've
| + 288991 [phrogz@ma .c] My apologies for second guessing you. Having read the PEG paper[1], I
| | 288995 [no@sp m. le ] Well, though the authors of the packrat paper described a parser that
| + 288993 [no@sp m. le ] Well, yes-ish. If you look at the definition of FWS, it matches any non-zero
|   289031 [matt.mower@g] Would I be alone in finding Objective-C support useful?
|   289036 [rubyfan@gm i] An Objective-C backend for TreeTop would rock!
|   289058 [no@sp m. le ] Once the basic framework for multiple output languages was there,
|   + 289084 [matt.mower@g] No, probably easier.
|   + 289111 [rubyfan@gm i] What do you think would be involved to create this framework for
|     289252 [no@sp m. le ] No design docs, but the Ruby text is built using a Ruby builder,
|     289422 [rubyfan@gm i] Yeah, I noticed the Builder stuff.  I did some changes
+ 289028 [vidar.hoksta] The "obsolete" productions were not obsolete in RFC 822, and hence

NoMethodError when trying to validate model field
288979 [laredotornad] "is_client?" to help with the validation.  But I did it wrong because
289047 [greenewm@ya ] I can explain why you're getting this error.  validates_as_phone is a

Re: tail call elimination
288981 [ttmrichter@g] ~ $irb gem API 288985 [dangerwillro] I'm curious is there a flag or an easy way to extend gem when calling 289231 [drbrain@se m] Talk to Chad Wooley. He's writing a gem installer tool. 289264 [dangerwillro] Ok, thanks, 289279 [drbrain@se m] No. If you're going to be writing a tool, use the API the 289292 [dangerwillro] Many thanks! Ruby/Tk/Iwidgets tabnotebook (and scrollbar) 288986 [karl.miller.] I've created an iwidgets tabnotebook, with a large number of tabs, 289908 [nagai@ai ky ] You must control start position of the tabset. 289967 [nagai@ai ky ] Probably the following is better. Sorry. 289992 [karl.miller.] Yay! This worked very well. Thank you :) 290284 [nagai@ai ky ] The previous version does not work with some of widget options [OT] JNA Help - LPDWORD 288994 [djberg96@gm ] Does anyone happen to know the JNA equivalent of [24].pack('L')? I need 289027 [tim.pease@gm] Fire off an e-mail to Rich Kilmer. I do believe he did quite a bit of MOSSAD killed Benazir Bhutto - Mossad killed ZIA to effect a clean break between pakistan and USA - Mossad vomited Herbert Bush 288998 [khazar@in ia] MOSSAD killed Benazir Bhutto - Mossad killed ZIA to effect a clean Spreadsheet Excel: How to merge cells? 289002 [michael.schm] I'm using spreadsheet-excel-0.3.5.1 on Windows XP with Excel 2000 and 289013 [henssel@gm i] you never seem to apply the format after you have defined it?! I don't can you do this ? ruby aptitute 289005 [bad_good_lio] # in source1.rb + 289006 [luc@ho k- on] I first tried with various uses of Binding but couldn't get it to work. | 289015 [bad_good_lio] nice answer + 289014 [eeklund@gm i] You can open class C2 (or Object), intercept the creation of C2#met looking for XML parsers in Ruby 289009 [ravin.iitb@g] I am looking for a validating XML parser for ruby. I found that there 289017 [lloyd@2l ve ] Maybe you just typed in the wrong thing to search for and missed this. + 289022 [vasudevram@g] /rexml-processing-xml-in-ruby.html + 289088 [bryan@ra le ] Don't use REXML if performance is important to you. libxml-ruby is 289096 [jeremymcanal] And it's validating like the OP asked for. Double win!! :) 289129 [ravin.iitb@g] Thank you all for your responses. Actually I am aware of libxml-ruby. I Proposal/RFQ: Hash#values/keys with block 289018 [dirk.traulse] Hash#values and Hash#keys return the values/keys of a hash as an array. 289020 [wieczo.yo@go] I am sure you could use external iterators for that and extend your Hash class. 289021 [shortcutter@] hash.select {|k,v| k.size == 1 }.map {|k,v| k} 289034 [dirk.traulse] Why make it standard? 289040 [shortcutter@] True. 289138 [dirk.traulse] That's true. So this has to be proven by implementation. + 289147 [micathom@gm ] #keys should return the hash's keys, IMHO it shouldn't iterate over | 289179 [dirk.traulse] How could you return the keys without iterating over them? | 289198 [micathom@gm ] Well, from my POV this is rather a special case of a more general + 289153 [shortcutter@] Nice list. Yes, indeed, I see what you mean. [OT] Blogging Platform suggestions? 289025 [u.alberton@g] First of all, I would like to apologize for being off-topic. + 289041 [wieczo.yo@go] Heya, + 289507 [perrin@ap th] I've been running a personal weblog with WordPress for a long time. It Re: Ruby & Word 2007 help - SOLUTION 289033 [mickmiller@i] Mr Masaki, Re: assert{ 2.0 } - a new kind of assertion 289035 [kingdon@pa i] Nice. 289038 [p.black@ac .] Phlip, 289136 [ pjm@sp .c m] It's nice to see people making the effort to bring these primitive + 289164 [mailbox@dm t] I always wondered why dynamically typed languages do not make brackets | 289258 [jcoffin@ta u] kazakov.de says... + 289170 [ pjm@sp .c m] Parentheses? What parentheses? ;-) + 289256 [jcoffin@ta u] [ improved asserts for Ruby ] 289269 [jcoffin@ta u] @gmail.com says... "Fuzzy" matching of lines between CVS mailing lists 289037 [phil@pr co .] People, 289042 [shortcutter@] <brainstorming> regex to avoid escaped quotes or double quotes 289043 [netcam@gm il] ... Looking for a publicly accessible SOAP example 289044 [rbronosky@gm] I realize that SOAP is dead. I didn't realize this until this week. + 289050 [yermej@gm il] Are you just looking for a SOAP server to test against? I haven't + 316833 [davidaustin7] I don't think SOAP is dead. I have had two requests to create a client error installing using rubygem 289045 [sanjay.k.pat] I am doing a fresh install. I have installed 289135 [larsch@be un] First hit: http://www.google.com/search?q=no%20such%20file%20to%20load%20--%20zlib newbie file write problem 289046 [larzeb@gm il] This is my first attempt at ruby. I've written a class (SicCode) which + 289049 [bbxx789_05ss] It sounds like your last line is the problem, so it doesn't have + 289052 [yermej@gm il] If get_sql works in irb, it could be that the line endings in the file 289056 [larzeb@gm il] f = File.new("d:\downloads\\text.txt", "w") 289082 [bbxx789_05ss] It's time to stop asking us to debug imaginary code. Post a simple, 289091 [larzeb@gm il] Sorry, I can't do it in 20 lines, but it's very simple. + 289108 [bbxx789_05ss] irb(main):179:1> f.puts s | 289109 [larzeb@gm il] IF EXISTS (SELECT * FROM Sic WHERE Code = '3291') | 289110 [bbxx789_05ss] Is there no way to test what the return value of a function is? What's | 289112 [bbxx789_05ss] def g | 289162 [larzeb@gm il] class SicCode + 289139 [m_goldberg@a] Your problem has a simple fix -- remove the 'puts'. You want the 289151 [larzeb@gm il] Morton, 289165 [dominikho@gm] You should remove the puts in the get_sql function, not the f.puts call. 289171 [larzeb@gm il] Perfect, Dominik, it works! neat idea from arc 289059 [martindemell] Paul Graham just released Arc (http://paulgraham.com/arc0.html), a + 289068 [matz@ru y- a] We can do it by using #grep, e.g. | 289118 [martindemell] I was thinking of this as a replacement for (and generalisation of) | 289291 [pit.capitain] Martin, you can define + 289070 [shortcutter@] You either need "*arg" or "arg = nil" because otherwise the method + 289073 [marcel@ve ni] On Jan 29, 2008, at 4:07 PM, "Martin DeMello" | + 289074 [mental@ry ia] I suppose the reverse of this is a use case for having a Case::Not[] in my case gem. | + 289095 [dan-ml@da 42] => [2, 4] + 289105 [znmeb@ce ma ] Well ... not sure about this relative to Ruby, but I must admit I'm a + 289119 [martindemell] Same here. I was excited, but it doesn't look all that special. Qi has + 289122 [micathom@gm ] It seems rather like a Scheme pre-compiler to handle some syntaxtic For Loop question 289060 [pimea.mark@g] ok basically i cant quite figure out how to do a for loop i want in + 289061 [jameskilton@] @question_array.each_with_index do |part, i| | 289063 [jameskilton@] Crap, I mean + 289066 [thopre@gm il] ... + 289069 [rasputnik@gm] question_array.each { |element| | 289133 [jari.william] question_array.each { |element| + 289075 [bbxx789_05ss] "isnt blank" != nil | 289076 [bbxx789_05ss] "blank" != nil | + 289077 [bbxx789_05ss] Double whoops. I guess "blank" does equal nil. | + 289078 [s.korteling@] But what is "blank" in an array? You can't do a=[nil,,1,2,3] . + 289144 [micathom@gm ] And then do what? Do you need the index? In this case you can use the 289184 [pimea.mark@g] thanks to everyone who posted. This one worked for what i was doing 289285 [shortcutter@] What code? The question is what are you trying to achieve here? This applying a random method to an object 289064 [boris@ba of ] A weblog showed that .methods could be sorted and behaved like an array 289067 [vjoel@pa h. ] 15.send(array.shuffle.first) Newbie question 'require' 289085 [skoren@co ca] ... + 289087 [wieczo.yo@go] Try adding | 289089 [skoren@co ca] That did it! | 289093 [wieczo.yo@go] You're welcome! I had the problem a few month ago, when I installed + 289094 [TimHunter@nc] When you install a gem you must use RubyGems to load it as well. Did you 289097 [marike1@op o] You could also add, Problem with rbwfile in Registry: killed tooltips in FxRuby? 289092 [RichardDummy] What is the definition of the data item in the HKEY_LOCAL_MACHINE smtp.set_debug_output - capture output to string? 289099 [aktxyz@gm il] As shown below, I can send debug output from Net::SMTP to stderr, how + 289100 [aktxyz@gm il] fyi, this StringIO technique does not work... | 289102 [fwmailinglis]$ irb
| 289104 [aktxyz@gm il] Sigh, I had a class that overrides do_start some of Net::SMTP so that
+ 289101 [fwmailinglis] require 'stringio'

storing multiple of the same object from a request
289115 [laredotornad] I have this form ...
289219 [rick.denatal] First, this is really a question for the rails group.

Re: REXML (1.8.6 p111) Document.write fails - "undefined loc
289116 [weyus@at .n ] Current solution is to simply fix the name of the variable.  Whatever

How do we create ann Interface using Webrick
289126 [prasadp@gs a] I have created the following interface but while connecting the client

Newbie: working with binary files/extract png from a binary file
289131 [jim.foltz@gm] I am reverse engineering a binary file that has an embedded PNG image
289173 [vjoel@pa h. ] Do you know the absolute starting position of the embedded PNG?
289227 [jim.foltz@gm] Thank you both for your information and effort.
289239 [adam.shelly@] I patched it together based on wikipedia's PNG entry and parts of a
289446 [jim.foltz@gm] OK, it's really not that hard is it?