Running ruby

Have you actually read the responses to your questions?

For 1: Start -> Run -> command.com
For 2: Right click on title bar of command window, Properties, Colors tab.

*Both* of these questions have been answered. Multiple times.

···

-----Original Message-----
From: yahdoco [mailto:yahdoco@yahoo.com]
Sent: Thursday, September 06, 2007 5:25 PM
To: ruby-talk ML
Subject: Re: running ruby

(1)Is there another way to keep the window in
view until I enter an exit command?

(2) I still have the problem that the window consists of white
characters on a black background. Is there a ruby command to change
the window or create another window with features that I can control?

--
Phillip Gawlowski

Nobuyoshi Nakada wrote:

Hi,

At Wed, 5 Sep 2007 16:19:31 +0900,
Alex Young wrote in [ruby-talk:267699]:

I was thinking more along the lines of control codes. You can run "color 70" at the command prompt, and that'll invert the colours (documented here: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true\)
but I can't think how to do that from within a script running under that shell.

system("color 70")

And there's me thinking that wouldn't work because it would execute in a subshell... I guess I should try these things before writing them off :slight_smile:

···

--
Alex

Your questions have already been answered. Your problem
is that you don't know how to use the Windows console
(also known as a DOS box). You need to learn how to use
it before you attempt to learn to program in Ruby.

···

----------------------------------
Hi William...That's why I call myself a newbie. I don't know what I
don't know. Like many scientists, my method of solving problems is to
discover things by trial and error. Eventually, I will fill in the
gaps in my knowledge. If some nice guys out in ruby-land will help me,
that would be nice too. Thank you for your comments and have a nice
day! Yahdoco

> From: yahdoco [mailto:yahd...@yahoo.com]
> Sent: Thursday, September 06, 2007 5:25 PM
> To: ruby-talk ML
> Subject: Re: running ruby

> (1)Is there another way to keep the window in
> view until I enter an exit command?

> (2) I still have the problem that the window consists of white
> characters on a black background. Is there a ruby command to change
> the window or create another window with features that I can control?

Have you actually read the responses to your questions?

For 1: Start -> Run -> command.com
For 2: Right click on title bar of command window, Properties, Colors tab.

*Both* of these questions have been answered. Multiple times.

--
Phillip Gawlowski

···

On Sep 6, 11:45 am, Phil <cmdjackr...@googlemail.com> wrote:

> -----Original Message-----

Have you actually read the responses to your questions?
For 1: Start -> Run -> command.com
For 2: Right click on title bar of command window, Properties, Colors tab.
*Both* of these questions have been answered. Multiple times.
Phillip Gawlowski

···

----------------------------------
Hi Phillip...I have not ignored the messages sent here. Let me begin
by saying that I am using Windows98. It may have some limitations you
are not aware of. I have carried out the operations you are talikng
about. Here are the results:

enter "command.com"

c:\WINDOW\Desktop>
Right Click on Title Bar
(DIALOG BOX comes up)
MS-DOS Prompt Properties
TABS->|Program,Font,Memory,Screen,Misc|
There is no Colors Tab.
When I click on Screen, it shows the screen
I will get (white characters on a black
foreground). There is no button to control
color or reverse black and white.
I have gone to the Control Panel-->Display in MyComputer. It allows me
to control colors in many places, but not in this window. It looks
like I change what I would like to change. Thanks for trying to help
me.
----------------------------------
----------------------------------
My next plan is to try to transfer the data from the black-white
screen to a Notepad file called outzzz.txt. Perhaps someone can
correct my code below to make this happen. Here is the code:
.................................
#generate some simple output (comment)
puts "Hello World"

f = File.new("outzzz.txt", "w")
f.write("this is a test")

require 'open-uri'
require 'csv'

def get_adjusted_close stock_symbol
  puts "-- #{stock_symbol} Adjusted Close - Historical --"
  url = "http://ichart.finance.yahoo.com/table.csv?
s=#{stock_symbol}&d=7&e=1&f=2006&g=d&a=2&b=26&c=1990&ignore=.csv"
  puts "Connecting to #{url}\n"

  csv = CSV.parse(open(url).read)

  csv.each{|row|
    puts "#{row[0]} - #{row.last}"
}
  puts "---------------------------------"
end

example_stocks = "CSCO GOOG"
print "Enter a series of stock symbols separated by spaces (example:
#{example_stocks}) to retrieve the historical adjusted close.\n"
stock_symbols = gets
stock_symbols ||= example_stocks

stock_symbols.split.each{|symbol|
  get_adjusted_close(symbol)
  f.write(get_adjusted_close(symbol))
}

Thanks for your help. Yahdoco

Hi,

At Thu, 6 Sep 2007 16:53:26 +0900,
Alex Young wrote in [ruby-talk:267858]:

> system("color 70")
>
And there's me thinking that wouldn't work because it would execute in a
subshell... I guess I should try these things before writing them off :slight_smile:

I'd tried it on Windows XP Home. Since a console isn't a
per-process resource, it works regardless which process did it.

···

--
Nobu Nakada

yahdoco wrote:

Your questions have already been answered. Your problem
is that you don't know how to use the Windows console
(also known as a DOS box). You need to learn how to use
it before you attempt to learn to program in Ruby.

----------------------------------
Hi William...That's why I call myself a newbie. I don't know what I
don't know. Like many scientists, my method of solving problems is to
discover things by trial and error. Eventually, I will fill in the
gaps in my knowledge. If some nice guys out in ruby-land will help me,
that would be nice too. Thank you for your comments and have a nice
day! Yahdoco

1) Add a line saying "gets" to the end of your script.
2) Add a line saying "system '70'" to the start of your script.

···

--
Alex

DWARE.html

dummies - Learning Made Easy.
html

···

-----Original Message-----
From: yahdoco [mailto:yahdoco@yahoo.com]
Sent: Thursday, September 06, 2007 5:45 PM
To: ruby-talk ML
Subject: Re: running ruby

> Your questions have already been answered. Your problem
> is that you don't know how to use the Windows console
> (also known as a DOS box). You need to learn how to use
> it before you attempt to learn to program in Ruby.
----------------------------------
Hi William...That's why I call myself a newbie. I don't know what I
don't know. Like many scientists, my method of solving problems is to
discover things by trial and error. Eventually, I will fill in the
gaps in my knowledge. If some nice guys out in ruby-land will help me,
that would be nice too. Thank you for your comments and have a nice
day! Yahdoco

--
Phillip Gawlowski