[16912] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4324 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 14 18:06:44 2000

Date: Thu, 14 Sep 2000 15:05:23 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <968969123-v9-i4324@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 14 Sep 2000     Volume: 9 Number: 4324

Today's topics:
        'Listen' option on sockets <r.schwebel@zeutec.de>
    Re: 'Listen' option on sockets <psbrady@my-deja.com>
    Re: 'Listen' option on sockets <uri@sysarch.com>
    Re: [Newbie]File::Find question nobull@mail.com
        ANNOUNCE: AI::NeuralNet::Mesh v0.44 <jdb@wcoil.com>
        ANNOUNCE: Finance::QuoteHist 0.21 Released <sisk@mojotoad.com>
        Assigning hash keys from lists <aqumsieh@hyperchip.com>
    Re: Assigning hash keys from lists <ren.maddox@tivoli.com>
    Re: Assigning hash keys from lists (Craig Berry)
        Beginner needs help!! <jedgar@mail.arc.nasa.gov>
    Re: Beginner needs help!! penpendisarapen@my-deja.com
    Re: Beginner needs help!! (Tony L. Svanstrom)
        BUG FIX: AI::NeuralNet::Mesh v0.43 <jdb@wcoil.com>
    Re: Building and traversing trees (Mark-Jason Dominus)
    Re: Building and traversing trees wrathmolten@my-deja.com
        can i run a cgi script within javascript tag? <klidge@mailbox.gr>
    Re: Can you do this with a Hash? nobull@mail.com
    Re: Can you do this with a Hash? (David Wall)
    Re: Can you do this with a Hash? rathmore@tierceron.com
    Re: Changing the filename for reporting compile errors <thomharp@flash.net>
    Re: Changing the filename for reporting compile errors (Richard J. Rauenzahn)
    Re: Character Class in Regex - Despecify What? (Mark-Jason Dominus)
    Re: copying only non-open files <davemci@nortelnetworks.com>
    Re: copying only non-open files nobull@mail.com
    Re: cross-platform archive mgt <davids@tttttdesertigloo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 13 Sep 2000 07:46:01 +0200
From: Robert Schwebel <r.schwebel@zeutec.de>
Subject: 'Listen' option on sockets
Message-Id: <39BF1499.3B3FB815@zeutec.de>

Hi!

I have a problem with a small server program. My server shall only serve
one single client, so if a second one tries to connect to the port he
has to get a 'connection denied'. After reading the 'IO::Socket::INET'
manpage my impression was that the 'Listen' option does what I need and
something like this should work:

$server = IO::Socket::INET->new( Proto     => 'tcp',
                                 LocalPort => $PORT,
                                 Listen    => 1, 
                                 Reuse     => 1);

Unfortunately, the second (and any further) one who tries to connect
just gets a connection that queues up until the first client
disconnects. 

Any idea what I could do? However, here you'll find my Here's my perl
configuration.

Robert

----------8<----------8<----------8<----------8<----------

spectator001:/home/zeutec/bin # perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.14, archname=i686-linux-thread
    uname='linux spectator001 2.2.14 #1 mon mar 13 10:51:48 gmt 2000
i686 unknown '
    config_args='-Dusethreads'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=define useithreads=undef
usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define 
    use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=2.95.2 19991024 (release)
    cppflags='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-D_REENTRANT -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_THREADS USE_LARGE_FILES
PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Sep  8 2000 13:58:40
  @INC:
    /usr/local/lib/perl5/5.6.0/i686-linux-thread
    /usr/local/lib/perl5/5.6.0
    /usr/local/lib/perl5/site_perl/5.6.0/i686-linux-thread
    /usr/local/lib/perl5/site_perl/5.6.0
    /usr/local/lib/perl5/site_perl
    .
spectator001:/home/zeutec/bin #
-- 
    _
   / \     _    Dipl.-Ing. Robert Schwebel        r.schwebel@zeutec.de
--/   \   / \/--------------------------------------------------------
       \_/      ZEUTEC Opto-Elektronik GmbH              www.zeutec.de
                Kieler Str. 211, 24786 Rendsburg, Germany
                Phone: +49-4331-136-653   Fax: +49-4331-136-651

