407820-408178

407565-410198 subjects 408021-408989

Eloquent Ruby Kaprekar's Number
407820 [lists@ru y- ] Which way is the eloquent ruby way to write this algorithm?
+ 407821 [tamouse.list] def kaprekar?(k)
| 407822 [tamouse.list] Well, that will teach me not to test more thoroughly.
+ 407824 [lists@ru y- ] Yes, Kaprekar number is good to be an exercise in creating a (Ruby)
+ 407825 [josh.cheek@g] def kaprekar?(num)
+ 407827 [sto.mar@we .] To me, as long as there are no performance considerations involved,
| 407828 [peterhickman] For me 2 and 3 are unreadable, not to mention overly complicated. I would
| 407835 [lists@ru y- ] There isn't any, I believe. Though there could be a use for them in the
| + 407837 [lists@ru y- ] Thank you for replying.  How about some exercises that are related to
| | 407839 [peterhickman] Your new version is much clearer. But I will nitpick anyway :)
| | 407846 [lists@ru y- ] That doesn't compile for me.
| + 407838 [sto.mar@we .] There is also minitest/spec, you should have a look at that, too.
| + 407850 [list.push@gm] Your requirements seem to be different than the definition that I read. See
+ 407853 [list.push@gm] def try2(n)
  407856 [sto.mar@we .] OP was asking for "eloquent" solutions...
  + 407857 [tamouse.list] ...
  | 407869 [lists@ru y- ] nice. a lot of fun. Now I think I know why people like Rspec so much.
  + 407858 [tamouse.list] This may not be eloquent ruby, but it certainly is sublime. Only patch

question on watir ,
407826 [lists@ru y- ] class IDITHarnessTest < Watir::TestCase

Installing Ruby & Rails on Ubuntu 12
407832 [lists@ru y- ] I have been trying to install Ruby on Rails and get an environment
407834 [atma@co va e] I'm not sure what's going on but try running sudo ruby prog ... When installing gems with sudo ruby probably uses a different directory to store your gems.

installing FileUtils error
407833 [lists@ru y- ] Building native extensions.  This could take a while...
+ 407843 [tamouse.list] sudo apt-get install imagemagick
| 407847 [lists@ru y- ] nope, ImageMagick is alredy installed. And it's odd, because I have
| 407861 [tamouse.list] Hmm, yeah, that is weird, then. I don't believe ImageMagick has special
| 407862 [lists@ru y- ] yes, I can confirm that.
+ 407849 [lists@ru y- ] thank you. I also needed the "libmagickwand-dev"

Vinayak Mithbaokar is on a business trip.
407836 [vinayak.mith] I will be out of the office starting  June 1, 2013 and return on June 24,

Question about displaying an image with green shoes
407840 [ruby.student] I am trying to display an image using green shoes. Instead of the image the
+ 407842 [ashbbb@gm il] image "/home/rstudent/MyData/Programs/shoes/OIT_Logo2.png"
+ 407902 [tamouse.list] the system I get a very small rectangle with the bottom right corner  bent
  407905 [ruby.student] I think I do now, after Ashbb replied to my email.

Making PKCS12 Stores in Ruby (& where's PKCS8)?
407841 [lists@ru y- ] I'm fairly new to Ruby, but very comfortable with OpenSSL.  I thought it
407845 [tony.arcieri] I normally hate being this guy, but: my advice is don't go down this road.
407851 [wbrisett@at ] I'm not doing anything with OpenSSL, but I am curious. If you don't =
407867 [tony.arcieri] and

ANN: Sequel 3.48.0 Released
407852 [lists@ru y- ] Sequel is a lightweight database access toolkit for Ruby.

green shoes: placing 3 equidistant images
407864 [ruby.student] I have three small images which I would like to place right at the
407904 [ashbbb@gm il] I think that you are looking for `align` style like this.
407906 [ruby.student] ashbb,

Is it a bug(about constant reference on dynamic class).
407865 [lists@ru y- ] When I use a dynamic class, It can not reference constants.
+ 407866 [tamouse.list] ENOTABUG :)
| 407874 [lists@ru y- ] Thanks for your reply.
+ 407877 [lists@ru y- ] c = Class.new {
| 407887 [tamouse.list] It happens a lot :)
+ 407896 [gwtmp01@ma .] The reason is that your two examples have different lexical scopes and =
+ 407900 [fxn@ha hr f.] Don't know how much you know about resolution of constants.

[ANN] binman 3.3.1 - man pages for bin scripts
407868 [sunaku@gm il] binman produces UNIX manual pages for executable scripts using

Generating Secure Passwords With Ruby, Atmospheric Noise, and Comics
407870 [lists@ru y- ] Hey guys,

