From: Eric Armstrong on
Chad Perrin wrote:
> On Sat, Jul 29, 2006 at 08:07:10AM +0900, Eric Armstrong wrote:
>> So how would you implement a simple keyboard-controller
>> for threads on Windows?
>>
>> Or are my options restricted to full-blown GUI
>> or nothing at all?
>
> You could always just implement your own text-based captive interface,
> if that's what you really want.
>
Riiigghttt....

Given infinite time and energy, I could build everything
I ever wanted or needed, and then some.

I was kind of looking for a simple solution that "just
works" until I can get around to adding the GUI I
eventually plan to add anyway.

It sounds so seductively simple, too: "just implement
my own text-based captive interface". (What the heck
is that, anyway?)
:_)





From: Chad Perrin on
On Sat, Jul 29, 2006 at 08:42:58AM +0900, Eric Armstrong wrote:
> Chad Perrin wrote:
> >On Sat, Jul 29, 2006 at 08:07:10AM +0900, Eric Armstrong wrote:
> >>So how would you implement a simple keyboard-controller
> >>for threads on Windows?
> >>
> >>Or are my options restricted to full-blown GUI
> >>or nothing at all?
> >
> >You could always just implement your own text-based captive interface,
> >if that's what you really want.
> >
> Riiigghttt....
>
> Given infinite time and energy, I could build everything
> I ever wanted or needed, and then some.
>
> I was kind of looking for a simple solution that "just
> works" until I can get around to adding the GUI I
> eventually plan to add anyway.
>
> It sounds so seductively simple, too: "just implement
> my own text-based captive interface". (What the heck
> is that, anyway?)

What is what -- a captive interface? It's an interface that forces you
to do everything you want to do with a program without letting you do
other things between minor operations. For instance, a non-captive CLI
is something like apt-get on Debian GNU/Linux or ipconfig on Windows,
while a captive interface is something like an ncurses-based program
that starts, takes input, gives output, and doesn't go away until you're
all done with it.

--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
unix virus: If you're using a unixlike OS, please forward
this to 20 others and erase your system partition.

From: Sam Smoot on

Eric Armstrong wrote:

> Interesting. I suppose it could be considered a
> Curses bug, then.

My experience has been that IO is blocking in Ruby/Windows. Just try
creating a background thread to insert into an MSSQL server through
WIN32OLE+ADO. It's an exercise in futility. :-)

I even had a seperate process that exposed a ThreadQueue in the DRb
server for the client to push onto, but while the server was busy, the
client was blocked. _In a completely different process, only connected
through DRb!_

I can appreciate the general Ruby community attitude that OS-Threading
isn't absolutely vital when you're on Linux and have _fork_ at the
ready, but under Windows it's very painful and really limits the types
of applications you can build with Ruby (with a reasonable amount of
effort) IME.

From: Ezra Zygmuntowicz on

On Jul 28, 2006, at 4:42 PM, Eric Armstrong wrote:

> Chad Perrin wrote:
>> On Sat, Jul 29, 2006 at 08:07:10AM +0900, Eric Armstrong wrote:
>>> So how would you implement a simple keyboard-controller
>>> for threads on Windows?
>>>
>>> Or are my options restricted to full-blown GUI
>>> or nothing at all?
>> You could always just implement your own text-based captive
>> interface,
>> if that's what you really want.
> Riiigghttt....
>
> Given infinite time and energy, I could build everything
> I ever wanted or needed, and then some.
>
> I was kind of looking for a simple solution that "just
> works" until I can get around to adding the GUI I
> eventually plan to add anyway.
>
> It sounds so seductively simple, too: "just implement
> my own text-based captive interface". (What the heck
> is that, anyway?)
> :_)


Eric-

Have a look at the highline gem. Its a great library for console
based question and menu systems. And it works with threading.

-Ezra

From: Eric Armstrong on
Ezra Zygmuntowicz wrote:
>
> Have a look at the highline gem. Its a great library for console
> based question and menu systems. And it works with threading.
>
Could be a useful option. Thanks for the tip.
Found it's main page at
http://highline.rubyforge.org/

Is there a starter app anywhere? I see the APIs.
I'm guessing I do something like this:

ifc = HighLine.new
ifc.say "xyz"
response = ifc.ask "xyz"

But it would be nice to have a little scaffolding
to start from...