+++ Neue Adresse! +++ New Address! +++ Neue Adresse! +++ New Address!
++++


------------------------------

Date: Thu, 14 Sep 2000 20:00:41 GMT
From: Paul Brady <psbrady@my-deja.com>
Subject: Re: 'Listen' option on sockets
Message-Id: <8praos$it8$1@nnrp1.deja.com>

In article <39BF1499.3B3FB815@zeutec.de>,
  r.schwebel@zeutec.de wrote:
> Hi!
>
> I have a problem with a small server program. My server shall only
serve
> one single client, so if a second one tries to connect to the port he
> has to get a 'connection denied'. After reading the 'IO::Socket::INET'
> manpage my impression was that the 'Listen' option does what I need
and
> something like this should work:
>
> $server = IO::Socket::INET->new( Proto     => 'tcp',
>                                  LocalPort => $PORT,
>                                  Listen    => 1,
>                                  Reuse     => 1);
>
> Unfortunately, the second (and any further) one who tries to connect
> just gets a connection that queues up until the first client
> disconnects.
>

Not sure how you would handle this at the server and, but you might try
setting a timeout on the client connection.

Paul.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 14 Sep 2000 20:31:41 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: 'Listen' option on sockets
Message-Id: <x7aedahg0j.fsf@home.sysarch.com>

>>>>> "RS" == Robert Schwebel <r.schwebel@zeutec.de> writes:

  RS> $server = IO::Socket::INET->new( Proto     => 'tcp',
  RS>                                  LocalPort => $PORT,
  RS>                                  Listen    => 1, 
  RS>                                  Reuse     => 1);

  RS> Unfortunately, the second (and any further) one who tries to connect
  RS> just gets a connection that queues up until the first client
  RS> disconnects. 

because the listen socket is still active, it will let connections get
started. until you accept them they are not fully connected.
even with a listen queue size of only 1, when you accept the first
connection, it clears up a slot in the queue which the next client will
use. a third client then will get a connection refused error.

the only sure way to allow only one connection is to close the listen
socket after you have accepted a single client. when the client is done
and that socket is closed, create a new listen socket which can then
allow a new client to try to connect.

  RS> Any idea what I could do? However, here you'll find my Here's my perl
  RS> configuration.

that is not useful here. 

<BIG snip>

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: 14 Sep 2000 19:28:35 +0100
From: nobull@mail.com
Subject: Re: [Newbie]File::Find question
Message-Id: <u98zsusu98.fsf@wcl-l.bham.ac.uk>

skbrown@vcd.hp.com (Steve K. Brown) writes:

> sub wanted{
  [snip]
>    chdir $vss;
> }

  [snip]

>    find(\&wanted, $i);

> I do know the Find does a chdir to the found directory.  This code finds the first two files and
> then gives the error:  Can't stat FILENAME: No such file or directory.
> 
> Why is it that I can not chdir to the orginal directory in between find calls?

Because File::Find makes the assumption that the wanted() is not
going to change the current directory.

This is not explicitly documented but is not what you'd call unexpected.

If you consider this behaviour not-intiative perhaps you should submit
a documentation patch.

> What changes do you suggest to make this code work better?

Remove the chdir() that's causing the error.  You may also want to
remove the other one as it's probably redundant.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 14 Sep 2000 21:01:57 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: ANNOUNCE: AI::NeuralNet::Mesh v0.44
Message-Id: <ss2fg9ejct624@corp.supernews.com>

Greetings Perlfolk,

Announcing the release of

    AI-NeuralNet-Mesh-0.44.zip

NOTE:  This is version 0.44, an bug fix release for the v0.43 of the module.
              This fixed a compatibilty issue that 0.43 had with Perl 5.3.3

Recomended download URL:
 http://www.josiah.countystart.com/modules/get.pl?mesh:announce


It has entered CPAN as
  file: $CPAN/authors/id/J/JB/JBRYAN/AI-NeuralNet-Mesh-0.44.zip
  size: 99886 bytes
   md5: 5d1c68c7d494da158ce50c263a7d77a1

** What is this?

AI::NeuralNet::Mesh is an optimized, accurate
neural network Mesh. It was designed with
accruacy and speed in mind.

