[24808] in Perl-Users-Digest
Perl-Users Digest, Issue: 6960 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 4 18:11:14 2004
Date: Sat, 4 Sep 2004 15:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 4 Sep 2004 Volume: 10 Number: 6960
Today's topics:
Burned using the .. operator (J. Romano)
Re: Burned using the .. operator <bik.mido@tiscalinet.it>
can I use 3 dot operator? <richard.kofler@chello.at>
Re: can I use 3 dot operator? <nobull@mail.com>
Desparate, tired programmer -- bug in perl5.6.1/apache1 <rls@tamu.edu>
Re: Desparate, tired programmer -- bug in perl5.6.1/apa <mritty@gmail.com>
Discussing the shuttle in the wrong newsgroups (was Re: <dietz@dls.net>
Mingw and perl. <olczyk2002@yahoo.com>
multiple regex pattern matching per line? (Darius)
Re: multiple regex pattern matching per line? <noreply@gunnar.cc>
Re: multiple regex pattern matching per line? <nobull@mail.com>
Re: NEw to Perl <usenet@morrow.me.uk>
packing floats? <mikee@mikee.ath.cx>
Re: packing floats? <nobull@mail.com>
Re: packing floats? <nobull@mail.com>
Re: packing floats? <uri@stemsystems.com>
Re: print Location to blank window? (krakle)
Re: print Location to blank window? <sbryce@scottbryce.com>
Re: print Location to blank window? <jurgenex@hotmail.com>
Re: Reading Unicode File and Saving Contents to Access <usenet@morrow.me.uk>
Sipering with javascript. <olczyk2002@yahoo.com>
Re: two's compliment? <1.8.7@nodomain.com>
Re: two's compliment? <1.8.7@nodomain.com>
Re: two's compliment? (Randal L. Schwartz)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 4 Sep 2004 07:41:42 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Burned using the .. operator
Message-Id: <b893f5d4.0409040641.465c1445@posting.google.com>
Dear Perl community,
I was recently burned using the .. operator in a Perl program. I
initially thought it was a bug that was causing the problem, but I
eventually figured out the reason behind the "burn." Therefore, I'll
share my findings here in the hopes that it might help someone in the
future not to be burned by it like I was.
Basically, I had code that read an input file a line at a time,
processed the line, and then put the processed line into an output
file. In the loop that read each line, there was a condition that was
something like:
if ($mandatory or m/BEGIN/ .. m/END/)
{
print OUT $_;
}
The condition was supposed to mean: "If the line is mandatory or it is
between the 'BEGIN' and 'END' lines, print the line to the output
file."
Sounds simple enough.
Well, what was happening was that sometimes that condition worked
exactly as expected, but other times it always evaluated to true, even
when the line was not mandatory nor fell between BEGIN and END lines.
I thought this was a bug in Perl, because when I ran the program in
the debugger, stopped at a breakpoint set at that condition, and
evaluated the condition with a command like:
print "True" if ($mandatory or m/BEGIN/ .. m/END/);
the word "True" would not be printed. But when I hit "n" to advance
to the next line, the program counter would advance to the print
statement, as if it evaluated to true!
I was ready to call it a Perl bug until I realized that the lines:
if ($mandatory or m/BEGIN/ .. m/END/) # line 1
and
if (m/BEGIN/ .. m/END/ or $mandatory) # line 2
are NOT equivalent!
Because of a thing called "short circuit evaluation," the ..
operator may not get evaluated in line 1, whereas it will always be
evaluated in line 2. And if you are expecting the .. operator to be
evaluated when in fact it doesn't, then that can mean that you think
the .. operator will get set to "false," when in reality it never
does, and instead will continue to return "true."
That's what was happening with me. Because the .. operator was not
being evaluated when I thought it was, it never got a chance to "shut
itself off," and since I was thinking of it in terms of the current
line being between the BEGIN and END lines, I could not figure out why
it was behaving the way it did.
So why did typing the condition right into the debugger return the
behavior that I was expecting (which was opposite of the program
behavior)? Because, when I typed the line:
print "True" if ($mandatory or m/BEGIN/ .. m/END/);
into the debugger, it was evaluating that particular .. operator FOR
THE FIRST TIME. And since the current line was not mandatory nor
between the BEGIN and END lines, it correctly evaluated to false.
Although they looked identical, the .. operator I typed into the
debugger was NOT the same one as the one in the Perl script, and
therefore they kept track of their own states, independent of each
other.
Which brings me to another point to be careful of:
Anytime you type a line like this (that contains the .. or the ...
operator) in the debugger:
print "True" if m/BEGIN/ .. m/END/;
it is essentially the same as the line:
print "True" if m/BEGIN/;
because that line, when typed in the debugger, only gets evaluated
once, and therefore only the first part of the .. operator will make a
difference when evaluated. This is true even if you type that
condition into the debugger multiple times (because, according to the
interpreter, those are separate instantiations of the .. operator, and
therefore they all keep their own separate state).
Chances are, if you are using the line:
if ($mandatory or m/BEGIN/ .. m/END/)
in a Perl program you probably meant to use:
if (m/BEGIN/ .. m/END/ or $mandatory)
instead, since short-circuit evaluation won't affect the state of
$mandatory (but can definitely affect the state of the .. operator).
So be careful of using the .. and ... operators in a condition
where short-circuit evaluation is an issue. Hopefully fewer
programmers will be burned by this now that I have shared this with
you.
-- Jean-Luc
------------------------------
Date: Sat, 04 Sep 2004 21:39:24 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Burned using the .. operator
Message-Id: <7f6kj05671215hl5jv79oclaudhcsoaau9@4ax.com>
On 4 Sep 2004 07:41:42 -0700, jl_post@hotmail.com (J. Romano) wrote:
> So be careful of using the .. and ... operators in a condition
>where short-circuit evaluation is an issue. Hopefully fewer
>programmers will be burned by this now that I have shared this with
>you.
Well, I appreciate your efforts, but IMHO, and I say IMHO, short
circuiting of logical operators is so charachteristic of Perl, and so
often used to one's great advantage that I doubt that any but a very
minority of programmers could get burnt with it in connection with
C<..> and C<...>; they have themselves other gotchas due to their
"exotic nature" that are more likely to byte an (inexperienced) user
on the neck...
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Sat, 04 Sep 2004 21:12:52 GMT
From: Richard Kofler <richard.kofler@chello.at>
Subject: can I use 3 dot operator?
Message-Id: <413A305A.F564B46D@chello.at>
[ sorry for my bad English ]
I try to process the ouput of a database utility,
see the format after __DATA__ below.
Test data shows the structure hopefully clear enough.
Reading perldoc about the .. and ... operators, and googling
for examples in perl.beginners and here I was not
able to accomplish using those, what I was able to put
together in a 'not-so-perlish' way.
The script I have now, does what I need, but I want to
ask if there is a better way of processing lines of text
which are separated by a special type of line,
detectable with means of a regexp, much like a headline,
at least sort of but not like a paragraph type headline.
Here is my script:
--------------------------------
#!/usr/bin/perl
use warnings;
use strict;
sub print_linebuf {
my $rbuf = $_[0];
my $linecnt = 0;
# print all but the last line from buffer
foreach my $line ( @{ $rbuf } ) {
$linecnt++;
print $line, "\n" unless ($linecnt == scalar(@{ $rbuf }));
}
@{ $rbuf } = ( );
}
my @linebuf;
my $seen = 1;
my $tag;
while (<DATA>) {
chomp;
if (/-+\s+(\d+)\s+-+/) {
# save the block identifier (SID)
$tag = $1;
$seen = 0;
print_linebuf(\@linebuf) unless ($seen);
}
my $taggedstr = $tag . " " . $_;
push @linebuf, $taggedstr;
}
print_linebuf(\@linebuf);
__DATA__
----- 501 -----
A
B
C
----- 202 -----
1
2
----- 03 -----
D
E
F
----- 04 -----
H
I
J
----- 754 -----
4
5
----- 22612 -----
6
7
8
9
----------------------------
You kind attention appreciated.
dic_k
--
Richard Kofler
SOLID STATE EDV
Dienstleistungen GmbH
Vienna/Austria/Europe
------------------------------
Date: Sat, 04 Sep 2004 22:42:21 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: can I use 3 dot operator?
Message-Id: <chdcrt$h0j$1@slavica.ukpost.com>
Richard Kofler wrote:
> Subject: can I use 3 dot operator?
Probably not usefully in this case.
> sub print_linebuf {
>
> my $rbuf = $_[0];
> my $linecnt = 0;
>
> # print all but the last line from buffer
> foreach my $line ( @{ $rbuf } ) {
> $linecnt++;
> print $line, "\n" unless ($linecnt == scalar(@{ $rbuf }));
> }
> @{ $rbuf } = ( );
> }
This is more simply
sub print_linebuf {
my $rbuf = shift;
pop @$rbuf;
print "$_\n" for @$rbuf
@$rbuf = ();
}
> my @linebuf;
> my $seen = 1;
> my $tag;
>
> while (<DATA>) {
> chomp;
>
> if (/-+\s+(\d+)\s+-+/) {
> # save the block identifier (SID)
> $tag = $1;
>
> $seen = 0;
> print_linebuf(\@linebuf) unless ($seen);
> }
> my $taggedstr = $tag . " " . $_;
> push @linebuf, $taggedstr;
> }
>
> print_linebuf(\@linebuf);
The variable $seen in the above code serves no purpose.
my @linebuf;
my $tag;
while (<DATA>) {
chomp;
if (/-+\s+(\d+)\s+-+/) {
# save the block identifier (SID)
$tag = $1;
print_linebuf(\@linebuf);
}
push @linebuf, "$tag $_";
}
print_linebuf(\@linebuf);
------------------------------
Date: Sat, 04 Sep 2004 08:30:05 -0500
From: Ryan Saunders <rls@tamu.edu>
Subject: Desparate, tired programmer -- bug in perl5.6.1/apache1.3.31 ?
Message-Id: <chcg0u$5tl$1@news.tamu.edu>
I've literally been up all night poking at the same block of code...does
anyone know why a Perl script that runs perfectly from the command-line
will silently refuse to write to (or delete) its data file when called
from PHP using the system() command?
Perl 5.6.1
Apache 1.3.31
PHP 4.3.8
Linux 2.4.24
I'm ready to pull my hair out...or someone else's :-(
------------------------------
Date: Sat, 04 Sep 2004 09:47:40 -0400
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Desparate, tired programmer -- bug in perl5.6.1/apache1.3.31 ?
Message-Id: <chch2k$n3q$1@misc-cct.server.rpi.edu>
Ryan Saunders wrote:
> I've literally been up all night poking at the same block of code...does
> anyone know why a Perl script that runs perfectly from the command-line
> will silently refuse to write to (or delete) its data file when called
> from PHP using the system() command?
>
> Perl 5.6.1
> Apache 1.3.31
> PHP 4.3.8
> Linux 2.4.24
>
> I'm ready to pull my hair out...or someone else's :-(
Most likely the web user that Apache runs as which runs your PHP script
doesn't have the same permissions that you do.
If you're not sure what username the server is running as, try printing
the output of `whoami` from within your PHP script.
Paul Lalli
------------------------------
Date: Sat, 04 Sep 2004 16:52:04 -0500
From: "Paul F. Dietz" <dietz@dls.net>
Subject: Discussing the shuttle in the wrong newsgroups (was Re: Xah Lee's Unixism)
Message-Id: <xYqdnUCRPJQUpafcRVn-qQ@dls.net>
Rupert Pigott wrote:
> Joe Pfeiffer wrote:
>> However, it would certainly not have failed at the segment joints.#
>
> Indeed, it could have failed in a way entirely unique to itself... :)
For example, it would have been more difficult to cast, so it could
have been more prone to catastrophic failures due to casting errors
(voids in the grain, poor bonding of the grain to the casing, etc.)
The safer answer would have been liquid boosters, but they cost more.
The underlying problem was that the shuttle never made economic sense
(fraudulent projections of high flight rates notwithstanding.)
Followup to sci.space.policy.
Paul
------------------------------
Date: Sat, 04 Sep 2004 16:06:33 -0500
From: TLOlczyk <olczyk2002@yahoo.com>
Subject: Mingw and perl.
Message-Id: <i7bkj09gbgc8r3h7n16avab9rlk57pnm4i@4ax.com>
I find that sometimes perl modules that include C code have problems
with the Activestate distro ( which uses MSVC ). I don't particularly
like cygwin because there are times when the cygwin dll can act
flakey. I've looked around for instructions on building perl within
Mingw, but am finding the information confusing. Can anyone explain/
recommend some web pages on using Mingw for perl?
The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,
**
Thaddeus L. Olczyk, PhD
There is a difference between
*thinking* you know something,
and *knowing* you know something.
------------------------------
Date: 4 Sep 2004 13:24:41 -0700
From: dmedhora@yahoo.com (Darius)
Subject: multiple regex pattern matching per line?
Message-Id: <26a5971.0409041224.55956135@posting.google.com>
Hi All,
I need to correct the title below. Can you help?
Lets say I have a line like this below:
<word_word1 string="start" date="2004-09-02 07:33:22" id="2033878"
word_id="2000589" get_id="8647" ><word name="MOVIE"><film
title="S"things Gotta Give" the_number="531780"
/></word></word_word1><film title="S'"e Gotta Give"
the_number="531780" />
This should be one continuous line, no new lines inbetween.
How do I correct the tag 'title' so that its ALWAYS correct and reads
as title="Somethings Gotta Give"
So there are 2 changes required here..It should basically become
this:-
<word_word1 string="start" date="2004-09-02 07:33:22" id="2033878"
word_id="2000589" get_id="8647" ><word name="MOVIE"><film
title="Somethings Gotta Give" the_number="531780"
/></word></word_word1><film title="Somethings Gotta Give"
the_number="531780" />
Please help urgently. Thanks
D
------------------------------
Date: Sat, 04 Sep 2004 23:12:51 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: multiple regex pattern matching per line?
Message-Id: <2pupd8Fp03f1U1@uni-berlin.de>
Darius wrote:
> I need to correct the title below.
<snip>
> Please help urgently.
Urgent? Really? Hope you are a fast reader, then.
perldoc perlrequick
perldoc perlop (the s/// operator)
> Thanks
You're welcome.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sat, 04 Sep 2004 22:18:27 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: multiple regex pattern matching per line?
Message-Id: <chdbf3$foa$1@slavica.ukpost.com>
Darius wrote:
>
> <word_word1 string="start" date="2004-09-02 07:33:22" id="2033878"
> word_id="2000589" get_id="8647" ><word name="MOVIE"><film
> title="S"things Gotta Give" the_number="531780"
> /></word></word_word1><film title="S'"e Gotta Give"
> the_number="531780" />
>
> This should be one continuous line, no new lines inbetween.
>
> How do I correct the tag 'title' so that its ALWAYS correct and reads
> as title="Somethings Gotta Give"
>
> So there are 2 changes required here..It should basically become
> this:-
> <word_word1 string="start" date="2004-09-02 07:33:22" id="2033878"
> word_id="2000589" get_id="8647" ><word name="MOVIE"><film
> title="Somethings Gotta Give" the_number="531780"
> /></word></word_word1><film title="Somethings Gotta Give"
> the_number="531780" />
Can you explain how a human would be expected to know how to achive this
(without prior knowledge of the film title)?
------------------------------
Date: Sat, 4 Sep 2004 15:23:52 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: NEw to Perl
Message-Id: <oovo02-hp4.ln1@osiris.mauzo.dyndns.org>
Quoth tadmc@augustmail.com:
> Shawn Melnic <sham_x30@yahoo.com> wrote:
>
> > while(&list) {
> > @line = ..
> > bla bla
> > bla
> > }
> >
> > sub list {
>
> my @list;
> push @list, "line 1";
> push @list, "line 2" ;
> push @list, "line 3" ;
> return @list;
>
> > }
> >
> > Basically, I want while to read the sub list into an array..
>
> Can't be done.
Yes it can: tie and select a filehandle to push printed stuff onto an
array. Not that I'm suggesting that's the *right* way to do it... :)
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: Sat, 04 Sep 2004 15:47:35 -0000
From: Mike <mikee@mikee.ath.cx>
Subject: packing floats?
Message-Id: <10jjosne5gmh15@corp.supernews.com>
I'm playing with some code and I want to check that a given
array is unique. I'm trying to take the values (18) and pack
them into a piece of memory for comparison. Each array packed
I think should be 18*4=72 bytes. With this 72 byte string stuck
into a hash then I can easily tell if I have a unique entity.
My question is how to (and what is efficient) pack the values
into a string? These are floats and I'm not interested in
maintaining the actual float representation for this portion of
my code.
I've tried:
my $hash = pack('a18', @floats);
my $hash = pack('h18', @floats);
but they've not worked. What does?
Mike
------------------------------
Date: Sat, 04 Sep 2004 19:38:44 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: packing floats?
Message-Id: <chd23k$dj0$1@slavica.ukpost.com>
Mike wrote:
> I'm playing with some code and I want to check that a given
> array is unique. I'm trying to take the values (18) and pack
> them into a piece of memory for comparison. Each array packed
> I think should be 18*4=72 bytes. With this 72 byte string stuck
> into a hash then I can easily tell if I have a unique entity.
> My question is how to (and what is efficient) pack the values
> into a string? These are floats and I'm not interested in
> maintaining the actual float representation for this portion of
> my code.
The term 'hash' (in the normal sense as oppposed to Perl's synonym for
associative array) and also your assertion that you are "not interested
in maintaining the actual float representation" implies a lossy
encoding. There is no gurantee that to inputs will not yield the same
hash. IS that OK? In a Perl HASH (i.e. associative array) this is not
an issue as for each hashed key value there is a list of actual
key/value pairs.
> I've tried:
>
> my $hash = pack('a18', @floats);
> my $hash = pack('h18', @floats);
>
> but they've not worked.
Read the desciption of the 'a' and 'h' in the doumentation of pack().
> What does?
Then look alongside these for another character that does what you
evidently want. (Hint: it has the word 'float' in the description).
Of couse it may not necessarily be 72 bytes, it'll be 1 times whatever
the number of bytes is in a single-precision float in the native format.
Of course by converting to single precision it is possible that numbers
that would have compared unequal with == will compare equal in the
'hash'. Then again you should never reley on == with floating point
numbers anyhow.
Most people would not bother with pack and just use "@floats" - is
memory really that tight? (Of course stringification also results in a
loss of precision).
------------------------------
Date: Sat, 04 Sep 2004 19:41:45 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: packing floats?
Message-Id: <chd299$dj0$2@slavica.ukpost.com>
Brian McCauley wrote:
> Mike wrote:
>
>> I'm playing with some code and I want to check that a given
>> array is unique. I'm trying to take the values (18) and pack
>> them into a piece of memory for comparison. Each array packed
>> I think should be 18*4=72 bytes.
> Of couse it may not necessarily be 72 bytes, it'll be 1 times whatever
> the number of bytes is in a single-precision float in the native format.
That should say 18 times!
------------------------------
Date: Sat, 04 Sep 2004 20:13:00 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: packing floats?
Message-Id: <x7brgloktg.fsf@mail.sysarch.com>
>>>>> "BM" == Brian McCauley <nobull@mail.com> writes:
BM> Of course by converting to single precision it is possible that
BM> numbers that would have compared unequal with == will compare equal in
BM> the 'hash'. Then again you should never reley on == with floating
BM> point numbers anyhow.
BM> Most people would not bother with pack and just use "@floats" - is
BM> memory really that tight? (Of course stringification also results in
BM> a loss of precision).
just pack using 'd' and you won't lose any data and that bytestring can
be hashed just fine. i use 'd' in Sort::Maker when using the GRT sort
style and it is just what the OP really wants.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 4 Sep 2004 07:39:39 -0700
From: krakle@visto.com (krakle)
Subject: Re: print Location to blank window?
Message-Id: <237aaff8.0409040639.63171e28@posting.google.com>
"Travis" <dingdongy2k@hotmail.com> wrote in message news:<SR6_c.4953$Vl5.1081@newsread2.news.atl.earthlink.net>...
Travis everyone here has their thick heads up their butts...
> I am using
>
> print "location: http://www.yahoo.com\n\n";
>
> Is there a way to get it to print to a blank page.
> such as target="_blank"
For the morons of this thread what Travis is asking: Is there away to
use the Location header to target a new browser window or an existing
one or a frame...
And the answer is, surprisingly to most, yes. Use:
print <<EOF;
Location: http://www.yahoo.com
Window-target: _blank
EOF
Try that :)
------------------------------
Date: Sat, 04 Sep 2004 09:10:46 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: print Location to blank window?
Message-Id: <10jjmn5ksle8842@corp.supernews.com>
krakle wrote:
> For the morons of this thread
Morons? His question had nothing to do with Perl!
------------------------------
Date: Sat, 04 Sep 2004 16:01:29 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: print Location to blank window?
Message-Id: <tFl_c.2682$5Y6.2026@trnddc07>
Scott Bryce wrote:
> krakle wrote:
Oh, krakle is still around?
>> For the morons of this thread
>
> Morons? His question had nothing to do with Perl!
I guess it's just perfect that he's still a honor guest in my killfile
jue
------------------------------
Date: Sat, 4 Sep 2004 15:50:45 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Reading Unicode File and Saving Contents to Access
Message-Id: <5b1p02-hp4.ln1@osiris.mauzo.dyndns.org>
[ please don't top-post ]
Quoth qjason@starhub.net.sg:
> Hi Ben,
>
> Thanks for your reply. I have tried the encode method but the
> characters seem even further off now:
>
[ please don't post binary data to a text ng ]
Have you tried using DBI?
> The 'closest' I think I have come is using:
>
> use Unicode::String qw(utf16);
> $name = Unicode::String::utf16( $name );
>
> which gives me this
>
> Some of the characters appear ok in the browser, although it still
> isn't entirely right.
Browser? What browser? Is this a stealth CGI question?
Ben
--
"If a book is worth reading when you are six, * ben@morrow.me.uk
it is worth reading when you are sixty." - C.S.Lewis
------------------------------
Date: Sat, 04 Sep 2004 16:00:47 -0500
From: TLOlczyk <olczyk2002@yahoo.com>
Subject: Sipering with javascript.
Message-Id: <he9kj0lhpmapsddea33gc43d1l7k2oleeq@4ax.com>
I'd like to write a program to spider certain websites
which contain javascript.
One example is a local newspaper providing tv listings.
The page is set up in the following way, it brings up
the listing for half of todays channels for the next
three hours in a grid certain buttons advance the
grid by executing javascript commands ( advance previous
scroll etc, ) Rather than sit there wait half a minute for the next
page to load I thought I would write a script that searches for
the shows and extracts the pages with the shows I want on it.
Another example almost anyone can understand, is the "Look inside
feature " of amazon, where three or four pages of the book plus
toc and index are put on the site. You then use scroll buttons
to move back and forth, and of course they call javascript.
What I've read about spidering with javascript is confusing.
Can anyone help?
The reply-to email address is olczyk2002@yahoo.com.
This is an address I ignore.
To reply via email, remove 2002 and change yahoo to
interaccess,
**
Thaddeus L. Olczyk, PhD
There is a difference between
*thinking* you know something,
and *knowing* you know something.
------------------------------
Date: Sat, 4 Sep 2004 07:00:13 -0700
From: "187" <1.8.7@nodomain.com>
Subject: Re: two's compliment?
Message-Id: <2pu01qFp0su9U1@uni-berlin.de>
Randal L. Schwartz wrote:
> *** post for FREE via your newsreader at post.newsfeed.com ***
>
> "two's compliment" would be
>
> he: You look nice!
> she: You look nice too!
>
> Maybe you meant "two's complement"?
>
> And I would have sent this in email, but you didn't provide a valid
> return address or any means to decrypt same. Shame on you!
Actually I never updated it, and for good reason. (Spam mainly.)
It's: bigal187 AT rx.eastcoasttfc.com
> People like you not understanding Usenet operating procedure.
I really don't think you're correct here. Usenet is not about sending
email, it's about exchanging information *in* *news groups*. Standard
"operating procedure" has always been this, and everyone has the right
not ot display their true email. when ever I do, I get spammed, one way
or another. Since I stopped and changed my email, I don't get any.
Good day.
------------------------------
Date: Sat, 4 Sep 2004 07:07:11 -0700
From: "187" <1.8.7@nodomain.com>
Subject: Re: two's compliment?
Message-Id: <2pu0esFoihr6U1@uni-berlin.de>
Chris Mattern wrote:
> 187 wrote:
>
>> I'm hoping someone can clear up this little confusion here regarding
>> binary not's.
>>
>> print unpack('H128', pack('N', ~4294966272));
>>
>> This gives: 000003ff
>>
>> Why is it on my TI86 I get FFFFFFFF000003FF. This seems more
>> (Commands: (not 4294966272)->Hex )
>>
>> Which is correct?
>
> The TI, of course.
>
>> It seems more correct to me that the remaining bits be
>> flipped from the not operation (0 -> 1), but why do c/c++/perl/etc
>> not do this?
>
> Because there *aren't* any "remaining bits". The computer
> you're working on has 4-byte integers, and you overflowed
> it--the number is too big for your data model. The
> TI, with 8-byte integers, was plenty big enough to
> hold your number. Look up the documentation for pack
> and unpack on how to specify 8-byte integers. You
> wanted to say 'Q', not 'N' (and that'll only work if you
> have 64-bit support).
Thank you for your reply. I udnerstand how it became overloaded, but
then why does this happen?
print ~-31, "\n", ~30
Output:
30
4294967265
Why does the 2nd statement not return -31? Is it Perl not wanting to
return a signed number? This seems rather incorrect, mathimatically.
(Please corect me if I'm wrong.)
------------------------------
Date: 04 Sep 2004 07:27:57 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: two's compliment?
Message-Id: <86zn46153m.fsf@blue.stonehenge.com>
*** post for FREE via your newsreader at post.newsfeed.com ***
>>>>> "187" == 187 <1.8.7@nodomain.com> writes:
>> People like you not understanding Usenet operating procedure.
187> I really don't think you're correct here. Usenet is not about sending
187> email, it's about exchanging information *in* *news groups*. Standard
187> "operating procedure" has always been this,
For some version of "always". Mine apparently predates yours. You
speak like someone relatively new to Usenet, probably not coming until
the post-spam era.
In the pre-spam days, it was common courtesy to always include an email
address that worked, so that you could curse in private, but bless
in public. Nobody seems to have courtesy here any more.
{sigh}
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
-----= Posted via Newsfeed.Com, Uncensored Usenet News =-----
http://www.newsfeed.com - The #1 Newsgroup Service in the World!
-----== 100,000 Groups! - 19 Servers! - Unlimited Download! =-----
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 6960
***************************************