Does Tracepoint use the same probes that dtrace uses?
407871 [lists@ru y- ] I spent some time learning about using Dtrace and Ruby.. then found the

monkeypatch imap class error handling
407873 [henne.gwath@] I have a broken IMAP-Server which violates the imap protocol. I want

Ruby extremely slow compared to PHP
407882 [lists@ru y- ] trying to switch to Ruby(not for web development) because it seems easy
+ 407883 [lists@ru y- ] before you are talking about speed, talk about what ruby version you use
| 407884 [lists@ru y- ] [i686-linux]"
+ 407885 [sto.mar@we .] ret = "../"
| 407888 [lists@ru y- ] So one problem could be "redundant" variables? Thank you!
| 407890 [sto.mar@we .] I didn't mean that. You probably meant
| 407891 [sto.mar@we .] Forget it.
| 407893 [peterhickman] Well running the code against the example url the reason for the length of
+ 407889 [tamouse.list] It would be really helpful to me if you'd also post the PHP version.
+ 407894 [lists@ru y- ] There are three different scripts there: lfi.php, funcs.php and dirs.php
+ 407895 [tamouse.list] So, basically, curl is getting a lot less data than Net::HTTP is
  + 407901 [alexg@ru ge ] My guess (totally untested) would be that curl/PHP is getting a gzipped
  + 407921 [lists@ru y- ] Thanks for your answer!
    + 407925 [groups@in ox] But a more apples-to-apples comparison would use a Ruby library that also
    | 407951 [lists@ru y- ] Nice to meet you here! I wanted to know,in your RubyTapas video
    | 407956 [groups@in ox] Emacs. But you're probably referring to the insertion of results into the
    + 407972 [tamouse.list] The curl handle *is* closed -- it is a local variable (no globals

Help with a small httping\other-ping related script.
407892 [eliezer@ng e] My script does a small httping and returns the duration of the httping.

'require' is not loading files
407897 [lists@ru y- ] I am new to ruby and have been teaching it to myself for the past so I
+ 407898 [fluido@fl id] Sorry for the delay!
| 407903 [sto.mar@we .] Note that require_relative will not work with irb.
+ 407899 [windwiny.ubt] require './b'
+ 407909 [lists@ru y- ] Thank you for the help. require './a' works just like it should.

Cannot access constants from included modules in a submodule
407907 [lists@ru y- ] I am trying to include a bunch of constants into a module and all its
+ 407920 [bradleydsmit] can you put the actual code in a gist or something to make it easier to
+ 407927 [zettabyte@gm] I would just say that your "submodules" are "namespaced" or "nested" within
  407984 [lists@ru y- ] Okay, I see how this works now.

TCPServer/Socket and Marshal problem
407908 [atma@co va e] I'm writing a client/server application using TCPSocket and TCPServer. To serialize the objects at this point I use Marshal, since it comes handy.
+ 407911 [joelvanderwe] You can try
| 407913 [atma@co va e] Worked fine! Thank you! I don't get it thought, could you elaborate a bit?
| 407918 [joelvanderwe] Sure (sorry to be cryptic!).
| 407937 [atma@co va e] Thanks for the amazing explanation!
+ 407912 [lists@ru y- ] ============================================
+ 407978 [shortcutter@] This is where I'd stop and use DRb instead.
  407979 [atma@co va e] ...
  + 407980 [shortcutter@] That depends on how you set it up: if avoiding that other port is so
  | 407983 [atma@co va e] ...
  | 407987 [shortcutter@] it
  | 407989 [atma@co va e] ...
  | 407994 [shortcutter@] .com>
  | 407998 [atma@co va e] ...
  + 407990 [seki.at.drub] On 2013/06/05, at 17:54, Panagiotis Atmatzidis <atma@convalesco.org> =
    408006 [atma@co va e] On 5 =1B$B&)&O&T&M=1B(B 2013, at 15:45 , SEKI Masatoshi =
    408067 [atma@co va e] 76         def client_address
    408085 [shortcutter@] Line 79 or 80 is nonsense.

How to evaluate VBscript in Ruby 2.0.0 under Windows 7
407910 [echristopher] I've run into a little more pain running my existing scripts using Ruby
407944 [phasis@gm il] This is not Ruby 2.0.0 vs Ruby 1.9.3 issue, but 64 bit vs 32 bit issue.
407953 [echristopher] and

Problems after upgraded from 1.9.1 to 1.9.3
407914 [lists@ru y- ] We have a production server with a running web application and just
407916 [wishdev@gm i] John

Where does Ruby look to load files?
407915 [lists@ru y- ] Can someone explain what changed from 1.9.1 to 1.9.2 with regards to
+ 407917 [wishdev@gm i] That little thing called Google again.....
+ 407924 [lists@ru y- ] I did indeed google this.  I was more confused afterwards.  The articles
+ 407928 [lists@ru y- ] It is going to take two days to fix one application alone; We have many
  + 407934 [wishdev@gm i] Why upgrade to 1.9.3 then? Why no testing in advance of the upgrade?
  + 407942 [jeremy@bo p.] You do realize that the change to Ruby that is giving you problems here
    407943 [hassan.schro] 3) Lack of (apparently) any production environment change control.

