Yohanes Santoso | 1 Sep 01:56 2004

Re: Two issues with webrick - both threading & OS related

Jamis Buck <jgb3 <at> email.byu.edu> writes:

> Perhaps it is something with 1.8.1?

No, it isn't. My ruby is 1.8.1, as shown in earlier posts.

Looks like this problem is person-specific (is there such a
thing?). Is your ruby on linux compiled from scratch or from your
distro? If it is from distro, which distro do you have? And *donning
flame suit* if your distro is redhat, try compiling ruby from source.

YS.

Florian Frank | 1 Sep 02:35 2004
Picon
Picon

Re: Problem with File::Tail (no new lines getting processed)

On 2004-09-01 06:08:57 +0900, Josh Endries wrote:
> having trouble tailing the file, though. When I start the program it 
> spits out the entire file (unless I have rewind in the open() call), 
> then sits there "tailing" but no new lines get displayed. Normal 
> `tail` works from the console... This is all on a FreeBSD 4.10 system.

I could confirm this behaviour on a local FreeBSD installation. I think
you found a bug: If EOFError occurs on FreeBSD the tailed file handle
is tagged with an error flag. So further reading isn't possible before
calling clearerr on it. Because I cannot do this directly from Ruby I
just used the seek method to clearerr as a side effect. This seemed
rather hackish to me: Perhaps it would be better to use a dedicated
method for this. Or should Ruby take care of clearing the handle after
an EOFError occurs, so users don't have to? I am not quite sure...

Could you try this hotfixed version?

http://www.ping.de/~flori/programs/ruby/file-tail/file-tail-0.1.1.tgz

--

-- 
lambda { |c| lambda { |f| f[f] } [ lambda { |f| c[lambda { |x| f[f][x] } ] }] }

Mark Probert | 1 Sep 02:40 2004

IOWA -- another newbie question


What is the best way of running an external script and returning the 
results from within IOWA?

I have been doing the 

   <at> output = %x(ruby my_script)

and getting nowhere (the "ruby my_script" works correctly from the command 
line).

I assume that I need to use a cgi-bin wrapper or similar?

--

-- 
-mark.  (probertm  <at>  acm dot org)

nobu.nokada | 1 Sep 03:34 2004
Picon
Picon

Re: Followup on HPUX build issue

Hi,

At Wed, 1 Sep 2004 05:55:10 +0900,
nesius wrote in [ruby-talk:111144]:
> The test is:
> $CC -o conftest $CFLAGS -lutil -E conftest.c
> 
> -E tells both gcc and ansic to dump the pre-processor output.
> gcc interprets -o as a directive to dump the output into conftest.
> /opt/ansic/bin/cc, when it sees -E, does not understand -o.
> it just dumps the output to stdout.   A better way to do this
> when using ansic is to use the '-P' directive, like so:
> $CC $CFLAGS -P conftest.c.  The preprocessor output will
> be put into conftest.i.

Thank you, I got it.  RUBY_CPPOUTFILE in configure.in seems not
to be working.

Try this patch with deleting config.cache file.


Index: configure.in
===================================================================
RCS file: /cvs/ruby/src/ruby/configure.in,v
retrieving revision 1.245
diff -u -2 -p -r1.245 configure.in
--- configure.in	30 Aug 2004 06:16:29 -0000	1.245
+++ configure.in	1 Sep 2004 01:31:31 -0000
 <at>  <at>  -23,4 +23,5  <at>  <at>  AC_DEFUN(RUBY_CPPOUTFILE,
 CPPFLAGS='-o conftest.i'
(Continue reading)

Jim Weirich | 1 Sep 03:45 2004

Re: Two issues with webrick - both threading & OS related

Jamis Buck wrote:
> For what it's worth, I took the script you posted and ran it on my linux 
> box, and it worked. I requested /sleep, and while it was sleeping I 
> requested /greet, and it sent me /greet right away.

Actually, that works on all the platforms I've tried.

What doesn't work (on some platforms) is requesting a /sleep while 
another /sleep is in progress.  The second sleep will block, waiting for 
the first.

--

-- 
-- Jim Weirich    jim <at> weirichhouse.org     http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

Josh Endries | 1 Sep 03:48 2004

Re: Problem with File::Tail (no new lines getting processed)

Florian Frank wrote:
> Could you try this hotfixed version?
> 
> http://www.ping.de/~flori/programs/ruby/file-tail/file-tail-0.1.1.tgz

This version works great (or, at least, as expected). I had a feeling it 
had something to do with FreeBSD. :)

