New to Ruby, making a program from a disabled friend

Hi. I am only learning Ruby to help my friend out, and am completely new
to programming. I am trying to make a program that can take in text and
then blink it out using the moniter screen (like say, switching from
black to white). I’ve found some references here on how to convert
letters into morse code, that I can use to learn:
http://www.ruby-forum.com/topic/105552#new

But how would I make the graphical component work?

Anyone who can help, thank you so much in advance.

I am also considering trying to do this with something else, any other
programming languages that are quick to learn I can accomplish this
with? I kept trying to think of way to possibly do it with flash?

Hank Q. wrote:

Hi. I am only learning Ruby to help my friend out, and am completely new
to programming. I am trying to make a program that can take in text and
then blink it out using the moniter screen (like say, switching from
black to white). I’ve found some references here on how to convert
letters into morse code, that I can use to learn:
Morse Code (#121) - Ruby - Ruby-Forum

But how would I make the graphical component work?

Anyone who can help, thank you so much in advance.

I am also considering trying to do this with something else, any other
programming languages that are quick to learn I can accomplish this
with? I kept trying to think of way to possibly do it with flash?

Something called “curses” (or “ncurses”) can be used to control the
color of text on a monitor. However, it’s called “curses” for a reason.
In my opinion, it’s waste of time to spend any time learning curses.
Rather, you should spend your time learning gui programming, which is a
subject dealing with how to create your own windows and fill them with
text or images or forms to query the user for information. With gui
programming it is much easier to manipulate text color, etc. However,
gui programming is generally an advanced topic in any language, so you
would need to learn the language of your choice pretty well, then learn
gui programming in that language. So maybe learning a little ruby and
then trying to accomplish what you want with curses would take less
time.

In my opinion, it’s waste of time to spend any time learning curses.

The problem is that the ncurses Interface sucks.
But you can create great programs with ncurses.

Marc H. said:

In my opinion, it’s waste of time to spend any time learning curses.

The problem is that the ncurses Interface sucks. But you can create
great programs with ncurses.

htop download | SourceForge.net

+1 on htop. Folk shoud take a look.

marc wrote:

Marc H. said:

htop download | SourceForge.net

+1 on htop. Folk shoud take a look.

Thank you. Very nice!

If only it were written with ruby/ncurses.

Hank Q. wrote:

I am trying to make a program that can take in text and
then blink it out using the moniter screen
[snip]

But how would I make the graphical component work?

You can use a GUI like Shoes. Then use huge font. It’s very easy to
program in Shoes. Google for “ruby shoes” to learn more about it.

But maybe there are other approaches. For example, if your friend can
hear, you can send the text to a program that “speaks”. There are
several such free programs (e.g. “espeak”).

(And as people suggested here, it’s not very wise to waste time with
curses.)

On Wed, Apr 29, 2009 at 10:14 AM, Hank Q. [email protected]
wrote:

I am also considering trying to do this with something else, any other
programming languages that are quick to learn I can accomplish this
with? I kept trying to think of way to possibly do it with flash?

Posted via http://www.ruby-forum.com/.

You could set up something very simply with no programming at all.
If you want quick and easy, …

Make an HTML file like this ABC

Keep the file open in your editor,
Open the file with your browser,
type in stuff in the editor,
save the file,
and then refresh the browser.

Or maybe you could write a Ruby program to do these things for you.
It is not very smooth but you can try it in a few seconds and maybe it
will give you some other ideas.

You may want to use more HTML to make the text bigger, or a different
color, for example.
Not all browsers work. Firefox seems to work OK.

Harry

Harry K. wrote:

On Wed, Apr 29, 2009 at 10:14 AM, Hank Q. [email protected]
wrote:

I am also considering trying to do this with something else, any other
programming languages that are quick to learn I can accomplish this
with? I kept trying to think of way to possibly do it with flash?

Posted via http://www.ruby-forum.com/.

You could set up something very simply with no programming at all.
If you want quick and easy, …

Make an HTML file like this ABC

Keep the file open in your editor,
Open the file with your browser,
type in stuff in the editor,
save the file,
and then refresh the browser.

Or maybe you could write a Ruby program to do these things for you.
It is not very smooth but you can try it in a few seconds and maybe it
will give you some other ideas.

You may want to use more HTML to make the text bigger, or a different
color, for example.
Not all browsers work. Firefox seems to work OK.

Harry

Nice idea. It doesn’t work in mac/safari with the tag the css style
text-decoration:blink, but it does work with mac/firefox(with latest
version 3.0.10)

Here is a version that uses large, white, blinking text on a black
background:

#blinker { text-decoration: blink; background-color: black; color: white; font-size: 5em; } body { background-color: black; }
Hello friend

The op can change the colors or the size of the text as well as the
background color of the blinker and body.

7stud – wrote:

It doesn’t work in mac/safari with the tag the css style
text-decoration:blink

That should read:

It doesn’t work in mac/safari with the tag or the css style
text-decoration:blink.

I read something that says only Opera and Mozilla browsers support it
blinking text, which means it won’t work in Internet Explorer.
Apparently, it was such an annoying feature most browsers dropped it.

On Thu, Apr 30, 2009 at 4:14 PM, 7stud – [email protected]
wrote:

7stud – wrote:

It doesn’t work in mac/safari with the tag the css style
text-decoration:blink

That should read:

It doesn’t work in mac/safari with the tag or the css style
text-decoration:blink.

I don’t think that’s what the OP meant by blinking the text - note the
reference to morse code. I think he meant flashing the screen in dots
and dashes

martin

Dear Hank,

you could also consider to use a Braille display
(Refreshable braille display - Wikipedia)(i.e., a USB
device
which displays a line of text in the tactile writing system for
visually impaired people.)
I’ve seen people use this kind of device in the university library
next to my home town, where there is a school for visually impaired
people.

That’s not a Ruby solution, but you might find Ruby useful for other
things in the future :slight_smile:

Best regards,

Axel

On Fri, 2009-05-01 at 04:51 +0900, Lee G. wrote:

Hi. I am only learning Ruby to help my friend out, and am completely
new
to programming. I am trying to make a program that can take in text
and
then blink it out using the moniter screen (like say, switching from
black to white).

Please give a little more explanation to what ‘blink it out’ means
exactly.

You might want to look into http://processing.org, which is about as
easy
and powerful as you can hope for when it comes to graphical programming.
And there is a ruby version of processing, as well.

Good luck,
Lee

Hank Q. wrote:

Thanks to everyone that has answered so far! I’m in college right now,

Everyone should learn one programming language. Yet, I know when you’re
in school you don’t spend what little free time you have studying
extracurricular subjects. So take a programming class.

Please give a little more explanation to what ‘blink it out’ means
exactly.

Like how morse code is usually heard in sound blips consisting of
shorter blips and longer blips. Like the letter C in morse code is -.-.

I mean the same, but visually, possibly using black and white. Like a
shorter blip could be let’s say .25 sec of white, a longer would be .6
sec of white. My friend has difficulty with ears, eyes, and hands
(otherwise, we could use braille), so I thought of this idea.

Thanks to everyone that has answered so far! I’m in college right now,
so I won’t be able to try these things out until the weekend, but I’m
really happy this message has gotten so many replies. I’ve considered a
braille display, but they are supposedly very expensive, but I will
reconsider it and be on the lookout for it in libraries or universities.