Setting debug location
407919 [lists@ru y- ] I'm working on a gem for DCI (maroon) and a major part of that gem does

loaded gem money but not found
407922 [lists@ru y- ] I loaded the money gem (Ruby 1.9.1), but it is not found.
407969 [tamouse.list] Since you're using per-user rvm, DON'T sudo gem install. That uses the

Re: Problems after upgrading from 1.9.1 to 1.9.3
407923 [lists@ru y- ] I did indeed try google and looked at the first 10 link; I was not able
407970 [tamouse.list] Just read the documentation on rvm at http://rvm.io.

Question About OCR in Ruby vs. Rails
407926 [kirkkeeter@g] Team,
+ 407929 [jstewart@fu ] I've had pretty good luck shelling out to pdftotext to get the text from
+ 407930 [zettabyte@gm] Unless the actual data you're trying to extract from the PDF is actually
+ 407971 [tamouse.list] I don't know if the OCR part is a good use of Rails, etc, but a system

Longer user input?
407931 [lists@ru y- ] I think the maximum number of characters in user input ('gets') is 254.
+ 407935 [hassan.schro] Why?  And regardless, how hard would it be to test that assumption?
| 407938 [lists@ru y- ] It's not an assumption, I have tested it. After typing 254 (or so)
| + 407939 [adam@ap es o] You might be reaching a limitation with the terminal you're using.
| + 407941 [hassan.schro] As Adam already pointed out - no. It's apparently a limitation of your
| + 407975 [tamouse.list] $ ruby -e 'f = gets.chomp; puts "f = #{f}\nf.size = #{f.size}"'
+ 407947 [lists@ru y- ] Is this by any chance on Windows? I think it was mentioned in another
+ 407973 [tamouse.list] Seriously.

Mobile Ruby Website
407932 [kirkkeeter@g] I'm doing a mobile version of a Ruby on Rails website -- and i've decided
+ 407933 [matt@te hn r] You would probably find a lot more expertise in Rails on the Rails mailing
+ 407974 [tamouse.list] jQuery, jQueryUI, and jQuery Mobile are all open source... What exactly

money gem with 1.9.1?
407936 [lists@ru y- ] money requires Ruby version >= 1.9.2.
407940 [jeremy@bo p.] Apparently, the version of the money gem that used to be installed for

Nokogiri::XML methods example
407945 [lists@ru y- ] I am not able to find out a simple example to find out the how the

Is rubyquiz.com dead?
407946 [lists@ru y- ] Thread title says everything.
+ 407948 [jgabrielygal] I've checked the whois record and saw that the domain is using
+ 407981 [lists@ru y- ] This sucks. I was planning on uses those for practice.. Does anyone know
| 407982 [jgabrielygal] Jesus.
| 407988 [sophrinix@gm] archive.org has a fairly complete archive of the website from eairler this
| 407991 [sophrinix@gm] In no way shape or form am I saying that I have the time to manage or
| 408051 [cfriedo@ya o] ...
| 408052 [sophrinix@gm] I haven't had a chance to work on this today. The next step could of steps
+ 407992 [lists@ru y- ] There's always the RubyQuiz book...
+ 408001 [lists@ru y- ] Hey Andrew I'd be interested in making it github pages site. What would
| 408002 [sophrinix@gm] My idea was to convert to a jekyll site, also, tracking down all the
+ 408009 [lists@ru y- ] Okay sounds super cool! I'm in. Though, I'm actually going to be super
+ 408053 [lists@ru y- ] I'll build the jekyll site. I've been spending the last few days
| 408054 [sophrinix@gm] go for it
+ 408062 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
| 408068 [atma@co va e] I'm sure they killed Kenny too  Άχ  Those bastards
+ 408076 [lists@ru y- ] So, I emailed James Edward Gray II, the for webmaster of rubyquiz.com
+ 408080 [lists@ru y- ] maintain the site. He just needs to needs to move it to another server

Need help to start with Ruby
407949 [lists@ru y- ] I am very new to Ruby. Can anybody please suggest any tutorial or web
+ 407950 [lists@ru y- ] Posted via http://www.ruby-forum.com/.
+ 407952 [lists@ru y- ] Check out http://ruby-doc.org/
+ 407954 [lists@ru y- ] If you're looking for a basic intro to the language, this is pretty
| 407967 [dave@lo ke s] If you can stand my voice, I have recorded my lectures for 2 ruby classes an=
+ 408018 [lists@ru y- ] Thank you very much all...
  408027 [tuanpro.itma] you can try http://rubymonk.com, which is a well-written site for Ruby

