Forum: Ruby New to Ruby, making a program from a disabled friend

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Hank Q. (Guest)
on 2009-04-29 05:14
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?
7stud -. (Guest)
on 2009-04-29 07:27
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:
> 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?

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.
Robert H. (Guest)
on 2009-04-29 15:46
> 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.

http://sourceforge.net/projects/htop
marc (Guest)
on 2009-04-29 15:53
(Received via mailing list)
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.
>
> http://sourceforge.net/projects/htop

+1 on htop. Folk shoud take a look.
Joel VanderWerf (Guest)
on 2009-04-29 22:21
(Received via mailing list)
marc wrote:
> Marc H. said:
>> http://sourceforge.net/projects/htop
>
> +1 on htop. Folk shoud take a look.

Thank you. Very nice!

If only it were written with ruby/ncurses.
Albert S. (Guest)
on 2009-04-30 07:41
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.)
Harry K. (Guest)
on 2009-04-30 10:00
(Received via mailing list)
On Wed, Apr 29, 2009 at 10:14 AM, Hank Q. <removed_email_address@domain.invalid>
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 <blink>ABC</blink>

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
Axel E. (Guest)
on 2009-04-30 13:51
(Received via mailing list)
Dear Hank,

you could also consider to use a Braille display
(http://en.wikipedia.org/wiki/Refreshable_Braille_d...., 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 :)

Best regards,

Axel
7stud -. (Guest)
on 2009-04-30 14:39
Harry K. wrote:
> On Wed, Apr 29, 2009 at 10:14 AM, Hank Q. <removed_email_address@domain.invalid>
> 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 <blink>ABC</blink>
>
> 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:

<html>
<head>
<title></title>

<style type="text/css">
  #blinker {
    text-decoration: blink;
    background-color: black;
    color: white;
    font-size: 5em;
}
  body {
    background-color: black;
}
</style>

</head>
<body>


<div id="blinker">Hello friend</div>


</body>
</html>

The op can change the colors or the size of the text as well as the
background color of the blinker and body.
7stud -. (Guest)
on 2009-04-30 14:44
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.
Martin DeMello (Guest)
on 2009-04-30 23:35
(Received via mailing list)
On Thu, Apr 30, 2009 at 4:14 PM, 7stud -- <removed_email_address@domain.invalid>
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
Lee G. (Guest)
on 2009-04-30 23:52
(Received via mailing list)
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
Reid T. (Guest)
on 2009-05-01 00:13
(Received via mailing list)
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.
Hank Q. (Guest)
on 2009-05-01 01:00
> 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.
7stud -. (Guest)
on 2009-05-01 02:40
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.
This topic is locked and can not be replied to.