Thanks,
Josh
Attachment (smime.p7s): application/x-pkcs7-signature, 4282 bytes
Kirk Haines | 1 Sep 03:55 2004

Re: IOWA -- another newbie question

On Wed, 1 Sep 2004 09:40:23 +0900, Mark Probert wrote
> What is the best way of running an external script and returning the 
> results from within IOWA?
> 
> I have been doing the
> 
>    <at> output = %x(ruby my_script)
> 
> and getting nowhere (the "ruby my_script" works correctly from the 
> command line).
> 
> I assume that I need to use a cgi-bin wrapper or similar?

There should be no difference between running an external script from within 
an IOWA app and any other Ruby program.

So, if %x(ruby my_script) is not working, my guess is that it is either 
because the PATH of the IOWA process doesn't have ruby in it, or my_script 
is not in the current working directory of the process.

Your safest bet is to explicitly specify the path to your ruby executable 
and the path to your script.

Something like this:

ruby = File::join(::Config::CONFIG['bindir'],
                  ::Config::CONFIG['ruby_install_name'])
ruby << ::Config::CONFIG['EXEEXT']
 <at> output = %x(#{ruby} /path/to/my_script)

(Continue reading)

Jim Weirich | 1 Sep 04:23 2004

Re: Two issues with webrick - both threading & OS related

Jim Weirich wrote:
> What doesn't work (on some platforms) is requesting a /sleep while 
> another /sleep is in progress.  The second sleep will block, waiting for 
> the first.

Odd ... Ryan and I tried this at work on several machines and the second 
request blocked until the first was done.  _One_ of those machines was 
my Linux laptop.

I just tried this at home on my desktop and laptop, and the second 
request is no longer blocking.  Perhaps there is some subtle difference 
in the code I'm using now (posted by Ryan a few messages back in this 
thread) and the code I used yesterday at work.

Or I'm going crazy.

(Or both, but I'm not considering that possibility yet).

--

-- 
-- Jim Weirich    jim <at> weirichhouse.org     http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

rdlugosz.1044583 | 1 Sep 04:34 2004

Re: Two issues with webrick - both threading & OS related

--- ruby-talk <at> ruby-lang.org wrote:
> Actually, that works on all the platforms
I've >tried.
> 
> What doesn't work (on some platforms) is >requesting a
/sleep while 
> another /sleep is in progress.  The second sleep >will block,
waiting for 
> the first.

Yes, requesting a different servlet (such as
/greet) while sleep is processing works fine on all platforms for me as well.
 And FWIW, the versions on one of the redhat boxes was compiled by hand, the
other from RPM.

The problem is that /sleep is blocking all other calls
to /sleep.  Jamis: could you try that?  Just make several requests to /sleep
pretty quickly - do each of your requests all end at about the same time,
or are their completions each ten seconds apart?

I agree that the problem
seems "person-specific", but between Jim, myself, and another guy there's
three people and probably 7 or 8 platforms showing the same results. 

The
behavior we're seeing is similar to what you would expect from a Java servlet
implementing SingleThreadModel (IIRC).

Thanks again to all who are helping
with this!
(Continue reading)

Hidetoshi NAGAI | 1 Sep 04:36 2004
Picon

Re: widget modifs after calls to Tk.mainloop

Hi, 

From: Nicolas Decoster <nicolas.decoster <at> noveltis.fr>
Subject: widget modifs after calls to Tk.mainloop
Date: Wed, 1 Sep 2004 00:00:56 +0900
Message-ID: <41349259.6080307 <at> noveltis.fr>
> Is it possible using Ruby/Tk to create widgets, then view and 
> interactivly interact with them, then change their behavior and view and 
> interact again with them. For example in Tcl/Tk shell (wish):
    (snip)
> Is there a similar command sequence for Ruby/Tk.

For example, 

$ /usr/local/bin/irb
irb(main):001:0> require 'tk'
irb(main):002:0> Thread.new{Tk.mainloop}
irb(main):003:0> v = 1
irb(main):004:0> b = TkButton.new(:command=>proc{puts v}).pack
irb(main):005:0> v = 2
irb(main):006:0> b.command{puts "#{v}#{v}"}

--

-- 
                                  Hidetoshi NAGAI (nagai <at> ai.kyutech.ac.jp)


Gmane