This network model is very flexable. It will allow
for clasic binary operation or any range of integer
or floating-point inputs you care to provide. With
this you can change activation types on a per node or
per layer basis (you can even include your own anonymous
subs as activation types). You can add sigmoid transfer
functions and control the threshold. You can learn data
sets in batch, and load CSV data set files. You can do
almost anything you need to with this module. This code
is deigned to be flexable. Any new ideas for this module?
Contact Josiah Bryan at <jdb@wcoil.com>

As always, included is a cleaned, CSS-ed, HTML-format of the POD docs.

** What's new?

>From the POD:
This is version 0.44, an bug fix for the third release of the module.

This fixed a compatibilty issue that 0.43 had with Perl 5.3.3

With this version I have gone through and tuned up many area
of this module, including the descent algorithim in learn(),
as well as four custom activation functions, and several export
tag sets. With this release, I have also included a few
new and more practical example scripts. (See ex_wine.pl) This release
also includes a simple example of an ALN (Adaptive Logic Network) made
with this module. See ex_aln.pl. Also in this release is support for
loading data sets from simple CSV-like files. See the load_set() method
for details. This version also fixes a big bug that I never knew about
until writing some demos for this version - that is, when trying to use
more than one output node, the mesh would freeze in learning. But, that
is fixed now, and you can have as many outputs as you want (how does 3
inputs and 50 outputs sound? :-) Also in this release is output range
limiting via the range() activation function.

** What do you think?

Now I know you people are out there that are using the module...
I can hear the fists hitting the keyboards in frustration. :-) Relieve
some of that frustration by e-mailing me and letting me know what
you think of the module and any suggestions you got.

Use it, let me know what you all think. This is just a
groud-up write of a neural network, no code stolen or
anything else. Don't expect a classicist view of nerual
networking here. I simply wrote from operating theory,
not math theory. Any die-hard neural networking gurus out
there? Let me know how far off I am with
this code! :-)

Regards,

        ~ Josiah Bryan, <jdb@wcoil.com>

--
Josiah Bryan
jdb@wcoil.com
Tel: 937.316.6256








------------------------------

Date: Wed, 13 Sep 2000 14:09:48 -0500
From: Matt Sisk <sisk@mojotoad.com>
Subject: ANNOUNCE: Finance::QuoteHist 0.21 Released
Message-Id: <ss2ffp2mct656@corp.supernews.com>

A new version, 0.21 of the Finance::QuoteHist suite of modules, has been
released to the CPAN.

The big news: Dividends and Splits are now supported.

The more detailed news:

   - Splits and dividends added
   - Much faster queries, primarily due to taking
     advantage of Yahoo and CSV-formatted data,
     when available
   - Supports grabbing non-adjusted data, as well
     as notification when transitioning to a site
     that cannot provide non-adjusted data
   - Supports auto-adjusting of non-adjusted
     quotes for tables that include an adjusted
     column (like Yahoo in HTML mode)
   - Information pedigree support -- i.e., from
     which site did the quote/split/dividend data
     come for a particular ticker symbol

The new release can be found either on the CPAN:

   http://www.cpan.org/modules/by-authors/id/M/MS/MSISK/

Or, as always, back at the Toadstool:

   http://www.mojotoad.com/sisk/projects/Finance-QuoteHist


Enjoy,
Matthew Sisk
sisk@mojotoad.com




------------------------------

Date: Thu, 14 Sep 2000 19:02:03 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Assigning hash keys from lists
Message-Id: <7a8zsupzki.fsf@merlin.hyperchip.com>


This came up a couple of days ago.

We have strings of the form:

	key1.key2.key3.key4 = val1
	key1.key2.key5      = val2
etc ..

We would like to use all the keys on the left hand side of the equal
sign (separated by dots) as multiple keys of an anonymous hash with the
value appearing on the right of the equal sign:

	$hash->{key1}{key2}{key3}{key4} = val1;
	$hash->{key1}{key2}{key5}       = val2;

What is the "niftiest" way to do that?

We came up with something like:

	my $hash = {};

	for my $string (@strings) {
		my ($keys, $val) = split /\s*=\s*/ => $string;
		my @keys         = split /\./      => $keys;
		my $last         = pop   @keys;

		my $ref          = $hash;

		for my $key (@keys) {
			$ref->{$key} = {};
			$ref         = $ref->{$key};
		}

		$ref->{$last} = $val;
	}

