[#390749] Why are there so many similar/identical methods in core classes — Kassym Dorsel <k.dorsel@...>

Let's look at the Array class and start with method aliases.

14 messages 2011/12/02

[#390755] Inverse Operation of Module#include — Su Zhang <su.comp.lang.ruby@...>

Hi list,

21 messages 2011/12/02
[#390759] Re: Inverse Operation of Module#include — Ryan Davis <ryand-ruby@...> 2011/12/02

[#390764] Re: Inverse Operation of Module#include — Isaac Sanders <isaacbfsanders@...> 2011/12/02

I would suggest an Adapter pattern use here. IF there is something that has

[#390876] black magical hash element vivification — Chad Perrin <code@...>

Ruby (1.9.3p0 to be precise, installed with RVM) is not behaving as I

12 messages 2011/12/05

[#390918] WEB SURVEY about Ruby Community — Intransition <transfire@...>

Did any one else get this survey request?

14 messages 2011/12/07

[#390976] Confusing results from string multiplication — Rob Marshall <robmarshall@...>

Hi,

19 messages 2011/12/08

[#391019] How can I do h["foo"] += "bar" if h["foo"] does not exist? — "Andrew S." <andrewinfosec@...>

Hi there,

13 messages 2011/12/09

[#391027] reading from file without end-of-lines — Janko Muzykant <umrzykus@...>

hi,

20 messages 2011/12/09
[#391028] Re: reading from file without end-of-lines — Gavin Sinclair <gsinclair@...> 2011/12/09

> i'm trying to read a few text values from single file:

[#391031] Re: reading from file without end-of-lines — Robert Klemme <shortcutter@...> 2011/12/09

On Fri, Dec 9, 2011 at 9:58 AM, Gavin Sinclair <gsinclair@gmail.com> wrote:

[#391042] Re: reading from file without end-of-lines — Gavin Sinclair <gsinclair@...> 2011/12/09

On Fri, Dec 9, 2011 at 8:18 PM, Robert Klemme

[#391135] I need advice on what to do next. — Nathan Kossaeth <system_freak_2004@...>

I am new to programming. I read the ebook "Learn to Program" by Chris

23 messages 2011/12/12

[#391216] perf optimization using profile results — Chuck Remes <cremes.devlist@...>

I need some help with optimizing a set of libraries that I use. They are ffi-rzmq, zmqmachine and rzmq_brokers (all up on github).

13 messages 2011/12/13
[#391218] Re: perf optimization using profile results — Chuck Remes <cremes.devlist@...> 2011/12/13

On Dec 13, 2011, at 9:57 AM, Chuck Remes wrote:

[#391234] Re: perf optimization using profile results — Charles Oliver Nutter <headius@...> 2011/12/14

A couple quick observations.

[#391238] Re: perf optimization using profile results — Chuck Remes <cremes.devlist@...> 2011/12/14

On Dec 13, 2011, at 7:03 PM, Charles Oliver Nutter wrote:

[#391324] ruby 1.9 threading performance goes non-linear — Joel VanderWerf <joelvanderwerf@...>

12 messages 2011/12/16
[#391325] Re: ruby 1.9 threading performance goes non-linear — Eric Wong <normalperson@...> 2011/12/16

Joel VanderWerf <joelvanderwerf@gmail.com> wrote:

[#391420] Accessing class instance variables from an instance? — "Shareef J." <shareef@...>

Hi there,

26 messages 2011/12/20
[#391454] Re: Accessing class instance variables from an instance? — Khat Harr <myphatproxy@...> 2011/12/21

Actually, now that I'm thinking about it the existing behavior sort of

[#391456] Re: Accessing class instance variables from an instance? — Josh Cheek <josh.cheek@...> 2011/12/21

On Tue, Dec 20, 2011 at 9:42 PM, Khat Harr <myphatproxy@hotmail.com> wrote:

[#391545] Kernel#exit raises an exception? — Khat Harr <myphatproxy@...>

While I was working on embedding an interpreter I wrote a function to

13 messages 2011/12/24

[#391618] rvmsh: An easy installer for RVM — Bryan Dunsmore <dunsmoreb@...>

I have recently begun work on a project called [rvmsh]

12 messages 2011/12/29

[#391783] Mailspam — Gunther Diemant <g.diemant@...>

Is there a way to stop this mailspam of Luca (Mail)?

12 messages 2011/12/29

[#391790] What’s the standard way of implementing #hash for value objects in Ruby? — Nikolai Weibull <now@...>

Hi!

23 messages 2011/12/29
[#391792] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Gunther Diemant <g.diemant@...> 2011/12/29

I think you can't access instance variables from a class method, so

[#391793] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Nikolai Weibull <now@...> 2011/12/29

On Thu, Dec 29, 2011 at 15:52, Gunther Diemant <g.diemant@gmx.net> wrote:

[#391811] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Robert Klemme <shortcutter@...> 2011/12/29

On Thu, Dec 29, 2011 at 4:06 PM, Nikolai Weibull <now@bitwi.se> wrote:

[#391812] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Nikolai Weibull <now@...> 2011/12/29

On Fri, Dec 30, 2011 at 00:26, Robert Klemme <shortcutter@googlemail.com> w=

[#391816] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Josh Cheek <josh.cheek@...> 2011/12/30

On Thu, Dec 29, 2011 at 5:47 PM, Nikolai Weibull <now@bitwi.se> wrote:

[#391833] Re: What’s the standard way of implementing #hash for value objects in Ruby? — Robert Klemme <shortcutter@...> 2011/12/30

On Fri, Dec 30, 2011 at 12:47 AM, Nikolai Weibull <now@bitwi.se> wrote:

Re: Learn To Program (Chris Pine) - Building and Sorting Array

From: Alexander McMillan <alexandermcmillan@...>
Date: 2011-12-11 10:48:25 UTC
List: ruby-talk #391109
It is one thing reading Chris Pines book and then jumping into rails but=2C=
 Christ Pines book is dated=2C also it only deals with "a little" Ruby. Bef=
ore learning Rails I would suggest you first learn how to create the "page"=
=2C widgets and so on. You should try the gem RXRuby to learn to create pas=
sword boxes etc. RXRuby may have come with your Ruby installation.Why I say=
 you should learn how to create "page" and widgets is simple=2C you will ha=
ve to do this with Rails.The "page" is basically pages that appear on the s=
creen=2C these could be graphics=2C or form type pages.There are a few begi=
nners Ruby lessons on oldkingjames.org that may help you with your Ruby as =
these are for complete beginners to programming itself.

> Date: Sat=2C 10 Dec 2011 08:02:02 +0900
> From: emekapatrick@gmail.com
> Subject: Re: Learn To Program (Chris Pine) - Building and Sorting Array
> To: ruby-talk@ruby-lang.org
>=20
> Hi John=2C
>=20
> Thanks so much for getting back to me and for your kind words. Really=20
> big encouragement for someone just starting out and feeling a wee bit=20
> lost at times. As well=2C I must say the willingness of people in the Rub=
y=20
> community to offer help has really been pretty amazing.
>=20
> John W Higgins wrote in post #1036028:
> > Good Day Emeka=2C
> >
> > On Fri=2C Dec 9=2C 2011 at 12:47 PM=2C Emeka Patrick
> > <emekapatrick@gmail.com>wrote:
> >
> >> Hi Robert=2C
> >>
> >> Thanks so much for getting back to me on this much appreciated. Some
> >> questions in-line below.
> >>
> >
> > Thank you for at least attempting to figure things out. Very refreshing
> > in
> > contrast to some of the questions that people pose here........
>=20
> Thanks a bunch. Want to make sure I truly understand how and why things=20
> work when they do (or when they don't!)
>=20
> >> >
> >> >> '. Basically=2C I don't think I get what I'm making response equal =
to=2C is
> >> >> it an empty string=2C or?
> >> >
> >> > !=3D and =3D=3D are tests and not assignments.  If you exchange =3D=
=3D for !=3D
> >> > you also need to exchange branches of the if else end construct.
> >>
> >> So basically with !=3D and =3D=3D I'm asking if what precedes the expr=
ession
> >> is either "different from"  or "the same as" whatever follows. Am I
> >> correct?
> >>
> >
> > That would be correct.
> >
>=20
> Great!
>=20
> >
> >> Also=2C I still don't think I fully understand the empty string. In th=
e
> >> two lines of code...
> >>
> >> if response !=3D ''
> >> responses.push response
> >>
> >> ...am I doing something like "Is what was entered for the variable
> >> response different from an empty string? If so then push whatever stri=
ng
> >> is entered to the end of the responses array."
> >>
> >
> > That would also be correct. One other small item=2C normally code is
> > indented
> > (Ruby standard is 2 spaces) another level inside a control statement
> > (if/while/else and such) to make it slightly easier to read the code.
>=20
> I've been trying to do this as well as line up certain elements of code=
=2C=20
> but keep slipping in my enthusiasm to get it all out there. Def. need to=
=20
> try harder to keep it up. What about using Tab to indent=2C is there  any=
=20
> reason that might be frowned upon? Btw=2C I'm using TextMate.
>=20
> >
> > Taking your earlier work
> >
> > if response !=3D ''
> >   responses.push response
> > else
> >   puts responses.sort
> >   break
> > end
> >
> >
> > It seemed to me that the logical way to enter this code would be
> >>
> >> responses =3D []
> >> response =3D gets.chomp
> >>
> >> while response !=3D ''
> >>   responses.push response
> >> end
> >>
> >> puts responses.sort
> >>
> >
> > Actually very close here. Your problem is that you end up in an endless
> > loop because you never get another entry from the user.
> >
> > This should do the trick
> >
> > responses =3D []
> > response =3D gets.chomp
> >
> > while response !=3D ''
> >   responses.push response
> >   response =3D gets.chomp # get another line from the user
> > end
> >
> > puts responses.sort
> >
>=20
> Oh wow=2C ok=2C I think I get it. This is super clean too. Much nicer tha=
n=20
> what I originally had. Now=2C one last question=2C I need response =3D=20
> gets.chomp in the first instance just to define what the variable stands=
=20
> for=2C correct? It's not actually until the second instance where I'm=20
> soliciting input from the user=2C or actually is it more so the first=20
> instance both defines the variable and solicits  input from the user=20
> while the second instance solicits input in a continuous loop until it=20
> gets broken=2C i.e. when a user enters an empty string?
>=20
> > But very very close for someone just picking up programming. You appear
> > to
> > at least grasp the basic mechanics of working through a problem!
> >
> > Best of luck to you!
> >
> > John
>=20
> Thanks again John=2C super helpful! Almost done with chapter 9=2C "Writin=
g=20
> Your Own Methods". Only 100 pages to go!
>=20
> On another note=2C do you have any recommendations for Ruby resources=20
> and/or a path to take towards Ruby On Rails? I'm planning on finishing=20
> Learning to Program=2C doing the  Rails for Zombies courses=2C then divin=
g=20
> into Michael Hartl's tutorial for Rails 2.3 and then reading Agile=20
> Development with Rails 3rd edition. Thoughts? Btw=2C I'm learning 2.3 as =
a=20
> site I had built was in 2.3.8 and I figure I should learn that first and=
=20
> then later learn 3 / 3.1.
>=20
> Thanks=2C
>=20
> Emeka
>=20
> --=20
> Posted via http://www.ruby-forum.com/.
>=20
 		 	   		  =

In This Thread

Prev Next