[30250] in Perl-Users-Digest
Perl-Users Digest, Issue: 1493 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 29 16:09:54 2008
Date: Tue, 29 Apr 2008 13:09:12 -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 Tue, 29 Apr 2008 Volume: 11 Number: 1493
Today's topics:
Compress::Zlib inflateInit help (hymie!)
Re: Compress::Zlib inflateInit help <paul.marquess@btinternet.com>
Re: Compress::Zlib inflateInit help (hymie!)
Re: Compress::Zlib inflateInit help <paul.marquess@btinternet.com>
Re: download with HTML::FORM login and password on page <baptiste.fevre@gmail.com>
How do I follow links stored in an array? BirgitteRand@gmail.com
Re: How do I follow links stored in an array? <noreply@gunnar.cc>
Re: How do I follow links stored in an array? <john@castleamber.com>
Re: How do I follow links stored in an array? <simon.chao@fmr.com>
Re: Lawyers prosecuters media and programmers (I need H <not-my-email@nowhere.com>
Re: Looking for any programmer ($850k+/yr telecommute) <uri@stemsystems.com>
Re: Looking for any programmer ($850k+/yr telecommute) <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
Re: use of DBI; I am getting multiple error messages mi <hjp-usenet2@hjp.at>
Re: use perl to draw Venn Diagram <zentara@highstream.net>
Re: Windows mail. <veatchla@yahoo.com>
Re: WWW::Mechanize doesn't always follow_link(text <rvtol+news@isolution.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Apr 2008 09:38:40 -0500
From: hymie_@_lactose.homelinux.net (hymie!)
Subject: Compress::Zlib inflateInit help
Message-Id: <l-udnZgiDZ9tr4rVnZ2dnUVZ_h-vnZ2d@comcast.com>
Greetings.
I'm using Compress::Zlib for the first time. I'm working with strings
are are ZLib-compressed but not fully RFC1950 compliant. I'm getting
some errors and, although I have it working, I know there has to be
a better way.
I started pretty simple:
my ($inflate,$status);
($inflate,$status) = inflateInit();
while ($i<3)
{
print "$i\n";
# the strings are coming from an internet socket.
# i can probably get some sample lines if needed
read($socket,$line,$number);
($newline,$status) = $inflate->inflate($line);
print "line -> $newline\n";
print "status -> $status\n";
print "msg -> " , $inflate->msg() , "\n";
$i++;
}
and got these results
0
line ->
status -> data error
msg -> incorrect header check
1
line ->
status -> data error
msg -> incorrect header check
2
line ->
status -> data error
msg -> incorrect header check
So I did some research and found about adding the header to the string:
my ($inflate,$status);
($inflate,$status) = inflateInit();
while ($i<3)
{
print "$i\n";
# the strings are coming from an internet socket.
# i can probably get some sample lines if needed
read($socket,$line,$number);
$line = "\x78\x01$line"; # i added this line here
($newline,$status) = $inflate->inflate($line);
print "line -> $newline\n";
print "status -> $status\n";
print "msg -> " , $inflate->msg() , "\n";
$i++;
}
and did a little better
0
line -> 06710002515770TradePAC USD17393883907^PDP.IV
status ->
msg ->
1
line ->
status -> data error
msg -> incorrect data check
2
line ->
status -> data error
msg -> incorrect data check
So I adjusted the header thusly
my ($inflate,$status);
($inflate,$status) = inflateInit();
while ($i<3)
{
print "$i\n";
# the strings are coming from an internet socket.
# i can probably get some sample lines if needed
read($socket,$line,$number);
$line = "\x78\x01$line" if $i==0; # i altered this line here
($newline,$status) = $inflate->inflate($line);
print "line -> $newline\n";
print "status -> $status\n";
print "msg -> " , $inflate->msg() , "\n";
$i++;
}
but same results
line -> 06710002515770TradePAC USD17393883907^PDP.IV
status ->
msg ->
1
line ->
status -> data error
msg -> incorrect data check
2
line ->
status -> data error
msg -> incorrect data check
Now, here is what I finally got working:
while ($i<3)
{
print "$i\n";
my ($inflate,$status);
($inflate,$status) = inflateInit(); # moved inflateInit here
# the strings are coming from an internet socket.
# i can probably get some sample lines if needed
read($socket,$line,$number);
$line = "\x78\x01$line"; # always add header
($newline,$status) = $inflate->inflate($line);
print "line -> $newline\n";
print "status -> $status\n";
print "msg -> " , $inflate->msg() , "\n";
$i++;
}
but it has to be inefficient always running inflateInit.
So can somebody help me figure out what I'm doing wrong?
Thanks.
--hymie! http://lactose.homelinux.net/~hymie hymie@lactose.homelinux.net
------------------------ Without caffeine for 546 days ------------------------
Convicted of a crime I didn't even commit! Attempted Murder -- now, honestly,
what is that? Do they give a Nobel Prize for Attempted Chemistry? Do they?
-- Sideshow Bob (The Simpsons)
-------------------------------------------------------------------------------
------------------------------
Date: Tue, 29 Apr 2008 17:37:10 +0100
From: Paul Marquess <paul.marquess@btinternet.com>
Subject: Re: Compress::Zlib inflateInit help
Message-Id: <48174e3b$0$662$4d4eb98e@read.news.uk.uu.net>
hymie! wrote:
> Greetings.
>
> I'm using Compress::Zlib for the first time. I'm working with strings
> are are ZLib-compressed but not fully RFC1950 compliant. I'm getting
> some errors and, although I have it working, I know there has to be
> a better way.
>
> I started pretty simple:
>
> my ($inflate,$status);
> ($inflate,$status) = inflateInit();
> while ($i<3)
> {
> print "$i\n";
> # the strings are coming from an internet socket.
> # i can probably get some sample lines if needed
> read($socket,$line,$number);
> ($newline,$status) = $inflate->inflate($line);
> print "line -> $newline\n";
> print "status -> $status\n";
> print "msg -> " , $inflate->msg() , "\n";
> $i++;
> }
>
> and got these results
>
> 0
> line ->
> status -> data error
> msg -> incorrect header check
> 1
> line ->
> status -> data error
> msg -> incorrect header check
> 2
> line ->
> status -> data error
> msg -> incorrect header check
>
> So I did some research and found about adding the header to the string:
>
> my ($inflate,$status);
> ($inflate,$status) = inflateInit();
> while ($i<3)
> {
> print "$i\n";
> # the strings are coming from an internet socket.
> # i can probably get some sample lines if needed
> read($socket,$line,$number);
> $line = "\x78\x01$line"; # i added this line here
> ($newline,$status) = $inflate->inflate($line);
> print "line -> $newline\n";
> print "status -> $status\n";
> print "msg -> " , $inflate->msg() , "\n";
> $i++;
> }
>
> and did a little better
>
> 0
> line -> 06710002515770TradePAC USD17393883907^PDP.IV
> status ->
> msg ->
> 1
> line ->
> status -> data error
> msg -> incorrect data check
> 2
> line ->
> status -> data error
> msg -> incorrect data check
>
> So I adjusted the header thusly
>
> my ($inflate,$status);
> ($inflate,$status) = inflateInit();
> while ($i<3)
> {
> print "$i\n";
> # the strings are coming from an internet socket.
> # i can probably get some sample lines if needed
> read($socket,$line,$number);
> $line = "\x78\x01$line" if $i==0; # i altered this line here
> ($newline,$status) = $inflate->inflate($line);
> print "line -> $newline\n";
> print "status -> $status\n";
> print "msg -> " , $inflate->msg() , "\n";
> $i++;
> }
>
> but same results
>
> line -> 06710002515770TradePAC USD17393883907^PDP.IV
> status ->
> msg ->
> 1
> line ->
> status -> data error
> msg -> incorrect data check
> 2
> line ->
> status -> data error
> msg -> incorrect data check
>
> Now, here is what I finally got working:
>
> while ($i<3)
> {
> print "$i\n";
> my ($inflate,$status);
> ($inflate,$status) = inflateInit(); # moved inflateInit here
> # the strings are coming from an internet socket.
> # i can probably get some sample lines if needed
> read($socket,$line,$number);
> $line = "\x78\x01$line"; # always add header
> ($newline,$status) = $inflate->inflate($line);
> print "line -> $newline\n";
> print "status -> $status\n";
> print "msg -> " , $inflate->msg() , "\n";
> $i++;
> }
>
> but it has to be inefficient always running inflateInit.
>
> So can somebody help me figure out what I'm doing wrong?
Do you have any more info on the structure of the data in the socket. For
example, is there any significance toyou reading $number bytes at a time
from the socket?
If you can get it to work by prefixing every $number bytes with "\x78\x01"
it sounds like you are dealing with one or more RFC1951 data streams.
If you want Compress::Zlib to read an RFC1951 stream, add the WindowsBits
parameter like this when you create the inflation object
($inflate,$status) = inflateInit(WindowBits => -MAX_WBITS);
An alternative is to use one of the of IO::Uncompress modules that
Compress::Zlib now uses behind the scenes. So, for example, if you expect a
single RFC1951 compressed data stream from the socket, the code below will
read it, uncompress it, and write the result into $data
use IO::Uncompress::RawInflate qw(:all)
my $data ;
rawinflate $socket => \$data
or die "Cannot uncompress: $RawInflateError\n";
Paul
------------------------------
Date: Tue, 29 Apr 2008 12:08:47 -0500
From: hymie_@_lactose.homelinux.net (hymie!)
Subject: Re: Compress::Zlib inflateInit help
Message-Id: <d4idnTGX1eiCy4rVnZ2dnUVZ_j6dnZ2d@comcast.com>
In our last episode, the evil Dr. Lacto had captured our hero,
Paul Marquess <paul.marquess@btinternet.com>, who said:
>Do you have any more info on the structure of the data in the socket. For
>example, is there any significance toyou reading $number bytes at a time
>from the socket?
Data spec, including java sample code (I don't speak java)
The basic structure of the data is:
<blockTime><blockSequence><blockSize><block>...
blockTime = a 64-bit long representing the time of the block in
milliseconds since the epoc.
blockSequence = a 32-bit int representing a sequence number for the
block of data (see "id" parameter above).
blockSize = a 32-bit int representing the size of the compressed block
in bytes.
block = a compressed chunk of data.
You will need to take the compressed block of data and uncompress it
to produce workable raw data. You should be able to use a standard ZLIB
compression library to do this. This functionality is usually found in
your existing development environment. In Java, ZLIB is built into the
VM itself. You need to hand the data block to a java.util.zip.Inflater.
Example:
Inflater decompresser = new Inflater();
decompresser.setInput(compressedBlock, 0, compressedDataLength);
byte[] result = new byte[2048];
int resultLength = decompresser.inflate(result);
decompresser.end();
String message = new String(result, 0, resultLength, "UTF-8");
>If you can get it to work by prefixing every $number bytes with "\x78\x01"
>it sounds like you are dealing with one or more RFC1951 data streams.
No. It only works if I re-run inflateInit and *then* prefix the
string with \x78\x01
>If you want Compress::Zlib to read an RFC1951 stream, add the WindowsBits
>parameter like this when you create the inflation object
>
> ($inflate,$status) = inflateInit(WindowBits => -MAX_WBITS);
That works well for my first data chunk, after that I get
1
line ->
status -> stream end
2
line ->
status -> stream end
> use IO::Uncompress::RawInflate qw(:all)
>
> my $data ;
> rawinflate $socket => \$data
> or die "Cannot uncompress: $RawInflateError\n";
Again, this works well for my first data chunk, but doesn't read the
cleartext data preceding the second data chunk:
0
line -> 06710003526346TradeNLS USD11221066211JRN
status ->
1
--hymie! http://lactose.homelinux.net/~hymie hymie@lactose.homelinux.net
------------------------ Without caffeine for 546 days ------------------------
------------------------------
Date: Tue, 29 Apr 2008 19:36:45 +0100
From: Paul Marquess <paul.marquess@btinternet.com>
Subject: Re: Compress::Zlib inflateInit help
Message-Id: <48176a42$0$665$4d4eb98e@read.news.uk.uu.net>
hymie! wrote:
> In our last episode, the evil Dr. Lacto had captured our hero,
> Paul Marquess <paul.marquess@btinternet.com>, who said:
>
>>Do you have any more info on the structure of the data in the socket. For
>>example, is there any significance toyou reading $number bytes at a time
>>from the socket?
>
> Data spec, including java sample code (I don't speak java)
>
> The basic structure of the data is:
>
> <blockTime><blockSequence><blockSize><block>...
>
> blockTime = a 64-bit long representing the time of the block in
> milliseconds since the epoc.
>
> blockSequence = a 32-bit int representing a sequence number for the
> block of data (see "id" parameter above).
>
> blockSize = a 32-bit int representing the size of the compressed block
> in bytes.
>
> block = a compressed chunk of data.
>
> You will need to take the compressed block of data and uncompress it
> to produce workable raw data. You should be able to use a standard ZLIB
> compression library to do this. This functionality is usually found in
> your existing development environment. In Java, ZLIB is built into the
> VM itself. You need to hand the data block to a java.util.zip.Inflater.
>
> Example:
> Inflater decompresser = new Inflater();
> decompresser.setInput(compressedBlock, 0, compressedDataLength);
> byte[] result = new byte[2048];
> int resultLength = decompresser.inflate(result);
> decompresser.end();
> String message = new String(result, 0, resultLength, "UTF-8");
>
>>If you can get it to work by prefixing every $number bytes with "\x78\x01"
>>it sounds like you are dealing with one or more RFC1951 data streams.
>
> No. It only works if I re-run inflateInit and *then* prefix the
> string with \x78\x01
>
>>If you want Compress::Zlib to read an RFC1951 stream, add the WindowsBits
>>parameter like this when you create the inflation object
>>
>> ($inflate,$status) = inflateInit(WindowBits => -MAX_WBITS);
>
> That works well for my first data chunk, after that I get
> 1
> line ->
> status -> stream end
> 2
> line ->
> status -> stream end
>
>> use IO::Uncompress::RawInflate qw(:all)
>>
>> my $data ;
>> rawinflate $socket => \$data
>> or die "Cannot uncompress: $RawInflateError\n";
>
> Again, this works well for my first data chunk, but doesn't read the
> cleartext data preceding the second data chunk:
The key part I didn't know was you are dealing with a sequence of compressed
RFC 1951 data streams that are each prefixed with a bespoke header. So that
means you need to deal with reading both compressed & non-compressed data
from the socket. Is there a link you can post that describes this feed in
more detail?
So assuming nothing else comes down the socket, you could try something like
this - you may need to change the final "N" in the unpack call to a "V" if
the byte order is non-standard.
my $header;
my $header_size = 8 + 4 + 4; # time + sequence + size
while (read($socket, $header, $header_size) == $header_size)
{
my ($time1, $time2, $sequence, $size) = unpack "NNNN", $header;
rawinflate $socket => \$data, InputLength => $size
or die "Cannot uncompress: $RawInflateError\n";
print "$daat\n";
}
cheers
Paul
------------------------------
Date: Tue, 29 Apr 2008 09:14:14 -0700 (PDT)
From: Winston75 <baptiste.fevre@gmail.com>
Subject: Re: download with HTML::FORM login and password on page
Message-Id: <4d3561d7-d608-4a88-b305-46927e63a7a4@25g2000hsx.googlegroups.com>
On 28 avr, 13:43, Peter Makholm <pe...@makholm.net> wrote:
> Winston75 <baptiste.fe...@gmail.com> writes:
> > i don't understand my code is corrupted at form "value" instance??
> > error prompt : Can't call method "value" on an undefined value at
> > ligne 27 (here : =A0 =A0 $form->find_input('txtusername')-
> >>value($user);) ??
> > =A0 =A0 $form->find_input('txtusername')->value($user);
>
> I assume this is line 27?
>
> What you have is that the find_input method on you HTML::Form object
> returns undef. According to the documentation this means that there is
> no input in the form matching you criteria.
>
> //Makholm
thanks for you reponss.
my error was in web adresss:
'http://www.mysite.com/login.asp/';
but
'http://www.mysite.com/login.asp';
OK, next :
#!/usr/bin/perl -w
use strict;
use warnings;
#use diagnostics;
use LWP::UserAgent;
use HTML::Form;
use HTML::SimpleLinkExtor;
my ($user,$pass ) =3D qw(username password);
my $base =3D 'http://www.mysite.com/login.asp';
my $ua =3D LWP::UserAgent->new(agent =3D> 'Microsoft Internet Explorer
6.0' );
my $req =3D HTTP::Request->new( GET =3D> "${base}" );
my $res =3D $ua->request($req);
die $res->status_line if not $res->is_success;
my $form =3D (HTML::Form->parse($res->content, $base))[1];
$form->find_input('txtusername')->value($user);
$form->find_input('txtpassword')->value($pass);
my $base2 =3D'http://www.mysite.com/database/';
my $ua2 =3D LWP::UserAgent->new(agent =3D> 'Microsoft Internet Explorer
6.0' );
my $req2 =3D HTTP::Request->new( GET =3D> "${base2}" );
my $res2 =3D $ua2->request($req2);
die $res2->status_line if not $res2->is_success;
my $extractor =3D HTML::SimpleLinkExtor->new($base2);
$extractor->parse($res2->content);
my @allLinks =3D $extractor->links;
for (@allLinks)
{
if (/DataAge.asp/) {
print $_ . "\n";
}
}
my result & code are correct : print command send me, "www.mysite.com/
DataAge.asp"
however, how to connect on this link, without losing a session with
$user et $pass??
the lib html:linkextractor can extract my link, but not simulate a
CLICK on my new link www.mysite.com/DataAge.asp, for instance.
thanks,
------------------------------
Date: Tue, 29 Apr 2008 03:55:41 -0700 (PDT)
From: BirgitteRand@gmail.com
Subject: How do I follow links stored in an array?
Message-Id: <e10dff68-e4d2-4c0b-a3b2-62a38168ae80@c58g2000hsc.googlegroups.com>
I don't know how to follow links in an array (@links) at the bottom of
this script. Can anyone help me?
/Birgitte
#!/usr/bin/perl
use strict;
use WWW::Mechanize;
use LWP::Simple;
use HTML::TokeParser;
use XML::RSS;
# Create the RSS object.
my $rss = XML::RSS->new( version => '2.0' );
# Prep the RSS.
$rss->channel(
title => "JP",
link => "http://jp.dk/seneste",
description => "JP");
my $starting_url = 'http://jp.dk/seneste/';
my $output_dir = "c:/temp/jp";
# Create a new instance of WWW::Mechanize
my $mechanize = WWW::Mechanize->new();
# Retrieve the page
$mechanize->get($starting_url);
my $html = $mechanize->content;
my $p = HTML::TokeParser->new( \$html );
#jump through tags until you get 'h1'
while( my $title = $p->get_tag( 'h1' )) {
last if $title->[1]->{class} eq 'h1';
}
# look through the tokens until you hit the end of 'h1'
my @links;
while ( my $token = $p->get_token ) {
last if $token->[0] eq 'E' && $token->[1] eq 'h1'; #i.e., a
div end tag
if ( $token->[0] eq 'S' && $token->[1] eq 'a' ) {
push @links, $token->[2]->{href} if $token->[2]->{href} =~ /\/udland
\/.*?article.*/;
}
}
# now follow the links
for my $link ( @links ) {
$mechanize->follow( $link );
my $html = $mechanize->content;
my $p = HTML::TokeParser->new( \$html );
while( my $article = $p->get_token( 'h1' )) {
if ( $article->[0] eq 'S' and $article->[1] eq 'h1' ) {
my $title = $p->get_trimmed_text( '/h1' );
$article = $p->get_tag('p');
$article = $p->get_tag('p');
my $date = $p->get_trimmed_text('/p');
print "$date\n$title\n\n";
}
}
}
------------------------------
Date: Tue, 29 Apr 2008 18:04:42 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How do I follow links stored in an array?
Message-Id: <67ov95F2n5ls7U1@mid.individual.net>
BirgitteRand@gmail.com wrote:
> I don't know how to follow links in an array (@links) at the bottom of
> this script.
First you'd better make sure that there are some links in @links to follow.
> #jump through tags until you get 'h1'
> while( my $title = $p->get_tag( 'h1' )) {
> last if $title->[1]->{class} eq 'h1';
> }
Since there are no <h1> elements in the document, that code jumps to the
end of string.
You can simply do:
$p->get_tag('/h2');
to get to the section of the document you are interested in. No loop needed.
> # look through the tokens until you hit the end of 'h1'
> my @links;
> while ( my $token = $p->get_token ) {
> last if $token->[0] eq 'E' && $token->[1] eq 'h1';
-----------------------------------------------------^^^^
Suppose you mean 'div' ...
> # now follow the links
Yes, but first make sure that @links contains what you expect.
print "$_\n" for @links;
If it does, you can start working with the last section of your script.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 29 Apr 2008 18:02:21 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: How do I follow links stored in an array?
Message-Id: <Xns9A8F84A5EA2B1castleamber@130.133.1.4>
BirgitteRand@gmail.com wrote:
> I don't know how to follow links in an array (@links) at the bottom of
> this script. Can anyone help me?
You might want to have a peek at:
<http://johnbokma.com/perl/rss-web-feed-builder.html>
--
John
http://johnbokma.com/perl/
------------------------------
Date: Tue, 29 Apr 2008 12:10:29 -0700 (PDT)
From: nolo contendere <simon.chao@fmr.com>
Subject: Re: How do I follow links stored in an array?
Message-Id: <4bdb0ae8-c8d6-4c29-9497-b01c5a6b9ce0@c65g2000hsa.googlegroups.com>
On Apr 29, 2:02=A0pm, John Bokma <j...@castleamber.com> wrote:
> BirgitteR...@gmail.com wrote:
> > I don't know how to follow links in an array (@links) at the bottom of
> > this script. Can anyone help me?
>
> You might want to have a peek at:
> <http://johnbokma.com/perl/rss-web-feed-builder.html>
that's a nifty little script you got there. i esp. like the coding
style; very clean and clear :-).
------------------------------
Date: Tue, 29 Apr 2008 18:00:44 +0500
From: "Cosmic programmer" <not-my-email@nowhere.com>
Subject: Re: Lawyers prosecuters media and programmers (I need HELP!)
Message-Id: <fv7660$4sp$1@registered.motzarella.org>
<stop.carl.now@gmail.com> wrote in message
news:ed4c0bb6-e78d-4474-9e39-89aa65feb64d@w74g2000hsh.googlegroups.com...
>A guy named Carl is harassing me on a google groups thread
>
> http://groups.google.com/group/misc.consumers/browse_thread/thread/632bbfcdfc76c4ab#
>
> I am looking for private detectives to find him.
> I am looking for lawyers to sue him.
> I am looking for people on google groups to come to my moral defense.
> I am looking for a psychiatrist to help me with my medications.
> I am looking for programmers and developers to help me make a site
> about my harassment by Carl
> I want this posted on digg, slashdot and everything. BBC CNN MSNBC go.
> Dateline NBC
>
> Thank you ahead of time, So much,
>
> Logan Cuurwitz
> logan.cuurwitz@gmail.com - please contact me!
> P.S. Mirror on craigslist
Only number four seems to be your genuine need but you didn't include the
relevant newsgroup.
--
When you argue with a fool, chances are he's doing the same
------------------------------
Date: Tue, 29 Apr 2008 15:22:34 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Looking for any programmer ($850k+/yr telecommute)
Message-Id: <x763u01ya1.fsf@mail.sysarch.com>
>>>>> "Cp" == Cosmic programmer <not-my-email@nowhere.com> writes:
Cp> "Ubersite" <b.cilfone.uber@googlemail.com> wrote in message
Cp> news:8bf1b1f4-27e0-42c9-a5e3-9a69028a1500@34g2000hsf.googlegroups.com...
>> www.ubersite.com - Future of media.
>>
>>
>> What do you think of it? Will you join?
Cp> I didn't find any link on that site.
you obviously aren't worth $850k a year!
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
------------------------------
Date: Tue, 29 Apr 2008 17:32:41 +0200
From: Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
Subject: Re: Looking for any programmer ($850k+/yr telecommute)
Message-Id: <48173f94$0$14352$e4fe514c@news.xs4all.nl>
Ubersite schreef:
> www.ubersite.com - Future of media.
>
>
> What do you think of it? Will you join?
With the current downfall of the dollar, I'll work a week for that
amount. ;-)
Erwin Moller
------------------------------
Date: Tue, 29 Apr 2008 21:12:08 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: use of DBI; I am getting multiple error messages mixed in with ?the correct output.
Message-Id: <slrng1esoa.vbp.hjp-usenet2@hrunkner.hjp.at>
On 2008-04-28 21:58, Charlton Wilbur <cwilbur@chromatico.net> wrote:
>>>>>> "PJH" == Peter J Holzer <hjp-usenet2@hjp.at> writes:
>
> >> The term "null string" for what would more reasonably called an
> >> "empty string" is a mistake. When the Camel is wrong, it
^^^^^^^^^^^^^^^^^^^^^^^
> >> should be corrected, not defended as if it were Holy Writ.
>
> PJH> It isn't wrong.
>
> I didn't say it was *wrong*;
I have underlined it above to refresh your memory.
> I said it was a mistake, because of the very ambiguity that you are
> alternately defending and insisting is not present.
>
> PJH> It may be that Ted and you are unfamiliar with this
> PJH> term. That doesn't make it wrong (If every English term I'm
> PJH> unfamilar with was wrong, the English would have a poor
> PJH> language, indeed). It may in some context be ambiguous. I was
> PJH> going to criticize Ben (was it Ben?) for using the phrase in
> PJH> this thread, but then I noticed that he hadn't brought it up,
> PJH> but was merely discussing a quote from the Camel book.
>
> In other words, if Ben had written it originally, you would have
> considered it a fault, but because it can be found in the Camel, it
> becomes Holy Writ and thus to be defended as an article of faith.
No. If Ben had written it I would have considered it a fault because he
used the term in a discussion which involved the term "NULL" as defined
in SQL. Using the term "null string" in such a discussion should be
avoided just because it sounds too similar. But Wall et al were not
discussing SQL NULL values in their book, and probably not even C null
pointers (I don't have the book at hand, so I can't check). So they had
no reason to avoid this common term.
> PJH> And I don't think you can fault Wall et al for not
> PJH> anticipating that someone with a Java and SQL background
> PJH> might misunderstand an term with an otherwise quite specific
> PJH> meaning.
>
> Hardly; as I pointed out, it's also unclear in meaning for those of us
> with C backgrounds as well,
I am one of "those of us with C backgrounds". I've been programming in C
for more than 20 years now (although I've switched mostly to Perl since
the mid-1990s).
> especially when the term "empty string" conveys the same information
> without the prospect of ambiguity.
I wouldn't bet that nobody can misunderstand "empty string", either. The
English language (like any natural language) is intrinsically ambiguous
and context-sensitive. Yes, the meaning of "empty string" or
"zero-length string" is probably easier to guess for someone who doesn't
know the term, but my point is that Wall et al had no reason to think
that a reader might not know the term. Ted complained that they didn't
define it. The book also uses the word "dog" without defining it (and in
four different meanings in the same sentence, no less!), because they
assume that the reader knows the meaning(s) of the word. Now, natural
language changes, and jargon changes even faster. It might be that a
term which had only one meaning in 1990 (when the first edition of the
book was written), is now ambiguous. Then it should be changed. But I
don't see the fact that one person in 18 years misinterpreted that
sentence as proof that this is the case.
> This has not appeared to be a rational argument for some time, and if
> you prefer to defend inaccuracy and ambiguity
On the contrary, I always try to be as precise as possible. I would
never call a null pointer a null string, because a pointer and string
just aren't the same. I also try not gratuitously use terms which
already have a precise meaning in some other meaning. So, because "null
string" already has the meaning "zero-length string", I wouldn't call a
varchar (SQL) or String (Java) variable with the value null a "null
string". That's just confusing.
> with the delusion that it's instantly clear to everyone except Java
> programmers, by all means, carry on.
In more than 20 years of programming (and reading technical literature
in English) I've come across the term "null string" numerous times. I
cannot recall a single instance where it wasn't unambiguosly synonymous
with "empty string". Only when googling for the term I found a few
scattered Java tutorials which used it differently.
hp
------------------------------
Date: Tue, 29 Apr 2008 12:31:06 GMT
From: zentara <zentara@highstream.net>
Subject: Re: use perl to draw Venn Diagram
Message-Id: <bv4e14p1s493irevu8ltepl1pb6lch0uf9@4ax.com>
On Mon, 28 Apr 2008 23:55:57 +0800, "Ela" <ela@yantai.org> wrote:
>> You could probably also use brushes instead. Anyway all the
>> information is really there in the docs. If you're unable to create a
>> working script from that, you may want to post at least what you've
>> got now and what you're having difficulty with *exactly*. Just
>> claiming GD doesn't do what you want when it clearly does and even
>> provide examples in the docs isn't helping.
>>
>> Take some time to read the full manpage linked above, it's not that
>> big and you should be able to figure it out yourself.
>>
>I feel sorry for not understanding what "holes" refer to... Not
>complimenting Matlab, but I am used to its elegant library to provide
>intuitive and powerful functions... Certainly, GD provides a greater control
>over how wide the holes can be...
>
If you need to do this without X, you might want to look at the Cairo
module
http://cairographics.org/samples/
You can save them to many file formats. Gtk2's graphics are based
on Cairo.
zentara
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
------------------------------
Date: Tue, 29 Apr 2008 13:36:09 -0500
From: l v <veatchla@yahoo.com>
Subject: Re: Windows mail.
Message-Id: <reqdnTimB80H94rVnZ2dnUVZ_uWdnZ2d@supernews.com>
DaveN wrote:
> "l v" <veatchla@yahoo.com> wrote in message
> news:NcGdnW-51_ewEovVnZ2dnUVZ_hadnZ2d@supernews.com...
>> DaveN wrote:
>>> Hi.
>>>
>>> Does anyone have example scripts to work with Windows Mail and in
>>> particular
>>> with usenet groups? I want to build a spam filter to run on all the
>>> groups
>>> I am subscribed to.
>>>
>> Don't write your own when one already exists.
>>
>> http://www.nfilter.org/
>>
>> --
>>
>> Len
>
>
> Tried that, struggled to get it to work. Maybe not compatible with Vista!
> :-(
>
According to rec.photo.digital posts (subject: Help please filtering
google groups) nfilter/newsfilter is compatible with Vista.
see http://preview.tinyurl.com/3zo7uu
--
Len
------------------------------
Date: Tue, 29 Apr 2008 12:59:56 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: WWW::Mechanize doesn't always follow_link(text
Message-Id: <fv76al.12s.1@news.isolution.nl>
Martijn Lievaart schreef:
> Dr.Ruud:
>> Martijn Lievaart:
>>> Dr.Ruud:
>>>> RedGrittyBrick:
>>>>> szr:
>>>>>> He's after a ' ', which us a non-breaking space, which is
>>>>>> ASCII 0xA0 hex or 160 dec. ' ' can even be re-written as
>>>>>> ' ' .
>>>>>
>>>>> s/ASCII/Unicode/
>>>>
>>>> Exactly. ISO-8859-* too.
>>>
>>> No, no, HTML uses Unicode codepoints (which in this case coincide,
>>> but that's beside the (code)point).
>>
>> No, no, no, no, that depends on the encoding being used. Yes, numeric
>> references always refer to Universal Character Set code points,
>> regardless of the page's encoding, but HTML is not "limited" to that.
>
> No, no, no, no, no :-) You already said it yourself, numeric
> references always refer to Unicode codepoints. That's the only point
> I was trying to make, and why you cannot substititute ISO-8859-*
> above.
Your "No, no," was about a limit I didn't imply, so was not about what I
wrote, but about what you limited it to. ("Fallacy of Distribution")
--
Affijn, Ruud
"Gewoon is een tijger."
------------------------------
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 V11 Issue 1493
***************************************