This works fine, but strikes me as rather long. Anybody can come up with
something shorter and/or sweeter?

--Ala


------------------------------

Date: 14 Sep 2000 14:49:15 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Assigning hash keys from lists
Message-Id: <m3ya0uzrd0.fsf@dhcp11-177.support.tivoli.com>

Ala Qumsieh <aqumsieh@hyperchip.com> writes:

> This came up a couple of days ago.
> 
> We have strings of the form:
> 
> 	key1.key2.key3.key4 = val1
> 	key1.key2.key5      = val2
> etc ..
> 
> We would like to use all the keys on the left hand side of the equal
> sign (separated by dots) as multiple keys of an anonymous hash with the
> value appearing on the right of the equal sign:
> 
> 	$hash->{key1}{key2}{key3}{key4} = val1;
> 	$hash->{key1}{key2}{key5}       = val2;
> 
> What is the "niftiest" way to do that?

How 'bout this ugliness:

for (@strings) {
  s/\./}{/g;
  s/\s*=/}=/;
  eval '$hash->{'.$_;
}

-- 
Ren Maddox
ren@tivoli.com


------------------------------

Date: Thu, 14 Sep 2000 20:43:55 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Assigning hash keys from lists
Message-Id: <ss2e4b6hct611@corp.supernews.com>

Ala Qumsieh (aqumsieh@hyperchip.com) wrote:
: We have strings of the form:
: 
: 	key1.key2.key3.key4 = val1
: 	key1.key2.key5      = val2
: etc ..
: 
: We would like to use all the keys on the left hand side of the equal
: sign (separated by dots) as multiple keys of an anonymous hash with the
: value appearing on the right of the equal sign:
: 
: 	$hash->{key1}{key2}{key3}{key4} = val1;
: 	$hash->{key1}{key2}{key5}       = val2;
: 
: What is the "niftiest" way to do that?

Not sure about niftiest, but perhaps niftier:

#!/usr/bin/perl -w
# deephash - generate hash tree from string input (clpm demo)
# Craig Berry (20000914)

use strict;

my %hash;

while (<DATA>) {
  chomp;
  my $hr     = \%hash;
  my @pieces = split /\s*[.=]\s*/;
  $hr = ($hr->{shift @pieces} ||= {}) while @pieces > 2;
  $hr->{$pieces[-2]} = $pieces[-1];
}

print join(':', keys %hash), "\n";
print join(':', keys %{$hash{key1}{key2}}), "\n";
print "$hash{key1}{key2}{key5}\n";

__DATA__
key1.key2.key3.key4 = val1
key1.key2.key5      = val2
key6.key7           = val3

: This works fine, but strikes me as rather long. Anybody can come up with
: something shorter and/or sweeter?

Mine uses more or less the same algorithm as yours, but more compactly.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Every force evolves a form."
   |              - Shriekback


------------------------------

Date: Thu, 14 Sep 2000 11:39:32 -0700
From: "Joe Edgar" <jedgar@mail.arc.nasa.gov>
Subject: Beginner needs help!!
Message-Id: <8pr608$o3t$1@sun500.nas.nasa.gov>

