[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Newbie help, please

Peter Zotov

4/26/2009 8:03:00 PM

Mike West wrote:
> Hello all,
>
> I am a complete novice to programming. I have chosen Ruby as my first
> language.
>
> I am attempting to follow some tutorials in a book I have. However, I am
> running into some errors, and can not figure out why. Can you please
> guide me?

You cannot simply add strings and numbers together; you must convert
number to string first.

Try this code:

puts (2+4).to_s + ' is the sum of 2+4.'

and

puts 'Hello, what is your favorite number?'
number = gets.chomp
better = number.to_i+1
puts number.to_s + '?? Don\t you know that ' + better.to_s + 'is a superior
selection?'

But the right way to do this is to use expression inlining, such as there:

puts "#{2+4} is the sum of 2+4."

or

puts "#{number}?? Don\t you know that #{better} is a superior
selection?"

It does .to_s implicitly. Notice the double quotes, it won't work with single.

WBR, Peter Zotov

10 Answers

Nusrat, Rowayton, Connecticut

4/14/2011 11:04:00 PM

0

On Thu, 14 Apr 2011 10:28:02 -0400, P-Dub <pwolfe00@hotmail.com>
wrote:

>On 4/14/2011 2:06 AM, SHOES THROWER wrote:
>> On Mar 20, 6:55 pm, Aviroce<dudaras...@gmail.com> wrote:
>>> IS GROUND ZERO CONDEMNED?
>>> By Aviroce
>>>
>>> ?At ground zero, the future finally appears?(http://news.ya...
>>> ap/us_attacks_redevelopment) is diabolical in its assumptions.
>>> Although we would like to think that new buildings will be built
>>> blessed by multi-faith and multi-ethnic surrounding structures, one
>>> would wonder whether or not this site is condemned. Keep in mind
>>> that Al-Qaeda tried to destroy the site several times until it
>>> destroyed it with one binladination (fantastic, dramatic, glamorous,
>>> superhumanly act of destruction.) The land is contaminated by
>>> atrocious savages, Jews, as the world community recognizes them
>>> except perhaps among Jews and USA government officials. May be the
>>> story would go that ?What Bin Laden destroys cannot be rebuilt to
>>> stand or if rebuilt will be destroyed again.? Time will tell.
>>> Aviroce
>>
>> The Hebrew state will die out
>
>The world will destroy Islam in the long run. Islam cannot survive
>against being exposed as the fraud that it is.
>
>And every day, Islam is exposed more.
>
>Ground Zero will rise, and New York will continue to prosper.
>
>But Muslims in Islamic countries will continue to suffer and starve in
>hell and filth - until the day they overthrow their disgusting regimes.
>
>P-Dub: The truth is here: www.thereligionofpeace.com . Muslims - don't
>be afraid. Click it.

I think it is foolish to wait for Islam to die off on its own. I have
always maintained a Pig Poop attack on Mecca would cause a hasty
death to child molester Mohammad's perversion.

Aviroce

4/14/2011 11:50:00 PM

0

It sure will.



On Apr 13, 11:06 pm, SHOES THROWER <blondes_gaulloi...@yahoo.com>
wrote:
> On Mar 20, 6:55 pm, Aviroce <dudaras...@gmail.com> wrote:
>
>
>
>
>
> > IS GROUND ZERO CONDEMNED?
> > By Aviroce
>
> > “At ground zero, the future finally appears”(http://news.ya...
> > ap/us_attacks_redevelopment) is diabolical in its assumptions.
> > Although we would like to think that new buildings will be built
> > blessed by multi-faith and multi-ethnic surrounding structures, one
> > would wonder whether or not this site is condemned.   Keep in mind
> > that Al-Qaeda tried to destroy the site several times until it
> > destroyed it with one binladination (fantastic, dramatic, glamorous,
> > superhumanly act of destruction.)  The land is contaminated by
> > atrocious savages,  Jews, as the world community recognizes them
> > except perhaps among Jews and USA government officials.  May be the
> > story would go that “What Bin Laden destroys cannot be rebuilt to
> > stand or if rebuilt will be destroyed again.”   Time will tell.
> > Aviroce
>
> The Hebrew state will die out- Hide quoted text -
>
> - Show quoted text -

Aviroce

4/14/2011 11:54:00 PM

0

No nation on earth that led the human race ever stayed doing the
same. No one thought Rome will weaken. By the end of the Roman
Empire, Ceasarship was for sale to highest bidder. Some ceasars were
not Romans. Muslims advanced civilization for about eight hundred
years. USA is less than two hundred and fifty years and it has been
leading mankind for about sixty years.



On Apr 14, 7:28 am, P-Dub <pwolf...@hotmail.com> wrote:
> On 4/14/2011 2:06 AM, SHOES THROWER wrote:
>
>
>
>
>
> > On Mar 20, 6:55 pm, Aviroce<dudaras...@gmail.com>  wrote:
> >> IS GROUND ZERO CONDEMNED?
> >> By Aviroce
>
> >> “At ground zero, the future finally appears”(http://news.ya...
> >> ap/us_attacks_redevelopment) is diabolical in its assumptions.
> >> Although we would like to think that new buildings will be built
> >> blessed by multi-faith and multi-ethnic surrounding structures, one
> >> would wonder whether or not this site is condemned.   Keep in mind
> >> that Al-Qaeda tried to destroy the site several times until it
> >> destroyed it with one binladination (fantastic, dramatic, glamorous,
> >> superhumanly act of destruction.)  The land is contaminated by
> >> atrocious savages,  Jews, as the world community recognizes them
> >> except perhaps among Jews and USA government officials.  May be the
> >> story would go that “What Bin Laden destroys cannot be rebuilt to
> >> stand or if rebuilt will be destroyed again.”   Time will tell.
> >> Aviroce
>
> > The Hebrew state will die out
>
> The world will destroy Islam in the long run. Islam cannot survive
> against being exposed as the fraud that it is.
>
> And every day, Islam is exposed more.
>
> Ground Zero will rise, and New York will continue to prosper.
>
> But Muslims in Islamic countries will continue to suffer and starve in
> hell and filth - until the day they overthrow their disgusting regimes.
>
> P-Dub: The truth is here:www.thereligionofpeace.com. Muslims - don't
> be afraid. Click it.- Hide quoted text -
>
> - Show quoted text -

Aviroce

4/14/2011 11:57:00 PM

0

There is a story about a Jew making a dump within sight of the Prophet
Mohammed. One day this stopped. The Prophet Mohammed sent his men
after him to find out why he stopped his open dump.
Feces and sewage are the main themes of interest of Jews. They get
high on hydrogen sulfide.


On Apr 14, 4:04 pm, "Nusrat, Rowayton, Connecticut"
<rizvi...@optonline.net> wrote:
> On Thu, 14 Apr 2011 10:28:02 -0400, P-Dub <pwolf...@hotmail.com>
> wrote:
>
>
>
>
>
> >On 4/14/2011 2:06 AM, SHOES THROWER wrote:
> >> On Mar 20, 6:55 pm, Aviroce<dudaras...@gmail.com>  wrote:
> >>> IS GROUND ZERO CONDEMNED?
> >>> By Aviroce
>
> >>> “At ground zero, the future finally appears”(http://news.ya...
> >>> ap/us_attacks_redevelopment) is diabolical in its assumptions.
> >>> Although we would like to think that new buildings will be built
> >>> blessed by multi-faith and multi-ethnic surrounding structures, one
> >>> would wonder whether or not this site is condemned.   Keep in mind
> >>> that Al-Qaeda tried to destroy the site several times until it
> >>> destroyed it with one binladination (fantastic, dramatic, glamorous,
> >>> superhumanly act of destruction.)  The land is contaminated by
> >>> atrocious savages,  Jews, as the world community recognizes them
> >>> except perhaps among Jews and USA government officials.  May be the
> >>> story would go that “What Bin Laden destroys cannot be rebuilt to
> >>> stand or if rebuilt will be destroyed again.”   Time will tell.
> >>> Aviroce
>
> >> The Hebrew state will die out
>
> >The world will destroy Islam in the long run. Islam cannot survive
> >against being exposed as the fraud that it is.
>
> >And every day, Islam is exposed more.
>
> >Ground Zero will rise, and New York will continue to prosper.
>
> >But Muslims in Islamic countries will continue to suffer and starve in
> >hell and filth - until the day they overthrow their disgusting regimes.
>
> >P-Dub: The truth is here:www.thereligionofpeace.com. Muslims - don't
> >be afraid. Click it.
>
> I think it is foolish to wait for Islam to die off on its own. I have
> always maintained a Pig Poop attack on Mecca would cause a hasty
> death to child molester Mohammad's perversion.- Hide quoted text -
>
> - Show quoted text -

P-Dub

4/15/2011 5:00:00 PM

0

On 4/14/2011 7:57 PM, Aviroce wrote:
> There is a story about a Jew making a dump within sight of the Prophet
> Mohammed. One day this stopped. The Prophet Mohammed sent his men

I think that all toilets should have a picture of the 'prophet' - along
with a copy of the Koran - at the bottom of the toilet bowl, so that we
can all shit on them.

I applaud all those who burn the Koran. I support all efforts to destroy
every copy of this disgusting garbage.


Nusrat, Rowayton, Connecticut

4/16/2011 11:14:00 AM

0

On Thu, 14 Apr 2011 16:54:17 -0700 (PDT), Aviroce
<dudaraster@gmail.com> wrote:

For you to make an idiotic assertion like Islam advanced since is even
more stupid than your usual nonsense all have come to expect from you.
As usual you offer no evidence or proof to support your grandiose
claims.
I reaffirm that in some instances Islam was forerunner in retarding
and even fighting the progress and advancement of science an honour
heretofore generally attributed only to followers of the Popes.



>No nation on earth that led the human race ever stayed doing the
>same. No one thought Rome will weaken. By the end of the Roman
>Empire, Ceasarship was for sale to highest bidder. Some ceasars were
>not Romans. Muslims advanced civilization for about eight hundred
>years. USA is less than two hundred and fifty years and it has been
>leading mankind for about sixty years.
>

Aviroce

4/17/2011 6:56:00 AM

0

In perspectivity, infinity is a short distance away.


On Apr 13, 11:06 pm, SHOES THROWER <blondes_gaulloi...@yahoo.com>
wrote:
> On Mar 20, 6:55 pm, Aviroce <dudaras...@gmail.com> wrote:
>
>
>
>
>
> > IS GROUND ZERO CONDEMNED?
> > By Aviroce
>
> > “At ground zero, the future finally appears”(http://news.ya...
> > ap/us_attacks_redevelopment) is diabolical in its assumptions.
> > Although we would like to think that new buildings will be built
> > blessed by multi-faith and multi-ethnic surrounding structures, one
> > would wonder whether or not this site is condemned.   Keep in mind
> > that Al-Qaeda tried to destroy the site several times until it
> > destroyed it with one binladination (fantastic, dramatic, glamorous,
> > superhumanly act of destruction.)  The land is contaminated by
> > atrocious savages,  Jews, as the world community recognizes them
> > except perhaps among Jews and USA government officials.  May be the
> > story would go that “What Bin Laden destroys cannot be rebuilt to
> > stand or if rebuilt will be destroyed again.”   Time will tell.
> > Aviroce
>
> The Hebrew state will die out- Hide quoted text -
>
> - Show quoted text -

Aviroce

4/17/2011 6:58:00 AM

0

Remember my CRESADE, Muslim Holy War. You can see Palestinians, Arabs
and Muslims are building up for the Cresade.



On Apr 14, 7:28 am, P-Dub <pwolf...@hotmail.com> wrote:
> On 4/14/2011 2:06 AM, SHOES THROWER wrote:
>
>
>
>
>
> > On Mar 20, 6:55 pm, Aviroce<dudaras...@gmail.com>  wrote:
> >> IS GROUND ZERO CONDEMNED?
> >> By Aviroce
>
> >> At ground zero, the future finally appears (http://news.ya...
> >> ap/us_attacks_redevelopment) is diabolical in its assumptions.
> >> Although we would like to think that new buildings will be built
> >> blessed by multi-faith and multi-ethnic surrounding structures, one
> >> would wonder whether or not this site is condemned.   Keep in mind
> >> that Al-Qaeda tried to destroy the site several times until it
> >> destroyed it with one binladination (fantastic, dramatic, glamorous,
> >> superhumanly act of destruction.)  The land is contaminated by
> >> atrocious savages,  Jews, as the world community recognizes them
> >> except perhaps among Jews and USA government officials.  May be the
> >> story would go that What Bin Laden destroys cannot be rebuilt to
> >> stand or if rebuilt will be destroyed again.   Time will tell.
> >> Aviroce
>
> > The Hebrew state will die out
>
> The world will destroy Islam in the long run. Islam cannot survive
> against being exposed as the fraud that it is.
>
> And every day, Islam is exposed more.
>
> Ground Zero will rise, and New York will continue to prosper.
>
> But Muslims in Islamic countries will continue to suffer and starve in
> hell and filth - until the day they overthrow their disgusting regimes.
>
> P-Dub: The truth is here:www.thereligionofpeace.com. Muslims - don't
> be afraid. Click it.- Hide quoted text -
>
> - Show quoted text -

Aviroce

4/17/2011 7:00:00 AM

0

I remember that from before. If you remember too, I mentioned that
Saudi Arabia is getting such poop as is dominated by USA and Israel.
Now Saudi Arabia is thinking twice about your poop. It wants to shift
its interests towards China and India. How about them apples?


On Apr 14, 4:04 pm, "Nusrat, Rowayton, Connecticut"
<rizvi...@optonline.net> wrote:
> On Thu, 14 Apr 2011 10:28:02 -0400, P-Dub <pwolf...@hotmail.com>
> wrote:
>
>
>
>
>
> >On 4/14/2011 2:06 AM, SHOES THROWER wrote:
> >> On Mar 20, 6:55 pm, Aviroce<dudaras...@gmail.com>  wrote:
> >>> IS GROUND ZERO CONDEMNED?
> >>> By Aviroce
>
> >>> “At ground zero, the future finally appears”(http://news.ya...
> >>> ap/us_attacks_redevelopment) is diabolical in its assumptions.
> >>> Although we would like to think that new buildings will be built
> >>> blessed by multi-faith and multi-ethnic surrounding structures, one
> >>> would wonder whether or not this site is condemned.   Keep in mind
> >>> that Al-Qaeda tried to destroy the site several times until it
> >>> destroyed it with one binladination (fantastic, dramatic, glamorous,
> >>> superhumanly act of destruction.)  The land is contaminated by
> >>> atrocious savages,  Jews, as the world community recognizes them
> >>> except perhaps among Jews and USA government officials.  May be the
> >>> story would go that “What Bin Laden destroys cannot be rebuilt to
> >>> stand or if rebuilt will be destroyed again.”   Time will tell.
> >>> Aviroce
>
> >> The Hebrew state will die out
>
> >The world will destroy Islam in the long run. Islam cannot survive
> >against being exposed as the fraud that it is.
>
> >And every day, Islam is exposed more.
>
> >Ground Zero will rise, and New York will continue to prosper.
>
> >But Muslims in Islamic countries will continue to suffer and starve in
> >hell and filth - until the day they overthrow their disgusting regimes.
>
> >P-Dub: The truth is here:www.thereligionofpeace.com. Muslims - don't
> >be afraid. Click it.
>
> I think it is foolish to wait for Islam to die off on its own. I have
> always maintained a Pig Poop attack on Mecca would cause a hasty
> death to child molester Mohammad's perversion.- Hide quoted text -
>
> - Show quoted text -

Aviroce

4/17/2011 7:03:00 AM

0

"Legacy of Islam" (1939) written by Oxford University professors.


On Apr 16, 4:14 am, "Nusrat, Rowayton, Connecticut"
<rizvi...@optonline.net> wrote:
> On Thu, 14 Apr 2011 16:54:17 -0700 (PDT), Aviroce
>
> <dudaras...@gmail.com> wrote:
>
> For you to make an idiotic assertion like Islam advanced since is even
> more stupid than your usual nonsense all have come to expect from you.
> As usual you offer no evidence or proof to support your grandiose
> claims.
> I reaffirm that in some instances Islam was forerunner in retarding
> and even fighting the progress and advancement of science an honour
> heretofore generally attributed only to followers of the Popes.
>
>
>
> >No nation on earth that led the human race ever stayed doing the
> >same.  No one thought Rome will weaken.  By the end of the Roman
> >Empire, Ceasarship was for sale to highest bidder.  Some ceasars were
> >not Romans.  Muslims advanced civilization for about eight hundred
> >years.  USA is less than two hundred and fifty years and it has been
> >leading mankind for about sixty years.- Hide quoted text -
>
> - Show quoted text -