Create a nested structure from a CSV
407955 [lists@ru y- ] {:user_name=>'foo', :user_id=>2,
+ 407957 [lists@ru y- ] You have attributes like "is supervisor". Maybe a Hash isn't the best
| 407958 [lists@ru y- ] Thanks for responding. I had considered something like that but I want
| 408011 [tamouse.list] Actually, I'd go ahead and use ActiveRecord or Sequel with an sqlite
| 408015 [doug@ds if r] I think this would be easier to work with if implemented using classes and
+ 407959 [lists@ru y- ] Bah, my brain hurts too much to write a recursive hashifier at the
  + 407960 [Anton.Scipio] unsubscribe
  + 407985 [lists@ru y- ] thanks for the reply and the code. haven't been able to figure it out

how to implement a UNIX 'export' in Ruby
407961 [lists@ru y- ] I've been googling and getting nowhere on this, and I find it an
+ 407962 [echristopher] Have you tried it? I don't have g95, but a similar test case worked for me.
+ 407964 [joelvanderwe] Yup.

OT: Romance novel
407963 [echristopher] I just noticed a romance novel someone left lying around -- called _If you
407965 [josh.cheek@g] lol, nice :) http://www.amazon.com/dp/1402269765
407966 [stu@ru yp og] Yeah it's a real gem. not your average boy meets git; boy loses girl; boy

Compiling or building an application with green shoes
407968 [ruby.student] I am learning ruby and shoes and started to building a simple
+ 407986 [ashbbb@gm il] Green Shoes is just a gem written by pure ruby.
| 407993 [ruby.student] Got it. Thank you!
+ 407997 [lists@ru y- ] I don't know whether green shoes works with the OCRA gem, but it might
  407999 [ruby.student] Will do.
  408034 [ruby.student] Team,

Ruby Progress Catcher
407976 [lists@ru y- ] So what I am asking how to do is have a script that reads all of the
+ 407977 [shortcutter@] I am not really sure what to make of this: reading does not modify the file
+ 408008 [tamouse.list] What's in it for us?

Can't get "animate" to work on green shoes
407995 [ruby.student] I am trying to do a simple animation. Basically I have a small png image of
407996 [ruby.student] Sorry team, I found the failure for the "animate." I forgot to add *

My car is "falling" off the screen green shoes
408000 [ruby.student] Team,
408007 [martindemell] screen of width 20, a car at position 10, and it moves 15 units in
408025 [ruby.student] I defined my screen as "fullscreen" and I don't know how to tell the actual
+ 408026 [ashbbb@gm il] Fantastic! Glad to hear that. :-D
+ 408029 [lists@ru y- ] and then, a little physics
  408030 [ruby.student] This also works very nicely!

How to install money gem?
408003 [lists@ru y- ] We have a production server running Ruby 1.9.1. It runs and works
+ 408004 [sophrinix@gm] 1.9.1 is not a very good version of ruby. It was considered
+ 408005 [jeremy@bo p.] When the production server was configured to run your application, there

RubyTk - tkimg fails to import?
408010 [lists@ru y- ] In order to use PNG files with RubyTk I need to import the 'tkimg'
+ 408013 [nagai@ai ky ] It means that Ruby/Tk cannot find *Tcl/Tk's* Img extension package.
+ 408028 [lists@ru y- ] Hey,
| 408032 [nagai@ai ky ] In this case, it is not important.
+ 408040 [lists@ru y- ] Hey,

Need help understanding recursion.
408012 [lists@ru y- ] Ive been reading Chris Pine's book 'Learn to Program' and its been going
+ 408014 [tamouse.list] What I would suggest is installing pry and using it to step through your
+ 408016 [fluido@fl id] The example is well-thought-out and well-written. What is it that you
| 408017 [keystonelemu] Read through 'The Little Schemer' and recursion will be a step by step
| + 408019 [lists@ru y- ] Recursive algorithms are essentially self-calling algorithms -- so any
| + 408022 [tamouse.list] Oh, well played, Brandon, well played. :)
+ 408020 [lists@ru y- ] Sorry, I realized that I should probably help you understand your
+ 408048 [lists@ru y- ] Thanks Alphonse!! That is exactly the help I needed and definitely
| 408112 [lists@ru y- ] Sorry if this reply is a little late.
+ 408161 [lists@ru y- ] Thanks for your help Alphonse! Youve been a great help. Sorry for all
+ 408178 [lists@ru y- ] Sounds about right, here's the first few runs of the block, and when it
threads.html
top