I need to export data from a CGI script to an Ms-Excel spreadsheet.  The
PERL5 library I'm using does not have the Win32::OLE module so I'm trying
to save the data in a variable with a .csv extension.  However, I can't get
this to work correctly.  If I have the variable [$export_data = "Jim, 32
years old, married, yadayada";],  how do I go about attaching a .csv
extension to that value so it can be saved to someone's desktop - therefore
allowing the user to open the file themselves?  Also, is it possible to add
a module to a PERL library if I don't have root access to the server?
If anyone knows the answer or can point me in the direction of a good
reference for this sort of exporting, I would greatly appreciate it.

Thanks in advance!

--
----------------------------------
Joseph Edgar
Web Development Team





------------------------------

Date: Thu, 14 Sep 2000 19:34:34 GMT
From: penpendisarapen@my-deja.com
Subject: Re: Beginner needs help!!
Message-Id: <8pr989$gqm$1@nnrp1.deja.com>

In article <8pr608$o3t$1@sun500.nas.nasa.gov>,
  "Joe Edgar" <jedgar@mail.arc.nasa.gov> wrote:
> I need to export data from a CGI script to an Ms-Excel spreadsheet.
The
> PERL5 library I'm using does not have the Win32::OLE module so I'm
trying
> to save the data in a variable with a .csv extension.  However, I
can't get
> this to work correctly.  If I have the variable [$export_data = "Jim,
32
> years old, married, yadayada";],  how do I go about attaching a .csv
> extension to that value so it can be saved to someone's desktop -
therefore
> allowing the user to open the file themselves?  Also, is it possible
to add
> a module to a PERL library if I don't have root access to the server?
> If anyone knows the answer or can point me in the direction of a good
> reference for this sort of exporting, I would greatly appreciate it.
>
> Thanks in advance!
>
> --
> ----------------------------------
> Joseph Edgar
> Web Development Team
>
>

I'm not very experienced myself, but I've done some work creating .csv
files. I don't think you need to attach the ".csv" extension to the
value, you need to add ".csv" to the end of the filename. The .csv file
is just a plaintext file. As long as the file is downloaded as an ACII
file, the following should work fine:

open(CSV, ">myfile.csv");
print CSV $export_data . "\n";
close CSV;

--
BBQ
www.eaglescorner.com


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 14 Sep 2000 23:39:28 +0200
From: tony@svanstrom.com (Tony L. Svanstrom)
Subject: Re: Beginner needs help!!
Message-Id: <1egz2sy.ph3fekg2mne4N%tony@svanstrom.com>

Joe Edgar <jedgar@mail.arc.nasa.gov> wrote:

> I need to export data from a CGI script to an Ms-Excel spreadsheet.  The
> PERL5 library I'm using does not have the Win32::OLE module so I'm trying
> to save the data in a variable with a .csv extension.  However, I can't get
> this to work correctly.  If I have the variable [$export_data = "Jim, 32
> years old, married, yadayada";],  how do I go about attaching a .csv
> extension to that value so it can be saved to someone's desktop - therefore
> allowing the user to open the file themselves?

You use the correct header to tell the webbrowser what kind of data it
is that you're sending it (check the HTTP 1.1 spec).

> Also, is it possible to add a module to a PERL library if I don't have
                                            ^^^^
That's Perl, not PERL.

> root access to the server?

Yes, you can add modules yourself.

> If anyone knows the answer or can point me in the direction of a good
> reference for this sort of exporting, I would greatly appreciate it.

There came a lot of good stuff along with it when it was installed...


     /Tony
-- 
     /\___/\ Who would you like to read your messages today? /\___/\
     \_@ @_/  Protect your privacy:  <http://www.pgpi.com/>  \_@ @_/
 --oOO-(_)-OOo---------------------------------------------oOO-(_)-OOo--
   on the verge of frenzy - i think my mask of sanity is about to slip
 ---ôôô---ôôô-----------------------------------------------ôôô---ôôô---
    \O/   \O/  ©99-00 <http://www.svanstrom.com/?ref=news>  \O/   \O/


------------------------------

Date: 14 Sep 2000 21:07:14 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: BUG FIX: AI::NeuralNet::Mesh v0.43
Message-Id: <8prem2$70n$0@206.230.71.54>

Greetings Perlfolk,

Announcing the release of

    AI-NeuralNet-Mesh-0.44.zip

NOTE:  This is version 0.44, an bug fix release for the v0.43 of the module.
              This fixed a compatibilty issue that 0.43 had with Perl 5.3.3

Recomended download URL:
 http://www.josiah.countystart.com/modules/get.pl?mesh:misc


It has entered CPAN as
  file: $CPAN/authors/id/J/JB/JBRYAN/AI-NeuralNet-Mesh-0.44.zip
  size: 99886 bytes
   md5: 5d1c68c7d494da158ce50c263a7d77a1

** What is this?

AI::NeuralNet::Mesh is an optimized, accurate
neural network Mesh. It was designed with
accruacy and speed in mind.

This network model is very flexable. It will allow
for clasic binary operation or any range of integer
or floating-point inputs you care to provide. With
this you can change activation types on a per node or
per layer basis (you can even include your own anonymous
subs as activation types). You can add sigmoid transfer
functions and control the threshold. You can learn data
sets in batch, and load CSV data set files. You can do
almost anything you need to with this module. This code
is deigned to be flexable. Any new ideas for this module?
Contact Josiah Bryan at <jdb@wcoil.com>

As always, included is a cleaned, CSS-ed, HTML-format of the POD docs.

** What's new?

>From the POD:
This is version 0.44, an bug fix for the third release of the module.

This fixed a compatibilty issue that 0.43 had with Perl 5.3.3

With this version I have gone through and tuned up many area
of this module, including the descent algorithim in learn(),
as well as four custom activation functions, and several export
tag sets. With this release, I have also included a few
new and more practical example scripts. (See ex_wine.pl) This release
also includes a simple example of an ALN (Adaptive Logic Network) made
with this module. See ex_aln.pl. Also in this release is support for
loading data sets from simple CSV-like files. See the load_set() method
for details. This version also fixes a big bug that I never knew about
until writing some demos for this version - that is, when trying to use
more than one output node, the mesh would freeze in learning. But, that
is fixed now, and you can have as many outputs as you want (how does 3
inputs and 50 outputs sound? :-) Also in this release is output range
limiting via the range() activation function.

** What do you think?

Now I know you people are out there that are using the module...
I can hear the fists hitting the keyboards in frustration. :-) Relieve
some of that frustration by e-mailing me and letting me know what
you think of the module and any suggestions you got.

Use it, let me know what you all think. This is just a
groud-up write of a neural network, no code stolen or
anything else. Don't expect a classicist view of nerual
networking here. I simply wrote from operating theory,
not math theory. Any die-hard neural networking gurus out
there? Let me know how far off I am with
this code! :-)

Regards,

        ~ Josiah Bryan, <jdb@wcoil.com>

--
Josiah Bryan
jdb@wcoil.com
Tel: 937.316.6256









------------------------------

Date: Thu, 14 Sep 2000 20:22:55 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Building and traversing trees
Message-Id: <39c1339f.3e9f$129@news.op.net>

In article <968953127.21507.0.nnrp-07.9e98e5bc@news.demon.co.uk>,
Clyde Ingram <cingram-at-pjocs-dot-demon-dot-co-dot-uk> wrote:
>I want to build a tree representation of heirarchical address strings.
>For example, give the strings:
>
>/GB/BT/BBC/NEWS
>/GB/BT/BBC/SPORT
>/GB/BT/BBC/DRAMA
>/GB/BT/ITV
>/GB/BT/C4
>/US/ATT/ABC
>/US/ATT/NBC

# Build tree
my $top = {};
while (<>) {
  chomp;
  s{^/}{};   # Remove leading /
  my $position = $top;
  for my $field (split m{/}) {
    $position->{$field}= {} unless exists $position->{$field};
    $position = $position->{$field};
  }
}

# print tree
print_tree($top);

sub print_tree {
  my ($root, $nodename, $indentation) = @_;
  $indentation = 0 unless defined $indentation;
  $nodename = '<root>' unless defined $nodename;

  print(("\t" x $indentation), $nodename, "\n");

  while (my($subnodename, $subtree) = each %$root) {
    print_tree($subtree, $subnodename, $indentation+1);
  }
}




------------------------------

Date: Thu, 14 Sep 2000 20:47:37 GMT
From: wrathmolten@my-deja.com
Subject: Re: Building and traversing trees
Message-Id: <8prdh0$mci$1@nnrp1.deja.com>


> Can anyone point to Perl code snippets for building and traversing
trees?

There is a good discussion on Trees in TPJ ("The Perl Journal") in the
latest issue #18. I got it at the book store a few days ago. It focuses
on a game tree, but I think it is all good information and likely to be
of some help to you.

Rathmore


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 14 Sep 2000 23:55:09 +0300
From: "klidge" <klidge@mailbox.gr>
Subject: can i run a cgi script within javascript tag?
Message-Id: <8prduu$cn2$1@ulysses.noc.ntua.gr>

I would like to ask you if it's possible for a cgi script written in perl
to run from within a javascript script
example:
Html source:
<script language="javascript">
--the code i need here---
</script>
In order for the "result" after accessing the page would be the same as the
htm source was:
<script language="javascript">
document.write('this line has been generated from a cgi perl script');
</script>

thank you in advance




------------------------------

Date: 14 Sep 2000 20:44:36 +0100
From: nobull@mail.com
Subject: Re: Can you do this with a Hash?
Message-Id: <u94s3isqqj.fsf@wcl-l.bham.ac.uk>

rathmore@tierceron.com writes:

> My question is, can a hash have more than one value per key? 

No, but it can contain a reference to an array or hash. 

> If that is possible, I'm thinking the code would be fairly
> straight-forward, but I can't find any reference to hashes with more
> than one value per key.

perldoc perldsc

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: 14 Sep 2000 16:18:18 -0400
From: darkon@one.net (David Wall)
Subject: Re: Can you do this with a Hash?
Message-Id: <8FAFA136Adarkononenet@206.112.192.118>

rathmore@tierceron.com wrote in <8pqva5$45f$1@nnrp1.deja.com>:
>My question is, can a hash have more than one value per key? If that is
>possible, I'm thinking the code would be fairly straight-forward, but I
>can't find any reference to hashes with more than one value per key.
>Does that break the whole concept of a hash?
>
>Other ideas on what kind of data structure I might use?

You might look at perldsc, the data structures cookbook.  perlreftut and 
perlref could be helpful as well.

-- 
David Wall
darkon@one.net


------------------------------

Date: Thu, 14 Sep 2000 20:43:50 GMT
From: rathmore@tierceron.com
Subject: Re: Can you do this with a Hash?
Message-Id: <8prd9v$m1j$1@nnrp1.deja.com>

Brendon Caligari <bcaligari@my-deja.com> wrote:
> I found the book "Advanced Perl Programming" (O'Reilly)
> very helpful.

Purchased that book at lunch today. :)

> ----------
> my %hi	= (
> 	'earth'	=> ['big', 'blue'],
> 	'moon'	=> ['small', 'grey'],
> );
> foreach (keys(%hi))	{
> 	print("$_\t$hi{$_}[0]\t$hi{$_}[1]\n");
> }

I can't wait until I get this stuff so well that _I'm_ able to whip out
code at the drop of a hat!

Rathmore


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 14 Sep 2000 15:17:19 -0400
From: Thom Harp <thomharp@flash.net>
Subject: Re: Changing the filename for reporting compile errors
Message-Id: <39C1243F.BAADFB5B@flash.net>

I happened across the __WARN__ pseudo signal and it allowed be to do
exactly what I needed when used with a closure (I used the closure because
I proprocess alot of files with different names so I can't hard code the
names, and I don't like global data):

sub FilterWarning ($$) {
  my ($old_name, $new_name) = @_;
  return sub { my $string = shift; $string =~ s/$old_name/$new_name/g;
print STDERR $string }
}

$tmp = Prepeocess_File ($original);

$SIG{__WARN__} = FilterWarning ($tmp, $original);
do $code;
$SIG{__WARN__} = 'DEFAULT';

thanks...




------------------------------

Date: 14 Sep 2000 21:11:15 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: Changing the filename for reporting compile errors
Message-Id: <968965874.697212@hpvablab.cup.hp.com>

Thom Harp <thomharp@flash.net> writes:
>Specifically, I preprocess my script and write out the processed version
>to /tmp and then execute it with
>    do '/tmp/file.pl';

Just a warning -- are you aware of the UNIX security implications of
doing this?  (i.e., building a program off in /tmp and then running
it..)

There are many ways to minimize the risk, but I wanted to make sure
you're aware there are risks you may not be aware of!

Rich

-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


------------------------------

Date: Thu, 14 Sep 2000 19:32:22 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Character Class in Regex - Despecify What?
Message-Id: <39c127c5.3a83$179@news.op.net>


In article <8pqrvs$4vl$1@wanadoo.fr>,
Elisa Roselli <e.roselli@volusoft.com> wrote:
>I'm not sure I fully understand how $cue ever gets to be defined


>>          $cue = $_;

There.



------------------------------

Date: Thu, 14 Sep 2000 13:59:46 -0400
From: "Dave McIntyre" <davemci@nortelnetworks.com>
Subject: Re: copying only non-open files
Message-Id: <8pr3lb$csp$1@bcarh8ab.ca.nortel.com>


"Dave McIntyre" <davemci@nortelnetworks.com> wrote in message
news:8pqn99$3re$1@bcarh8ab.ca.nortel.com...
> We're trying to setup a cron job (SunOS) that copies and moves files via
> File::Copy.
>
> Problem is, we want to avoid the files that are active at the moment.
> Is flock the answer? I also considered using the file test operator -t ,
but
> I'm not
> sure what "Filehandle is opened to a tty" means.
>

In case anyone's curious, I decided to go with this simple solution, namely
skip the file if it's been touched in the last 60 seconds:

use File::Copy qw/cp mv/;
$path = "ROOS/upload/herb/";
$logfile = "mfcron.log";
$interval= 60;
open (LOG, ">>$logfile") or die "$!\n";
opendir(DIR, $path) or print LOG and die " Can't opendir: $!\n";
$now = time;
while ($file = readdir(DIR))
{
     $access = (stat("$path$file"))[9];
     $y=$now-$access;
     next if ($y < $interval);
     cp("$path$file", "${path}data/$file") or print LOG "Can't copy $file
$!\n";
     mv("$path$file", "${path}incoming/$file") or print LOG "Can't move
$file $!\n";
}
closedir (DIR);




------------------------------

Date: 14 Sep 2000 19:35:13 +0100
From: nobull@mail.com
Subject: Re: copying only non-open files
Message-Id: <u97l8esty6.fsf@wcl-l.bham.ac.uk>

"Dave McIntyre" <davemci@nortelnetworks.com> writes:

> Problem is, we want to avoid the files that are active at the moment.
> Is flock the answer?

Not unless you can get everyone else who is using the files to co-operate.

This is a fundamentally Unix question not related to Perl.

> I also considered using the file test operator -t 

Don't.

> I'm not sure what "Filehandle is opened to a tty" means.

It means that for example that -t STDOUT is true if the output of your
script is going directly to a terminal and has not been directed to a
pipe or file.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\
<


------------------------------

Date: Thu, 14 Sep 2000 13:25:02 -0700
From: "David P. Schwartz" <davids@tttttdesertigloo.com>
Subject: Re: cross-platform archive mgt
Message-Id: <39C1341E.22493DE4@tttttdesertigloo.com>

Martien Verbruggen wrote:

> [please, in the future, post your reply _after_ the suitably trimmed
> text you reply to.]
>
> On Tue, 12 Sep 2000 22:57:06 -0700,
>         David P. Schwartz <davids@YYYYdesertigloo.com> wrote:
>
> [reformatted]
>
> > ps: as far as being an SAQ goes, consider this: most of the searches
> > I've done for this using as many as eight keywords have been turning
> > up over 10,000 hits.
>
> Use a decent search engine. It really would help a lot if everyone
> would stay away from altavista and such, or would only use it after
> having read the help pages.
>
> http://www.google.com/
>
> 'zip archive perl'
>
> The first page of results contains many references to the module you
> are looking for. Google always is this successful.

I tried Google, only I used a few more keywords in different orders.  It gave me
a few thousand hits, too, and nothing near the top was of any use.

> <snip>                     Here I posted one query, and I got one direct
> > hit.
>
> Maybe, but it's an expensive hit. Human interaction is always
> expensive. That's why search engines exist. It really is important
> that you learn to use them correctly. Not all search engines are
> equal. Some work better with as few keywords as possible (especially
> the very specialised ones), and some need loads of keywords, and they
> still give lots of garbage.

Maybe there should be a warning on these newsgroups: WARNING: our time is
valueable!  Don't post questions here until you've spent at least five hours
searching around the web and you haven't found what you need!

I thank everybody for your time.  Mine's valueable too.  I also wish the search
engines were better, and that I would be better at guessing word combinations
that yield productive results more of the time.  Sometimes it works, sometimes
it doesn't.  That's why it's nice to have places like this to come when we're
feeling like idiots and are willing to get blasted for posting what some
consider to be dumb questions...

-David Schwartz



------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4324
**************************************


home help back first fref pref prev next nref lref last post